Exemplo n.º 1
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);
            };
        }
Exemplo n.º 2
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);
        }