Skip to content

Commit 6332f60

Browse files
authored
Merge pull request #3 from TheBlackParrot/master
Updated for 1.39.1
2 parents e7bc502 + af22159 commit 6332f60

File tree

9 files changed

+96
-49
lines changed

9 files changed

+96
-49
lines changed

CustomMenuText/CustomMenuText.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@
5858
<Private>False</Private>
5959
<SpecificVersion>False</SpecificVersion>
6060
</Reference>
61-
<Reference Include="IPA.Loader, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61+
<Reference Include="BeatSaber.ViewSystem">
62+
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.ViewSystem.dll</HintPath>
63+
<Private>false</Private>
64+
</Reference>
65+
<Reference Include="IPA.Loader, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
6266
<Private>False</Private>
6367
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\IPA.Loader.dll</HintPath>
6468
<SpecificVersion>False</SpecificVersion>

CustomMenuText/DefaultTextFile.txt

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,61 @@ CUTE
229229

230230
# Just Shapes & Beats
231231
<size=80%><#FFFFFF>Just <size=100%>sh<#FD479E>a<#FFFFFF>pes
232-
<size=130%><#81D9E5>&beats
232+
<size=130%><#81D9E5>&beats
233+
234+
# skissue
235+
SKILL
236+
ISSUE
237+
238+
# rank schmank
239+
RANK
240+
SCHMANK
241+
242+
# i lov pp
243+
<size=75%><#777777>I LOVE
244+
<size=0%>
245+
<size=140%><#6772E5>PP
246+
247+
# :3
248+
COLON
249+
THREE
250+
251+
# :3333
252+
<size=333%><#FF55DD>:3
253+
254+
# :3333c
255+
<size=666%><#FF55DD>:3c
256+
257+
# slice for 115!
258+
<size=75%><#FF0000>SLICE FOR
259+
<size=0%>
260+
<size=150%><#0099FF>115!
261+
262+
# accn't
263+
<size=175%><#FF0000>ACCN'T
264+
265+
# yippee!
266+
YIPP
267+
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
268+
269+
# !bsr 25f
270+
<size=75%><#777777>!bsr
271+
<size=0%>
272+
<size=150%><#0099FF>25f
273+
274+
# Wanna break from the ads?
275+
Wanna break
276+
from the ads?
277+
278+
# funny meme
279+
<size=75%><#FF0077>30-50 FERAL HOGS
280+
<size=75%><#FF0000>RUNNING <size=50%><#777777>INTO MY <size=75%><#33FF66>YARD
281+
<size=50%><#333333>(<size=33%>WITHIN 3-5 MINUTES<size=50%>)
282+
<size=75%><#0099FF>WHILE MY SMALL KIDS PLAY
283+
284+
# 1.29.1 moment
285+
OFFICIAL
286+
<size=50%>1.29.1 REFUGEE CLUB MEMBER
287+
288+
# Blank (i use this mod to hide the text actually)
289+

CustomMenuText/Plugin.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using IPA.Utilities;
1515
using System.Reflection;
1616
using System.Threading.Tasks;
17+
using BeatSaberMarkupLanguage.Util;
1718
using HarmonyLib;
1819
using IPA.Loader;
1920

@@ -151,7 +152,7 @@ public void OnDisable()
151152
}
152153

153154
[OnStart]
154-
public void OnApplicationStart()
155+
async public void OnApplicationStart()
155156
{
156157
if (!Directory.Exists(Path.Combine(UnityGame.UserDataPath, "CustomMenuText", "Cache")))
157158
Directory.CreateDirectory(Path.Combine(UnityGame.UserDataPath, "CustomMenuText", "Cache"));
@@ -168,7 +169,8 @@ public void OnApplicationStart()
168169

169170
FontManager.FirstTimeFontLoad();
170171

171-
//BeatSaberMarkupLanguage.Settings.BSMLSettings.instance.AddSettingsMenu("Menu Text", "CustomMenuText.Configuration.settings.bsml", Configuration.CustomMenuTextSettingsUI.instance);
172+
await MainMenuAwaiter.WaitForMainMenuAsync();
173+
MainMenuAwaiter.MainMenuInitializing += Views.UICreator.CreateMenu;
172174
Views.UICreator.CreateMenu();
173175
reloadFile();
174176
}
@@ -425,13 +427,6 @@ public void OnApplicationQuit()
425427
}
426428
Directory.Delete(cachePath);
427429
}
428-
429430
}
430-
431-
432-
433-
434-
435-
436431
}
437432
}

