mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-04 20:42:22 +08:00
Cleanup runtime-specific
This commit is contained in:
@ -23,7 +23,9 @@ namespace UnityExplorer.Loader.ML
|
||||
|
||||
try
|
||||
{
|
||||
// TEMPORARY - JUST REQUIRED UNTIL ML 0.3.1 RELEASED
|
||||
MelonPreferences.Mapper.RegisterMapper(KeycodeReader, KeycodeWriter);
|
||||
MelonPreferences.Mapper.RegisterMapper(MenuPagesReader, MenuPagesWriter);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
@ -80,6 +82,8 @@ namespace UnityExplorer.Loader.ML
|
||||
MelonPreferences.Save();
|
||||
}
|
||||
|
||||
// TEMPORARY - JUST REQUIRED UNTIL ML 0.3.1 RELEASED
|
||||
|
||||
public static KeyCode KeycodeReader(TomlObject value)
|
||||
{
|
||||
try
|
||||
@ -101,6 +105,28 @@ namespace UnityExplorer.Loader.ML
|
||||
{
|
||||
return MelonPreferences.Mapper.ToToml(value.ToString());
|
||||
}
|
||||
|
||||
public static UI.Main.MenuPages MenuPagesReader(TomlObject value)
|
||||
{
|
||||
try
|
||||
{
|
||||
var kc = (UI.Main.MenuPages)Enum.Parse(typeof(UI.Main.MenuPages), (value as TomlString).Value);
|
||||
|
||||
if (kc == default)
|
||||
throw new Exception();
|
||||
|
||||
return kc;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return UI.Main.MenuPages.Home;
|
||||
}
|
||||
}
|
||||
|
||||
public static TomlObject MenuPagesWriter(UI.Main.MenuPages value)
|
||||
{
|
||||
return MelonPreferences.Mapper.ToToml(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user