Skip to content

Commit

Permalink
[KKLB] Fix crash in VR mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed May 28, 2023
1 parent ddb5c4f commit a1ce9b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
15 changes: 6 additions & 9 deletions KKLB_CheatTools/CheatToolsWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using HarmonyLib;
using RuntimeUnityEditor.Core.Inspector;
using RuntimeUnityEditor.Core.Inspector.Entries;
using RuntimeUnityEditor.Core.Utils;
Expand All @@ -18,14 +19,6 @@ public static void InitializeCheats()
{
_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>)(() => Game.Instance) , "Game.Instance"),
new KeyValuePair<object, string>((Func<object>)EditorUtilities.GetRootGoScanner, "Root Objects")
};
Expand Down Expand Up @@ -98,8 +91,12 @@ void EnsureNonzeroCount(List<int> list)
}
}
EnsureNonzeroCount(gameStatus.listEndingCount);
EnsureNonzeroCount(gameStatus.listMiniGamePlayCount);
EnsureNonzeroCount(gameStatus.listMiniGameClearCount);

// Doesn't exist in VR version, only NonVR
var tvf = Traverse.Create(gameStatus).Field("listMiniGamePlayCount");
if (tvf.FieldExists())
EnsureNonzeroCount(tvf.GetValue<List<int>>());

gameStatus.SetSystemFlag(ID_SFlag.SFlag_End, true);
}
Expand Down
8 changes: 4 additions & 4 deletions KKLB_CheatTools/KKLB_CheatTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\lib\net45\Assembly-CSharp.dll</HintPath>
<HintPath>..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\lib\net45\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx, Version=5.4.20.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\IllusionLibs.BepInEx.5.4.20\lib\net35\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\lib\net45\netstandard.dll</HintPath>
<HintPath>..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\lib\net45\netstandard.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RuntimeUnityEditor.Core, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -110,11 +110,11 @@
<Error Condition="!Exists('..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.targets'))" />
<Error Condition="!Exists('..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.targets'))" />
<Error Condition="!Exists('..\packages\IllusionLibs.BepInEx.Harmony.2.9.0\build\IllusionLibs.BepInEx.Harmony.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IllusionLibs.BepInEx.Harmony.2.9.0\build\IllusionLibs.BepInEx.Harmony.targets'))" />
<Error Condition="!Exists('..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets'))" />
<Error Condition="!Exists('..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets'))" />
</Target>
<Import Project="..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule.targets" Condition="Exists('..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule.targets')" />
<Import Project="..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.targets" Condition="Exists('..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.targets')" />
<Import Project="..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.targets" Condition="Exists('..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.2019.4.9\build\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.targets')" />
<Import Project="..\packages\IllusionLibs.BepInEx.Harmony.2.9.0\build\IllusionLibs.BepInEx.Harmony.targets" Condition="Exists('..\packages\IllusionLibs.BepInEx.Harmony.2.9.0\build\IllusionLibs.BepInEx.Harmony.targets')" />
<Import Project="..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets" Condition="Exists('..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.1\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets')" />
<Import Project="..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets" Condition="Exists('..\packages\IllusionLibs.KoiKoiLB.Assembly-CSharp.2023.5.27.2\build\IllusionLibs.KoiKoiLB.Assembly-CSharp.targets')" />
</Project>
2 changes: 1 addition & 1 deletion KKLB_CheatTools/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.IMGUIModule" version="2019.4.9" targetFramework="net46" />
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule" version="2019.4.9" targetFramework="net46" />
<package id="IllusionLibs.KoikatsuSunshine.UnityEngine.UI" version="2019.4.9" targetFramework="net46" />
<package id="IllusionLibs.KoiKoiLB.Assembly-CSharp" version="2023.5.27.1" targetFramework="net46" />
<package id="IllusionLibs.KoiKoiLB.Assembly-CSharp" version="2023.5.27.2" targetFramework="net46" />
<package id="RuntimeUnityEditor.Core" version="4.2.0" targetFramework="net46" developmentDependency="true" />
</packages>

0 comments on commit a1ce9b1

Please sign in to comment.