Skip to content

Commit

Permalink
Updated to work with ModSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
octoberU committed Nov 28, 2020
1 parent 8aeb818 commit 793d7c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void RegisterConfig()
MelonPrefs.RegisterBool(Category, nameof(ShowSongInfo), true, "Display song info during gameplay.");
MelonPrefs.RegisterBool(Category, nameof(ShowHighscoreDifference), true, "Display score difference from your highscore");

MelonPrefs.RegisterFloat(Category, nameof(OverlayScale), 1.4f, "Changes the scale of the overlay");
MelonPrefs.RegisterFloat(Category, nameof(OverlayScale), 1.4f, "Changes the scale of the overlay [0,5,0.2,1.4]");

OnModSettingsApplied();
}
Expand Down
1 change: 1 addition & 0 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public override void OnLevelWasInitialized(int level)
public override void OnModSettingsApplied()
{
Config.OnModSettingsApplied();
UI.OnModSettingsApplied();
}

public override void OnUpdate()
Expand Down
9 changes: 8 additions & 1 deletion UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public static void Initialize()
{
PrepareOverlay();
GetReferences();
canvasScaler.scaleFactor = Config.OverlayScale;
FadeOutOverlay();
overlay.SetActive(false);
bottomRight.gameObject.SetActive(false);
topLeft.gameObject.SetActive(Config.ShowModifiers);
kataConfig = KataConfig.I;
OnModSettingsApplied();
}

public static void PrepareOverlay()
Expand Down Expand Up @@ -132,6 +132,13 @@ public static void UpdateUiInfo(SongList.SongData data)
ModifierText.text = Utility.GetModText();
}

public static void OnModSettingsApplied()
{
canvasScaler.scaleFactor = Config.OverlayScale;
topRight.gameObject.SetActive(Config.ShowSongInfo);
topLeft.gameObject.SetActive(Config.ShowModifiers);
bottomLeft.gameObject.SetActive(Config.ShowScore);
}


public static void UpdateDisplay(int score, int streak)
Expand Down

0 comments on commit 793d7c7

Please sign in to comment.