Ejemplo n.º 1
0
        private static void SetNonFrogtownModStatus(ModDetails details, bool enable)
        {
            string src, dst;
            var    display = details.dllFileName.Substring(1, details.dllFileName.Length - 1);

            if (enable)
            {
                src = DISABLED_MOD_FOLDER + "\\" + details.dllFileName;
                dst = ENABLED_MOD_FOLDER + "\\" + details.dllFileName;

                FrogtownShared.Log("FrogShared", LogLevel.Info, display + " moved to plugins, will be loaded after restart.");
            }
            else
            {
                src = details.dllFileFullPath;
                if (string.IsNullOrEmpty(src))
                {
                    src = ENABLED_MOD_FOLDER + "\\" + details.dllFileName;
                }
                dst = DISABLED_MOD_FOLDER + "\\" + details.dllFileName;
                FrogtownShared.Log("FrogShared", LogLevel.Info, display + " moved to disabled, will be unloaded after restart.");
            }
            System.IO.File.Move(src, dst);

            details.enabled = enable;
            //Don't call afterToggle because they aren't actually changed until restart
        }
Ejemplo n.º 2
0
        private static void AfterModToggle(ModDetails details)
        {
            if (details.frogtownModDetails != null && details.frogtownModDetails.isNotCheaty)
            {
                return;
            }

            if (whitelistFrameworkUnlisted.Contains(details.GUID))
            {
                return;
            }

            if (details.enabled)
            {
                modCount++;
                FrogtownShared.Log("FrogShared", LogLevel.Info, details.GUID + " enabled.");
            }
            else
            {
                modCount--;
                FrogtownShared.Log("FrogShared", LogLevel.Info, details.GUID + " disabled.");
            }

            bool newIsModded = modCount > 0;

            if (RoR2Application.isModded != newIsModded)
            {
                RoR2Application.isModded = newIsModded;
                FrogtownShared.Log("FrogShared", LogLevel.Info, "Set isModded flag to " + newIsModded);
            }
        }