public override void enableMod() { string summary = "Mods Enabled: PolyTechFramework"; foreach (PolyTechMod mod in modsDisabledByPTF) { mod.enableMod(); summary += $" - {mod.Info.Metadata.Name}"; } modsToggledSummary = summary; PolyTechUtils.setReplaysModded(); }
public void Awake() { moddedWatermark = Config.Bind(moddedWatermarkDef, watermarks.polytech, new ConfigDescription("Selected Watermark")); vanillaWatermark = Config.Bind(vanillaWatermarkDef, watermarks.polytech, new ConfigDescription("Selected Watermark")); modEnabled = Config.Bind(modEnabledDef, true, new ConfigDescription("Enable Mod")); modEnabled.SettingChanged += onEnableDisable; forceCheat = Config.Bind(forceCheatDef, false, new ConfigDescription("Force Cheat Flag")); forceCheat.SettingChanged += onForceCheatToggle; sandboxEverywhere = Config.Bind(sandboxEverywhereDef, false, new ConfigDescription("Allow sandbox resource editor and scene changer in any level (enables cheat flag)")); sandboxEverywhere.SettingChanged += sandboxEverywhereToggle; globalToggleHotkey = Config.Bind(globalToggleHotkeyDef, new BepInEx.Configuration.KeyboardShortcut(KeyCode.BackQuote, KeyCode.LeftAlt), new ConfigDescription("Keybind used to toggle mods without opening the config menu.")); leaderboardProtMin = Config.Bind(leaderboardProtMinDef, 71, new ConfigDescription("Minimum value allowed to upload to leaderboard. 71 is the minimum to protect from automatic shadowbans.")); leaderboardProtMin.SettingChanged += onLeaderboardProtChange; leaderboardCheck = Config.Bind(leaderboardCheckDef, false, new ConfigDescription("If checked, the game will confirm with the user before uploading scores to the leaderboard.")); leaderboardBlock = Config.Bind(leaderboardBlockDef, false, new ConfigDescription("If checked, the game will never upload a score to the leaderboard.")); noncheatMods.ListChanged += onCosmeticsChanged; cheatMods.ListChanged += onCheatsChanged; enabledCheatTweaks = 0 + (forceCheat.Value ? 1 : 0) + (sandboxEverywhere.Value ? 1 : 0); this.modCheated = false; this.repositoryUrl = "https://github.com/PolyTech-Modding/PolyTechFramework/"; Harmony.CreateAndPatchAll(typeof(PolyTechMain)); PolyTechUtils.setModdedSimSpeeds(); PolyTechUtils.setReplaysModded(); PolyTechUtils.setVersion(); this.ptfLogger = Logger; Logger.LogInfo($"Loaded {PluginName} v{PluginVersion}"); this.isCheat = false; this.isEnabled = modEnabled.Value; ptfInstance = this; this.authors = new string[] { "MoonlitJolty", "Conqu3red", "Razboy20", "Tran Fox", "nitsuga5124" }; registerMod(this); }