Skip to content

Commit

Permalink
Fixed default selected difficulty
Browse files Browse the repository at this point in the history
  • Loading branch information
DenJur committed Oct 11, 2018
1 parent 0136c09 commit 835e559
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions StartOptions/StartOptionsModBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace StartOptions
{
Expand Down Expand Up @@ -115,8 +118,28 @@ public override void OnDeactivate()
};
}

public override void OnActivate()
private IEnumerator ChangeStartSettings()
{
yield return new WaitForEndOfFrame();
var combo = WindowManager.FindElementPath("MainPanel/DiffCombobox").GetComponent<GUICombobox>();
combo.Selected = 3;
}

private void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode)
{
if (scene.name.Equals("Customization") && isActiveAndEnabled)
{
StartCoroutine(ChangeStartSettings());
}
}

void Start()
{
SceneManager.sceneLoaded += OnLevelFinishedLoading;
}

public override void OnActivate()
{
DifficultyValues.DefaultStartMoney = new int[]
{
100000000,
Expand Down

0 comments on commit 835e559

Please sign in to comment.