Esempio n. 1
0
        private static void DrawGirlCheatMenu(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("Character status editor");

            if (!Singleton <LobbySceneManager> .IsInstance())
            {
                var visibleGirls = _gameMgr.heroineList;

                for (var i = 0; i < visibleGirls.Count; i++)
                {
                    var girl = visibleGirls[i];
                    if (GUILayout.Button($"Select #{i} - {GetHeroineName(girl)}"))
                    {
                        _currentVisibleGirl = girl;
                    }
                }

                GUILayout.Space(6);
            }

            if (_currentVisibleGirl != null)
            {
                DrawSingleGirlCheats(_currentVisibleGirl, cheatToolsWindow);
            }
            else
            {
                GUILayout.Label("Select a character to edit their stats");
            }
        }
Esempio n. 2
0
        private static void DrawGlobalUnlocks(CheatToolsWindow window)
        {
            GUILayout.Label("Global unlocks (might need a reload)");

            CheatToolsPlugin.UnlockAllPositions.Value = GUILayout.Toggle(CheatToolsPlugin.UnlockAllPositions.Value, "Unlock all H positions");

            if (GUILayout.Button("Obtain all H positions"))
            {
                // Vanilla positions don't seem to go above 60, modded positions are above 1000 usually
                // 8 buckets might change in the future if game is updated with more h modes, check HSceneProc.lstAnimInfo for how many are needed
                for (int i = 0; i < 10; i++)
                {
                    _gameMgr.glSaveData.playHList[i] = new HashSet <int>(Enumerable.Range(0, 9999));
                }
            }

            if (GUILayout.Button("Unlock all wedding personalities"))
            {
                foreach (var personalityId in Singleton <Voice> .Instance.voiceInfoList.Select(x => x.No).Where(x => x >= 0))
                {
                    _gameMgr.weddingData.personality.Add(personalityId);
                }
            }

            /* Doesn't work, need a list of items to put into glSaveData.clubContents from somewhere
             *  if (GUILayout.Button("Unlock all free H toys/extras"))
             *  {
             *      var go = new GameObject("CheatTools Temp");
             *      var handCtrl = go.AddComponent<HandCtrl>();
             *      var dicItem = (Dictionary<int, HandCtrl.AibuItem>)Traverse.Create(typeof(HandCtrl)).Field("dicItem").GetValue(handCtrl);
             *      _gameMgr.glSaveData.clubContents[0] = new HashSet<int>(dicItem.Select(x => x.Value.saveID).Where(x => x >= 0));
             *      go.Destroy();
             *  }*/
        }
Esempio n. 3
0
        private void Update()
        {
            if (_showCheatWindow.Value.IsDown())
            {
                if (_cheatWindow == null)
                {
                    _cheatWindow = new CheatToolsWindow(_runtimeUnityEditorCore);
                }

                _cheatWindow.Show = !_cheatWindow.Show;
            }
            else if (_noclip.Value.IsDown())
            {
                NoclipMode = !NoclipMode;
            }

            if (NoclipMode)
            {
                if (Game.IsInstance())
                {
                    var player = Game.Instance.Player;
                    if (player != null)
                    {
                        var playerTransform = player.transform;
                        if (playerTransform != null && playerTransform.GetComponent <NavMeshAgent>()?.enabled == false)
                        {
                            RunNoclip(playerTransform);
                            return;
                        }
                    }
                }

                NoclipMode = false;
            }
        }
Esempio n. 4
0
        private static void DrawGirlCheatMenu(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("Heroines");

            var visibleGirls = _map.AgentTable.Values;

            foreach (var girl in visibleGirls)
            {
                if (GUILayout.Button($"Select #{girl.ID} - {girl.CharaName ?? girl.name}"))
                {
                    _currentVisibleGirl = girl;
                }
            }

            GUILayout.Space(6);

            if (_currentVisibleGirl != null)
            {
                DrawSingleGirlCheats(_currentVisibleGirl, cheatToolsWindow);
            }
            else
            {
                GUILayout.Label("Select a heroine to access her stats");
            }
        }
Esempio n. 5
0
        private static void DrawHSceneCheats(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("H scene controls");

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Male Gauge: " + _hFlag.gaugeMale.ToString("N1"), GUILayout.Width(150));
                _hFlag.gaugeMale = GUILayout.HorizontalSlider(_hFlag.gaugeMale, 0, 100);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Female Gauge: " + _hFlag.gaugeFemale.ToString("N1"), GUILayout.Width(150));
                _hFlag.gaugeFemale = GUILayout.HorizontalSlider(_hFlag.gaugeFemale, 0, 100);
            }

            GUILayout.EndHorizontal();

            if (_hSprite != null)
            {
                if (GUILayout.Button("Force quit H scene"))
                {
                    Utils.Sound.Play(SystemSE.cancel);
                    _hSprite.flags.click       = HFlag.ClickKind.end;
                    _hSprite.flags.isHSceneEnd = true;
                    _hSprite.flags.numEnd      = 0;
                }
            }
        }
Esempio n. 6
0
        private static void DrawHSceneCheats(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("H scene controls");

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Male Gauge: " + _hScene.feel_m.ToString("F2"), GUILayout.Width(150));
                _hScene.feel_m = GUILayout.HorizontalSlider(_hScene.feel_m, 0, 1);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Female Gauge: " + _hScene.feel_f.ToString("F2"), GUILayout.Width(150));
                _hScene.feel_f = GUILayout.HorizontalSlider(_hScene.feel_f, 0, 1);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Pain Gauge: " + _hScene.feelPain.ToString("F2"), GUILayout.Width(150));
                _hScene.feelPain = GUILayout.HorizontalSlider(_hScene.feelPain, 0, 1);
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button("Open HScene Flags in inspector"))
            {
                cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(_hScene, "HSceneFlagCtrl"), true);
            }
        }
