added coords
This commit is contained in:
@@ -291,6 +291,28 @@ public class MyScreen extends BaseOwoScreen<FlowLayout> {
|
||||
"Module Enabled", "Keystrokes is now active",
|
||||
"Module Disabled", "KeyStrokes is now inactive"
|
||||
);
|
||||
|
||||
FlowLayout coordinatesRow = ModuleRow.build(
|
||||
GLASS_PANEL, DISABLED, FLAT,
|
||||
Identifier.fromNamespaceAndPath("citrus-dev", "textures/icons/block_culling_file.png"),
|
||||
18, 12,
|
||||
MC_FIVE,
|
||||
"Coordinates",
|
||||
"Shows your Position",
|
||||
new ModuleRow.ToggleState() {
|
||||
public boolean get() { return Module_Coords.toggle; }
|
||||
public void set(boolean value) { Module_Coords.toggle = value; }
|
||||
},
|
||||
Identifier.fromNamespaceAndPath("citrus-dev", "textures/icons/settings.png"),
|
||||
() -> {
|
||||
Config.get().lastModule = "Coords";
|
||||
Config.get().save();
|
||||
openModuleSettings("Coords", CoordsSettings());
|
||||
},
|
||||
"Module Enabled", "Keystrokes is now active",
|
||||
"Module Disabled", "KeyStrokes is now inactive"
|
||||
);
|
||||
content.child(coordinatesRow);
|
||||
content.child(keyStrokesRow);
|
||||
content.child(fpsRow);
|
||||
|
||||
@@ -421,6 +443,23 @@ public class MyScreen extends BaseOwoScreen<FlowLayout> {
|
||||
);
|
||||
}
|
||||
|
||||
private List<SettingRow> CoordsSettings() {
|
||||
List<SettingsControls.ButtonState> positionStates = List.of(
|
||||
new SettingsControls.ButtonState("L-TOP", () -> Module_Coords.setPosition(1, 1)),
|
||||
new SettingsControls.ButtonState("R-TOP", () -> Module_Coords.setPosition(99, 1)),
|
||||
new SettingsControls.ButtonState("R-BOTTOM", () -> Module_Coords.setPosition(99, 99)),
|
||||
new SettingsControls.ButtonState("L-BOTTOM", () -> Module_Coords.setPosition(1, 99))
|
||||
);
|
||||
|
||||
|
||||
int currentIndex = positionIndex(Config.get().fpsX, Config.get().fpsY);
|
||||
|
||||
return List.of(
|
||||
new SettingRow("Position", SettingsControls.makeCyclingButton(GLASS_PANEL, positionStates, currentIndex))
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
private int positionIndex(int x, int y) {
|
||||
boolean right = x > 50;
|
||||
boolean bottom = y > 50;
|
||||
|
||||
Reference in New Issue
Block a user