From c3598cac49a461168d531bea6b81ce03189a35ba Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 6 Dec 2022 19:11:34 +0800 Subject: [PATCH 1/2] Resolve a feature about reacting toggles too fast --- src/main/java/minicraft/entity/mob/Player.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/minicraft/entity/mob/Player.java b/src/main/java/minicraft/entity/mob/Player.java index 18d1874f6..eb19e5ed5 100644 --- a/src/main/java/minicraft/entity/mob/Player.java +++ b/src/main/java/minicraft/entity/mob/Player.java @@ -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; } From 60ec37deeefe855120f5cb4bcbbf15783f291793 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 6 Dec 2022 19:34:56 +0800 Subject: [PATCH 2/2] Might resolve the potential rendering problem --- src/main/java/minicraft/screen/QuestsDisplay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/minicraft/screen/QuestsDisplay.java b/src/main/java/minicraft/screen/QuestsDisplay.java index 7ac0f7801..1c136319c 100644 --- a/src/main/java/minicraft/screen/QuestsDisplay.java +++ b/src/main/java/minicraft/screen/QuestsDisplay.java @@ -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(),