Skip to content

Commit

Permalink
v0.2.1: Keybind no longer activates when in a menu or typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelliedbanana committed Oct 4, 2023
1 parent 4f27869 commit b3900a6
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ buildscript {
maven { url 'https://jitpack.io/' }
}
dependencies {
classpath('com.github.Fox2Code.FoxLoader:dev:1.2.18')
classpath('com.github.Fox2Code.FoxLoader:dev:1.2.19')
}
}

apply plugin: 'foxloader.dev'

version '0.2.0'
version '0.2.1'

foxloader {
// forceReload = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.lwjgl.input.Keyboard;

public class LightLevelIndicatorModClient extends LightLevelIndicatorMod implements ClientMod {
private static final Minecraft minecraft = Minecraft.getInstance();
private static final KeyBinding toggleLightLevelIndicatorKeyBinding = new KeyBinding("Toggle Light Indicators", Keyboard.KEY_L);
private static boolean firstPress = true;

Expand All @@ -22,6 +23,11 @@ public void onInit() {
}

private void handleKeybind() {
if (minecraft.currentScreen != null) {
firstPress = true;
return;
}

if (Keyboard.isKeyDown(toggleLightLevelIndicatorKeyBinding.keyCode) && firstPress) {
LightLevelIndicatorHandler.toggleIsEnabled();
Minecraft.getInstance().thePlayer.displayChatMessage("Light Level Indicators: " + (LightLevelIndicatorHandler.getIsEnabled() ? "Enabled" : "Disabled"));
Expand Down

0 comments on commit b3900a6

Please sign in to comment.