Пример #1
0
        /// <summary>
        /// Method to play a sound if the user holds arrow up on the controller.
        /// </summary>
        static void Controller_Poll_Method()
        {
            try
            {
                for (int x = 0; x < Controller_Manager.PlayerControllers.Count; x++)
                {
                    // Get Controller State!
                    Sonic_Heroes_Joystick.Controller_Inputs_Generic P1_Controller = Controller_Manager.PlayerControllers[x].Get_Whole_Controller_State();

                    // Set index
                    Menu_Base.controllerIndex = x;

                    // Toggle Menu Visibility with Guide Button
                    if (P1_Controller.ControllerButtons.Button_L3)
                    {
                        // Render next frame.
                        if (Draw_Current_Menu)
                        {
                            Draw_Current_Menu = false; Enable_Game_Controller(); Current_Menu.Set_Toggle_State();
                        }
                        else
                        {
                            Draw_Current_Menu = true; Disable_Game_Controller(); Current_Menu.Set_Toggle_State();
                        }

                        // Wait for L3 Release for toggling menu.
                        while (P1_Controller.ControllerButtons.Button_L3)
                        {
                            P1_Controller = Controller_Manager.PlayerControllers[Menu_Base.controllerIndex].Get_Whole_Controller_State(); Thread.Sleep(32);
                        }
                    }

                    // Handle current menu screen.
                    if (Draw_Current_Menu && (Current_Menu != null))
                    {
                        Current_Menu.Handle_Controller_Inputs(P1_Controller, Controller_Manager);
                    }

                    // Try executing the controller handler.
                    try { Controller_Poll_Delegate?.Invoke(P1_Controller, Controller_Manager); } catch { }
                }
            }
            catch (Exception Ex) { Sonic_Heroes_Networking_Client.SendData_Alternate(Message_Type.Client_Call_Send_Message, Encoding.ASCII.GetBytes(Mod_Name + " Failed To Load: " + Ex.Message + " | " + Ex.StackTrace), false); }
        }
Пример #2
0
 public static void Return_Last_Menu()
 {
     Menu_Base Temp_Menu = Current_Menu; Current_Menu = Last_Menu; Last_Menu = Temp_Menu; Current_Menu.Pass_MessageBox_Message(); Current_Menu.Set_Toggle_State();
 }
Пример #3
0
 public static void Set_New_SubMenu(Menu_Base New_Menu)
 {
     Current_Menu = New_Menu; Current_Menu.Pass_MessageBox_Message(); Current_Menu.Set_Toggle_State();
 }