Skip to content

Commit

Permalink
Text now correctly rerolls every time you enter the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiswkearney committed Feb 12, 2020
1 parent cab0646 commit 9e01192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Custom Menu Text/CustomMenuTextPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace CustomMenuText
{
public class CustomMenuTextPlugin : IPlugin
{
public static CustomMenuTextPlugin instance;

// path to the file to load text from
private const string FILE_PATH = "/UserData/CustomMenuText.txt";
// path to load the font prefab from
Expand All @@ -24,7 +26,7 @@ public class CustomMenuTextPlugin : IPlugin
public static readonly Color defaultBottomColor = new Color(0, 0.5019608f, 1);

public const string DEFAULT_CONFIG =
@"# Custom Menu Text v3.1.0
@"# Custom Menu Text v3.1.1
# by Arti
# Special Thanks: Kyle1413, Alphie
#
Expand Down Expand Up @@ -168,7 +170,7 @@ Ask in <#7289DA>#pc-help
public static List<string[]> allEntries = null;

public string Name => "Custom Menu Text";
public string Version => "3.1.0";
public string Version => "3.1.1";

// Store the text objects so when we leave the menu and come back, we aren't creating a bunch of them
public static TextMeshPro mainText;
Expand All @@ -178,13 +180,14 @@ Ask in <#7289DA>#pc-help

public void OnApplicationStart()
{
instance = this;
SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
}

private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene arg1)
{
if (arg0.name == "EmptyTransition" && arg1.name.Contains("Menu")) // Only run in menu scene
if (arg1.name.Contains("Menu")) // Only run in menu scene
{
if (allEntries == null)
{
Expand Down
4 changes: 2 additions & 2 deletions Custom Menu Text/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.1.1.0")]
[assembly: AssemblyFileVersion("3.1.1.0")]

0 comments on commit 9e01192

Please sign in to comment.