Skip to content

Commit

Permalink
Making sure that imaginary first from the config is working
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogerio Gasi committed Apr 16, 2024
1 parent 487a4be commit 21f2fcc
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void OnNameChanged()

private void SetDebugMode(bool on)
{
var imaginaryFirst = MainData.instanceData.config.debug.imaginaryFirst;
ARDebug.Debugging = on;

// ReSharper disable once InvertIf
Expand Down Expand Up @@ -244,8 +243,20 @@ private void SaveUserData()
PlayerPrefsSaver.instance.name = userName;
PlayerPrefsSaver.instance.birthday = bd;
PlayerPrefsSaver.instance.gender = gender;
var imaginaryFirst = MainData.instanceData.config.debug.imaginaryFirst;
var gameOrder = new List<GameType> {GameType.Imaginarium, GameType.Real, GameType.Patience};
gameOrder.Shuffle();

if (imaginaryFirst)
{
if (gameOrder[0] != GameType.Imaginarium)
{
var index = gameOrder.IndexOf(GameType.Imaginarium);
gameOrder[index] = gameOrder[0];
gameOrder[0] = GameType.Imaginarium;
}
}

PlayerPrefsSaver.instance.gameType = gameOrder[0];
PlayerPrefsSaver.instance.gameTypeOrder = gameOrder;
PlayerPrefsSaver.instance.SavePlayerPrefs();
Expand Down

0 comments on commit 21f2fcc

Please sign in to comment.