Skip to content

Commit 0d8de56

Browse files
committed
Update Graphics Settings
1 parent fec805e commit 0d8de56

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

GraphicsSettingsIL2CPP_netFm/GraphicsSettings.cs

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ public class GraphicsSettings : BasePlugin
2424
private static ConfigEntry<int> Framerate;
2525
private static ConfigEntry<vSyncList> vSync;
2626

27-
//private static ConfigEntry<bool> Apply;
27+
private static ConfigEntry<bool> Apply;
2828

2929
public override void Load()
3030
{
31-
//Apply = Config.Bind("Apply Settings", "Apply All Graphics Settings Bellow", false, "Enable to apply the settings. This will be reset if anything changes.");
32-
//Apply.SettingChanged += (sender, args) => ApplySettings();
31+
Apply = Config.Bind("Apply Settings", "Apply All Graphics Settings Bellow", false, "If disabled, settings will not be applied even when clicking on \"Save Preferences\" button");
32+
Apply.SettingChanged += (sender, args) => ApplySettings();
3333

34-
Width = Config.Bind("Resolution", "Width", 0);
35-
//Width.SettingChanged += (sender, args) => Apply.Value = false;
36-
Height = Config.Bind("Resolution", "Height", 0);
37-
//Height.SettingChanged += (sender, args) => Apply.Value = false;
34+
Width = Config.Bind("Resolution", "Width", 1280);
35+
Width.SettingChanged += (sender, args) => ApplySettings();
36+
Height = Config.Bind("Resolution", "Height", 720);
37+
Height.SettingChanged += (sender, args) => ApplySettings();
3838
DisplayMode = Config.Bind("Resolution", "Display Mode", DisplayModeList.Windowed);
39-
//DisplayMode.SettingChanged += (sender, args) => Apply.Value = false;
39+
DisplayMode.SettingChanged += (sender, args) => ApplySettings();
4040

4141
vSync = Config.Bind("Framerate", "vSync", vSyncList.On);
42-
//vSync.SettingChanged += (sender, args) => Apply.Value = false;
42+
vSync.SettingChanged += (sender, args) => ApplySettings();
4343
Framerate = Config.Bind("Framerate", "Target Framerate", -1, "Target Framerate only works if vSync is Off. Set -1 to unlimited");
44-
//Framerate.SettingChanged += (sender, args) => Apply.Value = false;
44+
Framerate.SettingChanged += (sender, args) => ApplySettings();
4545

4646
SceneManager.add_sceneLoaded(new Action<Scene, LoadSceneMode>((s, lsm) => GetResolution()));
4747
}
@@ -62,16 +62,16 @@ private enum vSyncList
6262

6363
private void GetResolution()
6464
{
65+
Apply.Value = false;
6566
Width.Value = Screen.width;
6667
Height.Value = Screen.height;
6768
if (Screen.fullScreen) DisplayMode.Value = DisplayModeList.FullScreen;
6869
if (!Screen.fullScreen) DisplayMode.Value = DisplayModeList.Windowed;
69-
//Apply.Value = false;
7070
}
7171

7272
private void ApplySettings()
7373
{
74-
//if (!Apply.Value) return;
74+
if (!Apply.Value) return;
7575
if (DisplayMode.Value == DisplayModeList.FullScreen)
7676
Screen.SetResolution(Width.Value, Height.Value, FullScreenMode.ExclusiveFullScreen);
7777

IL2CppMonobehaviorTemplate/MonoTemplate.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
namespace IL2CppMonobehaviorTemplate
3939
{
4040
/// <summary>
41-
/// Add here a brief description
41+
/// Add a brief description of your class
4242
/// </summary>
4343
[BepInPlugin(GUID, PluginName, PluginVersion)]
4444

0 commit comments

Comments
 (0)