Example #1
0
    public void SpaceDropLogic(int num)
    {
        Click.Play();

        if (num == 0) // start game
        {
            SceneManager.LoadScene("_Scene_0");
        }

        if (num == 3) // show space shooter history
        {
            SpaceHistoryDropdown.ClearOptions();
            LoadSpaceHistoryDropdown();
            SpaceHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // open configurations or game levels
        {
            OpenPannel2 = SpaceFileItems[num];
            OpenPannel2.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }
    }
Example #2
0
 public void ExitUnblock()
 {
     Click.Play();
     UnblockUserStatus.text = "";
     UnblockPan.SetActive(false);
     OpenPannel.SetActive(true);
 }
Example #3
0
 public void ExitDeleteUser()
 {
     Click.Play();
     DeleteUserStatus.text = "";
     DeleteUserPan.SetActive(false);
     OpenPannel.SetActive(true);
 }
Example #4
0
    public void ChangePassword() // change the current users password
    {
        Click.Play();
        if (Users.CurrentUser.password == ChangePasswordField.text) // if you try to use the same password
        {
            ChangePasswordStatus.color = Color.red;
            ChangePasswordStatus.text  = "Password must be different from your previous password.";
        }

        else if (Users.CurrentUser.username == "admin" && ChangePasswordField.text != "") // if you are the admin
        {
            ChangePasswordStatus.color = Color.green;
            ChangePasswordStatus.text  = "admin password has been changed!";
            Users.ChangePassword(ChangePasswordField.text);
        }

        else if (ChangePasswordField.text != "" && Users.CurrentUser.username != "admin") // if you arnt the admin
        {
            Users.ChangePassword(ChangePasswordField.text);
            ChangePasswordStatus.color = Color.green;
            ChangePasswordStatus.text  = "Successfully changed password!";
        }

        else // if you dont put anything in the input field
        {
            ChangePasswordStatus.color = Color.red;
            ChangePasswordStatus.text  = "Password must contain at least one character.";
        }
    }
 public void ClickReturnWave()
 {
     Click.Play();
     WaveNumManager.WaveNum     = 0;
     WaveEnemyManager.killCount = 0;
     StartCoroutine(SceneChenge(0));
 }
Example #6
0
 public void ExitDisplay()
 {
     Click.Play();
     Backroundimage.sprite = preview.sprite; // change the BG on exit
     DisplayPan.SetActive(false);
     OpenPannel.SetActive(true);
 }
Example #7
0
 public void ExitCreateUser()
 {
     Click.Play();
     NewUserStatus.text = "";
     CreateUserPan.SetActive(false);
     OpenPannel.SetActive(true);
 }
Example #8
0
        private async void submitButton_Click(object sender, RoutedEventArgs e)
        {
            // if checkbox and field is validate
            if ((nameValid == true) && (emailValid == true) &&
                (contactValid == true) && (checkboxValid == true) && !emailDuplicate && !contactDuplicate)
            {
                Click.Play();
                submitButton.IsEnabled = false;
                SubmitIMG.Scale(scaleX: 1.3f, scaleY: 1.3f, centerX: 0f, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start();

                await System.Threading.Tasks.Task.Delay(200);

                SubmitIMG.Scale(scaleX: 1, scaleY: 1f, centerX: 0f, centerY: 0f, duration: 200, delay: 0, easingType: EasingType.Default).Start();

                AppCommunicator.WriteLinesToFile("PlayerData.txt",
                                                 new string[] { nameField.Text, emailField.Text, contactField.Text, "0", "0000-00-00", "0", "Panel01",
                                                                System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(), "no" });
                // email , voucher_code, redeem_code, created_at, is_sync
                AppCommunicator.WriteLinesToFile("VoucherDistributionData.txt",
                                                 new string[] { emailField.Text, "PEDIASURE", emailField.Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(), "no" });

                AppCommunicator.SaveData();

                await System.Threading.Tasks.Task.Delay(1600);

                Frame.Navigate(typeof(Pages.Webpage));
            }
            else
            {
                ShowWarning();
            }
        }
Example #9
0
 public void selectPlayer2()
 {
     player2IsAvailable = PlayerPrefs.GetInt("Player2", 0);
     if (player2IsAvailable == 1)
     {
         currentPlayer = 2;
         Click.Play();
         PlayerPrefs.SetInt("Player", 2);
         Player1BtnTXT.text = "1";
         Player2BtnTXT.text = "USED";
     }
     else if (player2IsAvailable == 0)
     {
         if (MyCoin >= 300)
         {
             Buy.Play();
             MyCoin = MyCoin - 300;
             PlayerPrefs.SetInt("Player2", 1);
             Player2BtnTXT.text = "USE";
             player2IsAvailable = PlayerPrefs.GetInt("Player2", 0);
         }
         else
         {
             Wrong.Play();
             StartCoroutine(NotificationFailed());
         }
     }
 }
Example #10
0
 public void ExitChangePass()
 {
     Click.Play();
     ChangePasswordStatus.text = "";
     ChangePassPan.SetActive(false);
     OpenPannel.SetActive(true);
 }
Example #11
0
 public void BackToDefaultPanel()
 {
     DefaultPanel.SetActive(true);
     ShopPanel.SetActive(false);
     ControlPanel.SetActive(false);
     Click.Play();
 }
Example #12
0
 public void Logout() // logout to login screen and youre time spent is logged into the system
 {
     Users.CurrentUser.Logins.Add(new SessionLogObject());
     Users.DumpUsers();
     Click.Play();
     PlayerPrefs.DeleteAll();
     SceneManager.LoadScene("LoginScene");
 }
Example #13
0
 public void UnblockUser() //unblock user in system
 {
     Click.Play();
     Users.UnblockUser(BlockedList.options[BlockedList.value].text);
     UnblockUserStatus.color = Color.green;
     UnblockUserStatus.text  = "Unblocked user!";
     BlockedList.options.Remove(BlockedList.options[BlockedList.value]);
     BlockedList.value = 0;
 }
Example #14
0
 public void ExitSpacePannel()
 {
     Click.Play();
     Border.SetActive(false);
     OpenPannel2.SetActive(false);
     CopyText.SetActive(true);
     CreatedByText.SetActive(true);
     MainText.SetActive(true);
     LogoutButton.SetActive(true);
     CopyBG.SetActive(true);
 }
Example #15
0
 public void ExitSpaceHistory()
 {
     Click.Play();
     Border.SetActive(false);
     SpaceHistoryPan.SetActive(false);
     CopyText.SetActive(true);
     CreatedByText.SetActive(true);
     MainText.SetActive(true);
     LogoutButton.SetActive(true);
     CopyBG.SetActive(true);
 }
Example #16
0
 public void selectPlayer1()
 {
     currentPlayer = 1;
     PlayerPrefs.SetInt("Player", 1);
     Player1BtnTXT.text = "USED";
     Click.Play();
     if (player2IsAvailable == 1)
     {
         Player2BtnTXT.text = "USE";
     }
 }
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         envolope.gameObject.SetActive(false);
         Ambience.Stop();
         canvas.gameObject.SetActive(true);
         Click.Play();
         Invoke("ChangeLevel", 2.0f);
     }
 }
