Пример #1
0
 public static void RegisterMod(FrogtownModDetails details)
 {
     if (!string.IsNullOrEmpty(details.GUID))
     {
         frogtownDetails.Add(details.GUID, details);
     }
 }
        public void Awake()
        {
            modDetails = new FrogtownModDetails("com.frogtown.healinghelper")
            {
                description          = "Turns you into a healing drone when you die, instead of spectating.",
                githubAuthor         = "ToyDragon",
                githubRepo           = "ROR2ModHealingHelper",
                thunderstoreFullName = "ToyDragon-HealingHelpers"
            };
            FrogtownShared.RegisterMod(modDetails);

            On.RoR2.Stage.FixedUpdate += (orig, instance) =>
            {
                StageFixedUpdatePrefix(instance);
                orig(instance);
            };

            On.RoR2.CharacterMaster.OnBodyDeath += (orig, instance) =>
            {
                orig(instance);
                CharacterMasterOnBodyDeathPostfix(instance);
            };

            On.RoR2.Run.Start += (orig, instance) =>
            {
                orig(instance);
                RunStartPostfix();
            };

            On.RoR2.Stage.RespawnCharacter += (orig, instance, characterMaster) =>
            {
                StageRespawnCharacterPrefix(characterMaster);
                orig(instance, characterMaster);
            };
        }
        public void Awake()
        {
            modDetails = new FrogtownModDetails("com.frogtown.chatcheats")
            {
                description          = "Adds the /change_char and /give_item chat commands.",
                githubAuthor         = "ToyDragon",
                githubRepo           = "ROR2ModChatCommandCheats",
                thunderstoreFullName = "ToyDragon-CheatingChatCommands",
                OnGUI = OnSettingsGUI
            };
            FrogtownShared.RegisterMod(modDetails);

            FrogtownShared.AddChatCommand("change_char", OnCharCommand);
            FrogtownShared.AddChatCommand("give_item", OnGiveCommand);
            FrogtownShared.AddChatCommand("remove_item", OnRemoveCommand);
            FrogtownShared.AddChatCommand("clear_items", OnClearItemsCommand);

            itemsByTier = new List <ItemIndex>();
            foreach (var itemIndex in ItemCatalog.allItems)
            {
                itemsByTier.Add(itemIndex);
            }
            itemsByTier.Sort((a, b) =>
            {
                var definitionA = ItemCatalog.GetItemDef(a);
                var definitionB = ItemCatalog.GetItemDef(b);
                return(definitionA.tier.CompareTo(definitionB.tier));
            });
        }
Пример #4
0
        public void Awake()
        {
            modDetails = new FrogtownModDetails("com.frogtown.characterrandomizer")
            {
                description          = "Switches the characters of everyone in the party randomly every stage.",
                githubAuthor         = "ToyDragon",
                githubRepo           = "ROR2ModCharacterRandomizer",
                thunderstoreFullName = "ToyDragon-CharacterRandomizer",
            };
            FrogtownShared.RegisterMod(modDetails);

            On.RoR2.Stage.RespawnCharacter += (orig, instance, characterMaster) =>
            {
                StageRespawnCharacterPrefix(characterMaster);
                orig(instance, characterMaster);
            };
        }
Пример #5
0
        public void Awake()
        {
            modDetails = new FrogtownModDetails("com.frogtown.engineerfixes")
            {
                description          = "Allows turret kills to drop lunar coins, and turret damage count in score card.",
                githubAuthor         = "ToyDragon",
                githubRepo           = "ROR2ModEngineerLunarCoinFix",
                thunderstoreFullName = "ToyDragon-EngineerLunarCoinsFix",
            };
            modDetails.OnlyContainsBugFixesOrUIChangesThatArentContriversial();
            FrogtownShared.RegisterMod(modDetails);

            On.RoR2.HealthComponent.TakeDamage += (orig, instance, damageInfo) =>
            {
                HealthComponentTakeDamagePrefix(damageInfo);
                orig(instance, damageInfo);
                HealthComponentTakeDamagePostfix(damageInfo);
            };
        }
Пример #6
0
        void Awake()
        {
            instance = this;

            On.RoR2.Chat.AddMessage_string += (orig, message) =>
            {
                orig(message);
                if (ParseUserAndMessage(message, out string userName, out string text))
                {
                    string[] pieces = text.Split(' ');
                    TriggerChatCommand(userName, pieces);
                }
            };

            FrogtownModDetails details = new FrogtownModDetails("com.frogtown.shared")
            {
                githubAuthor = "ToyDragon",
                githubRepo   = "ROR2ModShared",
                description  = "Powers this UI and contains shared resources for other mods.",
                noDisable    = true,
                OnGUI        = () =>
                {
                    bool newShowOnStart = GUILayout.Toggle(UI.instance.uiSettings.showOnStart, "Show this window on startup", GUILayout.ExpandWidth(false));
                    if (newShowOnStart != UI.instance.uiSettings.showOnStart)
                    {
                        UI.instance.uiSettings.showOnStart = newShowOnStart;
                        UI.instance.SaveSettings();
                    }
                }
            };

            details.OnlyContainsBugFixesOrUIChangesThatArentContriversial();
            ModManager.RegisterMod(details);

            //I use this to test multiplayer, leave it off in releases
            Invoke(nameof(Init), 1f);
        }
Пример #7
0
 public static void RegisterMod(FrogtownModDetails details)
 {
     ModManager.RegisterMod(details);
 }