Skip to content

Commit 6015262

Browse files
committed
Fix level0 corrupted error on game log (#74)
- Cannot add public variables to class or it messes with serialization (I think) - I'm not sure if this caused any issues in the past on chapters other than Rei (See #74 for details on rei)
1 parent 5e26440 commit 6015262

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Assets.Scripts.Core/GameSystem.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ public class GameSystem : MonoBehaviour
168168
// Set to True to ignore normal gameplay inputs:
169169
// - Disables normal inputs (e.g to advance text) in main GameSystem loop
170170
// - Disables some GUI inputs by manually added checks in each button type
171-
public bool MODIgnoreInputs;
171+
private bool _MODIgnoreInputs;
172+
public bool MODIgnoreInputs() => _MODIgnoreInputs;
173+
public void SetMODIgnoreInputs(bool value) => _MODIgnoreInputs = value;
172174

173175
// Unity will attempt to deserialize public properties and these aren't in the AssetBundle,
174176
// so use private ones with public accessors
@@ -853,7 +855,7 @@ private void Update()
853855
{
854856
if (blockInputTime <= 0f)
855857
{
856-
if ((CanInput || GameState != GameState.Normal) && (MODIgnoreInputs || inputHandler == null || !inputHandler()))
858+
if ((CanInput || GameState != GameState.Normal) && (MODIgnoreInputs() || inputHandler == null || !inputHandler()))
857859
{
858860
return;
859861
}

Assets.Scripts.UI.Menu/MenuUIButton.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private void OnClick()
2323
{
2424
gameSystem = GameSystem.Instance;
2525
}
26-
if(gameSystem.MODIgnoreInputs)
26+
if(gameSystem.MODIgnoreInputs())
2727
{
2828
return;
2929
}
@@ -106,7 +106,7 @@ private void Awake()
106106

107107
private void LateUpdate()
108108
{
109-
button.isEnabled = !GameSystem.Instance.MODIgnoreInputs;
109+
button.isEnabled = !GameSystem.Instance.MODIgnoreInputs();
110110
}
111111
}
112112
}

Assets.Scripts.UI.TitleScreen/TitleScreenButton.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private void OnClick()
2929
{
3030
GameSystem gameSystem = GameSystem.Instance;
3131

32-
if(gameSystem.MODIgnoreInputs) { return; }
32+
if(gameSystem.MODIgnoreInputs()) { return; }
3333

3434
if (gameSystem.GameState == GameState.TitleScreen && !(time > 0f) && UICamera.currentTouchID == -1)
3535
{
@@ -105,7 +105,7 @@ private void Awake()
105105

106106
private void LateUpdate()
107107
{
108-
button.isEnabled = (!GameSystem.Instance.MODIgnoreInputs && GameSystem.Instance.GameState == GameState.TitleScreen && !IsLeaving);
108+
button.isEnabled = (!GameSystem.Instance.MODIgnoreInputs() && GameSystem.Instance.GameState == GameState.TitleScreen && !IsLeaving);
109109
if (!isReady && time < 0f)
110110
{
111111
if (!button.enabled)

MOD.Scripts.UI/MODMenu.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public void Show()
344344
{
345345
void ForceShow()
346346
{
347-
gameSystem.MODIgnoreInputs = true;
347+
gameSystem.SetMODIgnoreInputs(true);
348348
gameSystem.HideUIControls();
349349
this.visible = true;
350350
}
@@ -397,7 +397,7 @@ public void UserToggleVisibility()
397397
public void ForceHide()
398398
{
399399
this.visible = false;
400-
gameSystem.MODIgnoreInputs = false;
400+
gameSystem.SetMODIgnoreInputs(false);
401401
gameSystem.ShowUIControls();
402402
}
403403

0 commit comments

Comments
 (0)