public static bool CategoryNameDisplay(UiAppFileIconSlot __instance, ref UiTooltipSimple ____tooltip) { if (HP2SR.cheatsEnabled || HP2SR.AllPairsEnabled.Value || !Game.Manager.Ui.currentCanvas.titleCanvas) { return(true); } int cat = __instance.girlDefinition.id - 1; int diff = HP2SR.lastChosenDifficulty; if (cat < RunTimer.categories.Length) { HP2SR.ShowTooltip(RunTimer.GetAll(cat, diff), 3000, 0, 50); return(false); } else { HP2SR.tooltip = null; HP2SR.tooltipTimer.Reset(); return(true); } }
public static void JustCheckingCategory(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot) { if (HP2SR.cheatsEnabled || HP2SR.AllPairsEnabled.Value) { return; } if (____selectedFileIconSlot.girlDefinition.id - 1 < RunTimer.categories.Length) { HP2SR.lastChosenCategory = ____selectedFileIconSlot.girlDefinition.id - 1; } }
public static void StartNewRun(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot) { shoesProgress = 0; if (HP2SR.run != null) { HP2SR.run.reset(); HP2SR.run = null; } if (!HP2SR.cheatsEnabled && !HP2SR.AllPairsEnabled.Value) { int catChoice = -1; for (int i = 0; i < __instance.fileIconSlots.Count; i++) { if (__instance.fileIconSlots[i].girlDefinition.girlName == ____selectedFileIconSlot.girlDefinition.girlName) { catChoice = i; HP2SR.lastChosenCategory = catChoice; break; } } HP2SR.run = new RunTimer(____newSaveFileIndex, catChoice, __instance.settingSelectorDifficulty.selectedIndex); } else { HP2SR.run = new RunTimer(); } }
public static void DefaultCategory(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot) { if (HP2SR.cheatsEnabled || HP2SR.AllPairsEnabled.Value) { return; } //default girl head to the last chosen category, show their details on the mouse if (____selectedFileIconSlot != null) { ____selectedFileIconSlot.button.Enable(); } ____selectedFileIconSlot = __instance.fileIconSlots[HP2SR.lastChosenCategory]; ____selectedFileIconSlot.button.Disable(); HP2SR.ShowTooltip(RunTimer.GetAll(HP2SR.lastChosenCategory, HP2SR.lastChosenDifficulty), 3000, 0, 50); __instance.Refresh(); }
public static void ClearReturnFlag(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot) { Game.Persistence.playerData.files[____newSaveFileIndex] = new PlayerFile(new SaveFile()); Game.Persistence.Apply(____newSaveFileIndex); Game.Persistence.SaveGame(); HP2SR.hasReturned = false; //alert the autosplitter if (!HP2SR.cheatsEnabled && !HP2SR.AllPairsEnabled.Value) { Game.Persistence.playerData.unlockedCodes.Remove(Game.Data.Codes.Get(HP2SR.QUICKTRANSITIONS)); searchForMe = 111; } }
public static void NewGameMenuFixer(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot) { //no save file was available, so use last file (or user's preference) if (____newSaveFileIndex < 0) { __instance.cellphone.phoneErrorMsg.ClearMessage(); int fileToDelete = HP2SR.AutoDeleteFile.Value - 1; int lastFile = Game.Persistence.playerData.files.Count - 1; if (fileToDelete >= 0 && fileToDelete < lastFile) { ____newSaveFileIndex = fileToDelete; } else { ____newSaveFileIndex = lastFile; } HP2SR.ShowTooltip("File #" + (____newSaveFileIndex + 1) + " will be deleted!", 3000, 0, 30); } //all girl heads available for (int j = 0; j < __instance.fileIconSlots.Count; j++) { __instance.fileIconSlots[j].Populate(false); __instance.fileIconSlots[j].canvasGroup.blocksRaycasts = true; } System.Random rand = new System.Random(); int r = rand.Next(__instance.fileIconSlots.Count); ____selectedFileIconSlot = __instance.fileIconSlots[r]; ____selectedFileIconSlot.button.Disable(); //default Easy difficulty __instance.settingSelectorDifficulty.Populate(Game.Manager.Settings.GetSettingValueNames("difficulty", MathUtils.IntToBool(__instance.settingSelectorGender.selectedIndex), 0), HP2SR.lastChosenDifficulty, false); __instance.settingSelectorDifficulty.PopDescriptions(Game.Manager.Settings.GetSettingValueDescs("difficulty", MathUtils.IntToBool(__instance.settingSelectorGender.selectedIndex), 0)); __instance.Refresh(); }