Esempio n. 7
0
        private void Update()
        {
            if (_showCheatWindow.Value.IsDown())
            {
                if (_cheatWindow == null)
                {
                    _cheatWindow = new CheatToolsWindow(_runtimeUnityEditorCore);
                }

                _cheatWindow.Show = !_cheatWindow.Show;
            }
        }
Esempio n. 8
0
 private void DrawTimeControls(CheatToolsWindow window)
 {
     GUILayout.BeginHorizontal();
     {
         GUILayout.Label("Speed", GUILayout.ExpandWidth(false));
         GUILayout.Label((int)Math.Round(Time.timeScale * 100) + "%", GUILayout.Width(35));
         Time.timeScale = GUILayout.HorizontalSlider(Time.timeScale, 0, 5, GUILayout.ExpandWidth(true));
         if (GUILayout.Button("Reset", GUILayout.ExpandWidth(false)))
         {
             Time.timeScale = 1;
         }
     }
     GUILayout.EndHorizontal();
 }
Esempio n. 9
0
        private static void DrawGlobalUnlocks(CheatToolsWindow window)
        {
            GUILayout.Label("Global unlocks (might need a reload)");

            // todo needs testing
            if (GUILayout.Button("Obtain all H positions"))
            {
                // Vanilla positions don't seem to go above 60, modded positions are above 1000 usually
                // 8 buckets might change in the future if game is updated with more h modes, check HSceneProc.lstAnimInfo for how many are needed
                for (int i = 0; i < 10; i++)
                {
                    Game.globalData.playHList[i] = new HashSet <int>(Enumerable.Range(0, 9999));
                }
            }
        }
Esempio n. 10
0
        private static void DrawGlobalUnlocks(CheatToolsWindow obj)
        {
            GUILayout.Label("Danger zone! These cheats are permanent and can't be undone without resetting the save.");

            if (GUILayout.Button("Get all achievements", GUILayout.ExpandWidth(true)))
            {
                foreach (var achievementKey in _gameMgr.saveData.achievement.Keys.ToList())
                {
                    SaveData.SetAchievementAchieve(achievementKey);
                }
            }
            if (GUILayout.Button("Unlock all perks", GUILayout.ExpandWidth(true)))
            {
                foreach (var achievementKey in _gameMgr.saveData.achievementExchange.Keys.ToList())
                {
                    SaveData.SetAchievementExchangeRelease(achievementKey);
                }
            }
        }
Esempio n. 11
0
        private static void DrawSingleGirlCheats(Heroine currentAdvGirl, CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.BeginVertical(GUI.skin.box);
            {
                GUILayout.Label("Selected heroine name: " + (GetHeroineName(currentAdvGirl)));
                GUILayout.Space(6);

                if (currentAdvGirl.chaCtrl != null && currentAdvGirl.chaCtrl.fileGameInfo2 != null)
                {
                    var anyChanges = false;
                    var gi2        = currentAdvGirl.gameinfo2;

                    void DrawSingleStateBtn(ChaFileDefine.State state)
                    {
                        if (GUILayout.Button(state.ToString()))
                        {
                            gi2.nowState   = state; gi2.calcState = state; gi2.nowDrawState = state;
                            gi2.Favor      = state == ChaFileDefine.State.Favor ? 100 : Mathf.Min(gi2.Favor, 90);
                            gi2.Enjoyment  = state == ChaFileDefine.State.Enjoyment ? 100 : Mathf.Min(gi2.Enjoyment, 90);
                            gi2.Aversion   = state == ChaFileDefine.State.Aversion ? 100 : Mathf.Min(gi2.Aversion, 90);
                            gi2.Slavery    = state == ChaFileDefine.State.Slavery ? 100 : Mathf.Min(gi2.Slavery, 90);
                            gi2.Broken     = state == ChaFileDefine.State.Broken ? 100 : Mathf.Min(gi2.Broken, 90);
                            gi2.Dependence = state == ChaFileDefine.State.Dependence ? 100 : Mathf.Min(gi2.Dependence, 90);
                            anyChanges     = true;
                        }
                    }

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Current state: " + gi2.nowState);
                        GUILayout.FlexibleSpace();
                        DrawSingleStateBtn(ChaFileDefine.State.Blank);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        DrawSingleStateBtn(ChaFileDefine.State.Favor);
                        DrawSingleStateBtn(ChaFileDefine.State.Enjoyment);
                        DrawSingleStateBtn(ChaFileDefine.State.Aversion);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        DrawSingleStateBtn(ChaFileDefine.State.Slavery);
                        DrawSingleStateBtn(ChaFileDefine.State.Broken);
                        DrawSingleStateBtn(ChaFileDefine.State.Dependence);
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.Space(6);

                    GUILayout.Label("Statistics:");

                    void ShowSingleSlider(string name, Action <int> set, Func <int> get)
                    {
                        GUILayout.BeginHorizontal();
                        {
                            var status = get();
                            GUILayout.Label(name + ": " + status, GUILayout.Width(120));
                            var newStatus = Mathf.RoundToInt(GUILayout.HorizontalSlider(status, 0, 100));
                            if (newStatus != status)
                            {
                                set(newStatus);
                                anyChanges = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                    }

                    void ShowSingleTextfield(string name, Action <int> set, Func <int> get)
                    {
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(name + ": ", GUILayout.Width(120));
                            GUI.changed = false;
                            var status    = get();
                            var textField = GUILayout.TextField(status.ToString());
                            if (GUI.changed && int.TryParse(textField, out var newStatus) && newStatus != status)
                            {
                                set(newStatus);
                                anyChanges = true;
                            }

                            GUI.changed = false;
                        }
                        GUILayout.EndHorizontal();
                    }

                    ShowSingleSlider(nameof(gi2.Favor), i => gi2.Favor           = i, () => gi2.Favor);
                    ShowSingleSlider(nameof(gi2.Enjoyment), i => gi2.Enjoyment   = i, () => gi2.Enjoyment);
                    ShowSingleSlider(nameof(gi2.Aversion), i => gi2.Aversion     = i, () => gi2.Aversion);
                    ShowSingleSlider(nameof(gi2.Slavery), i => gi2.Slavery       = i, () => gi2.Slavery);
                    ShowSingleSlider(nameof(gi2.Broken), i => gi2.Broken         = i, () => gi2.Broken);
                    ShowSingleSlider(nameof(gi2.Dependence), i => gi2.Dependence = i, () => gi2.Dependence);
                    ShowSingleSlider(nameof(gi2.Dirty), i => gi2.Dirty           = i, () => gi2.Dirty);
                    ShowSingleSlider(nameof(gi2.Tiredness), i => gi2.Tiredness   = i, () => gi2.Tiredness);
                    ShowSingleSlider(nameof(gi2.Toilet), i => gi2.Toilet         = i, () => gi2.Toilet);
                    ShowSingleSlider(nameof(gi2.Libido), i => gi2.Libido         = i, () => gi2.Libido);

                    ShowSingleTextfield(nameof(gi2.hCount), i => { gi2.hCount = i; if (i == 0)
                                                                   {
                                                                       gi2.firstHFlag = true;
                                                                   }
                                        }, () => gi2.hCount);

                    if (anyChanges)
                    {
                        _onGirlStatsChanged(_currentVisibleGirl);
                    }

                    if (GUILayout.Button("View more stats and flags"))
                    {
                        cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(gi2, "Heroine " + GetHeroineName(currentAdvGirl)), true);
                    }
                }

                GUILayout.Space(6);

                if (GUILayout.Button("Navigate to Heroine's GameObject"))
                {
                    if (currentAdvGirl.transform != null)
                    {
                        cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(currentAdvGirl.transform);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Heroine has no body assigned");
                    }
                }

                if (GUILayout.Button("Open Heroine in inspector"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(currentAdvGirl, "Heroine " + GetHeroineName(currentAdvGirl)), true);
                }

                if (GUILayout.Button("Inspect extended data"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(ExtensibleSaveFormat.ExtendedSave.GetAllExtendedData(currentAdvGirl.chaFile), "ExtData for " + currentAdvGirl.Name), true);
                }
            }
            GUILayout.EndVertical();
        }
