Skip to content

Commit a4b6837

Browse files
committed
1.19 bump, FUCK YOU IPA
1 parent c66779f commit a4b6837

File tree

4 files changed

+57
-30
lines changed

4 files changed

+57
-30
lines changed

CustomMenuText/Harmony Patches/DiColorsPatch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
/*using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
@@ -30,3 +30,4 @@ internal static void Postfix(DiColors.Services.SignColorSwapper __instance, Conf
3030
}
3131
}
3232
}
33+
*/

CustomMenuText/Plugin.cs

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void InitWithConfig(Config conf)
105105
[OnDisable]
106106
public void OnDisable()
107107
{
108-
harmony.UnpatchAll("com.headassbtw.custommenutext");
108+
harmony.UnpatchSelf();
109109
}
110110

111111
[OnStart]
@@ -168,26 +168,36 @@ public void YeetUpTheText()
168168
BottomColor = defaultBottomColor;
169169
}
170170

171-
172-
switch (Configuration.PluginConfig.Instance.SelectionType)
171+
172+
if (Configuration.PluginConfig.Instance.SelectionType == 0)
173173
{
174-
case 0:
175-
//default
176-
setText(EMPTY);
177-
defaultLogo.SetActive(true);
178-
179-
break;
180-
case 1:
181-
//random
182-
defaultLogo.SetActive(false);
183-
pickRandomEntry();
184-
break;
185-
case 2:
186-
//pre-chosen
187-
defaultLogo.SetActive(false);
188-
setText(allEntries[choice]);
189-
break;
174+
setText(EMPTY);
175+
defaultLogo.SetActive(true);
190176
}
177+
else
178+
{
179+
switch (Configuration.PluginConfig.Instance.SelectionType)
180+
{
181+
case 1:
182+
//random
183+
pickRandomEntry();
184+
break;
185+
case 2:
186+
187+
//pre-chosen
188+
try
189+
{
190+
setText(allEntries[choice]);
191+
}
192+
catch (Exception e)
193+
{
194+
Plugin.Log.Critical(e);
195+
}
196+
break;
197+
}
198+
defaultLogo.SetActive(false);
199+
}
200+
191201
}
192202

193203
public void ApplyFont()
@@ -201,6 +211,7 @@ private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene arg1)
201211
if (arg1.name.Contains("Menu")) // Only run in menu scene
202212
{
203213
TextInit();
214+
YeetUpTheText();
204215
}
205216
}
206217

CustomMenuText/Views/TextSelector/TextSelectorViewController.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ public void textSelect(TableView _, Cell cell)
209209
row2 = row;
210210
Plugin.selection_type = 0;
211211
Configuration.PluginConfig.Instance.SelectionType = 0;
212-
Plugin.instance.YeetUpTheText();
213212

214213

215214
}
@@ -218,7 +217,6 @@ public void textSelect(TableView _, Cell cell)
218217
Plugin.selection_type = 1;
219218
Configuration.PluginConfig.Instance.SelectionType = 1;
220219
Plugin.Instance.pickRandomEntry();
221-
Plugin.instance.YeetUpTheText();
222220
}
223221
if(row > 1)
224222
{
@@ -227,9 +225,8 @@ public void textSelect(TableView _, Cell cell)
227225
Plugin.choice = row2;
228226
Configuration.PluginConfig.Instance.SelectionType = 2;
229227
Configuration.PluginConfig.Instance.SelectedTextEntry = row2;
230-
Plugin.instance.YeetUpTheText();
231228
}
232-
229+
Plugin.instance.YeetUpTheText();
233230
}
234231
public Cell random = new Cell("Random");
235232
public Cell defaultt = new Cell("Default");
@@ -397,8 +394,26 @@ public void SetupFontList()
397394

398395
try{fontListData.tableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.Font);}
399396
catch(IndexOutOfRangeException){Plugin.Log.Critical("Tried to select a font beyond the bounds of the list");}
400-
Plugin.mainText.font = FontManager.Fonts[Configuration.PluginConfig.Instance.Font];
401-
Plugin.bottomText.font = FontManager.Fonts[Configuration.PluginConfig.Instance.Font];
397+
398+
399+
try
400+
{
401+
Plugin.mainText.font = FontManager.Fonts[Configuration.PluginConfig.Instance.Font];
402+
Plugin.bottomText.font = FontManager.Fonts[Configuration.PluginConfig.Instance.Font];
403+
}
404+
catch(Exception e)
405+
{
406+
Plugin.Log.Critical($"{e.GetType()}:");
407+
if (Plugin.mainText != null || Plugin.bottomText != null)
408+
{
409+
Plugin.Log.Critical("Text object was null");
410+
}
411+
else
412+
{
413+
Plugin.Log.Critical("Tried to set the text object's font beyond the bounds of the font array");
414+
Plugin.Log.Critical($"Slected: {Configuration.PluginConfig.Instance.Font}, Length: {FontManager.Fonts.Count}");
415+
}
416+
}
402417
}
403418
/*public void SetupImageList()
404419
{

CustomMenuText/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"id": "CustomMenuText",
44
"name": "CustomMenuText",
55
"author": "headassbtw",
6-
"version": "3.4.2",
6+
"version": "3.4.3",
77
"description": "",
8-
"gameVersion": "1.16.3",
8+
"gameVersion": "1.19.0",
99
"dependsOn": {
1010
"BSIPA": "^4.0.5",
11-
"BeatSaberMarkupLanguage": "^1.5.3"
11+
"BeatSaberMarkupLanguage": "^1.5.4"
1212
},
1313
"loadAfter": [
1414
"DiColors"
1515
],
1616
"features": []
17-
}
17+
}

0 commit comments

Comments
 (0)