Skip to content

Commit

Permalink
Merge pull request #1 from Rodaxoleaux/master
Browse files Browse the repository at this point in the history
Pulling in this code to start from (and to give credit to @Rodaxoleaux for implementing it); planning to refine a few more things before releasing CustomMenuText v2 (hopefully soon!)
  • Loading branch information
artemiswkearney authored Aug 3, 2018
2 parents 35fcbde + fde55e1 commit 44ade08
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Custom Menu Text/CustomMenuTextPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
gameDirectory = gameDirectory.Replace('\\', '/');
if (File.Exists(gameDirectory + FILE_PATH))
{
string[] linesInFile = File.ReadAllLines(gameDirectory + FILE_PATH);
string dataInFile = File.ReadAllText(gameDirectory + FILE_PATH);
string[] entriesInFile = dataInFile.Split(new string[]{ "\n\n", "\r\n\r\n" }, StringSplitOptions.RemoveEmptyEntries);
System.Random r = new System.Random();
string[] linesInFile = entriesInFile[r.Next(entriesInFile.Length)].Split(new string[]{ "\n","\r\n"},StringSplitOptions.RemoveEmptyEntries);

// if there's no text in the file, we leave the default values
if (linesInFile.Length > 0)
Expand All @@ -64,13 +67,6 @@ private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
newFirstLine = newFirstLine.ToUpperInvariant();
newSecondLine = newSecondLine.ToUpperInvariant();

// troll @Mexico King
if (newFirstLine == "MEAT" && newSecondLine == "SABER")
{
newFirstLine = "BEAT";
newSecondLine = "SAMER";
}

TextMeshPro wasB = GameObject.Find("B").GetComponent<TextMeshPro>();
TextMeshPro wasE = GameObject.Find("E").GetComponent<TextMeshPro>();
TextMeshPro wasAT = GameObject.Find("AT").GetComponent<TextMeshPro>();
Expand Down

0 comments on commit 44ade08

Please sign in to comment.