Esempio n. 12
0
        private static void DrawPlayerCheats(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("Player stats");

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("STR: " + _gameMgr.Player.physical, GUILayout.Width(60));
                _gameMgr.Player.physical = (int)GUILayout.HorizontalSlider(_gameMgr.Player.physical, 0, 100);
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("INT: " + _gameMgr.Player.intellect, GUILayout.Width(60));
                    _gameMgr.Player.intellect = (int)GUILayout.HorizontalSlider(_gameMgr.Player.intellect, 0, 100);
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("H: " + _gameMgr.Player.hentai, GUILayout.Width(60));
                    _gameMgr.Player.hentai = (int)GUILayout.HorizontalSlider(_gameMgr.Player.hentai, 0, 100);
                }
                GUILayout.EndHorizontal();

                var cycle = Object.FindObjectsOfType <Cycle>().FirstOrDefault();
                if (cycle != null)
                {
                    if (cycle.timerVisible)
                    {
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label("Time: " + cycle.timer.ToString("N1"), GUILayout.Width(65));
                            var newVal = GUILayout.HorizontalSlider(cycle.timer, 0, Cycle.TIME_LIMIT);
                            if (Math.Abs(newVal - cycle.timer) > 0.09)
                            {
                                typeof(Cycle)
                                .GetField("_timer", BindingFlags.Instance | BindingFlags.NonPublic)
                                ?.SetValue(cycle, newVal);
                            }
                        }
                        GUILayout.EndHorizontal();
                    }

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Day of the week: " + cycle.nowWeek);
                        if (GUILayout.Button("Next"))
                        {
                            cycle.Change(cycle.nowWeek.Next());
                        }
                    }
                    GUILayout.EndHorizontal();
                }
            }

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Academy Name: ", GUILayout.ExpandWidth(false));
                _gameMgr.saveData.accademyName =
                    GUILayout.TextField(_gameMgr.saveData.accademyName, GUILayout.ExpandWidth(true));
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Player Name: ", GUILayout.ExpandWidth(false));
                _gameMgr.Player.parameter.lastname  = GUILayout.TextField(_gameMgr.Player.parameter.lastname);
                _gameMgr.Player.parameter.firstname = GUILayout.TextField(_gameMgr.Player.parameter.firstname);
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button("Add 10000 club points (+1 level)"))
            {
                _gameMgr.saveData.clubReport.comAdd += 10000;
            }

            if (GUILayout.Button("Stop shame reactions in bathrooms"))
            {
                var actionMap = Object.FindObjectOfType <ActionMap>();
                if (actionMap != null)
                {
                    foreach (var param in actionMap.infoDic.Values)
                    {
                        if (param.isWarning)
                        {
                            param.isWarning = false;
                            CheatToolsPlugin.Logger.Log(LogLevel.Message,
                                                        "Disabling shame reactions on map: " + param.MapName);
                        }
                    }
                }
            }

            GUI.changed = false;
            var playerIsNoticeable = _playerEnterExitTrigger == null || _playerEnterExitTrigger.enabled;

            playerIsNoticeable = !GUILayout.Toggle(!playerIsNoticeable, "Make player unnoticeable");
            if (GUI.changed)
            {
                var actionMap = Object.FindObjectOfType <ActionScene>();
                if (actionMap != null)
                {
                    _playerEnterExitTrigger         = actionMap.Player.noticeArea;
                    _playerEnterExitTrigger.enabled = playerIsNoticeable;
                }
            }

            NoclipFeature.NoclipMode = GUILayout.Toggle(NoclipFeature.NoclipMode, "Enable player noclip");

            if (GUILayout.Button("Open player data in inspector"))
            {
                cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(_gameMgr.saveData.player, "Player data"), true);
            }
        }
