Skip to content

Commit

Permalink
Merge pull request #134 from LostLuma/remove-suspended-state
Browse files Browse the repository at this point in the history
Remove suspended power state
  • Loading branch information
LostLuma authored Oct 30, 2023
2 parents d5cea63 + 7a3aeda commit bf19370
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
10 changes: 1 addition & 9 deletions src/main/java/dynamic_fps/impl/DynamicFPSMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ private static boolean isDisabledInternal() {
return isDisabled || FREX.isFlawlessFramesActive();
}

private static boolean isPauseScreenOpened() {
return minecraft.screen instanceof PauseScreen;
}

private static boolean isLevelCoveredByScreen() {
return minecraft.screen != null && minecraft.screen.dynamic_fps$rendersBackground();
}
Expand Down Expand Up @@ -183,11 +179,7 @@ private static void checkForStateChanges() {
} else if (isForcingLowFPS) {
current = PowerState.UNFOCUSED;
} else if (window.isFocused()) {
if (!isPauseScreenOpened()) {
current = PowerState.FOCUSED;
} else {
current = PowerState.SUSPENDED;
}
current = PowerState.FOCUSED;
} else if (window.isHovered()) {
current = PowerState.HOVERED;
} else if (!window.isIconified()) {
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/dynamic_fps/impl/PowerState.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ public enum PowerState {
/*
* Window minimized or otherwise hidden.
*/
INVISIBLE(true),

/*
* User is currently on the pause screen.
*/
SUSPENDED(false);
INVISIBLE(true);

public final boolean configurable;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/dynamic_fps/impl/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public final class Config {
).apply(instance, Config::new));

public static final Config ACTIVE = new Config(-1, 1.0f, GraphicsState.DEFAULT, true, false);
public static final Config SUSPENDED = new Config(60, 1.0f, GraphicsState.DEFAULT, true, false);

public Config(int frameRateTarget, float volumeMultiplier, GraphicsState graphicsState, boolean showToasts, boolean runGarbageCollector) {
this.frameRateTarget = frameRateTarget;
Expand Down
14 changes: 4 additions & 10 deletions src/main/java/dynamic_fps/impl/config/DynamicFPSConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ private DynamicFPSConfig(Map<PowerState, Config> configs) {
}

public Config get(PowerState state) {
switch (state) {
case FOCUSED: {
return Config.ACTIVE;
}
case SUSPENDED: {
return Config.SUSPENDED;
}
default: {
return configs.get(state);
}
if (state == PowerState.FOCUSED) {
return Config.ACTIVE;
} else {
return configs.get(state);
}
}

Expand Down

0 comments on commit bf19370

Please sign in to comment.