Exemple #1
0
        public static void OnUpgradePre(BuildTool_Upgrade __instance)
        {
            if (UndoManager.IgnoreAllEvents.Value)
            {
                return;
            }

            if (NebulaModAPI.IsMultiplayerActive)
            {
                if (NebulaModAPI.MultiplayerSession.LocalPlayer.IsClient)
                {
                    return;
                }
            }

            upgradeIds.Clear();
            upgradeList.Clear();
            RecordUpgrades = true;
        }
Exemple #2
0
        public static void OnUpgradePost(BuildTool_Upgrade __instance)
        {
            if (UndoManager.IgnoreAllEvents.Value)
            {
                return;
            }

            if (NebulaModAPI.IsMultiplayerActive)
            {
                if (NebulaModAPI.MultiplayerSession.LocalPlayer.IsClient)
                {
                    return;
                }
            }

            RecordUpgrades = false;

            if (upgradeList.Count > 0)
            {
                PlayerUndo data = UndoManager.GetCurrentPlayerData();
                data.AddUndoItem(new UndoUpgrade(data, upgradeList));
            }
        }
Exemple #3
0
 public static void BuildTool_Upgrade_DeterminePreviews_Postfix(BuildTool_Upgrade __instance)
 {
     RenderBuildCounter(__instance);
 }