Esempio n. 13
0
        private static void DrawGirlCheatMenu(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("Girl stats");

            if (!_showSelectHeroineList)
            {
                var visibleGirls = GetCurrentVisibleGirls();

                for (var index = 0; index < visibleGirls.Length; index++)
                {
                    var girl = visibleGirls[index];
                    if (GUILayout.Button($"Select current #{index} - {girl.Name}"))
                    {
                        _currentVisibleGirl = girl;
                    }
                }

                var anyHeroines = _gameMgr.HeroineList != null && _gameMgr.HeroineList.Count > 0;
                if (anyHeroines)
                {
                    if (GUILayout.Button("Select from heroine list"))
                    {
                        _showSelectHeroineList = true;
                    }
                }

                if (_currentVisibleGirl != null)
                {
                    GUILayout.Space(6);
                    DrawHeroineCheats(_currentVisibleGirl, cheatToolsWindow);
                }
                else
                {
                    GUILayout.Label("Select a girl to access her stats");
                }

                if (anyHeroines)
                {
                    GUILayout.BeginVertical(GUI.skin.box);
                    {
                        GUILayout.Label("These affect ALL heroines");
                        if (GUILayout.Button("Make everyone friendly"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                h.favor   = 100;
                                h.anger   = 0;
                                h.isAnger = false;
                            }
                        }
                        if (GUILayout.Button("Make everyone lovers"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                h.anger        = 0;
                                h.isAnger      = false;
                                h.favor        = 100;
                                h.lewdness     = 100;
                                h.intimacy     = 100;
                                h.isGirlfriend = true;
                                h.confessed    = true;
                            }
                        }
                        if (GUILayout.Button("Make everyone club members"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                if (!h.isTeacher)
                                {
                                    h.isStaff = true;
                                }
                            }
                        }
                        if (GUILayout.Button("Make everyone virgins"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                MakeVirgin(h);
                            }
                        }
                        if (GUILayout.Button("Make everyone inexperienced"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                MakeInexperienced(h);
                            }
                        }
                        if (GUILayout.Button("Make everyone experienced"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                MakeExperienced(h);
                            }
                        }
                        if (GUILayout.Button("Make everyone perverted"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                MakeHorny(h);
                            }
                        }
                        if (GUILayout.Button("Clear everyone's desires"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                for (int i = 0; i < 31; i++)
                                {
                                    Game.Instance.actScene.actCtrl.SetDesire(i, h, 0);
                                }
                            }
                        }
                        if (GUILayout.Button("Everyone desires masturbation"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                Game.Instance.actScene.actCtrl.SetDesire(4, h, 100);
                            }
                        }
                        if (GUILayout.Button("Everyone desires lesbian"))
                        {
                            foreach (var h in Game.Instance.HeroineList)
                            {
                                Game.Instance.actScene.actCtrl.SetDesire(26, h, 100);
                                Game.Instance.actScene.actCtrl.SetDesire(27, h, 100);
                            }
                        }
                    }
                    GUILayout.EndVertical();
                }
            }
            else
            {
                if (_gameMgr.HeroineList == null || _gameMgr.HeroineList.Count == 0)
                {
                    _showSelectHeroineList = false;
                }
                else
                {
                    GUILayout.Label("Select one of the heroines to continue");

                    for (var index = 0; index < _gameMgr.HeroineList.Count; index++)
                    {
                        var heroine = _gameMgr.HeroineList[index];
                        if (GUILayout.Button($"Select #{index} - {heroine.Name}"))
                        {
                            _currentVisibleGirl    = heroine;
                            _showSelectHeroineList = false;
                        }
                    }
                }
            }
        }
Esempio n. 14
0
        private static void DrawPlayerCheats(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("Player stats");

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("STR: " + Game.Player.physical, GUILayout.Width(60));
                Game.Player.physical = (int)GUILayout.HorizontalSlider(Game.Player.physical, 0, 100);
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("INT: " + Game.Player.intellect, GUILayout.Width(60));
                    Game.Player.intellect = (int)GUILayout.HorizontalSlider(Game.Player.intellect, 0, 100);
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("H: " + Game.Player.hentai, GUILayout.Width(60));
                    Game.Player.hentai = (int)GUILayout.HorizontalSlider(Game.Player.hentai, 0, 100);
                }
                GUILayout.EndHorizontal();

                var cycle = Object.FindObjectsOfType <Cycle>().FirstOrDefault();
                if (cycle != null)
                {
                    if (cycle.timerVisible)
                    {
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label("Time: " + cycle.timer.ToString("N1"), GUILayout.Width(65));
                            var newVal = GUILayout.HorizontalSlider(cycle.timer, 0, Cycle.TIME_LIMIT);
                            if (Math.Abs(newVal - cycle.timer) > 0.09)
                            {
                                cycle._timer = newVal;
                            }
                        }
                        GUILayout.EndHorizontal();
                    }

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Day of the week: " + cycle.nowWeek);
                        if (GUILayout.Button("Next"))
                        {
                            cycle.Change(cycle.nowWeek.Next());
                        }
                    }
                    GUILayout.EndHorizontal();
                }
            }

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Player Name: ", GUILayout.ExpandWidth(false));
                Game.Player.parameter.lastname  = GUILayout.TextField(Game.Player.parameter.lastname);
                Game.Player.parameter.firstname = GUILayout.TextField(Game.Player.parameter.firstname);
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button("Add 100 Koikatsu points"))
            {
                Game.saveData.player.koikatsuPoint += 100;
            }

            if (GUILayout.Button("Stop shame reactions in bathrooms"))
            {
                var actionMap = Object.FindObjectOfType <ActionMap>();
                if (actionMap != null)
                {
                    foreach (var param in actionMap.infoDic.Values)
                    {
                        if (param.isWarning)
                        {
                            param.isWarning = false;
                            CheatToolsPlugin.Logger.Log(LogLevel.Message, "Disabling shame reactions on map: " + param.MapName);
                        }
                    }
                }
            }

            GUI.changed = false;
            var playerIsNoticeable = _playerEnterExitTrigger == null || _playerEnterExitTrigger.enabled;

            playerIsNoticeable = !GUILayout.Toggle(!playerIsNoticeable, "Make player unnoticeable");
            if (GUI.changed)
            {
                var actionMap = Object.FindObjectOfType <ActionScene>();
                if (actionMap != null)
                {
                    _playerEnterExitTrigger         = actionMap.Player.noticeArea;
                    _playerEnterExitTrigger.enabled = playerIsNoticeable;
                }
            }

            NoclipFeature.NoclipMode = GUILayout.Toggle(NoclipFeature.NoclipMode, "Enable player noclip");

            if (GUILayout.Button("Open player data in inspector"))
            {
                cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(Game.saveData.player, "Player data"), true);
            }

            GUILayout.BeginVertical(GUI.skin.box);
            {
                var currentPrayer = Game.saveData.prayedResult;
                var prayerIndex   = Array.IndexOf(_prayerIds, currentPrayer);
                var prayerName    = prayerIndex >= 0 ? _prayerNames[prayerIndex] : "Unknown";

                GUILayout.Label("Prayer bonus: " + prayerName);

                GUI.changed = false;
                var result = GUILayout.SelectionGrid(prayerIndex, _prayerNames, 1);
                if (GUI.changed)
                {
                    Game.saveData.prayedResult = _prayerIds[result];
                }
            }
            GUILayout.EndVertical();
        }
