Skip to content

Commit

Permalink
Add button to reset fullscreen resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Oct 24, 2022
1 parent dbeb177 commit bdb860b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions MOD.Scripts.Core/MODWindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ public static void ForceUnconfigureFullscreenLock()
{
PlayerPrefs.DeleteKey(FULLSCREEN_LOCK_KEY);
}
public static void ClearPlayerPrefsFullscreenResolution()
{
PlayerPrefs.DeleteKey("fullscreen_width");
PlayerPrefs.DeleteKey("fullscreen_height");
}

private static Resolution GetFullscreenResolution()
{
Expand Down
12 changes: 11 additions & 1 deletion MOD.Scripts.UI/MODMenuResolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void OnBeforeMenuVisible()

public void OnGUI()
{
Label("Resolution Settings");
Label($"Resolution Settings (Current: {Screen.width}x{Screen.height})");
{
GUILayout.BeginHorizontal();
if (Button(new GUIContent("480p", "Set resolution to 853 x 480"))) { SetAndSaveResolution(480); }
Expand All @@ -51,6 +51,16 @@ public void OnGUI()
}
}
GUILayout.EndHorizontal();

if (Button(new GUIContent(
"Reset Fullscreen Resolution",
"Force re-detection of the fullscreen resolution (matching your monitor's max resolution).\n\n" +
"You may want to do this if you change to a monitor with a different fullscreen resolution, and the game detects the wrong resolution.")
))
{
MODWindowManager.ClearPlayerPrefsFullscreenResolution();
MODWindowManager.GoFullscreen();
}
}
}

Expand Down

0 comments on commit bdb860b

Please sign in to comment.