Ticket #4031: continue_mp.patch

File continue_mp.patch, 2.5 KB (added by Imarok, 8 years ago)

Fixes the issue

  • binaries/data/mods/public/gui/gamesetup/gamesetup_mp.xml

     
    4545                    this.caption = Engine.ConfigDB_GetValue("user", "multiplayerserver");
    4646                </action>
    4747            </object>
    48 
    49             <object hotkey="confirm" type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed">
    50                 <translatableAttribute id="caption">Continue</translatableAttribute>
    51                 <action on="Press">
    52                     var joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption;
    53                     var joinServer = Engine.GetGUIObjectByName("joinServer").caption;
    54                     if (startJoin(joinPlayerName, joinServer))
    55                         switchSetupPage("pageJoin", "pageConnecting");
    56                 </action>
    57             </object>
    5848        </object>
    5949
    6050        <object name="pageHost" size="0 32 100% 100%" hidden="true">
     
    8777                    </action>
    8878                </object>
    8979            </object>
     80        </object>
    9081
    91             <object type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed">
    92                 <translatableAttribute id="caption">Continue</translatableAttribute>
    93                 <action on="Press">
     82        <object name="hostFeedback" type="text" style="ModernLabelText" size="50 100%-90 100%-50 100%-50" textcolor="red" />
     83
     84        <object hotkey="confirm" type="button" size="50%+5 100%-45 100%-18 100%-17" style="ModernButtonRed">
     85            <translatableAttribute id="caption">Continue</translatableAttribute>
     86            <action on="Press">
     87           
     88                if (Engine.GetGUIObjectByName("pageHost").hidden)
     89                {
     90                    var joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption;
     91                    var joinServer = Engine.GetGUIObjectByName("joinServer").caption;
     92                    if (startJoin(joinPlayerName, joinServer))
     93                        switchSetupPage("pageJoin", "pageConnecting");
     94                }
     95                else
     96                {
    9497                    var hostPlayerName = Engine.GetGUIObjectByName("hostPlayerName").caption;
    9598                    var hostServerName = Engine.GetGUIObjectByName("hostServerName").caption;
    9699                    if (startHost(hostPlayerName, hostServerName))
    97100                        switchSetupPage("pageHost", "pageConnecting");
    98                 </action>
    99             </object>
     101                }
     102            </action>
    100103        </object>
    101104
    102         <object name="hostFeedback" type="text" style="ModernLabelText" size="50 100%-90 100%-50 100%-50" textcolor="red" />
    103 
    104105        <object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
    105106            <translatableAttribute id="caption">Cancel</translatableAttribute>
    106107            <action on="Press">cancelSetup();</action>