Skip to content

Commit

Permalink
small UI updates, fix for menu button disappearing after soft restart
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlackParrot committed Nov 27, 2024
1 parent 417a204 commit af22159
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 32 deletions.
59 changes: 58 additions & 1 deletion CustomMenuText/DefaultTextFile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,61 @@ CUTE

# Just Shapes & Beats
<size=80%><#FFFFFF>Just <size=100%>sh<#FD479E>a<#FFFFFF>pes
<size=130%><#81D9E5>&beats
<size=130%><#81D9E5>&beats

# skissue
SKILL
ISSUE

# rank schmank
RANK
SCHMANK

# i lov pp
<size=75%><#777777>I LOVE
<size=0%>
<size=140%><#6772E5>PP

# :3
COLON
THREE

# :3333
<size=333%><#FF55DD>:3

# :3333c
<size=666%><#FF55DD>:3c

# slice for 115!
<size=75%><#FF0000>SLICE FOR
<size=0%>
<size=150%><#0099FF>115!

# accn't
<size=175%><#FF0000>ACCN'T

# yippee!
YIPP
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

# !bsr 25f
<size=75%><#777777>!bsr
<size=0%>
<size=150%><#0099FF>25f

# Wanna break from the ads?
Wanna break
from the ads?

# funny meme
<size=75%><#FF0077>30-50 FERAL HOGS
<size=75%><#FF0000>RUNNING <size=50%><#777777>INTO MY <size=75%><#33FF66>YARD
<size=50%><#333333>(<size=33%>WITHIN 3-5 MINUTES<size=50%>)
<size=75%><#0099FF>WHILE MY SMALL KIDS PLAY

# 1.29.1 moment
OFFICIAL
<size=50%>1.29.1 REFUGEE CLUB MEMBER

# Blank (i use this mod to hide the text actually)

13 changes: 4 additions & 9 deletions CustomMenuText/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using IPA.Utilities;
using System.Reflection;
using System.Threading.Tasks;
using BeatSaberMarkupLanguage.Util;
using HarmonyLib;
using IPA.Loader;

Expand Down Expand Up @@ -151,7 +152,7 @@ public void OnDisable()
}

[OnStart]
public void OnApplicationStart()
async public void OnApplicationStart()
{
if (!Directory.Exists(Path.Combine(UnityGame.UserDataPath, "CustomMenuText", "Cache")))
Directory.CreateDirectory(Path.Combine(UnityGame.UserDataPath, "CustomMenuText", "Cache"));
Expand All @@ -168,7 +169,8 @@ public void OnApplicationStart()

FontManager.FirstTimeFontLoad();

//BeatSaberMarkupLanguage.Settings.BSMLSettings.instance.AddSettingsMenu("Menu Text", "CustomMenuText.Configuration.settings.bsml", Configuration.CustomMenuTextSettingsUI.instance);
await MainMenuAwaiter.WaitForMainMenuAsync();
MainMenuAwaiter.MainMenuInitializing += Views.UICreator.CreateMenu;
Views.UICreator.CreateMenu();
reloadFile();
}
Expand Down Expand Up @@ -425,13 +427,6 @@ public void OnApplicationQuit()
}
Directory.Delete(cachePath);
}

}






}
}
4 changes: 2 additions & 2 deletions CustomMenuText/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("4.0.2")]
[assembly: AssemblyFileVersion("4.0.2")]
[assembly: AssemblyVersion("4.0.3")]
[assembly: AssemblyFileVersion("4.0.3")]
2 changes: 1 addition & 1 deletion CustomMenuText/Views/MenuTextFlowCoordinator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected override void DidActivate(bool firstActivation, bool addedToHierarchy,
{
if (firstActivation)
{
SetTitle("Menu Text");
SetTitle("Custom Menu Text");
showBackButton = true;
ProvideInitialViewControllers(_textSelectorViewController);
}
Expand Down
12 changes: 3 additions & 9 deletions CustomMenuText/Views/TextSelector/TextSelector.bsml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<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'>
<!--<horizontal pref-width="100" horizontal-fit="PreferredSize">
<text text="s" align="Center" font-size="7" />
<tab-selector tab-tag="yo" />
</horizontal>-->
<horizontal>
<vertical>
<page-button event-click='TextList#PageUp' direction='Up'/>
<custom-list id='TextList' select-cell='textSelect' contents='contents' vertical-fit='PreferredSize' list-width='45'>
<stack vertical-fit='PreferredSize' child-expand-height='false' >
<stack vertical-fit='PreferredSize' child-expand-height='false'>
<vertical pref-height='14' min-height='14' vertical-fit='PreferredSize'>
<horizontal horizontal-fit='PreferredSize'>
<vertical background='round-rect-panel' vertical-fit='PreferredSize' min-height='9' pref-height='9' padding='5' bg-color='#FFFFFF60'>
<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'>
<horizontal>
<!--<background background='round-rect-panel' tags='hovered' pref-width='9' pref-height='9' min-width='9' pad-right='10'/>!-->
<vertical child-expand-width='false' spacing='-1' vertical-fit='Unconstrained'>
<vertical child-expand-width='false' spacing='-2' vertical-fit='Unconstrained'>
<text text='~text-top' id='topText' align='Center' word-wrapping="true"/>
<text text='~text-bottom' id='bottomText' align='Center' word-wrapping="true"/>
</vertical>
</horizontal>
<!--<background background='round-rect-panel' tags='hovered' pref-width='9' pref-height='9' min-width='9' pad-right='10'/>!-->
</vertical>
</horizontal>
</vertical>
Expand Down
12 changes: 3 additions & 9 deletions CustomMenuText/Views/UICreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ namespace CustomMenuText.Views
internal class UICreator
{
public static MenuTextFlowCoordinator MenuTextFlowCoordinator;
public static bool Created;

async public static void CreateMenu()
{
await MainMenuAwaiter.WaitForMainMenuAsync();

if (!Created)
{
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
MenuButtons.Instance.RegisterButton(menuButton);
Created = true;
}
await MainMenuAwaiter.WaitForMainMenuAsync();
MenuButton menuButton = new MenuButton("Custom Menu Text", "Manage Custom Menu Text", ShowFlow);
MenuButtons.Instance.RegisterButton(menuButton);
}


Expand Down
2 changes: 1 addition & 1 deletion CustomMenuText/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "CustomMenuText",
"author": "TheBlackParrot",
"version": "4.0.3",
"description": "Replalces the ingame Beat Saber logo with custom text.",
"description": "Replaces the in-game Beat Saber logo with custom text.",
"gameVersion": "1.39.1",
"dependsOn": {
"BSIPA": "^4.3.4",
Expand Down

0 comments on commit af22159

Please sign in to comment.