private static void InitCommandsAndFreeConvars(On.RoR2.Console.orig_InitConVars orig, Console self) { void RemoveCheatFlag (BaseConVar cv) { cv.flags &= AllFlagsNoCheat; } orig(self); RemoveCheatFlag(self.FindConVar("sv_time_transmit_interval")); RemoveCheatFlag(self.FindConVar("run_scene_override")); RemoveCheatFlag(self.FindConVar("stage1_pod")); self.FindConVar("timescale").helpText += " Use time_scale instead!"; self.FindConVar("director_combat_disable").helpText += " Use no_enemies instead!"; self.FindConVar("timestep").helpText += " Let the DebugToolkit team know if you need this convar."; self.FindConVar("cmotor_safe_collision_step_threshold").helpText += " Let the DebugToolkit team know if you need this convar."; self.FindConVar("cheats").helpText += " But you already have the DebugToolkit mod installed..."; var mmConvar = (IntConVar) self.FindConVar("max_messages"); if (mmConvar.value == 25) { mmConvar.SetString("100"); } }
private static void Console_InitConVars(On.RoR2.Console.orig_InitConVars orig, Console self) { orig(self); var dictionary = (Dictionary <string, BaseConVar>) typeof(Console).GetField("allConVars", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(self); foreach (Settings.BaseCustomSetting customsetting in Settings.listSettings) { if (dictionary.ContainsKey(customsetting.conVar.name)) { dictionary[customsetting.conVar.name] = customsetting.conVar; } else { dictionary.Add(customsetting.conVar.name, customsetting.conVar); } } }