Beispiel #1
0
        void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>
            {
                if (ProgressBar.Value < 100)
                {
                    ProgressBar.Value += 1;
                }
                else 
                {
                    timer.Stop();
                    LoginScreen loginScreen = new LoginScreen();
                    loginScreen.Show();
                    this.Close();
                }
					if (ProgressBar.Value == 2) 
            {
                lblStatus.Content = "Estabelecendo conexão";
            }
            if (ProgressBar.Value == 25)
            {
                               
            }
            if (ProgressBar.Value == 27)
            {
                lblStatus.Content = "Conectando com o banco de dados..";

            }
            if (ProgressBar.Value == 30)
            {
                lblStatus.Content = "Conectando com o banco de dados...";

            }
            if (ProgressBar.Value == 38)
            {
                lblStatus.Content = "Conectando com o banco de dados....";
            }
            if (ProgressBar.Value == 45)
            {
                lblStatus.Content = "Recebendo dados.";
            }
            if (ProgressBar.Value == 49)
            {
                lblStatus.Content = "Recebendo dados..";
            }
            if (ProgressBar.Value == 54)
            {
                lblStatus.Content = "Recebendo dados..";
            }
            if (ProgressBar.Value == 59)
            {
                lblStatus.Content = "Recebendo dados...";
            }
            if (ProgressBar.Value == 67)
            {
                lblStatus.Content = "Recebendo dados....";
            }
            }));
            
        }
Beispiel #2
0
    void OnGUI()
    {
        GUI.depth = 10;
        GUI.skin  = login_gui_skin;
        GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), background);

        if (GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            LoginScreen.Show();
            gameObject.SetActive(false);
        }

        float offset = Screen.height / 20;

        GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), logo);

        offset += LOGO_SIZE + offset;

        float button_size = Screen.width / 3;

        GUI.Box(new Rect(Screen.width / 3 - button_size - Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("EML"));
        email = GUI.TextField(new Rect(Screen.width / 3 + Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), email);

        if (email.Length == 0)
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("EMPTYMAIL"));
            mail_error = true;
        }
        else if (!email.Contains(".") || !email.Contains("@"))
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("MAILNVLD"));
            mail_error = true;
        }
        else
        {
            mail_error = false;
        }


        offset += Properties.TEXT_HEIGHT * 4;

        GUI.Box(new Rect(Screen.width / 3 - button_size - Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("USRNM"));
        username = GUI.TextField(new Rect(Screen.width / 3 + Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), username);

        if (username.Length == 0)
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("EMPTYUSRNM"));
            username_error = true;
        }
        else if (username.Length < 4)
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("SHRTUSRNM"));
            username_error = true;
        }
        else
        {
            username_error = false;
        }

        offset += Properties.TEXT_HEIGHT * 4;

        GUI.Box(new Rect(Screen.width / 3 - button_size - Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("PW"));
        pw = GUI.PasswordField(new Rect(Screen.width / 3 + Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), pw, '*');

        if (pw.Length == 0)
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("EPMTYPW"));
            password_error = true;
        }
        else if (pw.Length < 4)
        {
            GUI.Label(new Rect(Screen.width - Screen.width / 4, offset, Screen.width / 4, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("SHRTPW"));
            password_error = true;
        }
        else
        {
            password_error = false;
        }


        offset += Properties.TEXT_HEIGHT * 4;

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("REG")))
        {
            if (!mail_error && !username_error && !password_error)
            {
                gameObject.SetActive(false);
                user_manager.doRegister(email, username, pw);
                RegisterResultScreen.Show();
                RegisterResultScreen.reg_result = -2;
            }
        }


        GUI.EndGroup();
    }
