Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }