Ticket #4112: hidereadybutton9.patch
File hidereadybutton9.patch, 2.2 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 531 let startGame = Engine.GetGUIObjectByName("startGame"); 532 startGame.hidden = hidden; 533 let right = hidden ? startGame.size.right : startGame.size.left - offset; 534 535 let cancelGame = Engine.GetGUIObjectByName("cancelGame"); 536 let cancelGameSize = cancelGame.size; 537 let xButtonSize = cancelGameSize.right - cancelGameSize.left; 538 cancelGameSize.right = right; 539 right -= xButtonSize; 540 541 for (let element of ["cheatWarningText", "onscreenToolTip"]) 542 { 543 let elementSize = Engine.GetGUIObjectByName(element).size; 544 elementSize.right = right - (cancelGameSize.left - elementSize.right); 545 Engine.GetGUIObjectByName(element).size = elementSize; 546 } 547 548 cancelGameSize.left = right; 549 cancelGame.size = cancelGameSize; 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