CustomMenuText/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.0.2")]
36-
[assembly: AssemblyFileVersion("4.0.2")]
35+
[assembly: AssemblyVersion("4.0.3")]
36+
[assembly: AssemblyFileVersion("4.0.3")]

CustomMenuText/Views/MenuTextFlowCoordinator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected override void DidActivate(bool firstActivation, bool addedToHierarchy,
2626
{
2727
if (firstActivation)
2828
{
29-
SetTitle("Menu Text");
29+
SetTitle("Custom Menu Text");
3030
showBackButton = true;
3131
ProvideInitialViewControllers(_textSelectorViewController);
3232
}

CustomMenuText/Views/TextSelector/TextSelector.bsml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
<vertical xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='https://monkeymanboy.github.io/BSML-Docs/ https://monkeymanboy.github.io/BSML-Docs/BSMLSchema.xsd'>
2-
<!--<horizontal pref-width="100" horizontal-fit="PreferredSize">
3-
<text text="s" align="Center" font-size="7" />
4-
<tab-selector tab-tag="yo" />
5-
</horizontal>-->
62
<horizontal>
73
<vertical>
84
<page-button event-click='TextList#PageUp' direction='Up'/>
95
<custom-list id='TextList' select-cell='textSelect' contents='contents' vertical-fit='PreferredSize' list-width='45'>
10-
<stack vertical-fit='PreferredSize' child-expand-height='false' >
6+
<stack vertical-fit='PreferredSize' child-expand-height='false'>
117
<vertical pref-height='14' min-height='14' vertical-fit='PreferredSize'>
128
<horizontal horizontal-fit='PreferredSize'>
13-
<vertical background='round-rect-panel' vertical-fit='PreferredSize' min-height='9' pref-height='9' padding='5' bg-color='#FFFFFF60'>
9+
<vertical background='round-rect-panel' vertical-fit='PreferredSize' min-height='9' pref-height='9' pad-top='5' pad-bottom='5' pad-left='2' pad-right='2' bg-color='#FFFFFFB0'>
1410
<horizontal>
15-
<!--<background background='round-rect-panel' tags='hovered' pref-width='9' pref-height='9' min-width='9' pad-right='10'/>!-->
16-
<vertical child-expand-width='false' spacing='-1' vertical-fit='Unconstrained'>
11+
<vertical child-expand-width='false' spacing='-2' vertical-fit='Unconstrained'>
1712
<text text='~text-top' id='topText' align='Center' word-wrapping="true"/>
1813
<text text='~text-bottom' id='bottomText' align='Center' word-wrapping="true"/>
1914
</vertical>
2015
</horizontal>
21-
<!--<background background='round-rect-panel' tags='hovered' pref-width='9' pref-height='9' min-width='9' pad-right='10'/>!-->
2216
</vertical>
2317
</horizontal>
2418
</vertical>

CustomMenuText/Views/TextSelector/TextSelectorViewController.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,18 @@ public void SetupTextList()
342342

343343
}
344344

345-
textListData.tableView.ReloadData();
345+
textListData.TableView.ReloadData();
346346

347347
switch (Configuration.PluginConfig.Instance.SelectionType)
348348
{
349349
case 0:
350-
textListData.tableView.SelectCellWithIdx(0);
350+
textListData.TableView.SelectCellWithIdx(0);
351351
break;
352352
case 1:
353-
textListData.tableView.SelectCellWithIdx(1);
353+
textListData.TableView.SelectCellWithIdx(1);
354354
break;
355355
case 2:
356-
textListData.tableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.SelectedTextEntry + 2);
356+
textListData.TableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.SelectedTextEntry + 2);
357357
break;
358358
}
359359
}
@@ -362,7 +362,7 @@ public void SetupFontList()
362362
//this should prevent selecting a font that doesn't exist
363363
if (Configuration.PluginConfig.Instance.Font > FontManager.Fonts.Count)
364364
Configuration.PluginConfig.Instance.Font = FontManager.Fonts.Count;
365-
fontListData.data.Clear();
365+
fontListData.Data.Clear();
366366
foreach (var font in FontManager.Fonts)
367367
{
368368
CustomListTableData.CustomCellInfo fontCell;
@@ -374,26 +374,26 @@ public void SetupFontList()
374374
if (name.ToLower().Equals("neontubes2") || name.ToLower().Equals("beon") || name.ToLower().Equals("teko"))
375375
{
376376
fontCell = new CustomListTableData.CustomCellInfo(name, "Built-In");
377-
fontListData.data.Add(fontCell);
377+
fontListData.Data.Add(fontCell);
378378
}
379379
else
380380
{
381381
fontCell = new CustomListTableData.CustomCellInfo(name);
382-
fontListData.data.Add(fontCell);
382+
fontListData.Data.Add(fontCell);
383383
}
384384
}
385385
catch (Exception e)
386386
{
387387
fontCell = new CustomListTableData.CustomCellInfo("Broken Font", "please remove it");
388-
fontListData.data.Add(fontCell);
388+
fontListData.Data.Add(fontCell);
389389
Plugin.Log.Critical("Exception while adding font:");
390390
Console.WriteLine(e.ToString());
391391
}
392392

