Skip to content

Commit

Permalink
Resolve a feature about reacting toggles too fast (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofferHolmesland authored Dec 8, 2022
2 parents b625835 + 60ec37d commit 9765d62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/minicraft/entity/mob/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,20 @@ public void tick() {
if (cooldowninfo > 0) cooldowninfo--;
if (questExpanding > 0) questExpanding--;

if (input.getKey("potionEffects").down && cooldowninfo == 0) {
if (input.getKey("potionEffects").clicked && cooldowninfo == 0) {
cooldowninfo = 10;
showpotioneffects = !showpotioneffects;
}

if (input.getKey("simpPotionEffects").down) {
if (input.getKey("simpPotionEffects").clicked) {
simpPotionEffects = !simpPotionEffects;
}

if (input.getKey("toggleHUD").down) {
if (input.getKey("toggleHUD").clicked) {
renderGUI = !renderGUI;
}

if (input.getKey("expandQuestDisplay").down) {
if (input.getKey("expandQuestDisplay").clicked) {
questExpanding = 30;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minicraft/screen/QuestsDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public QuestsDisplay() {
.setSelectable(true)
.createMenu(),
new Menu.Builder(false, 0, RelPos.LEFT)
.setPositioning(new Point(Screen.w / 2 - 8 * 11, 30), RelPos.RIGHT)
.setPositioning(new Point(Screen.w / 2 - 8 * (2 + Localization.getLocalized("minicraft.displays.quests.display.header.unlocked").length()), 30), RelPos.RIGHT)
.setEntries(new StringEntry("minicraft.displays.quests.display.header.unlocked", Color.GRAY))
.setSelectable(false)
.createMenu(),
Expand Down

0 comments on commit 9765d62

Please sign in to comment.