|
1 | 1 | package me.flashyreese.mods.sodiumextra.client; |
2 | 2 |
|
| 3 | +import me.flashyreese.mods.sodiumextra.client.config.SodiumExtraConfigKeys; |
3 | 4 | import me.flashyreese.mods.sodiumextra.client.config.SodiumExtraGameOptions; |
| 5 | +import me.flashyreese.mods.sodiumextra.client.gui.FullscreenResolutionConfirmation; |
4 | 6 | import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraDebugEntryCoords; |
5 | 7 | import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraDebugEntryFps; |
6 | 8 | import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraDebugEntryLightUpdates; |
@@ -84,14 +86,31 @@ public static CaffeineConfig mixinConfig() { |
84 | 86 | } |
85 | 87 |
|
86 | 88 | private static SodiumExtraGameOptions loadConfig() { |
87 | | - return SodiumExtraGameOptions.load(PlatformRuntimeInformation.getInstance().getConfigDirectory().resolve("sodium-extra-options.json").toFile()); |
| 89 | + return SodiumExtraGameOptions.load(PlatformRuntimeInformation.getInstance().getConfigDirectory().resolve(SodiumExtraConfigKeys.FILE_NAME).toFile()); |
| 90 | + } |
| 91 | + |
| 92 | + public static void armWaylandFullscreenResolutionRecovery() { |
| 93 | + SodiumExtraGameOptions options = options(); |
| 94 | + if (!options.extraSettings.waylandFullscreenResolutionRecoveryPending) { |
| 95 | + options.extraSettings.waylandFullscreenResolutionRecoveryPending = true; |
| 96 | + options.writeChanges(); |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + public static void disarmWaylandFullscreenResolutionRecovery() { |
| 101 | + SodiumExtraGameOptions options = options(); |
| 102 | + if (options.extraSettings.waylandFullscreenResolutionRecoveryPending) { |
| 103 | + options.extraSettings.waylandFullscreenResolutionRecoveryPending = false; |
| 104 | + options.writeChanges(); |
| 105 | + } |
88 | 106 | } |
89 | 107 |
|
90 | 108 | public static void onTick(Minecraft client) { |
91 | 109 | if (hud == null) { |
92 | 110 | hud = new SodiumExtraHud(); |
93 | 111 | } |
94 | 112 | hud.onStartTick(client); |
| 113 | + FullscreenResolutionConfirmation.tick(client); |
95 | 114 | } |
96 | 115 |
|
97 | 116 | public static void onHudRender(GuiGraphicsExtractor guiGraphics, DeltaTracker deltaTracker) { |
|
0 commit comments