mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 13:05:52 +08:00
Fix: Module name always white; wrap panels to next row on overflow
This commit is contained in:
1 parent
c8be55024c
commit
47f8f3e0c5
2 files changed
+16
-11
No files matched your search
@@ -24,6 +24,10 @@ public class ClickGUIScreen extends GuiScreen {
|
||||
panels.clear();
|
||||
|
||||
int x = 20;
|
||||
int y = 30;
|
||||
int panelWidth = 120;
|
||||
int gap = 20;
|
||||
int rowHeight = 30;
|
||||
|
||||
for (ModuleCategory category : ModuleCategory.values()) {
|
||||
List<Module> categoryModules = OrangeX.getInstance()
|
||||
@@ -33,15 +37,20 @@ public class ClickGUIScreen extends GuiScreen {
|
||||
if (categoryModules.isEmpty())
|
||||
continue;
|
||||
|
||||
if (x + panelWidth > this.width) {
|
||||
x = 20;
|
||||
y += 300 + rowHeight;
|
||||
}
|
||||
|
||||
Panel panel = new Panel(
|
||||
category,
|
||||
x,
|
||||
30,
|
||||
120,
|
||||
y,
|
||||
panelWidth,
|
||||
20
|
||||
);
|
||||
|
||||
int y = 20;
|
||||
int moduleY = 20;
|
||||
|
||||
for (Module module : categoryModules) {
|
||||
panel.addComponent(
|
||||
@@ -49,16 +58,16 @@ public class ClickGUIScreen extends GuiScreen {
|
||||
panel,
|
||||
module,
|
||||
0,
|
||||
y
|
||||
moduleY
|
||||
)
|
||||
);
|
||||
|
||||
y += 20;
|
||||
moduleY += 20;
|
||||
}
|
||||
|
||||
panels.add(panel);
|
||||
|
||||
x += 140;
|
||||
x += panelWidth + gap;
|
||||
}
|
||||
|
||||
loadPanelPositions();
|
||||
|
||||
+1
-5
@@ -54,15 +54,11 @@ public class ModuleButton extends Component {
|
||||
Gui.drawRect(getX(), getY(), getX() + width, getY() + height, 0xff1a4a2a);
|
||||
}
|
||||
|
||||
int color = module.isEnabled()
|
||||
? 0xff55ffff
|
||||
: 0xffffffff;
|
||||
|
||||
drawString(
|
||||
module.getName(),
|
||||
getX() + 5,
|
||||
getY() + 5,
|
||||
color
|
||||
0xffffffff
|
||||
);
|
||||
|
||||
if (expanded) {
|
||||
|
||||
Reference in new issue
Block a user