Esempio n. 15
0
        private static void DrawPlayerCheats(CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.Label("General / Player");
            var playerData = _map.Player.PlayerData;

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Fishing skill lvl: " + playerData.FishingSkill.Level, GUILayout.Width(150));
                if (GUILayout.Button("+500 exp"))
                {
                    playerData.FishingSkill.AddExperience(500);
                }
            }
            GUILayout.EndHorizontal();

            if (_resources != null)
            {
                var mp = _resources.MerchantProfile;
                if (mp != null)
                {
                    GUILayout.BeginHorizontal();
                    {
                        var shanLvl = mp.SpendMoneyBorder.Count(x => playerData.SpendMoney >= x) + 1;
                        GUILayout.Label("Shan heart lvl: " + shanLvl, GUILayout.Width(150));
                        if (GUILayout.Button("1"))
                        {
                            playerData.SpendMoney = 0;
                        }
                        if (GUILayout.Button("2"))
                        {
                            playerData.SpendMoney = mp.SpendMoneyBorder[0];
                        }
                        if (GUILayout.Button("3"))
                        {
                            playerData.SpendMoney = mp.SpendMoneyBorder[1];
                        }
                    }
                    GUILayout.EndHorizontal();
                }
            }

            FishingHackHooks.Enabled    = GUILayout.Toggle(FishingHackHooks.Enabled, "Enable instant fishing");
            UnlockCraftingHooks.Enabled = GUILayout.Toggle(UnlockCraftingHooks.Enabled, "Enable free crafting");
            NoclipFeature.NoclipMode    = GUILayout.Toggle(NoclipFeature.NoclipMode, "Enable player noclip");

            CheatToolsPlugin.BuildAnywhere.Value = GUILayout.Toggle(CheatToolsPlugin.BuildAnywhere.Value, "Allow building anywhere");
            CheatToolsPlugin.BuildOverlap.Value  = GUILayout.Toggle(CheatToolsPlugin.BuildOverlap.Value, "Allow building items to overlap");

            if (_resources != null)
            {
                var dp = _resources.DefinePack;
                if (dp != null)
                {
                    GUILayout.BeginVertical(GUI.skin.box);
                    {
                        GUILayout.Label("Warning: These can't be turned off!");
                        if (dp.MapDefines.ItemSlotMax >= 99999 && playerData.InventorySlotMax >= 99999)
                        {
                            GUI.enabled = false;
                        }
                        if (GUILayout.Button("Unlimited inventory slots"))
                        {
                            dp.MapDefines._itemSlotMax         = 99999;
                            dp.MapDefines._itemStackUpperLimit = 99999;
                            playerData.InventorySlotMax        = 99999;
                        }
                        GUI.enabled = true;

                        if (playerData.ItemList.Count == 0)
                        {
                            GUI.enabled = false;
                        }
                        if (GUILayout.Button("Clear player inventory"))
                        {
                            playerData.ItemList.Clear();
                            //MapUIContainer.AddNotify();
                            CheatToolsPlugin.Logger.LogMessage("Your inventory has been cleared.");
                        }
                        GUI.enabled = true;

                        GUILayout.BeginHorizontal();
                        {
                            var add1  = GUILayout.Button("Get +1 of all items");
                            var add99 = GUILayout.Button("+99");
                            if (add1 || add99)
                            {
                                if (_resources.GameInfo != null)
                                {
                                    var addAmount = add1 ? 1 : 99;
                                    foreach (var category in _resources.GameInfo.GetItemCategories())
                                    {
                                        foreach (var stuffItemInfo in _resources.GameInfo.GetItemTable(category).Values)
                                        {
                                            var it = playerData.ItemList.Find(item => item.CategoryID == stuffItemInfo.CategoryID && item.ID == stuffItemInfo.ID);
                                            if (it != null)
                                            {
                                                it.Count += addAmount;
                                            }
                                            else
                                            {
                                                playerData.ItemList.Add(new StuffItem(stuffItemInfo.CategoryID, stuffItemInfo.ID, addAmount));
                                            }
                                        }
                                    }

                                    CheatToolsPlugin.Logger.LogMessage(addAmount + " of all items have been added to your inventory");
                                }
                            }
                        }
                        GUILayout.EndHorizontal();
                    }
                    GUILayout.EndVertical();
                }
            }

            if (GUILayout.Button("Navigate to Player's GameObject"))
            {
                if (_map.Player.transform != null)
                {
                    cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(_map.Player.transform);
                }
                else
                {
                    CheatToolsPlugin.Logger.Log(BepInEx.Logging.LogLevel.Warning | BepInEx.Logging.LogLevel.Message,
                                                "Player has no body assigned");
                }
            }

            if (GUILayout.Button("Open Player in inspector"))
            {
                cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(_map.Player, "Player"), true);
            }
        }
