Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
No Melon Start Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Bright1192 authored May 31, 2023
1 parent 9247e15 commit 3766a57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
51 changes: 1 addition & 50 deletions Dependencies/MelonStartScreen/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,56 +40,7 @@ public override void OnInitialize()

private static int LoadAndRun(LemonFunc<int> functionToWaitForAsync)
{
// Start Screen has no signatures for Development Builds of UnityPlayer.dll
if (MelonUnityEngine.UnityDebug.isDebugBuild)
return functionToWaitForAsync();

Logger.Msg("Initializing...");

FolderPath = Path.Combine(MelonEnvironment.UserDataDirectory, "MelonStartScreen");
if (!Directory.Exists(FolderPath))
Directory.CreateDirectory(FolderPath);

ThemesFolderPath = Path.Combine(FolderPath, "Themes");
if (!Directory.Exists(ThemesFolderPath))
Directory.CreateDirectory(ThemesFolderPath);

UI_Theme.Load();
if (!UI_Theme.General.Enabled)
return functionToWaitForAsync();

// We try to resolve all the signatures, which are available for Unity 2018.1.0+
// If we can't find them (signatures changed or <2018.1.0), then we run the function and return.
try
{
if (!NativeSignatureResolver.Apply())
return functionToWaitForAsync();

if (!ApplyUser32SetTimerPatch())
return functionToWaitForAsync();

MelonDebug.Msg("Initializing Screen Renderer");
ScreenRenderer.Init();
MelonDebug.Msg("Screen Renderer initialized");

RegisterMessageCallbacks();

// Initial render
ScreenRenderer.Render();
}
catch (Exception e)
{
Logger.Error(e);
ScreenRenderer.disabled = true;
return functionToWaitForAsync();
}

SubscribeToCoreCallbacks();

StartFunction(functionToWaitForAsync);
MainLoop();

return functionRunResult;
return functionToWaitForAsync();
}

private static void SubscribeToCoreCallbacks()
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/MelonStartScreen/UI/UI_Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal static void Load()
internal class cGeneral
{
[TomlPrecedingComment("Toggles the Entire Start Screen ( true | false )")]
internal bool Enabled = true;
internal bool Enabled = false;
[TomlPrecedingComment("Current Theme of the Start Screen")]
internal string Theme = "Default";
}
Expand Down

0 comments on commit 3766a57

Please sign in to comment.