diff --git a/src/main/java/net/toshimichi/kzeplus/modules/VoteInfoModule.java b/src/main/java/net/toshimichi/kzeplus/modules/VoteInfoModule.java index 607be89..0e80f70 100644 --- a/src/main/java/net/toshimichi/kzeplus/modules/VoteInfoModule.java +++ b/src/main/java/net/toshimichi/kzeplus/modules/VoteInfoModule.java @@ -127,19 +127,21 @@ private class VoteInfoWidget implements Widget { @Override public void update(boolean placeholder) { - this.valid = successful && KzePlus.getInstance().getOptions().isShowNextVote() || placeholder; if (placeholder) { canVote = true; message = "投票できます"; + valid = true; } else if (nextVoteTicks > 0) { canVote = false; int hours = nextVoteTicks / 20 / (60 * 60); int minutes = nextVoteTicks / 20 / 60 % 60; int seconds = nextVoteTicks / 20 % 60; message = String.format("投票可能まで: %02d:%02d:%02d", hours, minutes, seconds); + valid = KzePlus.getInstance().getOptions().isShowNextVote() && !KzePlus.getInstance().getOptions().isShowNextVoteOnlyWhenAvailable(); } else { canVote = true; message = "投票できます"; + valid = KzePlus.getInstance().getOptions().isShowNextVote(); } } diff --git a/src/main/java/net/toshimichi/kzeplus/modules/WeaponInfoModule.java b/src/main/java/net/toshimichi/kzeplus/modules/WeaponInfoModule.java index bf95d21..1b5d6b7 100644 --- a/src/main/java/net/toshimichi/kzeplus/modules/WeaponInfoModule.java +++ b/src/main/java/net/toshimichi/kzeplus/modules/WeaponInfoModule.java @@ -132,7 +132,7 @@ public void render(int x, int y, MatrixStack stack, float tickDelta) { @Override public int getWidth() { - return weaponContextLength + 10; + return Math.max(125, weaponContextLength + 10); } @Override diff --git a/src/main/java/net/toshimichi/kzeplus/options/KzeOptions.java b/src/main/java/net/toshimichi/kzeplus/options/KzeOptions.java index d2f748a..097d117 100644 --- a/src/main/java/net/toshimichi/kzeplus/options/KzeOptions.java +++ b/src/main/java/net/toshimichi/kzeplus/options/KzeOptions.java @@ -22,5 +22,6 @@ public class KzeOptions { private boolean showTeam = true; private boolean showBonus = true; private boolean showNextVote = true; + private boolean showNextVoteOnlyWhenAvailable = false; private boolean hideVoteMessage = true; } diff --git a/src/main/java/net/toshimichi/kzeplus/options/KzeOptionsScreen.java b/src/main/java/net/toshimichi/kzeplus/options/KzeOptionsScreen.java index fb15e9b..cad506b 100644 --- a/src/main/java/net/toshimichi/kzeplus/options/KzeOptionsScreen.java +++ b/src/main/java/net/toshimichi/kzeplus/options/KzeOptionsScreen.java @@ -47,6 +47,7 @@ protected void init() { SimpleOption.ofBoolean("kze_plus.options.show_team", options.isShowTeam(), options::setShowTeam), SimpleOption.ofBoolean("kze_plus.options.show_bonus", options.isShowBonus(), options::setShowBonus), SimpleOption.ofBoolean("kze_plus.options.show_next_vote", options.isShowNextVote(), options::setShowNextVote), + SimpleOption.ofBoolean("kze_plus.options.show_next_vote_only_when_available", options.isShowNextVoteOnlyWhenAvailable(), options::setShowNextVoteOnlyWhenAvailable), SimpleOption.ofBoolean("kze_plus.options.hide_vote_message", options.isHideVoteMessage(), options::setHideVoteMessage), }; diff --git a/src/main/resources/assets/kze_plus/lang/en_us.json b/src/main/resources/assets/kze_plus/lang/en_us.json index 3aea79f..a38d194 100644 --- a/src/main/resources/assets/kze_plus/lang/en_us.json +++ b/src/main/resources/assets/kze_plus/lang/en_us.json @@ -22,5 +22,6 @@ "kze_plus.options.show_team": "チームを表示する", "kze_plus.options.show_bonus": "防衛・被弾ボーナスを表示する", "kze_plus.options.show_next_vote": "次の投票時刻を表示する", - "kze_plus.options.hide_vote_message": "投票メッセージを非表示にする" + "kze_plus.options.show_next_vote_only_when_available": "投票可能時のみ表示する", + "kze_plus.options.hide_vote_message": "投票を非表示にする" }