Esempio n. 16
0
        private static void DrawSingleGirlCheats(AgentActor currentAdvGirl, CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.BeginVertical(GUI.skin.box);
            {
                GUILayout.Label("Selected heroine name: " + (currentAdvGirl.CharaName ?? currentAdvGirl.name));
                GUILayout.Space(6);

                if (currentAdvGirl.ChaControl != null && currentAdvGirl.ChaControl.fileGameInfo != null)
                {
                    GUILayout.Label("Status");

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label($"Love phase: {currentAdvGirl.ChaControl.fileGameInfo.phase + 1} / 4");
                        if (GUILayout.Button("-1"))
                        {
                            currentAdvGirl.SetPhase(Mathf.Max(0, currentAdvGirl.ChaControl.fileGameInfo.phase - 1));
                        }
                        if (GUILayout.Button("+1"))
                        {
                            currentAdvGirl.SetPhase(Mathf.Min(3, currentAdvGirl.ChaControl.fileGameInfo.phase + 1));
                        }
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal();
                    {
                        var sickness = AIProject.Definitions.Sickness.TagTable.FirstOrDefault(x => x.Value == currentAdvGirl.AgentData.SickState.ID).Key;
                        GUILayout.Label($"Sickness: {sickness ?? "None"}", GUILayout.ExpandWidth(true));
                        if (GUILayout.Button("Heal", GUILayout.ExpandWidth(false)) && currentAdvGirl.AgentData.SickState.ID > -1)
                        {
                            currentAdvGirl.HealSickBySleep();
                            currentAdvGirl.AgentData.SickState.OverwritableID = -1;
                            currentAdvGirl.AgentData.WeaknessMotivation       = 0;
                        }
                    }
                    GUILayout.EndHorizontal();

                    foreach (Status.Type statusValue in Enum.GetValues(typeof(Status.Type)))
                    {
                        if (currentAdvGirl.AgentData.StatsTable.ContainsKey((int)statusValue))
                        {
                            GUILayout.BeginHorizontal();
                            {
                                var status = Mathf.RoundToInt(currentAdvGirl.AgentData.StatsTable[(int)statusValue]);
                                GUILayout.Label(statusValue + ": " + status, GUILayout.Width(120));
                                var newStatus = Mathf.RoundToInt(GUILayout.HorizontalSlider(status, 0, (int)statusValue == 5 ? 150 : 100));
                                if (newStatus != status)
                                {
                                    currentAdvGirl.AgentData.StatsTable[(int)statusValue] = newStatus;
                                }
                            }
                            GUILayout.EndHorizontal();
                        }
                    }
                    GUILayout.Space(6);

                    GUILayout.Label("Flavor skills");
                    foreach (FlavorSkill.Type typeValue in Enum.GetValues(typeof(FlavorSkill.Type)))
                    {
                        if (currentAdvGirl.ChaControl.fileGameInfo.flavorState.ContainsKey((int)typeValue))
                        {
                            GUILayout.BeginHorizontal();
                            {
                                GUILayout.Label(typeValue + ": ", GUILayout.Width(120));
                                GUI.changed = false;
                                var flavorSkill = currentAdvGirl.GetFlavorSkill(typeValue);
                                var textField   = GUILayout.TextField(flavorSkill.ToString());
                                if (GUI.changed && int.TryParse(textField, out var newSkill) && newSkill != flavorSkill)
                                {
                                    currentAdvGirl.SetFlavorSkill(typeValue, newSkill);
                                }
                                GUI.changed = false;
                            }
                            GUILayout.EndHorizontal();
                        }
                    }
                    GUILayout.Space(6);
                }

                if (currentAdvGirl.AgentData.TalkMotivation >= currentAdvGirl.AgentData.StatsTable[5])
                {
                    GUI.enabled = false;
                }
                if (GUILayout.Button("Reset talk time"))
                {
                    currentAdvGirl.AgentData.TalkMotivation     = currentAdvGirl.AgentData.StatsTable[5];
                    currentAdvGirl.AgentData.WeaknessMotivation = 0;
                }
                GUI.enabled = true;

                GUILayout.Space(6);

                if (GUILayout.Button("Navigate to Actor's GameObject"))
                {
                    if (currentAdvGirl.transform != null)
                    {
                        cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(currentAdvGirl.transform);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(BepInEx.Logging.LogLevel.Warning | BepInEx.Logging.LogLevel.Message, "Actor has no body assigned");
                    }
                }

                if (GUILayout.Button("Open Actor in inspector"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(currentAdvGirl, "Actor " + currentAdvGirl.CharaName), true);
                }

                if (GUILayout.Button("Inspect extended data"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(ExtensibleSaveFormat.ExtendedSave.GetAllExtendedData(currentAdvGirl.ChaControl?.chaFile), "ExtData for " + currentAdvGirl.CharaName), true);
                }
            }
            GUILayout.EndVertical();
        }
