示例#1
0
 public void OnBackButton()
 {
     if (newGameSettings.wereChangesMade())
     {
         NotificationBox.drawNotificationBox(canvasTranform, "Do you want to apply changes?", NotificationBox.Type.YES_NO, applyChangesAndCloseMenu, discardChangesAndClose);
     }
     else
     {
         closeMenu();
     }
 }
示例#2
0
    public void OnChangeKeyPressed(int keyboardKeyCodeId)
    {
        /* pressed key is illegal */
        if (Array.IndexOf(Controls.illegalKeys, (KeyCode)keyboardKeyCodeId) != -1)
        {
            string illegalKeys = "";
            foreach (KeyCode illegalKey in Controls.illegalKeys)
            {
                illegalKeys += illegalKey.ToString() + ", ";
            }

            NotificationBox.drawNotificationBox(canvasTranform, "Illegal key detected. \nDo not use those keys: " + illegalKeys);
            inputKeysTexts[changePretenderKey].text = ((KeyCode)newGameSettings.inputKeyCode[(int)changePretenderKey]).ToString();
            waitingForKey = false;
        }
        else
        {
            /* checking for same assign */
            for (int i = 0; i < newGameSettings.inputKeyCode.Length; i++)
            {
                if (newGameSettings.inputKeyCode[i] == keyboardKeyCodeId)
                {
                    InputKey foundKey = (InputKey)i;
                    newGameSettings.inputKeyCode[i] = (int)InputKey.None;
                    inputKeysTexts[foundKey].text   = KeyCode.None.ToString();
                    break;
                }
            }

            /* Setting new key value */
            newGameSettings.inputKeyCode[(int)changePretenderKey] = keyboardKeyCodeId;
            inputKeysTexts[changePretenderKey].text = ((KeyCode)(keyboardKeyCodeId)).ToString();
            changePretenderKey = InputKey.None;
            waitingForKey      = false;
        }
    }
 public void onLeaveServerClicked()
 {
     NotificationBox.drawNotificationBox(canvas.transform, "Do you really want to leave the server?", NotificationBox.Type.YES_NO, GameManager.leaveServer);
 }
示例#4
0
 public void OnApplyButton()
 {
     applyChanges();
     NotificationBox.drawNotificationBox(canvasTranform, "Settings have been applied");
 }
示例#5
0
 public void creditsButton()
 {
     NotificationBox.drawNotificationBox(canvas.transform, "Coming soon :)");
 }
示例#6
0
 public void leaveGameButton()
 {
     NotificationBox.drawNotificationBox(canvas.transform, "Do you really want to quit?", NotificationBox.Type.YES_NO, leaveGame);
 }