Skip to content

Commit

Permalink
Merge pull request #423 from Anvil-Dev/progress
Browse files Browse the repository at this point in the history
修改进度条样式
  • Loading branch information
Gu-ZT authored Apr 28, 2024
2 parents 750193b + db497ad commit 71179ec
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfi
int color;
float percent = (float) consume / generate;
if (percent < 0.75) {
color = 0xFF32CD32;
} else if (percent <= 1) {
color = 0xFFFFD700;
} else {
color = 0xFFFF0000;
Expand All @@ -41,7 +39,10 @@ public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfi
percent,
Component.translatable("tooltip.anvilcraft.jade.power_information", consume, generate),
elementHelper.progressStyle().color(color).textColor(-1),
Util.make(BoxStyle.DEFAULT, boxStyle -> boxStyle.borderColor = 0xFF555555),
Util.make(BoxStyle.DEFAULT, boxStyle -> {
boxStyle.borderColor = 0xFF555555;
boxStyle.bgColor = 0xFF32CD32;
}),
true
)
);
Expand Down

0 comments on commit 71179ec

Please sign in to comment.