mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:21:32 +01:00
(fix) crosshair settings
This commit is contained in:
parent
e6ab006b39
commit
4c14924eb3
@ -200,7 +200,10 @@ public class ModSettings extends SilentScreen {
|
||||
}
|
||||
}
|
||||
if(setting.isCellGrid()) {
|
||||
CellGrid.render(mouseX, mouseY, x + 100, settingY, setting);
|
||||
MouseCursorHandler.CursorType cellGridCursor = CellGrid.render(mouseX, mouseY, x + 100, settingY, setting);
|
||||
if(cellGridCursor != null) {
|
||||
cursorType = cellGridCursor;
|
||||
}
|
||||
settingY += 135;
|
||||
}
|
||||
if (setting.isSlider()) {
|
||||
@ -361,6 +364,7 @@ public class ModSettings extends SilentScreen {
|
||||
}
|
||||
if(setting.isCellGrid()) {
|
||||
CellGrid.click(mouseX, mouseY, mouseButton, setting);
|
||||
settingY += 135;
|
||||
}
|
||||
if(setting.isCombo()) {
|
||||
int index = 0;
|
||||
|
@ -7,6 +7,7 @@ import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
|
||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||
import net.silentclient.client.gui.util.RenderUtil;
|
||||
import net.silentclient.client.mods.Setting;
|
||||
import net.silentclient.client.utils.MouseCursorHandler;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@ -19,7 +20,8 @@ public class CellGrid {
|
||||
private static boolean rmb;
|
||||
private static boolean lmb;
|
||||
|
||||
public static void render(float mouseX, float mouseY, float x, float y, Setting grid) {
|
||||
public static MouseCursorHandler.CursorType render(float mouseX, float mouseY, float x, float y, Setting grid) {
|
||||
MouseCursorHandler.CursorType cursorType = null;
|
||||
for (int row = 0; row < 11; row++) {
|
||||
for (int col = 0; col < 11; col++) {
|
||||
float rx = x + col * 11;
|
||||
@ -32,20 +34,27 @@ public class CellGrid {
|
||||
MouseUtils.isInside((int) mouseX, (int) mouseY, rx, ry, 11, 11) ? 0x20ffffff : 0x00ffffff
|
||||
);
|
||||
|
||||
if(MouseUtils.isInside((int) mouseX, (int) mouseY, rx, ry, 11, 11) && rmb) {
|
||||
if(MouseUtils.isInside((int) mouseX, (int) mouseY, rx, ry, 11, 11)) {
|
||||
cursorType = MouseCursorHandler.CursorType.POINTER;
|
||||
if(rmb) {
|
||||
grid.getCells()[row][col] = true;
|
||||
}
|
||||
|
||||
if(MouseUtils.isInside((int) mouseX, (int) mouseY, rx, ry, 11, 11) && lmb) {
|
||||
if(lmb) {
|
||||
grid.getCells()[row][col] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trashBtn.xPosition = (int)x;
|
||||
trashBtn.yPosition = (int)y + 125;
|
||||
|
||||
trashBtn.drawButton(Minecraft.getMinecraft(), (int)mouseX, (int)mouseY);
|
||||
if(trashBtn.isMouseOver()) {
|
||||
cursorType = MouseCursorHandler.CursorType.POINTER;
|
||||
}
|
||||
}
|
||||
|
||||
return cursorType;
|
||||
}
|
||||
|
||||
public static void click(float mouseX, float mouseY, int btn, Setting setting) {
|
||||
|
@ -136,7 +136,10 @@ public class ModSettings extends SilentScreen {
|
||||
}
|
||||
}
|
||||
if(setting.isCellGrid()) {
|
||||
CellGrid.render(mouseX, mouseY, 3, settingY, setting);
|
||||
MouseCursorHandler.CursorType cellGridCursor = CellGrid.render(mouseX, mouseY, 3, settingY, setting);
|
||||
if(cellGridCursor != null) {
|
||||
cursorType = cellGridCursor;
|
||||
}
|
||||
settingY += 135;
|
||||
}
|
||||
if(setting.isSlider()) {
|
||||
@ -269,6 +272,7 @@ public class ModSettings extends SilentScreen {
|
||||
|
||||
if(setting.isCellGrid()) {
|
||||
CellGrid.click(mouseX, mouseY, mouseButton, setting);
|
||||
settingY += 135;
|
||||
}
|
||||
|
||||
if(setting.isSlider()) {
|
||||
|
Loading…
Reference in New Issue
Block a user