Ticket #4112: hidereadybutton4.patch
File hidereadybutton4.patch, 2.0 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/gamesetup/gamesetup.js
function initRadioButtons() 522 522 g_GameAttributes.settings.LastManStanding = false; 523 523 updateGameAttributes(); 524 524 }; 525 525 } 526 526 527 function hideStartGameButton(hidden) 528 { 529 Engine.GetGUIObjectByName("startGame").hidden = hidden; 530 531 // Move the cheatWarningText and back button to the right when hidden. 532 Engine.GetGUIObjectByName("cancelGame").size = hidden ? "100%-164 100%-52 100%-24 100%-24" : "100%-308 100%-52 100%-168 100%-24"; 533 Engine.GetGUIObjectByName("cheatWarningText").size = hidden ? "0 100%-52 100%-176 100%-24" : "0 100%-52 100%-320 100%-24"; 534 535 // Increase the size of onscreenToolTip when hidden. 536 Engine.GetGUIObjectByName("onscreenToolTip").size = hidden ? "20 100%-56 100%-168 100%-24" : "20 100%-56 100%-312 100%-24"; 537 } 538 527 539 /** 528 540 * If we're a network client, hide the controls and show the text instead. 529 541 */ 530 542 function hideControls() 531 543 { … … function hideControls() 538 550 Engine.GetGUIObjectByName("playerAssignment["+i+"]").hidden = true; 539 551 Engine.GetGUIObjectByName("playerCiv["+i+"]").hidden = true; 540 552 Engine.GetGUIObjectByName("playerTeam["+i+"]").hidden = true; 541 553 } 542 554 555 // The start game button should be hidden until the player assignments are received 556 // and it is known whether the local player is an observer. 557 hideStartGameButton(true); 543 558 Engine.GetGUIObjectByName("startGame").enabled = true; 544 559 } 545 560 546 561 /** 547 562 * Hides the GUI controls for clients and shows the read-only label instead. … … function handlePlayerAssignmentMessage(m 728 743 if (!message.newAssignments[guid]) 729 744 onClientLeave(guid); 730 745 731 746 g_PlayerAssignments = message.newAssignments; 732 747 748 hideStartGameButton(!g_IsController && g_PlayerAssignments[Engine.GetPlayerGUID()].player == -1); 749 733 750 updatePlayerList(); 734 751 updateReadyUI(); 735 752 sendRegisterGameStanza(); 736 753 } 737 754