예제 #1
0
        // custom keybinding input

        internal void Update()
        {
            if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID))
            {
                MinimapScript.Instances[playerID].ToggleEnable();
            }
        }
예제 #2
0
 public override void Update()
 {
     if (CustomKeybindings.GetKeyDown(MENU_KEY))
     {
         BuildingMenu.Show = !BuildingMenu.Show;
     }
 }
 internal void Update()
 {
     if (CustomKeybindings.GetKeyDown(MENU_KEY))
     {
         BuildingMenu.Show = !BuildingMenu.Show;
     }
 }
예제 #4
0
        internal void Update()
        {
            try
            {
                if (MenuManager.Instance.IsInMainMenuScene || NetworkLevelLoader.Instance.IsGameplayPaused)
                {
                    return;
                }
            }
            catch
            {
                return;
            }

            if (CustomKeybindings.GetKeyDown(NextKeyToggle, out int playerID))
            {
                var player = SplitScreenManager.Instance.LocalPlayers[playerID];
                CycleQuickslotBar(player.AssignedCharacter, true);
            }

            if (CustomKeybindings.GetKeyDown(PrevKeyToggle, out playerID))
            {
                var player = SplitScreenManager.Instance.LocalPlayers[playerID];
                CycleQuickslotBar(player.AssignedCharacter, false);
            }
        }
예제 #5
0
 public override void Update()
 {
     if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID))
     {
         var player = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter;
         CustomToggleTarget(player);
     }
 }
예제 #6
0
        internal void Update()
        {
            for (int i = 0; i < SlotsToAdd; i++)
            {
                if (CustomKeybindings.GetKeyDown($"QS_Instant{i + 12}", out int playerID))
                {
                    var character = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter;
                    character.QuickSlotMngr.QuickSlotInput(i + 11);
                    break;
                }
            }

            foreach (SplitPlayer player in SplitScreenManager.Instance.LocalPlayers)
            {
                var character = player.AssignedCharacter;
                int id        = character.OwnerPlayerSys.PlayerID;
                if (QuickSlotInstant9(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(12);
                }
                if (QuickSlotInstant10(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(13);
                }
                if (QuickSlotInstant11(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(14);
                }
                if (QuickSlotInstant12(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(15);
                }
            }

            if (!fixedDictionary && !LocalizationManager.Instance.IsLoading && LocalizationManager.Instance.Loaded)
            {
                fixedDictionary = true;

                var genLoc = SideLoader.References.GENERAL_LOCALIZATION;

                for (int i = 0; i < SlotsToAdd; i++)
                {
                    genLoc[$"InputAction_QS_Instant{i + 12}"] = $"Quick Slot {i + 9}";
                }
            }
        }
예제 #7
0
        internal void Update()
        {
            if (NetworkLevelLoader.Instance.IsGameplayPaused || !SplitScreenManager.Instance || SplitScreenManager.Instance.LocalPlayers == null)
            {
                return;
            }

            for (int i = 0; i < SlotsToAdd; i++)
            {
                if (CustomKeybindings.GetKeyDown($"QS_Instant{i + 12}", out int playerID))
                {
                    var character = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter;
                    character.QuickSlotMngr.QuickSlotInput(i + 11);
                    break;
                }
            }

            foreach (SplitPlayer player in SplitScreenManager.Instance.LocalPlayers)
            {
                var character = player.AssignedCharacter;
                int id        = character.OwnerPlayerSys.PlayerID;

                if (QuickSlotInstant9(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(12);
                }
                if (QuickSlotInstant10(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(13);
                }
                if (QuickSlotInstant11(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(14);
                }
                if (QuickSlotInstant12(id))
                {
                    character.QuickSlotMngr.QuickSlotInput(15);
                }
            }
        }
예제 #8
0
        public static void UpdateInteraction(LocalCharacterControl __instance)
        {
            if (__instance.InputLocked)
            {
                return;
            }

            try
            {
                if (CustomKeybindings.GetKeyDown("QuickSave"))
                {
                    SaveSystemReworked.MyLogger.LogDebug("QuickSave");
                    SaveManager.Instance.Save(true, true);
                    //QuickSave = SaveManager.Instance.ChooseCharacterSaveInstance(charUID, 0);

                    if ((bool)Global.AudioManager)
                    {
                        Global.AudioManager.PlaySound(GlobalAudioManager.Sounds.UI_NEWGAME_SelectSave);
                    }
                }
                //if (CustomKeybindings.GetKeyDown("QuickLoad"))
                //{
                //    SaveSystemReworked.MyLogger.LogDebug("QuickLoad");
                //    if (QuickSave == null)
                //    {
                //        QuickSave = SaveManager.Instance.ChooseCharacterSaveInstance(charUID, 0);
                //    }
                //    SplitScreenManager.Instance.LocalPlayers[0].SetChosenSave(QuickSave);

                //    QuickSave.ApplyLoadedSaveToChar(__instance.Character);
                //}
            }
            catch (Exception ex)
            {
                SaveSystemReworked.MyLogger.LogError(ex.Message);
            }
        }