forked from akanyan/mu3-mods
add offgeki
This commit is contained in:
111
Extras/Offgeki/MU3.Mod/State.cs
Normal file
111
Extras/Offgeki/MU3.Mod/State.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using MU3.Util;
|
||||
namespace MU3.Mod;
|
||||
|
||||
|
||||
class State: Singleton<State> {
|
||||
public bool RemoveBackground { get; set; } = false;
|
||||
public bool RemoveBackgroundFrame { get; set; } = false;
|
||||
public bool RemoveHeader { get; set; } = false;
|
||||
public bool RemoveFooter { get; set; } = false;
|
||||
|
||||
public bool RemovePlayerHealthUI { get; set; } = false;
|
||||
|
||||
public bool RemovePlayerBattleScoreUI { get; set; } = false;
|
||||
public bool RemovePlayerScoreUI { get; set; } = false;
|
||||
public bool RemoveEnemyUI { get; set; } = false;
|
||||
|
||||
public bool RemovePlayerCardUI { get; set; } = false;
|
||||
public bool RemovePlayerGeki { get; set; } = false;
|
||||
public bool RemoveAllyGekis { get; set; } = false;
|
||||
|
||||
public bool RemoveCharacterLine { get; set; } = false;
|
||||
public bool RemoveEnemy { get; set; } = false;
|
||||
public bool RemoveBoss { get; set; } = false;
|
||||
|
||||
public bool RemoveBullets { get; set; } = false;
|
||||
|
||||
public bool ReducedNoteFX { get; set; } = false;
|
||||
public bool RemoveNoteFX { get; set; } = false;
|
||||
|
||||
public float BackgroundR { get; set; } = 0f;
|
||||
public float BackgroundG { get; set; } = 0f;
|
||||
public float BackgroundB { get; set; } = 0f;
|
||||
|
||||
private bool getValue(IniFile ini, string key)
|
||||
{
|
||||
UnityEngine.Debug.Log("Get value for key: " + key);
|
||||
var value = ini.getValue("Offgeki", key, false);
|
||||
UnityEngine.Debug.Log("Value: " + value);
|
||||
return value;
|
||||
}
|
||||
private float getColorValue(IniFile ini, string key)
|
||||
{
|
||||
UnityEngine.Debug.Log("Get color value for key: " + key);
|
||||
var value = ini.getValue("Offgeki", key, 0f);
|
||||
|
||||
// Ceiling to 255
|
||||
if (value > 255)
|
||||
{
|
||||
value = 255;
|
||||
}
|
||||
|
||||
// Divide by 255
|
||||
value = value / 255.0f;
|
||||
|
||||
UnityEngine.Debug.Log("Value: " + value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
UnityEngine.Debug.Log("[Nogeki] Initializing State");
|
||||
using IniFile ini = new("mu3.ini");
|
||||
RemoveBackground = getValue(ini, "RemoveBackground");
|
||||
RemoveBackgroundFrame = getValue(ini, "RemoveBackgroundFrame");
|
||||
RemoveHeader = getValue(ini, "RemoveHeader");
|
||||
RemoveFooter = getValue(ini, "RemoveFooter");
|
||||
RemovePlayerHealthUI = getValue(ini, "RemovePlayerHealthUI");
|
||||
RemovePlayerBattleScoreUI = getValue(ini, "RemovePlayerBattleScoreUI");
|
||||
RemovePlayerScoreUI = getValue(ini, "RemovePlayerScoreUI");
|
||||
RemovePlayerCardUI = getValue(ini, "RemovePlayerCardUI");
|
||||
RemoveEnemyUI = getValue(ini, "RemoveEnemyUI");
|
||||
RemovePlayerGeki = getValue(ini, "RemovePlayerGeki");
|
||||
RemoveAllyGekis = getValue(ini, "RemoveAllyGekis");
|
||||
RemoveCharacterLine = getValue(ini, "RemoveCharacterLine");
|
||||
RemoveEnemy = getValue(ini, "RemoveEnemy");
|
||||
RemoveBoss = getValue(ini, "RemoveBoss");
|
||||
RemoveBullets = getValue(ini, "RemoveBullets");
|
||||
ReducedNoteFX = getValue(ini, "ReducedNoteFX");
|
||||
RemoveNoteFX = getValue(ini, "RemoveNoteFX");
|
||||
BackgroundR = getColorValue(ini, "BackgroundR");
|
||||
BackgroundG = getColorValue(ini, "BackgroundG");
|
||||
BackgroundB = getColorValue(ini, "BackgroundB");
|
||||
|
||||
UnityEngine.Debug.Log("[Nogeki] State initialized");
|
||||
}
|
||||
|
||||
override public string ToString()
|
||||
{
|
||||
return "State: \n"
|
||||
+ "\tRemove Background: " + RemoveBackground + "\n"
|
||||
+ "\tRemove Background Frame: " + RemoveBackgroundFrame + "\n"
|
||||
+ "\tRemove Header: " + RemoveHeader + "\n"
|
||||
+ "\tRemove Footer: " + RemoveFooter + "\n"
|
||||
+ "\tRemove Player Health UI: " + RemovePlayerHealthUI + "\n"
|
||||
+ "\tRemove Player Battle Score UI: " + RemovePlayerBattleScoreUI + "\n"
|
||||
+ "\tRemove Player Score UI: " + RemovePlayerScoreUI + "\n"
|
||||
+ "\tRemove Player Card UI: " + RemovePlayerCardUI + "\n"
|
||||
+ "\tRemove Enemy UI: " + RemoveEnemyUI + "\n"
|
||||
+ "\tRemove Player Geki: " + RemovePlayerGeki + "\n"
|
||||
+ "\tRemove Ally Gekis: " + RemoveAllyGekis + "\n"
|
||||
+ "\tRemove Enemy: " + RemoveEnemy + "\n"
|
||||
+ "\tRemove Boss: " + RemoveBoss + "\n"
|
||||
+ "\tRemove Bullets: " + RemoveBullets + "\n"
|
||||
+ "\tRemove Bright Note FX: " + ReducedNoteFX + "\n"
|
||||
+ "\tRemove All Note FX: " + RemoveNoteFX + "\n"
|
||||
+ "\tRemove Character Line: " + RemoveCharacterLine + "\n"
|
||||
+ "\tBackground R: " + BackgroundR + "\n"
|
||||
+ "\tBackground G: " + BackgroundG + "\n"
|
||||
+ "\tBackground B: " + BackgroundB + "\n";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user