示例#1
0
            public static void SwapSelectedSecondary()
            {
                int counter = 0;

                int[] selection = { 0, 0 };
                for (int i = 0; i < 8; i++)
                {
                    if (isSecondarySelected[i])
                    {
                        selection[counter] = i;
                        counter++;
                    }
                    if (counter == 2)
                    {
                        break;
                    }
                }
                string temp = Secondary[selection[0]];

                Secondary[selection[0]] = Secondary[selection[1]];
                Secondary[selection[1]] = temp;

                isSecondarySelected[selection[0]] = false;
                isSecondarySelected[selection[1]] = false;
                MPAutoSelection.SecondaryNeverSelect[selection[0]] = false;
                MPAutoSelection.SecondaryNeverSelect[selection[1]] = false;

                saveToFile();
                MPAutoSelection.Initialise();
            }
            public static void SwapSelectedSecondary()
            {
                int counter = 0;

                int[] selection = { 0, 0 };
                for (int i = 0; i < 8; i++)
                {
                    if (isSecondarySelected[i])
                    {
                        selection[counter] = i;
                        counter++;
                    }
                    if (counter == 2)
                    {
                        break;
                    }
                }
                string temp = MPAutoSelection.SecondaryPriorityArray[selection[0]];

                MPAutoSelection.SecondaryPriorityArray[selection[0]] = MPAutoSelection.SecondaryPriorityArray[selection[1]];
                MPAutoSelection.SecondaryPriorityArray[selection[1]] = temp;

                isSecondarySelected[selection[0]] = false;
                isSecondarySelected[selection[1]] = false;
                MPAutoSelection.SecondaryNeverSelect[selection[0]] = false;
                MPAutoSelection.SecondaryNeverSelect[selection[1]] = false;

                ExtendedConfig.Section_AutoSelect.Set(true);
                MPAutoSelection.Initialise();
            }
示例#3
0
        public static void Postfix(NetworkMessage msg)
        {
            msg.reader.SeekZero();
            RespawnMessage respawnMessage = msg.ReadMessage <RespawnMessage>();

            GameObject gameObject = ClientScene.FindLocalObject(respawnMessage.m_net_id);

            if (gameObject == null)
            {
                return;
            }
            Player playerFromNetId = gameObject.GetComponent <Player>();

            if (playerFromNetId == null)
            {
                return;
            }

            if (playerFromNetId.isLocalPlayer)
            {
                if (MenuManager.opt_primary_autoswitch == 0 && MPAutoSelection.primarySwapFlag)
                {
                    if (GameplayManager.IsMultiplayerActive && NetworkMatch.InGameplay())
                    {
                        MPAutoSelection.maybeSwapPrimary(true);
                    }
                }

                if (MPAutoSelection.secondarySwapFlag)
                {
                    if (GameplayManager.IsMultiplayerActive && NetworkMatch.InGameplay())
                    {
                        MPAutoSelection.maybeSwapMissiles(true);
                    }
                }
            }
        }
            public static void Postfix(int amt, MissileType mt, Player __instance)
            {
                if ((GameplayManager.IsChallengeMode || GameplayManager.IsMission) && !GameplayManager.IsMultiplayerActive && MPAutoSelection.secondarySwapFlag && __instance == GameManager.m_local_player)
                {
                    uConsole.Log(mt.ToString() + ", amt:" + amt);
                    int         new_missile     = MPAutoSelection.getMissilePriority(mt);
                    int         current_missile = MPAutoSelection.getMissilePriority(GameManager.m_local_player.m_missile_type);
                    MissileType old_missile     = GameManager.m_local_player.m_missile_type;
                    if (new_missile < current_missile && !MPAutoSelection.SecondaryNeverSelect[new_missile])
                    {
                        sp_next_missileType = mt;
                        delay = 1;
                    }

                    if (GameManager.m_local_player.m_missile_type == MissileType.DEVASTATOR && old_missile != MissileType.DEVASTATOR)
                    {
                        if (MPAutoSelection.zorc)
                        {
                            SFXCueManager.PlayCue2D(SFXCue.enemy_boss1_alert, 1f, 0f, 0f, false);
                            GameplayManager.AlertPopup(Loc.LS("DEVASTATOR SELECTED"), string.Empty, 5f);
                        }
                    }
                }
            }