Ticket #4112: hidereadybutton5.patch
File hidereadybutton5.patch, 2.3 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 if (Engine.GetGUIObjectByName("startGame").hidden == hidden) 530 return; 531 532 Engine.GetGUIObjectByName("startGame").hidden = hidden; 533 let offset = hidden ? 144 : -144; 534 535 // Move the cheatWarningText and back button to the right when hidden. 536 let cancelGameSize = Engine.GetGUIObjectByName("cancelGame").size; 537 cancelGameSize.left += offset; 538 cancelGameSize.right += offset; 539 540 Engine.GetGUIObjectByName("cancelGame").size = cancelGameSize; 541 542 let cheatWarningTextSize = Engine.GetGUIObjectByName("cheatWarningText").size; 543 cheatWarningTextSize.right += offset; 544 Engine.GetGUIObjectByName("cheatWarningText").size = cheatWarningTextSize; 545 546 // Increase the size of onscreenToolTip when hidden. 547 let onscreenToolTipSize = Engine.GetGUIObjectByName("onscreenToolTip").size; 548 onscreenToolTipSize.right += offset; 549 Engine.GetGUIObjectByName("onscreenToolTip").size = onscreenToolTipSize; 550 } 551 527 552 /** 528 553 * If we're a network client, hide the controls and show the text instead. 529 554 */ 530 555 function hideControls() 531 556 { … … function hideControls() 538 563 Engine.GetGUIObjectByName("playerAssignment["+i+"]").hidden = true; 539 564 Engine.GetGUIObjectByName("playerCiv["+i+"]").hidden = true; 540 565 Engine.GetGUIObjectByName("playerTeam["+i+"]").hidden = true; 541 566 } 542 567 568 // The start game button should be hidden until the player assignments are received 569 // and it is known whether the local player is an observer. 570 hideStartGameButton(true); 543 571 Engine.GetGUIObjectByName("startGame").enabled = true; 544 572 } 545 573 546 574 /** 547 575 * Hides the GUI controls for clients and shows the read-only label instead. … … function handlePlayerAssignmentMessage(m 728 756 if (!message.newAssignments[guid]) 729 757 onClientLeave(guid); 730 758 731 759 g_PlayerAssignments = message.newAssignments; 732 760 761 hideStartGameButton(!g_IsController && g_PlayerAssignments[Engine.GetPlayerGUID()].player == -1); 762 733 763 updatePlayerList(); 734 764 updateReadyUI(); 735 765 sendRegisterGameStanza(); 736 766 } 737 767