Beispiel #3
0
    void OnGUI()
    {
        GUI.depth = 0;
        GUI.skin  = RoomSelectionGUISkin;

        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);

        if (GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            Hide();
            WarpClient.GetInstance().Disconnect();
            LoginScreen.Show();
        }

        scrollPosition = GUI.BeginScrollView(scrollViewPosition, scrollPosition, scrollViewInnerPosition);

        float offsetX = roomBoxPosition.x;
        float offsetY = roomBoxPosition.y;

        for (int i = 0; i < ActiveRooms.Count; i++)
        {
            LiveRoomInfoEvent currentRoom = ActiveRooms[i];
            string[]          joinedUsers = currentRoom.getJoinedUsers();
            string            roomId      = currentRoom.getData().getId();
            object            type        = string.Empty;
            object            goal        = string.Empty;
            object            pw          = string.Empty;
            selectedRoomProperties = currentRoom.getProperties();
            selectedRoomProperties.TryGetValue("PW", out pw);
            if (selectedRoomProperties.TryGetValue("TYPE", out type) && selectedRoomProperties.TryGetValue("GOAL", out goal))
            {
                string playersText = string.Empty;

                for (int j = 0; j < 4; j++)
                {
                    if (j == 0 && joinedUsers != null)
                    {
                        playersText = joinedUsers[j];
                    }
                    else if (j == 0)
                    {
                        playersText = "-";
                    }
                    else if (joinedUsers != null && j < joinedUsers.Length)
                    {
                        playersText += "\n" + joinedUsers[j];
                    }
                    else
                    {
                        playersText += "\n-";
                    }
                }

                if (selectedRoomId == roomId)
                {
                    GUI.DrawTexture(new Rect(offsetX, offsetY, roomBoxPosition.width, roomBoxPosition.height), SelectedRoomBoxBackground);
                }
                else if (GUI.Button(new Rect(offsetX, offsetY, roomBoxPosition.width, roomBoxPosition.height), ""))
                {
                    selectedRoomId = roomId;
                    selectedRoomPw = pw == null ? null : pw.ToString();
                }
                GUI.BeginGroup(new Rect(offsetX, offsetY, roomBoxPosition.width, roomBoxPosition.height));
                DrawRoomBox(currentRoom.getData().getName(), type.ToString(), goal.ToString(), playersText, joinedUsers == null ? 0 : joinedUsers.Length, pw == null? null : pw.ToString());
                GUI.EndGroup();
                offsetX += offsetWidth / 2 + roomBoxPosition.width;
                if (i % 2 == 1)
                {
                    offsetY += offsetHeight + roomBoxPosition.height;
                    offsetX  = roomBoxPosition.x;
                }
            }
        }

        GUI.EndScrollView();

        if (GUI.Button(createRoomButtonPos, LanguageManager.getString("CRTROOM")))
        {
            Hide();
            CreateRoomMenu.Show();
        }

        if (!string.IsNullOrEmpty(selectedRoomId) && GUI.Button(joinRoomButtonPos, LanguageManager.getString("JOINROOM")))
        {
            if (selectedRoomPw != null && !string.IsNullOrEmpty(selectedRoomPw.ToString()))
            {
                PasswordEnterMenu.Show(selectedRoomPw.ToString(), selectedRoomId);
                Hide();
            }
            else
            {
                StartCoroutine(JoinRoom(selectedRoomId));
            }
        }

        if (GUI.Button(renewButtonPos, LanguageManager.getString("RENEW")))
        {
            Renew();
        }
    }
Beispiel #4
0
    void OnGUI()
    {
        GUI.depth = 10;
        GUI.skin  = MainMenuSkin;
        GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);

        if (Application.platform != RuntimePlatform.IPhonePlayer && GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            DialogBox.DialogBoxButtons = DialogBoxButtons.YES_NO;
            DialogBox.DialogText       = LanguageManager.getString("PROMPT_EXIT");
            DialogBox.CallbackObject   = gameObject;
            DialogBox.Show();
        }

        float offset = Screen.height / 20;

        GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), Logo);

        offset += LOGO_SIZE + offset;

        float button_size = Screen.width / 3 * 2;

        if (UserInteraction.InGame)
        {
            if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CNTNE")))
            {
                PlayerStats.Show();
                Hide();
            }
            offset += Properties.TEXT_HEIGHT * 3;
        }

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("SNGPLYR")))
        {
            Hide();
            SinglePlayerCreationMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("MLTPLYR")))
        {
            TrumpSelection.Hide();
            ScoreBoard.Hide();
            Properties.ActiveGameType = GameType.MultiPlayer;
            MultiplayerObjects.gameObject.SetActive(true);
            LoginScreen.Show();
            UserInteraction.InGame = false;
            Hide();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CRDTSBTN")))
        {
            Hide();
            CreditsMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("STNGS")))
        {
            Hide();
            SettingsMenu.BackMenu = this.GetType();
            SettingsMenu.Show();
        }

        GUI.EndGroup();
    }
 private void BgRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     LoginScreen page = new LoginScreen();
     page.Show();
     this.Close();
 }