Skip to content

Commit 846c685

Browse files
committed
Added trophies, train completion, and NTR blocking.
1 parent f0e7f39 commit 846c685

1 file changed

Lines changed: 84 additions & 4 deletions

File tree

CheatMenu/UserInterface/Gui.cs

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
using PlayerStatus;
2-
using System;
1+
using System.Runtime.Serialization;
2+
using MaidStatus;
33
using UnityEngine;
4+
using Math = System.Math;
5+
using Status = PlayerStatus.Status;
46

57
namespace CheatMenu.UserInterface
68
{
@@ -125,6 +127,34 @@ private static void GuiWindowControls(int id)
125127
GameMain.instance.CharacterMgr.status.clubGrade = UiToolbox.NumberField(GameMain.instance.CharacterMgr.status.clubGrade, "Club Grade", max: Status.ClubGradeMax);
126128
GUILayout.EndHorizontal();
127129

130+
if (Trophy.commonIdManager != null && GUILayout.Button("Unlock All Trophies"))
131+
{
132+
UnlockAllTrophies();
133+
}
134+
135+
if (GameMain.Instance.CharacterMgr.status.lockNTRPlay)
136+
{
137+
GUILayout.Label("NTR Blocked: Yes (can disable with event)");
138+
}
139+
else
140+
{
141+
GUILayout.BeginHorizontal();
142+
GUILayout.Label("NTR Blocked: No ಠ_ಠ");
143+
if (GUILayout.Button("Block NTR"))
144+
{
145+
GameMain.Instance.CharacterMgr.status.lockNTRPlay = true;
146+
try
147+
{
148+
DisplayFakeTrophy("A cuck no more");
149+
}
150+
catch
151+
{
152+
//Joke failed. Ignore.
153+
}
154+
}
155+
GUILayout.EndHorizontal();
156+
}
157+
128158
GUILayout.EndVertical();
129159

130160
GUILayout.BeginVertical(Sections2);
@@ -152,6 +182,18 @@ private static void GuiWindowControls(int id)
152182
maid.status.isNickNameCall = GUILayout.Toggle(maid.status.isNickNameCall, "Use Nickname");
153183
GUILayout.EndHorizontal();
154184

185+
GUILayout.BeginHorizontal(Sections);
186+
GUILayout.Label("Trainee: " + (maid.status.studyRate > 500 ? "Yes" : "No" + (maid.status.contract == Contract.Trainee ? " (contract change next morning!)" : string.Empty)));
187+
if (maid.status.studyRate > 500)
188+
{
189+
GUILayout.FlexibleSpace();
190+
if (GUILayout.Button("Complete Training"))
191+
{
192+
maid.status.studyRate = 500;
193+
}
194+
}
195+
GUILayout.EndHorizontal();
196+
155197
/*
156198
GUILayout.BeginHorizontal(Sections);
157199
if (GUILayout.Button("Max Out Current Job Class"))
@@ -181,8 +223,7 @@ private static void GuiWindowControls(int id)
181223

182224
/*
183225
GUILayout.BeginVertical(Sections);
184-
maid.status.baseTeachRate = NumberField(maid.status.baseTeachRate, "Teach Rate", 0, int.MaxValue);
185-
maid.status.studyRate = NumberField(maid.status.studyRate, "Study Rate", 0, int.MaxValue);
226+
//maid.status.baseTeachRate = UiToolbox.NumberField(maid.status.baseTeachRate, "Teach Rate", 0, int.MaxValue);
186227
GUILayout.EndVertical();
187228
*/
188229

@@ -205,5 +246,44 @@ private static void GuiWindowControls(int id)
205246

206247
UiToolbox.ChkMouseClick(WindowRect, ref CheatMenu.DrawUi);
207248
}
249+
250+
public static void UnlockAllTrophies()
251+
{
252+
var data = Trophy.GetAllDatas(true);
253+
254+
foreach (var trophyData in data)
255+
{
256+
GameMain.Instance.CharacterMgr.status.AddHaveTrophy(trophyData.id);
257+
}
258+
}
259+
260+
public static void DisplayFakeTrophy(string trophyText, string shopItem = "")
261+
{
262+
var gameObject = GameObject.Find("SystemUI Root/TrophyAchieveEffect");
263+
if (gameObject == null)
264+
{
265+
return;
266+
}
267+
268+
var component = gameObject.GetComponent<TrophyAchieveEffect>();
269+
if (component == null)
270+
{
271+
return;
272+
}
273+
274+
var trophy = FormatterServices.GetUninitializedObject(typeof(Trophy.Data)) as Trophy.Data;
275+
276+
if (trophy == null)
277+
{
278+
CheatMenu.PluginLogger.LogWarning("Trophy fail :(");
279+
return;
280+
}
281+
282+
typeof(Trophy.Data).GetField(nameof(Trophy.Data.rarity)).SetValue(trophy, 3);
283+
typeof(Trophy.Data).GetField(nameof(Trophy.Data.name)).SetValue(trophy, trophyText);
284+
typeof(Trophy.Data).GetField(nameof(Trophy.Data.effectDrawItemName)).SetValue(trophy, shopItem);
285+
286+
component.EffectStart(trophy);
287+
}
208288
}
209289
}

0 commit comments

Comments
 (0)