393393
}
394-
fontListData.tableView.ReloadData();
394+
fontListData.TableView.ReloadData();
395395

396-
try{fontListData.tableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.Font);}
396+
try{fontListData.TableView.SelectCellWithIdx(Configuration.PluginConfig.Instance.Font);}
397397
catch(IndexOutOfRangeException){Plugin.Log.Critical("Tried to select a font beyond the bounds of the list");}
398398

399399

@@ -437,13 +437,13 @@ public void SelectCorrectCell(int selType, int choice)
437437
switch (selType)
438438
{
439439
case 0:
440-
textListData.tableView.SelectCellWithIdx(0);
440+
textListData.TableView.SelectCellWithIdx(0);
441441
break;
442442
case 1:
443-
textListData.tableView.SelectCellWithIdx(1);
443+
textListData.TableView.SelectCellWithIdx(1);
444444
break;
445445
case 2:
446-
textListData.tableView.SelectCellWithIdx(choice + 2);
446+
textListData.TableView.SelectCellWithIdx(choice + 2);
447447
break;
448448
}
449449
}

CustomMenuText/Views/UICreator.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@
22
using BeatSaberMarkupLanguage.MenuButtons;
33
using BeatSaberMarkupLanguage.Settings;
44
using BeatSaberMarkupLanguage.FloatingScreen;
5+
using BeatSaberMarkupLanguage.Util;
56

67
namespace CustomMenuText.Views
78
{
89
internal class UICreator
910
{
1011
public static MenuTextFlowCoordinator MenuTextFlowCoordinator;
11-
public static bool Created;
1212

13-
public static void CreateMenu()
13+
async public static void CreateMenu()
1414
{
15-
if (!Created)
16-
{
17-
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
18-
MenuButtons.instance.RegisterButton(menuButton);
19-
Created = true;
20-
}
15+
await MainMenuAwaiter.WaitForMainMenuAsync();
16+
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
17+
MenuButtons.Instance.RegisterButton(menuButton);
2118
}
2219

2320

CustomMenuText/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"$schema": "https://raw.githubusercontent.com/bsmg/BSIPA-MetadataFileSchema/master/Schema.json",
33
"id": "CustomMenuText",
44
"name": "CustomMenuText",
5-
"author": "Saeraphinx",
6-
"version": "4.0.2",
7-
"description": "Replalces the ingame Beat Saber logo with custom text.",
8-
"gameVersion": "1.37.1",
5+
"author": "TheBlackParrot",
6+
"version": "4.0.3",
7+
"description": "Replaces the in-game Beat Saber logo with custom text.",
8+
"gameVersion": "1.39.1",
99
"dependsOn": {
1010
"BSIPA": "^4.3.4",
11-
"BeatSaberMarkupLanguage": "^1.11.3"
11+
"BeatSaberMarkupLanguage": "^1.12.3"
1212
}
1313
}

0 commit comments

Comments
 (0)