Skip to content

Commit af22159

Browse files
small UI updates, fix for menu button disappearing after soft restart
1 parent 417a204 commit af22159

File tree

7 files changed

+72
-32
lines changed

7 files changed

+72
-32
lines changed

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/UICreator.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@ namespace CustomMenuText.Views
99
internal class UICreator
1010
{
1111
public static MenuTextFlowCoordinator MenuTextFlowCoordinator;
12-
public static bool Created;
1312

1413
async public static void CreateMenu()
1514
{
16-
await MainMenuAwaiter.WaitForMainMenuAsync();
17-
18-
if (!Created)
19-
{
20-
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
21-
MenuButtons.Instance.RegisterButton(menuButton);
22-
Created = true;
23-
}
15+
await MainMenuAwaiter.WaitForMainMenuAsync();
16+
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
17+
MenuButtons.Instance.RegisterButton(menuButton);
2418
}
2519

2620

CustomMenuText/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "CustomMenuText",
55
"author": "TheBlackParrot",
66
"version": "4.0.3",
7-
"description": "Replalces the ingame Beat Saber logo with custom text.",
7+
"description": "Replaces the in-game Beat Saber logo with custom text.",
88
"gameVersion": "1.39.1",
99
"dependsOn": {
1010
"BSIPA": "^4.3.4",

0 commit comments

Comments
 (0)