Esempio n. 1
0
 public void AddDialogString(string val)
 {
     if (this._processDialog == null)
     {
         this._processDialog = new NetProcessNetworkDialog(this._app);
         this._app.UI.CreateDialog((Dialog)this._processDialog, null);
     }
     this._processDialog.AddDialogString(val);
 }
Esempio n. 2
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (msgType == "dialog_opened")
     {
         if (!(panelName == this.ID))
         {
             return;
         }
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblUser"), "text", App.Localize("@UI_GAMELOBBY_USERNAME_COLON"));
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblPass"), "text", App.Localize("@UI_GAMELOBBY_PASSWORD_COLON"));
     }
     else if (msgType == "button_clicked")
     {
         if (panelName == "buttonLAN")
         {
             this.SetLANMode(true);
         }
         else if (panelName == "buttonInternet")
         {
             this.SetLANMode(false);
         }
         else if (panelName == "buttonNewUser")
         {
             this._app.UI.CreateDialog((Dialog) new NetCreateUserDialog(this._app), null);
         }
         else if (panelName == "buttonCancel")
         {
             this._cancelled = true;
             this._app.UI.CloseDialog((Dialog)this, true);
         }
         else
         {
             if (!(panelName == "buttonLogin"))
             {
                 return;
             }
             if (this._lanmode)
             {
                 if (string.IsNullOrEmpty(this._enteredUser) || this._enteredUser.Contains(" "))
                 {
                     this._app.UI.CreateDialog((Dialog) new GenericTextDialog(this._app, App.Localize("@INVALID_USER"), App.Localize("@INVALID_USERNAME_TEXT"), "dialogGenericMessage"), null);
                 }
                 else
                 {
                     this._app.Network.Login(this._enteredUser);
                     this._app.Network.IsOffline = true;
                     this._app.UI.CloseDialog((Dialog)this, true);
                 }
             }
             else if (string.IsNullOrEmpty(this._enteredUser) || this._enteredUser.Contains(" "))
             {
                 this._app.UI.CreateDialog((Dialog) new GenericTextDialog(this._app, App.Localize("@INVALID_USER"), App.Localize("@INVALID_USERNAME_TEXT"), "dialogGenericMessage"), null);
             }
             else if (!this._app.Network.IsLoggedIn)
             {
                 this._app.Network.Login(this._enteredUser);
                 this._app.Network.IsOffline = false;
             }
             else
             {
                 this._app.Network.IsOffline = false;
                 this._app.UI.CloseDialog((Dialog)this, true);
             }
         }
     }
     else if (msgType == "text_changed")
     {
         if (panelName == "login_username")
         {
             this._enteredUser = msgParams[0];
         }
         else
         {
             if (!(panelName == "login_password"))
             {
                 return;
             }
             this._enteredPass = msgParams[0];
         }
     }
     else
     {
         if (!(msgType == "dialog_closed") || this._processDialog == null || !(panelName == this._processDialog.ID))
         {
             return;
         }
         this._processDialog = (NetProcessNetworkDialog)null;
         if (!this._success)
         {
             return;
         }
         this._app.Network.IsLoggedIn = true;
         this._app.UI.CloseDialog((Dialog)this, true);
     }
 }
Esempio n. 3
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (msgType == "dialog_opened" && panelName == this.ID)
     {
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblEmail"), "text", App.Localize("@UI_GAMELOBBY_EMAIL_COLON"));
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblUser"), "text", App.Localize("@UI_GAMELOBBY_USERNAME_COLON_B"));
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblPass"), "text", App.Localize("@UI_GAMELOBBY_PASSWORD_COLON_B"));
         this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "lblConfirm"), "text", App.Localize("@UI_GAMELOBBY_CONFIRM_PASSWORD"));
     }
     if (msgType == "button_clicked")
     {
         if (panelName == "okButton")
         {
             this._eulaConfirmDialogId = this._app.UI.CreateDialog((Dialog) new GenericQuestionDialog(this._app, App.Localize("@GAMESPY_AGREEMENT"), App.Localize("@GAMESPY_AGREEMENT_DESC"), "dialogEULAConfirm"), null);
             this._app.UI.SetVisible(this._eulaConfirmDialogId, false);
             this._app.UI.SetVisible(this._eulaConfirmDialogId, true);
         }
         else if (panelName == "cancelButton")
         {
             this._app.UI.CloseDialog((Dialog)this, true);
         }
     }
     if (msgType == "edit_confirmed")
     {
         if (panelName == "new_email")
         {
             this._app.UI.Send((object)"FocusKeyboard", (object)this._app.UI.Path(this.ID, "new_username"));
         }
         else if (panelName == "new_username")
         {
             this._app.UI.Send((object)"FocusKeyboard", (object)this._app.UI.Path(this.ID, "new_password"));
         }
         else if (panelName == "new_password")
         {
             this._app.UI.Send((object)"FocusKeyboard", (object)this._app.UI.Path(this.ID, "new_confirm"));
         }
         else
         {
             if (!(panelName == "new_confirm"))
             {
                 return;
             }
             this.Confirm();
         }
     }
     else if (msgType == "text_changed")
     {
         if (panelName == "new_email")
         {
             this._enteredEmail = msgParams[0];
         }
         else if (panelName == "new_username")
         {
             this._enteredUsername = msgParams[0];
         }
         else if (panelName == "new_password")
         {
             this._enteredPassword = msgParams[0];
         }
         else
         {
             if (!(panelName == "new_confirm"))
             {
                 return;
             }
             this._enteredConfirmPassword = msgParams[0];
         }
     }
     else
     {
         if (!(msgType == "dialog_closed"))
         {
             return;
         }
         if (this._processDialog != null && panelName == this._processDialog.ID)
         {
             this._processDialog = (NetProcessNetworkDialog)null;
             if (this._success)
             {
                 this._app.UI.CloseDialog((Dialog)this, true);
             }
         }
         if (!(panelName == this._eulaConfirmDialogId) || ((IEnumerable <string>)msgParams).Count <string>() <= 0 || !(msgParams[0] == "True"))
         {
             return;
         }
         this.Confirm();
     }
 }