public static void InitializeCheats() { CheatToolsWindow.OnShown = window => { _hFlag = Object.FindObjectOfType <HFlag>(); _talkScene = Object.FindObjectOfType <TalkScene>(); _hSprite = Object.FindObjectOfType <HSprite>(); _studioInstance = Studio.Studio.Instance; _soundInstance = Manager.Sound.Instance; _communicationInstance = Communication.Instance; _sceneInstance = Scene.Instance; _gameMgr = Game.Instance; _openInInspectorButtons = new[] { new KeyValuePair <object, string>(_gameMgr != null && _gameMgr.HeroineList.Count > 0 ? (Func <object>)(() => _gameMgr.HeroineList.Select(x => new ReadonlyCacheEntry(x.ChaName, x))) : null, "Heroine list"), new KeyValuePair <object, string>(_gameMgr, "Manager.Game.Instance"), new KeyValuePair <object, string>(_sceneInstance, "Manager.Scene.Instance"), new KeyValuePair <object, string>(_communicationInstance, "Manager.Communication.Instance"), new KeyValuePair <object, string>(_soundInstance, "Manager.Sound.Instance"), new KeyValuePair <object, string>(_hFlag, "HFlag"), new KeyValuePair <object, string>(_talkScene, "TalkScene"), new KeyValuePair <object, string>(_studioInstance, "Studio.Instance"), new KeyValuePair <object, string>((Func <object>)EditorUtilities.GetRootGoScanner, "Root Objects") }; }; CheatToolsWindow.Cheats.Add(new CheatEntry(w => _studioInstance == null && _gameMgr != null && !_gameMgr.saveData.isOpening, DrawPlayerCheats, "Start the game to see player cheats")); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _hFlag != null, DrawHSceneCheats, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _gameMgr != null, DrawGirlCheatMenu, null)); CheatToolsWindow.Cheats.Add(CheatEntry.CreateOpenInInspectorButtons(() => _openInInspectorButtons)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _gameMgr != null, DrawGlobalUnlocks, null)); }
public static void InitializeCheats() { CheatToolsWindow.OnShown = window => { _studioInstance = Studio.Studio.IsInstance() ? Studio.Studio.Instance : null; _soundInstance = Manager.Sound.instance; _sceneInstance = Scene.instance; _gameMgr = Game.IsInstance() ? Game.Instance : null; _baseMap = BaseMap.instance; _hScene = HSceneFlagCtrl.IsInstance() ? HSceneFlagCtrl.Instance : null; _openInInspectorButtons = new[] { new KeyValuePair <object, string>(_gameMgr != null && _gameMgr.heroineList.Count > 0 ? (Func <object>)(() => _gameMgr.heroineList.Select(x => new ReadonlyCacheEntry(GetHeroineName(x), x))) : null, "Heroine list"), new KeyValuePair <object, string>(ADVManager.IsInstance() ? ADVManager.Instance : null, "Manager.ADVManager.Instance"), new KeyValuePair <object, string>(_baseMap, "Manager.BaseMap.instance"), new KeyValuePair <object, string>(Character.IsInstance() ? Character.Instance : null, "Manager.Character.Instance"), new KeyValuePair <object, string>(typeof(Manager.Config), "Manager.Config"), new KeyValuePair <object, string>(_gameMgr, "Manager.Game.Instance"), new KeyValuePair <object, string>(GameSystem.IsInstance() ? GameSystem.Instance : null, "Manager.GameSystem.Instance"), new KeyValuePair <object, string>(_sceneInstance, "Manager.Scene.instance"), new KeyValuePair <object, string>(_soundInstance, "Manager.Sound.instance"), new KeyValuePair <object, string>(_studioInstance, "Studio.Instance"), new KeyValuePair <object, string>((Func <object>)EditorUtilities.GetRootGoScanner, "Root Objects") }; }; CheatToolsWindow.Cheats.Add(new CheatEntry(w => _hScene != null, DrawHSceneCheats, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _baseMap != null && (_hScene != null || Singleton <LobbySceneManager> .IsInstance()), DrawGirlCheatMenu, "Unable to edit character stats on this screen. Start an H scene or enter the lobby.")); CheatToolsWindow.Cheats.Add(CheatEntry.CreateOpenInInspectorButtons(() => _openInInspectorButtons)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _studioInstance == null && _gameMgr != null && _gameMgr.saveData != null, DrawGlobalUnlocks, null)); HarmonyLib.Harmony.CreateAndPatchAll(typeof(Hooks)); }
public static void Initialize() { CheatToolsWindow.OnShown = window => { _studioInstance = Studio.Studio.IsInstance() ? Studio.Studio.Instance : null; _soundInstance = Manager.Sound.Instance; _sceneInstance = Scene.Instance; _gameMgr = Game.IsInstance() ? Game.Instance : null; _resources = Resources.Instance; _map = Map.IsInstance() ? Map.Instance : null; _hScene = HSceneFlagCtrl.IsInstance() ? HSceneFlagCtrl.Instance : null; _gameTimeText = null; _openInInspectorButtons = new[] { new KeyValuePair <object, string>(_map != null && _map.AgentTable.Count > 0 ? (Func <object>)(() => _map.AgentTable.Values.Select(x => new ReadonlyCacheEntry(x.CharaName, x))) : null, "Heroine list"), new KeyValuePair <object, string>(Manager.ADV.IsInstance() ? Manager.ADV.Instance : null, "Manager.ADV.Instance"), new KeyValuePair <object, string>(AnimalManager.IsInstance() ? AnimalManager.Instance : null, "Manager.AnimalManager.Instance"), new KeyValuePair <object, string>(_map, "Manager.Map.Instance"), new KeyValuePair <object, string>(Character.IsInstance() ? Character.Instance : null, "Manager.Character.Instance"), new KeyValuePair <object, string>(Config.IsInstance() ? Config.Instance : null, "Manager.Config.Instance"), new KeyValuePair <object, string>(_gameMgr, "Manager.Game.Instance"), new KeyValuePair <object, string>(Manager.Housing.IsInstance() ? Manager.Housing.Instance : null, "Manager.Housing.Instance"), new KeyValuePair <object, string>(_sceneInstance, "Manager.Scene.Instance"), new KeyValuePair <object, string>(_soundInstance, "Manager.Sound.Instance"), new KeyValuePair <object, string>(_studioInstance, "Studio.Instance"), new KeyValuePair <object, string>((Func <object>)EditorUtilities.GetRootGoScanner, "Root Objects") }; }; CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null && _map.Player != null && _map.Player.PlayerData != null, DrawPlayerCheats, "Start the game to see player cheats")); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null && _map.Simulator != null, DrawEnviroControls, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _hScene != null, DrawHSceneCheats, null)); CheatToolsWindow.Cheats.Add(new CheatEntry(w => _map != null, DrawGirlCheatMenu, null)); CheatToolsWindow.Cheats.Add(CheatEntry.CreateOpenInInspectorButtons(() => _openInInspectorButtons)); }