Skip to content

Added VerticalLines option to UI #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.19.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/main/java/org/bleachhack/module/mods/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public UI() {
super("UI", KEY_UNBOUND, ModuleCategory.RENDER, true, "Shows stuff onscreen.",
new SettingToggle("Modulelist", true).withDesc("Shows the module list.").withChildren( // 0
new SettingToggle("InnerLine", true).withDesc("Adds an extra line to the front of the module list."),
new SettingToggle("OuterLine", false).withDesc("Adds an outer line to the module list."),
new SettingToggle("OuterLine", false).withDesc("Adds an outer line to the module list.").withChildren(
new SettingToggle("VerticalLine", true)
),
new SettingToggle("Fill", true).withDesc("Adds a black fill behind the module list."),
new SettingToggle("Watermark", true).withDesc("Adds the BleachHack watermark to the module list.").withChildren(
new SettingMode("Mode", "New", "Old").withDesc("The watermark type.")),
Expand Down Expand Up @@ -291,6 +293,7 @@ public void drawModuleList(MatrixStack matrices, int x, int y) {
int arrayCount = 0;
boolean inner = getSetting(0).asToggle().getChild(0).asToggle().getState();
boolean outer = getSetting(0).asToggle().getChild(1).asToggle().getState();
boolean vertical = getSetting(0).asToggle().getChild(1).asToggle().getChild(0).asToggle().getState() && outer;
boolean fill = getSetting(0).asToggle().getChild(2).asToggle().getState();
boolean rightAlign = x + mc.textRenderer.getWidth(moduleListText.get(0)) / 2 > mc.getWindow().getScaledWidth() / 2;

Expand All @@ -313,6 +316,18 @@ public void drawModuleList(MatrixStack matrices, int x, int y) {
}

mc.textRenderer.drawWithShadow(matrices, t, textStart, y + 1 + arrayCount * 10, color);

if (vertical) {
if(arrayCount == 0) {
DrawableHelper.fill(matrices, rightAlign ? textStart - 3 : startX, y - 1, rightAlign ? startX : outerX + 1, y, color);
}

if (arrayCount == moduleListText.size() - 1) {
DrawableHelper.fill(matrices, rightAlign ? textStart - 2 : startX, y + 9 + arrayCount * 10, rightAlign ? startX : outerX + 1, y + 10 + arrayCount * 10, color);
} else {
DrawableHelper.fill(matrices, rightAlign ? textStart - 2 : startX + mc.textRenderer.getWidth(moduleListText.get(arrayCount + 1)) + 4, y + 9 + arrayCount * 10, rightAlign ? startX - mc.textRenderer.getWidth(moduleListText.get(arrayCount + 1)) - 4 : outerX + 1, y + 10 + arrayCount * 10, color);
}
}
arrayCount++;
}
}
Expand Down