Example #18
0
 public void DeleteuserButton()
 {
     Click.Play();
     UserList.options.Clear();
     foreach (User user in Users.GetUsers().Values)
     {
         UserList.options.Add(new Dropdown.OptionData()
         {
             text = user.username
         });
     }
     OpenPannel.SetActive(false);
     DeleteUserPan.SetActive(true);
 }
Example #19
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            NextButton.IsEnabled = false;
            Click.Play();

            NextButton.Scale(scaleX: 1.3f, scaleY: 1.3f, centerX: 0, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start();

            await System.Threading.Tasks.Task.Delay(200);

            NextButton.Scale(scaleX: 1, scaleY: 1f, centerX: 0, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start();

            await System.Threading.Tasks.Task.Delay(1600);

            Frame.Navigate(typeof(Registration));
        }
Example #20
0
    public static void playSound(string clip)
    {
        switch (clip)
        {
        case "Bonus":

            Bonus.Play();
            break;

        case "Click":

            Click.Play();
            break;
        }
    }
Example #21
0
 public void UnblockButton()
 {
     Click.Play();
     BlockedList.options.Clear();
     foreach (User user in Users.GetUsers().Values)
     {
         if (user.status == "blocked")
         {
             BlockedList.options.Add(new Dropdown.OptionData()
             {
                 text = user.username
             });
         }
     }
     OpenPannel.SetActive(false);
     UnblockPan.SetActive(true);
 }
Example #22
0
    public void ExitSpaceGameLevelsPannel()
    {
        int NumofEisGood = 0;
        int ScoreisGood  = 0;

        if (BronzeLevel.NumofE < SilverLevel.NumofESilver && SilverLevel.NumofESilver < GoldLevel.NumofEGold)
        {
            NumofEisGood = 1;
        }

        else
        {
            NumofEisGood = 0;
        }

        if (BronzeLevel.ScoreToWin < SilverLevel.ScoreToWinSilver && SilverLevel.ScoreToWinSilver < GoldLevel.ScoreToWinGold)
        {
            ScoreisGood = 1;
        }

        else
        {
            ScoreisGood = 0;
        }

        if (ScoreisGood == 1 && NumofEisGood == 1)
        {
            Click.Play();
            Border.SetActive(false);
            OpenPannel2.SetActive(false);
            CopyText.SetActive(true);
            CreatedByText.SetActive(true);
            MainText.SetActive(true);
            LogoutButton.SetActive(true);
            CopyBG.SetActive(true);
        }

        else
        {
            SpaceErrorPan.SetActive(true);
            SpaceLevelsExitButton.interactable = false;
        }
    }
Example #23
0
    public void FileDropLogic(int num)
    {
        Click.Play();

        if (num == 0 && Users.CurrentUser.username != "admin") // if you are not the admin accessing user accounts
        {
            CreateUserMenuButton.interactable  = false;
            DeleteUserMenuButton.interactable  = false;
            UnBlockUserMenuButton.interactable = false;
        }

        if (num == 3) // if you are exiting the game
        {
            Users.CurrentUser.Logins.Add(new SessionLogObject());
            Users.DumpUsers();
            Application.Quit();
            PlayerPrefs.DeleteAll();
        }

        if (num == 2) // if you click on the history item
        {
            HistoryDropdown.ClearOptions();

            if (Users.CurrentUser.username != "admin") // if you are not the admin
            {
                LoadHistoryDropdown();                 // load the non-admin history
            }

            else // if you are the admin
            {
                LoadHistoryDropdownAdmin(); // load the admin history
            }
        }
        OpenPannel = FileItems[num];
        OpenPannel.SetActive(true);
        Border.SetActive(true);
        CopyText.SetActive(false);
        CreatedByText.SetActive(false);
        MainText.SetActive(false);
        LogoutButton.SetActive(false);
        CopyBG.SetActive(false);
    }
Example #24
0
    public void DeleteUser() // delete user from system
    {
        Click.Play();
        string selectedUser = UserList.options[UserList.value].text;

        if (selectedUser == "admin")
        {
            DeleteUserStatus.color = Color.red;
            DeleteUserStatus.text  = "Cannot delete admin user!";
        }

        else
        {
            Users.DeleteUser(selectedUser);
            DeleteUserStatus.color = Color.green;
            DeleteUserStatus.text  = "Deleted user.";
            UserList.options.Remove(UserList.options[UserList.value]);
            UserList.value = 0;
        }
    }
Example #25
0
    public void AppleDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show Apple picker history
        {
            LoadHistoryDropdownApple();
            AppleHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("ApplePickerGame");
        }
    }
Example #26
0
    public void RPSDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show rock paper scissors history
        {
            LoadHistoryDropdownRPS();
            RPSHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("SinglePlayer");
        }
    }
Example #27
0
    public void MemDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show memory game history
        {
            LoadHistoryDropdownMem();
            MemHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("MemMainMenu");
        }
    }
Example #28
0
    public void CreateUser() // create user in system
    {
        Click.Play();

        if (Users.ContainsUser(CreateUserField.text)) // if the user is already in system
        {
            NewUserStatus.color = Color.red;
            NewUserStatus.text  = "User already exists.";
        }

        else if (CreateUserField.text == "") // if input is empty
        {
            NewUserStatus.color = Color.red;
            NewUserStatus.text  = "Username must consist of at least one character.";
        }

        else // if everything went well
        {
            Users.AddUser(CreateUserField.text);
            NewUserStatus.color = Color.green;
            NewUserStatus.text  = "User was created Successfully!";
        }
    }
 public void ClickReturn()
 {
     Click.Play();
     MyScoreManager.score = 0;
     StartCoroutine(SceneChenge(0));
 }
 public void ClickContinue()
 {
     Click.Play();
     MyScoreManager.score = 0;
     StartCoroutine(SceneChenge(1));
 }