Skip to content

Commit f21c6ea

Browse files
committed
Upgraded DurabilityHUD
1 parent ac81f51 commit f21c6ea

7 files changed

Lines changed: 423 additions & 107 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,12 @@ Credits to [Trouser-Streak](https://github.com/etianl/Trouser-Streak/blob/main/s
648648
- Moveable with your mouse whenever an inventory menu is open.
649649
- Auto centres itself whenever items are removed.
650650
- Auto moves when action bar messages are shown (such as sleeping) behind the HUD.
651+
- Adjustable spacing between icons.
652+
- Optionally set the icons to be stacked vertically with durability either below or to the side of the icons.
653+
- Optionally allow showing of item enchantments in the action bar when scrolling through the hotbar (Compatible with resource packs).
651654

652-
![HUD](https://i.imgur.com/IZ4lFCx.png)
655+
![HUD](https://i.imgur.com/24mha4j.png)
656+
![Vertical](https://i.imgur.com/rqEV8Xx.png)
653657

654658
### DamageDetect
655659

src/main/java/net/wurstclient/hacks/DurabilityHudHack.java

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,62 @@ public String toString()
4040
}
4141
}
4242

43+
public enum IconLayout
44+
{
45+
HORIZONTAL("Horizontal"),
46+
VERTICAL("Vertical");
47+
48+
private final String label;
49+
50+
IconLayout(String label)
51+
{
52+
this.label = label;
53+
}
54+
55+
@Override
56+
public String toString()
57+
{
58+
return label;
59+
}
60+
}
61+
62+
public enum VerticalInfoPosition
63+
{
64+
BELOW("Below icon"),
65+
SIDE("To the side");
66+
67+
private final String label;
68+
69+
VerticalInfoPosition(String label)
70+
{
71+
this.label = label;
72+
}
73+
74+
@Override
75+
public String toString()
76+
{
77+
return label;
78+
}
79+
}
80+
4381
private final EnumSetting<DisplayMode> displayMode = new EnumSetting<>(
4482
"Display mode", DisplayMode.values(), DisplayMode.BOTH);
83+
private final EnumSetting<IconLayout> iconLayout = new EnumSetting<>(
84+
"Icon layout", IconLayout.values(), IconLayout.HORIZONTAL);
85+
private final EnumSetting<VerticalInfoPosition> verticalInfoPosition =
86+
new EnumSetting<>("Info position", VerticalInfoPosition.values(),
87+
VerticalInfoPosition.BELOW);
4588
private final CheckboxSetting bossBarStyle =
4689
new CheckboxSetting("Boss bar style", false);
4790
private final CheckboxSetting showOffhand =
4891
new CheckboxSetting("Show offhand", true);
92+
private final CheckboxSetting showHotbarEnchantments = new CheckboxSetting(
93+
"Show hotbar enchantments",
94+
"Shows the selected item's enchantments under the item name while cycling the hotbar.",
95+
false);
4996
private final CheckboxSetting avoidActionbarText = new CheckboxSetting(
50-
"Avoid actionbar text",
51-
"Moves the HUD up when Minecraft shows actionbar/overlay messages (e.g. sleeping).",
97+
"Avoid bottom text",
98+
"Moves the HUD up when Minecraft shows bottom-center text (actionbar, selected item name).",
5299
true);
53100
private final ColorSetting fontColor =
54101
new ColorSetting("Font color", new Color(0xFF, 0xFF, 0xFF, 0xFF));
@@ -57,6 +104,8 @@ public String toString()
57104
"Override the font color with a green→yellow→red gradient.", false);
58105
private final SliderSetting iconSize = new SliderSetting("Icon size", 24.0,
59106
16.0, 40.0, 1.0, ValueDisplay.INTEGER);
107+
private final SliderSetting iconSpacing = new SliderSetting("Icon spacing",
108+
6.0, 0.0, 20.0, 0.5, ValueDisplay.DECIMAL);
60109
private final SliderSetting fontScale = new SliderSetting("Font scale", 1.0,
61110
0.5, 2.0, 0.05, ValueDisplay.DECIMAL);
62111

@@ -65,12 +114,16 @@ public DurabilityHudHack()
65114
super("DurabilityHUD");
66115
setCategory(Category.RENDER);
67116
addSetting(displayMode);
117+
addSetting(iconLayout);
118+
addSetting(verticalInfoPosition);
68119
addSetting(bossBarStyle);
69120
addSetting(showOffhand);
121+
addSetting(showHotbarEnchantments);
70122
addSetting(avoidActionbarText);
71123
addSetting(fontColor);
72124
addSetting(gradientFontColor);
73125
addSetting(iconSize);
126+
addSetting(iconSpacing);
74127
addSetting(fontScale);
75128
}
76129

@@ -84,11 +137,26 @@ public boolean isBossBarStyle()
84137
return bossBarStyle.isChecked();
85138
}
86139

140+
public IconLayout getIconLayout()
141+
{
142+
return iconLayout.getSelected();
143+
}
144+
145+
public VerticalInfoPosition getVerticalInfoPosition()
146+
{
147+
return verticalInfoPosition.getSelected();
148+
}
149+
87150
public boolean isShowOffhand()
88151
{
89152
return showOffhand.isChecked();
90153
}
91154

155+
public boolean isShowHotbarEnchantments()
156+
{
157+
return showHotbarEnchantments.isChecked();
158+
}
159+
92160
public boolean avoidActionbarText()
93161
{
94162
return avoidActionbarText.isChecked();
@@ -109,6 +177,11 @@ public double getIconSize()
109177
return iconSize.getValue();
110178
}
111179

180+
public double getIconSpacing()
181+
{
182+
return iconSpacing.getValue();
183+
}
184+
112185
public double getFontScale()
113186
{
114187
return fontScale.getValue();

0 commit comments

Comments
 (0)