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