Esempio n. 17
0
        private static void DrawHeroineCheats(SaveData.Heroine currentAdvGirl, CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.BeginVertical();
            {
                GUILayout.Label("Selected girl name: " + currentAdvGirl.Name);

                GUILayout.BeginVertical();
                {
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Favor: " + currentAdvGirl.favor, GUILayout.Width(60));
                        currentAdvGirl.favor = (int)GUILayout.HorizontalSlider(currentAdvGirl.favor, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Lewd: " + currentAdvGirl.lewdness, GUILayout.Width(60));
                        currentAdvGirl.lewdness = (int)GUILayout.HorizontalSlider(currentAdvGirl.lewdness, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Anger: " + currentAdvGirl.anger, GUILayout.Width(60));
                        currentAdvGirl.anger = (int)GUILayout.HorizontalSlider(currentAdvGirl.anger, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Intimacy: " + currentAdvGirl.intimacy, GUILayout.Width(60));
                        currentAdvGirl.intimacy = (int)GUILayout.HorizontalSlider(currentAdvGirl.intimacy, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();

                GUILayout.Space(4);

                GUILayout.Label("Sex experience: " + GetHExpText(currentAdvGirl));
                GUILayout.Label("Set to: (changes multiple stats)");
                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("Virgin"))
                    {
                        MakeVirgin(currentAdvGirl);
                    }
                    if (GUILayout.Button("Inexp"))
                    {
                        MakeInexperienced(currentAdvGirl);
                    }
                    if (GUILayout.Button("Exp"))
                    {
                        MakeExperienced(currentAdvGirl);
                    }
                    if (GUILayout.Button("Horny"))
                    {
                        MakeHorny(currentAdvGirl);
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(4);

                GUILayout.Label("Set all touch experience");
                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("0%"))
                    {
                        SetGirlHExp(currentAdvGirl, 0f);
                    }
                    if (GUILayout.Button("50%"))
                    {
                        SetGirlHExp(currentAdvGirl, 50f);
                    }
                    if (GUILayout.Button("100%"))
                    {
                        SetGirlHExp(currentAdvGirl, 100f);
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(8);

                if (GUILayout.Button("Reset conversation time"))
                {
                    currentAdvGirl.talkTime = currentAdvGirl.talkTimeMax;
                }

                var actCtrl = _gameMgr?.actScene?.actCtrl;
                if (actCtrl != null)
                {
                    var sortedDesires = Enum.GetValues(typeof(DesireEng)).Cast <DesireEng>()
                                        .Select(i => new { id = i, value = actCtrl.GetDesire((int)i, currentAdvGirl) })
                                        .Where(x => x.value > 5)
                                        .OrderByDescending(x => x.value)
                                        .Take(8);

                    var any = false;
                    foreach (var desire in sortedDesires)
                    {
                        if (!any)
                        {
                            GUILayout.Label("Desires (and their strengths):\n");
                            any = true;
                        }
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label((int)desire.id + " " + desire.id);
                            GUILayout.FlexibleSpace();
                            GUILayout.Label(desire.value + "%");
                            if (GUILayout.Button("X", GUILayout.ExpandWidth(false)))
                            {
                                actCtrl.SetDesire((int)desire.id, currentAdvGirl, 0);
                            }
                        }
                        GUILayout.EndHorizontal();
                    }
                    if (!any)
                    {
                        GUILayout.Label("Has no desires");
                    }

                    if (GUILayout.Button("Clear all desires"))
                    {
                        for (int i = 0; i < 31; i++)
                        {
                            actCtrl.SetDesire(i, currentAdvGirl, 0);
                        }
                    }

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Set desire ", GUILayout.ExpandWidth(false));
                        _setdesireId = GUILayout.TextField(_setdesireId ?? "");
                        GUILayout.Label(" to value ", GUILayout.ExpandWidth(false));
                        _setdesireValue = GUILayout.TextField(_setdesireValue ?? "");
                        if (GUILayout.Button("OK", GUILayout.ExpandWidth(false)))
                        {
                            try
                            {
                                actCtrl.SetDesire((int)Enum.Parse(typeof(DesireEng), _setdesireId), currentAdvGirl, int.Parse(_setdesireValue));
                            }
                            catch (Exception e)
                            {
                                CheatToolsPlugin.Logger.LogMessage("Invalid desire ID (0-30) or value (0-100) - " + e.Message);
                            }
                        }
                    }
                    GUILayout.EndHorizontal();

                    var wantsMast = actCtrl.GetDesire(4, currentAdvGirl) > 80;
                    if (!wantsMast)
                    {
                        if (GUILayout.Button("Make desire to m********e"))
                        {
                            actCtrl.SetDesire(4, currentAdvGirl, 100);
                        }
                    }

                    var wantsLes = actCtrl.GetDesire(26, currentAdvGirl) > 80;
                    if (!wantsLes)
                    {
                        if (GUILayout.Button("Make desire to lesbian"))
                        {
                            actCtrl.SetDesire(26, currentAdvGirl, 100);
                            actCtrl.SetDesire(27, currentAdvGirl, 100);
                        }
                    }
                }

                GUILayout.Space(8);

                // 危険日 is risky, 安全日 is safe. Only change when user clicks to avoid messing with the value unnecessarily
                GUI.changed = false;
                var isDangerousDay = GUILayout.Toggle(HFlag.GetMenstruation(currentAdvGirl.MenstruationDay) == HFlag.MenstruationType.危険日, "Is on a risky day");
                if (GUI.changed)
                {
                    HFlag.SetMenstruation(currentAdvGirl, isDangerousDay ? HFlag.MenstruationType.危険日 : HFlag.MenstruationType.安全日);
                }

                currentAdvGirl.isVirgin     = GUILayout.Toggle(currentAdvGirl.isVirgin, "isVirgin");
                currentAdvGirl.isAnalVirgin = GUILayout.Toggle(currentAdvGirl.isAnalVirgin, "isAnalVirgin");

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("Sex count: ", GUILayout.ExpandWidth(false));
                    GUI.changed = false;
                    var newCount = GUILayout.TextField(currentAdvGirl.hCount.ToString(), GUILayout.ExpandWidth(true));
                    if (GUI.changed && int.TryParse(newCount, out var newCountInt))
                    {
                        currentAdvGirl.hCount = Mathf.Max(newCountInt, 0);
                    }
                }
                GUILayout.EndHorizontal();

                currentAdvGirl.isAnger = GUILayout.Toggle(currentAdvGirl.isAnger, "Is angry");
                currentAdvGirl.isDate  = GUILayout.Toggle(currentAdvGirl.isDate, "Date promised");
                //currentAdvGirl.isFirstGirlfriend = GUILayout.Toggle(currentAdvGirl.isFirstGirlfriend, "isFirstGirlfriend");

                GUI.changed = false;
                var newVal = GUILayout.Toggle(currentAdvGirl.talkEvent.Contains(0) || currentAdvGirl.talkEvent.Contains(1), "Had first meeting");
                if (GUI.changed)
                {
                    if (newVal)
                    {
                        currentAdvGirl.talkEvent.Add(0);
                        currentAdvGirl.talkEvent.Add(1);
                    }
                    else
                    {
                        currentAdvGirl.talkEvent.Remove(0);
                        currentAdvGirl.talkEvent.Remove(1);
                    }
                }

                GUI.changed = false;
                newVal      = GUILayout.Toggle(currentAdvGirl.talkEvent.Contains(2), "Is a friend");
                if (GUI.changed)
                {
                    if (newVal)
                    {
                        currentAdvGirl.talkEvent.Add(2);
                    }
                    else
                    {
                        currentAdvGirl.talkEvent.Remove(2);
                    }
                }

                currentAdvGirl.isGirlfriend = GUILayout.Toggle(currentAdvGirl.isGirlfriend, "Is a girlfriend");
                currentAdvGirl.isStaff      = GUILayout.Toggle(currentAdvGirl.isStaff, "Is a club member");

                currentAdvGirl.denial.kiss      = GUILayout.Toggle(currentAdvGirl.denial.kiss, "Won't refuse kiss");
                currentAdvGirl.denial.massage   = GUILayout.Toggle(currentAdvGirl.denial.massage, "Won't refuse strong massage");
                currentAdvGirl.denial.anal      = GUILayout.Toggle(currentAdvGirl.denial.anal, "Won't refuse anal");
                currentAdvGirl.denial.aibu      = GUILayout.Toggle(currentAdvGirl.denial.aibu, "Won't refuse vibrator");
                currentAdvGirl.denial.notCondom = GUILayout.Toggle(currentAdvGirl.denial.notCondom, "Insert w/o condom OK");

                if (_gameMgr?.actScene != null && currentAdvGirl.transform != null && GUILayout.Button("Follow me"))
                {
                    var npc = currentAdvGirl.transform.GetComponent <NPC>();
                    if (npc)
                    {
                        _gameMgr.actScene.Player.ChaserSet(npc);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Could not make heroine follow - NPC component not found");
                    }
                }

                if (GUILayout.Button("Navigate to heroine's GameObject"))
                {
                    if (currentAdvGirl.transform != null)
                    {
                        cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(currentAdvGirl.transform);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Heroine has no body assigned");
                    }
                }

                if (GUILayout.Button("Open Heroine in inspector"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(currentAdvGirl, "Heroine " + currentAdvGirl.Name), true);
                }

                if (GUILayout.Button("Inspect extended data"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(ExtensibleSaveFormat.ExtendedSave.GetAllExtendedData(currentAdvGirl.charFile), "ExtData for " + currentAdvGirl.Name), true);
                }
            }
            GUILayout.EndVertical();
        }
Esempio n. 18
0
        private static void DrawEnviroControls(CheatToolsWindow cheatToolsWindow)
        {
            var weatherSim = _map.Simulator;

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Weather: " + weatherSim.Weather, GUILayout.Width(120));

                if (weatherSim.Weather == Weather.Clear)
                {
                    GUI.enabled = false;
                }
                if (GUILayout.Button("Clear"))
                {
                    weatherSim.RefreshWeather(Weather.Clear, true);
                }
                GUI.enabled = true;

                if (GUILayout.Button("Next"))
                {
                    weatherSim.RefreshWeather(weatherSim.Weather.Next(), true);
                }
            }
            GUILayout.EndHorizontal();

            if (weatherSim.EnvironmentProfile != null)
            {
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label($"Temperature: {weatherSim.TemperatureValue:F0}C", GUILayout.Width(120));
                    weatherSim.TemperatureValue = GUILayout.HorizontalSlider(weatherSim.TemperatureValue,
                                                                             weatherSim.EnvironmentProfile.TemperatureBorder.MinDegree,
                                                                             weatherSim.EnvironmentProfile.TemperatureBorder.MaxDegree);
                }
                GUILayout.EndHorizontal();
            }

            if (weatherSim.EnviroSky != null && weatherSim.EnviroSky.GameTime != null)
            {
                GUILayout.BeginHorizontal();
                {
                    var gameTime = weatherSim.EnviroSky.GameTime;
                    //var dt = DateTime.MinValue.AddHours(gameTime.Hours).AddMinutes(gameTime.Minutes).AddSeconds(gameTime.Seconds);
                    GUILayout.Label("Game time:", GUILayout.Width(120));
                    var timeText    = _gameTimeText ?? $"{gameTime.Hours:00}:{gameTime.Minutes:00}:{gameTime.Seconds:00}";
                    var newTimeText = GUILayout.TextField(timeText, GUILayout.ExpandWidth(true));
                    if (timeText != newTimeText)
                    {
                        try
                        {
                            var parts = newTimeText.Split(':');
                            weatherSim.EnviroSky.SetTime(gameTime.Years, gameTime.Days, int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]));
                            _gameTimeText = null;
                        }
                        catch
                        {
                            // Let user keep editing if the parsing fails
                            _gameTimeText = newTimeText;
                        }
                    }
                }
                GUILayout.EndHorizontal();
            }
        }