seppuku_at.cfg changed, run setupDecompWorkspace! Big update for the UI backend
This commit is contained in:
parent
e4329a53a1
commit
29d348d569
|
@ -1,3 +1,3 @@
|
|||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
|
|
|
@ -14,6 +14,7 @@ public abstract class Command {
|
|||
private String[] alias;
|
||||
private String desc;
|
||||
private String usage;
|
||||
private String[] arguments;
|
||||
|
||||
private TextComponentString textComponentUsage;
|
||||
|
||||
|
@ -28,6 +29,14 @@ public abstract class Command {
|
|||
this.usage = usage;
|
||||
}
|
||||
|
||||
public Command(String displayName, String[] alias, String desc, String usage, String[] arguments) {
|
||||
this.displayName = displayName;
|
||||
this.alias = alias;
|
||||
this.desc = desc;
|
||||
this.usage = usage;
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
public Command(String displayName, String[] alias, String desc, TextComponentString textComponentUsage) {
|
||||
this(displayName, alias, desc, textComponentUsage.getText());
|
||||
this.textComponentUsage = textComponentUsage;
|
||||
|
@ -79,6 +88,10 @@ public abstract class Command {
|
|||
}
|
||||
}
|
||||
|
||||
public String tabComplete(String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
@ -111,6 +124,14 @@ public abstract class Command {
|
|||
this.usage = usage;
|
||||
}
|
||||
|
||||
public String[] getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
public void setArguments(String[] arguments) {
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
public TextComponentString getTextComponentUsage() {
|
||||
return textComponentUsage;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package me.rigamortis.seppuku.api.event.player;
|
||||
|
||||
import me.rigamortis.seppuku.api.event.EventCancellable;
|
||||
|
||||
/**
|
||||
* @author Seth
|
||||
*/
|
||||
public final class EventChatKeyTyped extends EventCancellable {
|
||||
|
||||
private char typedChar;
|
||||
private int keyCode;
|
||||
|
||||
public EventChatKeyTyped(char typedChar, int keyCode) {
|
||||
this.typedChar = typedChar;
|
||||
this.keyCode = keyCode;
|
||||
}
|
||||
|
||||
public char getTypedChar() {
|
||||
return typedChar;
|
||||
}
|
||||
|
||||
public void setTypedChar(char typedChar) {
|
||||
this.typedChar = typedChar;
|
||||
}
|
||||
|
||||
public int getKeyCode() {
|
||||
return keyCode;
|
||||
}
|
||||
|
||||
public void setKeyCode(int keyCode) {
|
||||
this.keyCode = keyCode;
|
||||
}
|
||||
}
|
|
@ -8,13 +8,11 @@ import net.minecraft.client.Minecraft;
|
|||
*/
|
||||
public class ButtonComponent extends HudComponent {
|
||||
|
||||
public boolean enabled, rightClickEnabled;
|
||||
public ComponentListener mouseClickListener, rightClickListener;
|
||||
public boolean enabled;
|
||||
|
||||
public ButtonComponent(String name) {
|
||||
super(name);
|
||||
this.enabled = false;
|
||||
this.rightClickEnabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +25,7 @@ public class ButtonComponent extends HudComponent {
|
|||
// draw bg
|
||||
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + (this.rightClickListener != null ? this.getW() - 8 : this.getW()), this.getY() + this.getH(), this.enabled ? 0x45002E00 : 0x452E0000);
|
||||
|
||||
if (this.rightClickListener != null) {
|
||||
if (this.subComponents > 0) {
|
||||
final boolean isMousingHoveringDropdown = mouseX >= this.getX() + this.getW() - 8 && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH();
|
||||
|
||||
// draw bg behind triangles
|
||||
|
@ -46,7 +44,11 @@ public class ButtonComponent extends HudComponent {
|
|||
}
|
||||
|
||||
// draw text
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(this.getName(), (int) this.getX() + 1, (int) this.getY() + 1, this.enabled ? 0xFF55FF55 : 0xFFFF5555);
|
||||
String renderName = this.getName();
|
||||
if (this.getDisplayName() != null) {
|
||||
renderName = this.getDisplayName();
|
||||
}
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(renderName, (int) this.getX() + 1, (int) this.getY() + 1, this.enabled ? 0xFF55FF55 : 0xFFFF5555);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,10 +60,10 @@ public class ButtonComponent extends HudComponent {
|
|||
|
||||
if (button == 0) {
|
||||
// handle clicking the right click button
|
||||
if (this.rightClickListener != null) {
|
||||
if (this.subComponents > 0) {
|
||||
// is inside button
|
||||
if (mouseX >= this.getX() + this.getW() - 8 && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH()) {
|
||||
this.rightClickListener.onComponentEvent();
|
||||
this.rightClickEnabled = !this.rightClickEnabled;
|
||||
return; // cancel normal action
|
||||
}
|
||||
}
|
||||
|
@ -69,13 +71,6 @@ public class ButtonComponent extends HudComponent {
|
|||
// enable / disable normally
|
||||
|
||||
this.enabled = !this.enabled;
|
||||
|
||||
if (this.mouseClickListener != null)
|
||||
this.mouseClickListener.onComponentEvent();
|
||||
|
||||
} else if (button == 1) {
|
||||
if (this.rightClickListener != null)
|
||||
this.rightClickListener.onComponentEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,14 @@ public final class CarouselComponent extends HudComponent {
|
|||
final String displayValueText = this.getName() + ": " + this.displayValue;
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(displayValueText, (int) this.getX() + 1, (int) this.getY() + 1, this.focused ? 0xFFFFFFFF : 0xFFAAAAAA);
|
||||
|
||||
if (this.subComponents > 0) {
|
||||
final int dotColor = this.rightClickEnabled ? 0xFF6D55FF : (this.focused ? 0x75FFFFFF : 0x75909090);
|
||||
RenderUtil.drawRect(this.getX() + this.getW() - 27, this.getY(), this.getX() + this.getW() - 18, this.getY() + this.getH(), 0xFF101010);
|
||||
RenderUtil.drawRect(this.getX() + this.getW() - 21, this.getY() + this.getH() - 2, this.getX() + this.getW() - 20, this.getY() + this.getH() - 1, dotColor);
|
||||
RenderUtil.drawRect(this.getX() + this.getW() - 23, this.getY() + this.getH() - 2, this.getX() + this.getW() - 22, this.getY() + this.getH() - 1, dotColor);
|
||||
RenderUtil.drawRect(this.getX() + this.getW() - 25, this.getY() + this.getH() - 2, this.getX() + this.getW() - 24, this.getY() + this.getH() - 1, dotColor);
|
||||
}
|
||||
|
||||
RenderUtil.drawRect(this.getX() + this.getW() - 18, this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0xFF101010);
|
||||
RenderUtil.drawTriangle(this.getX() + this.getW() - 14, this.getY() + 4, 3, -90, this.focused ? 0x75FFFFFF : 0x75909090);
|
||||
RenderUtil.drawTriangle(this.getX() + this.getW() - 4, this.getY() + 4, 3, 90, this.focused ? 0x75FFFFFF : 0x75909090);
|
||||
|
@ -59,6 +67,13 @@ public final class CarouselComponent extends HudComponent {
|
|||
if (mouseX >= this.getX() + this.getW() - 18 && mouseX <= this.getX() + this.getW() - 10) {
|
||||
this.declineOption();
|
||||
return true;
|
||||
} else if (mouseX >= this.getX() + this.getW() - 25 && mouseX <= this.getX() + this.getW() - 20) {
|
||||
this.rightClickEnabled = !this.rightClickEnabled;
|
||||
|
||||
if (!this.rightClickEnabled) {
|
||||
this.focused = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ public class ColorComponent extends TextComponent {
|
|||
displayedName = this.displayValue;
|
||||
} else if (customDisplayValue != null) {
|
||||
displayedName = customDisplayValue;
|
||||
} else if (this.getDisplayName() != null) {
|
||||
displayedName = this.getDisplayName();
|
||||
}
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(displayedName, (int) this.getX() + BORDER + COLOR_SIZE + BORDER, (int) this.getY() + BORDER, this.focused ? 0xFFFFFFFF : 0xFFAAAAAA);
|
||||
|
||||
|
|
|
@ -19,10 +19,15 @@ public class HudComponent {
|
|||
private float emptyH;
|
||||
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String tooltipText = "";
|
||||
|
||||
private boolean visible;
|
||||
|
||||
public ComponentListener mouseClickListener, rightClickListener;
|
||||
public boolean rightClickEnabled;
|
||||
public int subComponents = 0;
|
||||
|
||||
private List<Value> valueList = new ArrayList<Value>();
|
||||
|
||||
public HudComponent() {
|
||||
|
@ -76,7 +81,17 @@ public class HudComponent {
|
|||
}
|
||||
|
||||
public void mouseRelease(int mouseX, int mouseY, int button) {
|
||||
if (this.isMouseInside(mouseX, mouseY)) {
|
||||
if (button == 0) {
|
||||
if (this.mouseClickListener != null)
|
||||
this.mouseClickListener.onComponentEvent();
|
||||
} else if (button == 1) {
|
||||
if (this.rightClickListener != null)
|
||||
this.rightClickListener.onComponentEvent();
|
||||
|
||||
this.rightClickEnabled = !this.rightClickEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void keyTyped(char typedChar, int keyCode) {
|
||||
|
@ -165,6 +180,18 @@ public class HudComponent {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
/***
|
||||
* Nullable, use getName if this is not set.
|
||||
* @return
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getTooltipText() {
|
||||
return tooltipText;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,12 @@ public final class SliderComponent extends HudComponent {
|
|||
this.sliderBar.render(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(this.getName(), (int) this.getX() + 1, (int) this.getY() + 1, 0xFFAAAAAA);
|
||||
// draw text
|
||||
String renderName = this.getName();
|
||||
if (this.getDisplayName() != null) {
|
||||
renderName = this.getDisplayName();
|
||||
}
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(renderName, (int) this.getX() + 1, (int) this.getY() + 1, 0xFFAAAAAA);
|
||||
|
||||
String displayedValue = this.decimalFormat.format(this.value.getValue());
|
||||
if (this.sliding) {
|
||||
|
|
|
@ -47,15 +47,20 @@ public class TextComponent extends HudComponent {
|
|||
|
||||
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x45303030);
|
||||
|
||||
final String displayValueText = this.getName() + ": " + this.displayValue;
|
||||
String renderName = this.getName();
|
||||
if (this.getDisplayName() != null) {
|
||||
renderName = this.getDisplayName();
|
||||
}
|
||||
|
||||
final String displayValueText = renderName + ": " + this.displayValue;
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(displayValueText, (int) this.getX() + 1, (int) this.getY() + 1, this.focused ? 0xFFFFFFFF : 0xFFAAAAAA);
|
||||
|
||||
if (this.focused) {
|
||||
if (!this.selectedText.equals("")) {
|
||||
RenderUtil.drawRect(this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(this.getName() + ": "), this.getY(), this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(displayValueText), this.getY() + this.getH(), 0x45FFFFFF);
|
||||
RenderUtil.drawRect(this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(renderName + ": "), this.getY(), this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(displayValueText), this.getY() + this.getH(), 0x45FFFFFF);
|
||||
}
|
||||
|
||||
float blockX = this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(this.getName() + ": " + this.displayValue) + 1;
|
||||
float blockX = this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth(renderName + ": " + this.displayValue) + 1;
|
||||
float blockY = this.getY() + 1;
|
||||
int blockWidth = 2;
|
||||
int blockHeight = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT - 2;
|
||||
|
|
|
@ -83,6 +83,34 @@ public final class RenderUtil {
|
|||
GlStateManager.enableTexture2D();
|
||||
}
|
||||
|
||||
public static void drawSideGradientRect(float left, float top, float right, float bottom, int startColor, int endColor) {
|
||||
float f = (float) (startColor >> 24 & 255) / 255.0F;
|
||||
float f1 = (float) (startColor >> 16 & 255) / 255.0F;
|
||||
float f2 = (float) (startColor >> 8 & 255) / 255.0F;
|
||||
float f3 = (float) (startColor & 255) / 255.0F;
|
||||
float f4 = (float) (endColor >> 24 & 255) / 255.0F;
|
||||
float f5 = (float) (endColor >> 16 & 255) / 255.0F;
|
||||
float f6 = (float) (endColor >> 8 & 255) / 255.0F;
|
||||
float f7 = (float) (endColor & 255) / 255.0F;
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
GlStateManager.shadeModel(7425);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder bufferbuilder = tessellator.getBuffer();
|
||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
bufferbuilder.pos(right, top, 0).color(f1, f2, f3, f).endVertex();
|
||||
bufferbuilder.pos(left, top, 0).color(f4, f5, f6, f4).endVertex();
|
||||
bufferbuilder.pos(left, bottom, 0).color(f4, f5, f6, f4).endVertex();
|
||||
bufferbuilder.pos(right, bottom, 0).color(f1, f2, f3, f).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.shadeModel(7424);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableTexture2D();
|
||||
}
|
||||
|
||||
public static void drawTriangle(float x, float y, float size, float theta, int color) {
|
||||
GL11.glTranslated(x, y, 0);
|
||||
GL11.glRotatef(180 + theta, 0F, 0F, 1.0F);
|
||||
|
|
|
@ -15,10 +15,10 @@ import net.minecraft.util.text.event.HoverEvent;
|
|||
*/
|
||||
public final class FriendCommand extends Command {
|
||||
|
||||
private String[] addAlias = new String[]{"Add", "A"};
|
||||
private String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"};
|
||||
private String[] listAlias = new String[]{"List", "L"};
|
||||
private String[] clearAlias = new String[]{"Clear", "C"};
|
||||
private final String[] addAlias = new String[]{"Add", "A"};
|
||||
private final String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"};
|
||||
private final String[] listAlias = new String[]{"List", "L"};
|
||||
private final String[] clearAlias = new String[]{"Clear", "C"};
|
||||
|
||||
public FriendCommand() {
|
||||
super("Friend", new String[]{"F"}, "Allows you to add or remove friends", "Friend Add <Username>\n" +
|
||||
|
@ -26,6 +26,13 @@ public final class FriendCommand extends Command {
|
|||
"Friend Remove <Username>\n" +
|
||||
"Friend List\n" +
|
||||
"Friend Clear");
|
||||
|
||||
this.setArguments(new String[]{"add", "remove", "list", "clear"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tabComplete(String input) {
|
||||
return super.tabComplete(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,17 +7,22 @@ import me.rigamortis.seppuku.api.gui.hud.component.ComponentListener;
|
|||
import me.rigamortis.seppuku.api.gui.hud.component.HudComponent;
|
||||
import me.rigamortis.seppuku.api.gui.hud.component.ResizableHudComponent;
|
||||
import me.rigamortis.seppuku.api.module.Module;
|
||||
import me.rigamortis.seppuku.api.texture.Texture;
|
||||
import me.rigamortis.seppuku.api.util.ColorUtil;
|
||||
import me.rigamortis.seppuku.api.util.MathUtil;
|
||||
import me.rigamortis.seppuku.api.util.RenderUtil;
|
||||
import me.rigamortis.seppuku.api.value.Value;
|
||||
import me.rigamortis.seppuku.impl.config.HudConfig;
|
||||
import me.rigamortis.seppuku.impl.config.ModuleConfig;
|
||||
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* @author noil
|
||||
|
@ -34,6 +39,15 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
private final int TITLE_BAR_HEIGHT = mc.fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
private ColorComponent currentColorComponent = null;
|
||||
private Texture spectrum;
|
||||
|
||||
private int lastGradientMouseX = -1;
|
||||
private int lastGradientMouseY = -1;
|
||||
private int lastSpectrumMouseX = -1;
|
||||
private int lastSpectrumMouseY = -1;
|
||||
|
||||
public int baseColor = 0xFFFFFFFF;
|
||||
public int selectedColor = 0xFFFFFFFF;
|
||||
|
||||
public ColorsComponent() {
|
||||
super("Colors", 100, 120, 215, 1000);
|
||||
|
@ -43,6 +57,8 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
this.setH(120);
|
||||
this.setX((mc.displayWidth / 2.0f) - (this.getW() / 2));
|
||||
this.setY((mc.displayHeight / 2.0f) - (this.getH() / 2));
|
||||
|
||||
this.spectrum = new Texture("spectrum.jpg");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -153,10 +169,43 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
// draw overlay
|
||||
RenderUtil.drawRect(this.getX() + BORDER, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 1, this.getX() + this.getW() - BORDER, this.getY() + this.getH() - BORDER, 0xCC101010);
|
||||
|
||||
// draw exit button
|
||||
RenderUtil.drawRect(this.getX() + BORDER + 3, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 4, this.getX() + BORDER + 14, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 15, 0xFF101010);
|
||||
RenderUtil.drawRect(this.getX() + BORDER + 4, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 5, this.getX() + BORDER + 13, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 14, 0xFF303030);
|
||||
RenderUtil.drawLine(this.getX() + BORDER + 6, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 12, this.getX() + BORDER + 11, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 7, 1.0f, 0xFFFF0000);
|
||||
RenderUtil.drawLine(this.getX() + BORDER + 6, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 7, this.getX() + BORDER + 11, this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 12, 1.0f, 0xFFFF0000);
|
||||
// draw color
|
||||
RenderUtil.drawRect(this.getX() + (this.getW() / 2) - 10, this.getY() + (this.getH() / 4) - 10, this.getX() + (this.getW() / 2) + 10, this.getY() + (this.getH() / 4) + 10, this.currentColorComponent.getCurrentColor().getRGB());
|
||||
RenderUtil.drawBorderedRect(this.getX() + (this.getW() / 2) - 10, this.getY() + (this.getH() / 4) - 10, this.getX() + (this.getW() / 2) + 10, this.getY() + (this.getH() / 4) + 10, 1.0f, 0x00000000, 0xFFAAAAAA);
|
||||
|
||||
// draw spectrum
|
||||
this.spectrum.bind();
|
||||
this.spectrum.render(this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() / 2 + 10, this.getW() / 2 - this.getW() / 16, this.getH() / 2 - 18);
|
||||
// draw gradients
|
||||
GlStateManager.enableBlend();
|
||||
RenderUtil.drawRect(this.getX() + this.getW() / 4, this.getY() + this.getH() / 2 + 10, this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() - 8, 0xFFFFFFFF);
|
||||
RenderUtil.drawGradientRect(this.getX() + this.getW() / 4, this.getY() + this.getH() / 2 + 10, this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() - 8, 0x00000000, 0xFF000000);
|
||||
RenderUtil.drawSideGradientRect(this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() / 2 + 10, this.getX() + this.getW() / 2 + this.getW() / 4, this.getY() + this.getH() - 8, ColorUtil.changeAlpha(this.baseColor, 0xFF), 0x00000000);
|
||||
GlStateManager.disableBlend();
|
||||
// draw line between spectrum & gradients
|
||||
RenderUtil.drawLine(this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() / 2 + 10, this.getX() + this.getW() / 4 + this.getW() / 16, this.getY() + this.getH() - 8, 1.0f, 0xFF000000);
|
||||
|
||||
// draw selection rects
|
||||
int gradientSelectionColorInt = -1;
|
||||
if (this.lastGradientMouseX != -1 && this.lastGradientMouseY != -1) {
|
||||
gradientSelectionColorInt = (int) MathUtil.map(lastGradientMouseY, this.getY() + this.getH() / 2 + 10, this.getY() + this.getH() - 8, 0x00, 0xFF);
|
||||
final Color gradientSelectionColor = new Color(gradientSelectionColorInt, gradientSelectionColorInt, gradientSelectionColorInt);
|
||||
RenderUtil.drawLine(this.lastGradientMouseX - 1, this.lastGradientMouseY - 1, this.lastGradientMouseX + 1, this.lastGradientMouseY + 1, 1f, gradientSelectionColor.getRGB());
|
||||
RenderUtil.drawLine(this.lastGradientMouseX - 1, this.lastGradientMouseY + 1, this.lastGradientMouseX + 1, this.lastGradientMouseY - 1, 1f, gradientSelectionColor.getRGB());
|
||||
}
|
||||
if (this.lastSpectrumMouseX != -1 && this.lastSpectrumMouseY != -1) {
|
||||
final int spectrumSelectionColorInt = (gradientSelectionColorInt != -1) ? gradientSelectionColorInt : 0x00;
|
||||
final Color spectrumSelectionColor = new Color(spectrumSelectionColorInt, spectrumSelectionColorInt, spectrumSelectionColorInt);
|
||||
RenderUtil.drawLine(this.lastSpectrumMouseX - 1, this.lastSpectrumMouseY - 1, this.lastSpectrumMouseX + 1, this.lastSpectrumMouseY + 1, 1f, spectrumSelectionColor.getRGB());
|
||||
RenderUtil.drawLine(this.lastSpectrumMouseX - 1, this.lastSpectrumMouseY + 1, this.lastSpectrumMouseX + 1, this.lastSpectrumMouseY - 1, 1f, spectrumSelectionColor.getRGB());
|
||||
}
|
||||
|
||||
// draw color data
|
||||
if (this.getW() > 180) {
|
||||
final String hexColor = "#" + Integer.toHexString(this.currentColorComponent.getCurrentColor().getRGB()).toLowerCase().substring(2);
|
||||
final String rgbColor = String.format("r%s g%s b%s", this.currentColorComponent.getCurrentColor().getRed(), this.currentColorComponent.getCurrentColor().getGreen(), this.currentColorComponent.getCurrentColor().getBlue());
|
||||
|
@ -172,12 +221,14 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
|
||||
// Over list
|
||||
if (this.currentColorComponent == null) {
|
||||
if (this.scroll > 6) {
|
||||
RenderUtil.drawGradientRect(this.getX() + BORDER, listTop, this.getX() + this.getW() - SCROLL_WIDTH - BORDER, listTop + 8, 0xFF101010, 0x00000000);
|
||||
}
|
||||
if (this.getH() != this.getTotalHeight() && this.scroll != (this.totalHeight - this.getH())) {
|
||||
RenderUtil.drawGradientRect(this.getX() + BORDER, this.getY() + this.getH() - BORDER - 8, this.getX() + this.getW() - SCROLL_WIDTH - BORDER, this.getY() + this.getH() - BORDER, 0x00000000, 0xFF101010);
|
||||
}
|
||||
}
|
||||
|
||||
// render current color component
|
||||
if (this.currentColorComponent != null) {
|
||||
|
@ -196,20 +247,25 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
|
||||
@Override
|
||||
public void mouseRelease(int mouseX, int mouseY, int button) {
|
||||
final boolean inside = this.isMouseInside(mouseX, mouseY);
|
||||
final boolean insideTitlebar = mouseY <= this.getY() + BORDER + TITLE_BAR_HEIGHT;
|
||||
|
||||
if (this.currentColorComponent != null) {
|
||||
if (this.currentColorComponent.isMouseInside(mouseX, mouseY))
|
||||
if (this.currentColorComponent.isMouseInside(mouseX, mouseY)) {
|
||||
this.currentColorComponent.mouseRelease(mouseX, mouseY, button);
|
||||
else if (!this.isResizeDragging()) {
|
||||
} else if (inside && !insideTitlebar) {
|
||||
final boolean insideExit = mouseX <= this.getX() + BORDER + 14 && mouseY <= this.getY() + BORDER + TITLE_BAR_HEIGHT + 15;
|
||||
if (insideExit) {
|
||||
this.currentColorComponent = null;
|
||||
this.removeSelections();
|
||||
this.baseColor = 0xFFFFFFFF;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.mouseRelease(mouseX, mouseY, button);
|
||||
|
||||
final boolean inside = this.isMouseInside(mouseX, mouseY);
|
||||
final boolean insideTitlebar = mouseY <= this.getY() + BORDER + TITLE_BAR_HEIGHT;
|
||||
|
||||
if (inside && button == 0 && !insideTitlebar) {
|
||||
int offsetY = BORDER;
|
||||
|
||||
|
@ -221,7 +277,7 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
|
||||
final boolean insideComponent = mouseX >= (this.getX() + BORDER) && mouseX <= (this.getX() + this.getW() - BORDER - SCROLL_WIDTH) && mouseY >= (this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 1 + offsetY - this.scroll) && mouseY <= (this.getY() + BORDER + (mc.fontRenderer.FONT_HEIGHT * 2) + 1 + offsetY - this.scroll);
|
||||
if (insideComponent && this.currentColorComponent == null) {
|
||||
ColorComponent colorComponent = new ColorComponent(component.getName() + " " + value.getName(), ((Color) value.getValue()).getRGB(), ChatFormatting.WHITE + "Click to edit");
|
||||
ColorComponent colorComponent = new ColorComponent(component.getName() + " " + value.getName(), ((Color) value.getValue()).getRGB(), ChatFormatting.WHITE + "Edit...");
|
||||
colorComponent.returnListener = new ComponentListener() {
|
||||
@Override
|
||||
public void onComponentEvent() {
|
||||
|
@ -245,7 +301,7 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
|
||||
final boolean insideComponent = mouseX >= (this.getX() + BORDER) && mouseX <= (this.getX() + this.getW() - BORDER - SCROLL_WIDTH) && mouseY >= (this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 1 + offsetY - this.scroll) && mouseY <= (this.getY() + BORDER + (mc.fontRenderer.FONT_HEIGHT * 2) + 1 + offsetY - this.scroll);
|
||||
if (insideComponent && this.currentColorComponent == null) {
|
||||
ColorComponent colorComponent = new ColorComponent(module.getDisplayName() + " " + value.getName(), ((Color) value.getValue()).getRGB(), ChatFormatting.WHITE + "Click to edit");
|
||||
ColorComponent colorComponent = new ColorComponent(module.getDisplayName() + " " + value.getName(), ((Color) value.getValue()).getRGB(), ChatFormatting.WHITE + "Edit...");
|
||||
colorComponent.returnListener = new ComponentListener() {
|
||||
@Override
|
||||
public void onComponentEvent() {
|
||||
|
@ -279,6 +335,52 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
if (insideDragZone) {
|
||||
super.mouseClick(mouseX, mouseY, button);
|
||||
}
|
||||
|
||||
if (this.isDragging() || this.isResizeDragging()) {
|
||||
this.removeSelections();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isMouseInside(mouseX, mouseY) && this.currentColorComponent != null) {
|
||||
final boolean insideSpectrum =
|
||||
mouseX >= this.getX() + this.getW() / 4 + this.getW() / 16 &&
|
||||
mouseY >= this.getY() + this.getH() / 2 + 10 &&
|
||||
mouseX <= this.getX() + this.getW() / 4 + this.getW() / 16 + this.getW() / 2 - this.getW() / 16 &&
|
||||
mouseY <= this.getY() + this.getH() / 2 + 10 + this.getH() / 2 - 18;
|
||||
final boolean insideGradient =
|
||||
mouseX >= this.getX() + this.getW() / 4 &&
|
||||
mouseY >= this.getY() + this.getH() / 2 + 10 &&
|
||||
mouseX <= this.getX() + this.getW() / 4 + this.getW() / 16 &&
|
||||
mouseY <= this.getY() + this.getH() - 8;
|
||||
if (insideGradient || insideSpectrum) {
|
||||
Robot robot = null;
|
||||
try {
|
||||
robot = new Robot();
|
||||
} catch (AWTException e) {
|
||||
Seppuku.INSTANCE.getLogger().log(Level.WARNING, "Could not create robot for " + this.getName());
|
||||
}
|
||||
|
||||
if (robot != null) {
|
||||
PointerInfo pointerInfo = MouseInfo.getPointerInfo();
|
||||
Point point = pointerInfo.getLocation();
|
||||
int mX = (int) point.getX();
|
||||
int mY = (int) point.getY();
|
||||
Color colorAtMouseClick = robot.getPixelColor(mX, mY);
|
||||
if (insideSpectrum) {
|
||||
this.selectedColor = colorAtMouseClick.getRGB();
|
||||
this.currentColorComponent.setCurrentColor(colorAtMouseClick);
|
||||
this.currentColorComponent.returnListener.onComponentEvent();
|
||||
this.currentColorComponent.displayValue = "#" + Integer.toHexString(this.selectedColor).toLowerCase().substring(2);
|
||||
this.lastSpectrumMouseX = mouseX;
|
||||
this.lastSpectrumMouseY = mouseY;
|
||||
} else {
|
||||
this.baseColor = colorAtMouseClick.getRGB();
|
||||
this.lastGradientMouseX = mouseX;
|
||||
this.lastGradientMouseY = mouseY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -305,6 +407,13 @@ public final class ColorsComponent extends ResizableHudComponent {
|
|||
}
|
||||
}
|
||||
|
||||
private void removeSelections() {
|
||||
this.lastGradientMouseX = -1;
|
||||
this.lastGradientMouseY = -1;
|
||||
this.lastSpectrumMouseX = -1;
|
||||
this.lastSpectrumMouseY = -1;
|
||||
}
|
||||
|
||||
public int getScroll() {
|
||||
return scroll;
|
||||
}
|
||||
|
|
|
@ -624,17 +624,15 @@ public final class ModuleListComponent extends ResizableHudComponent {
|
|||
if (otherComponent == component || otherComponent.getName().equals(component.getName()))
|
||||
continue;
|
||||
|
||||
if (otherComponent instanceof ButtonComponent) {
|
||||
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
|
||||
if (isChildComponent) {
|
||||
if (!((ButtonComponent) otherComponent).rightClickEnabled) {
|
||||
if (!otherComponent.rightClickEnabled) {
|
||||
skipRendering = true;
|
||||
}
|
||||
|
||||
offsetX += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (skipRendering)
|
||||
continue;
|
||||
|
@ -646,8 +644,8 @@ public final class ModuleListComponent extends ResizableHudComponent {
|
|||
component.render(mouseX, mouseY, partialTicks);
|
||||
|
||||
if (offsetX > 0) {
|
||||
RenderUtil.drawLine(component.getX() - offsetX + 1, component.getY(), component.getX() - offsetX + 1, component.getY() + component.getH(), 2.0f, 0xFF202020);
|
||||
RenderUtil.drawLine(component.getX() - offsetX + 1, component.getY() + component.getH() / 2, component.getX(), component.getY() + component.getH() / 2, 2.0f, 0xFF202020);
|
||||
RenderUtil.drawLine(component.getX() - offsetX + 1, component.getY(), component.getX() - offsetX + 1, component.getY() + component.getH(), 2.0f, 0x90707070);
|
||||
RenderUtil.drawLine(component.getX() - offsetX + 1.5f, component.getY() + component.getH() / 2, component.getX() - 0.5f, component.getY() + component.getH() / 2, 2.0f, 0x90707070);
|
||||
}
|
||||
|
||||
offsetY += component.getH() + 1;
|
||||
|
@ -688,18 +686,13 @@ public final class ModuleListComponent extends ResizableHudComponent {
|
|||
|
||||
private void addComponentToButtons(HudComponent hudComponent) {
|
||||
for (HudComponent component : this.components) {
|
||||
if (component instanceof ButtonComponent) {
|
||||
if (component == hudComponent)
|
||||
continue;
|
||||
|
||||
boolean similarName = hudComponent.getName().toLowerCase().startsWith(component.getName().toLowerCase());
|
||||
if (similarName) {
|
||||
if (((ButtonComponent) component).rightClickListener == null) {
|
||||
((ButtonComponent) component).rightClickListener = new ComponentListener() {
|
||||
@Override
|
||||
public void onComponentEvent() {
|
||||
((ButtonComponent) component).rightClickEnabled = !((ButtonComponent) component).rightClickEnabled;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
component.subComponents++;
|
||||
hudComponent.setDisplayName(hudComponent.getName().substring(component.getName().length()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public final class PatchManager {
|
|||
this.patchList.add(new ChunkPatch());
|
||||
this.patchList.add(new GuiScreenPatch());
|
||||
this.patchList.add(new RenderGlobalPatch());
|
||||
this.patchList.add(new GuiChatPatch());
|
||||
|
||||
//load custom external patches
|
||||
//TODO this needs more testing
|
||||
|
|
|
@ -28,9 +28,18 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
|||
*/
|
||||
public final class BurrowModule extends Module {
|
||||
|
||||
public enum Mode {
|
||||
JUMP, GLITCH, TP
|
||||
}
|
||||
|
||||
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"m"}, "The current mode to use.", Mode.JUMP);
|
||||
public final Value<Float> glitchY = new Value<>("ModeGlitchY", new String[]{"mgy", "glitchy"}, "Using GLITCH mode, this will be your player's motionY.", 0.5f, 0.1f, 1.5f, 0.1f);
|
||||
public final Value<Integer> tpHeight = new Value<>("ModeTPHeight", new String[]{"mtph", "mth", "tpheight", "tpy"}, "Using TP mode, this will be how many blocks above the player to TP.", 5, 1, 10, 1);
|
||||
|
||||
public final Value<Float> delay = new Value<>("Delay", new String[]{"del", "d"}, "Delay(ms) to wait for placing obsidian after the initial jump.", 200.0f, 1.0f, 500.0f, 1.0f);
|
||||
public final Value<Boolean> rotate = new Value<>("Rotate", new String[]{"rot", "r"}, "Rotate the players head to place the block.", true);
|
||||
public final Value<Boolean> center = new Value<Boolean>("Center", new String[]{"centered", "c", "cen"}, "Centers the player on their current block when beginning to place.", false);
|
||||
public final Value<Boolean> offGround = new Value<Boolean>("OffGround", new String[]{"offg", "og", "o"}, "Forces player onGround to false when enabled.", true);
|
||||
|
||||
private final Timer timer = new Timer();
|
||||
private final RotationTask rotationTask = new RotationTask("BurrowTask", 9); // 9 == high priority
|
||||
|
@ -99,8 +108,21 @@ public final class BurrowModule extends Module {
|
|||
// get our block pos to place at
|
||||
final BlockPos positionToPlaceAt = new BlockPos(mc.player.getPositionVector()).down();
|
||||
if (this.place(positionToPlaceAt, mc)) { // we've attempted to place the block
|
||||
if (this.offGround.getValue()) {
|
||||
mc.player.onGround = false; // set onground to false
|
||||
}
|
||||
|
||||
switch (this.mode.getValue()) {
|
||||
case JUMP:
|
||||
mc.player.jump(); // attempt another jump to flag ncp
|
||||
break;
|
||||
case GLITCH:
|
||||
mc.player.motionY = this.glitchY.getValue();
|
||||
break;
|
||||
case TP:
|
||||
mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY - this.tpHeight.getValue(), mc.player.posZ, mc.player.onGround));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// swap back to original
|
||||
|
|
|
@ -3,14 +3,22 @@ package me.rigamortis.seppuku.impl.module.hidden;
|
|||
import me.rigamortis.seppuku.Seppuku;
|
||||
import me.rigamortis.seppuku.api.command.Command;
|
||||
import me.rigamortis.seppuku.api.event.minecraft.EventKeyPress;
|
||||
import me.rigamortis.seppuku.api.event.player.EventChatKeyTyped;
|
||||
import me.rigamortis.seppuku.api.event.player.EventSendChatMessage;
|
||||
import me.rigamortis.seppuku.api.event.render.EventRender2D;
|
||||
import me.rigamortis.seppuku.api.gui.hud.component.HudComponent;
|
||||
import me.rigamortis.seppuku.api.module.Module;
|
||||
import me.rigamortis.seppuku.api.util.RenderUtil;
|
||||
import me.rigamortis.seppuku.api.value.Value;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiChat;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Author Seth
|
||||
* 4/16/2019 @ 8:44 AM.
|
||||
|
@ -18,6 +26,9 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
|||
public final class CommandsModule extends Module {
|
||||
|
||||
public final Value<String> prefix = new Value("Prefix", new String[]{"prefx", "pfx"}, "The command prefix.", ".");
|
||||
public final Value<Boolean> predictions = new Value("Predictions", new String[]{"predict", "pre"}, "Renders command predictions on the screen (WIP).", false);
|
||||
|
||||
private final Set<String> predictedCommands = new LinkedHashSet<>();
|
||||
|
||||
public CommandsModule() {
|
||||
super("Commands", new String[]{"cmds", "cmd"}, "Allows you to execute client commands", "NONE", -1, ModuleType.HIDDEN);
|
||||
|
@ -25,6 +36,80 @@ public final class CommandsModule extends Module {
|
|||
this.toggle();
|
||||
}
|
||||
|
||||
@Listener
|
||||
public void onRender2D(EventRender2D event) {
|
||||
if (!this.predictions.getValue())
|
||||
return;
|
||||
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.player != null) {
|
||||
if (mc.currentScreen instanceof GuiChat) {
|
||||
int height = 0;
|
||||
|
||||
//final String input = ((GuiChat) mc.currentScreen).inputField.getText();
|
||||
|
||||
for (String cmd : this.predictedCommands) {
|
||||
final HudComponent predictionComponent = new HudComponent(2, event.getScaledResolution().getScaledHeight() - 24 - height, 4 + mc.fontRenderer.getStringWidth(cmd), mc.fontRenderer.FONT_HEIGHT);
|
||||
RenderUtil.drawRect(predictionComponent.getX(), predictionComponent.getY(), predictionComponent.getX() + predictionComponent.getW(), predictionComponent.getY() + predictionComponent.getH(), 0xFF101010);
|
||||
mc.fontRenderer.drawStringWithShadow(cmd, predictionComponent.getX() + 2, predictionComponent.getY(), 0xFF9900EE);
|
||||
height += mc.fontRenderer.FONT_HEIGHT + 1;
|
||||
}
|
||||
} else {
|
||||
this.predictedCommands.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Listener
|
||||
public void onChatKeyTyped(EventChatKeyTyped event) {
|
||||
if (!this.predictions.getValue())
|
||||
return;
|
||||
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.player != null) {
|
||||
if (mc.currentScreen instanceof GuiChat) {
|
||||
if (event.getKeyCode() == 15) { // tab
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
final int prefixLength = this.prefix.getValue().length();
|
||||
String input = ((GuiChat) mc.currentScreen).inputField.getText();
|
||||
|
||||
if (Character.isLetter(event.getTypedChar()) && !Character.isSpaceChar(event.getTypedChar())) {
|
||||
input += event.getTypedChar();
|
||||
}
|
||||
|
||||
if (input.startsWith(this.prefix.getValue())) {
|
||||
if (input.length() > prefixLength) {
|
||||
input = input.substring(prefixLength);
|
||||
}
|
||||
|
||||
Command similarCommand = null;
|
||||
|
||||
this.populateCommands(input);
|
||||
if (this.predictedCommands.size() > 0) {
|
||||
for (String cmd : this.predictedCommands) {
|
||||
similarCommand = Seppuku.INSTANCE.getCommandManager().findSimilar(cmd);
|
||||
if (similarCommand != null) {
|
||||
if (event.getKeyCode() == 15) {
|
||||
((GuiChat) mc.currentScreen).inputField.setText(this.prefix.getValue() + similarCommand.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (similarCommand != null) {
|
||||
if (input.length() > similarCommand.getDisplayName().length()) {
|
||||
if (this.matches(input, similarCommand.getDisplayName())) {
|
||||
this.populateArguments(similarCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Listener
|
||||
public void keyPress(EventKeyPress event) {
|
||||
if (this.prefix.getValue().length() == 1) {
|
||||
|
@ -63,6 +148,36 @@ public final class CommandsModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
private void populateCommands(String input) {
|
||||
this.predictedCommands.clear();
|
||||
|
||||
for (Command cmd : Seppuku.INSTANCE.getCommandManager().getCommandList()) {
|
||||
if (this.matches(input, cmd.getDisplayName())) {
|
||||
this.predictedCommands.add(cmd.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void populateArguments(Command command) {
|
||||
for (Command cmd : Seppuku.INSTANCE.getCommandManager().getCommandList()) {
|
||||
if (!cmd.getDisplayName().equalsIgnoreCase(command.getDisplayName()))
|
||||
continue;
|
||||
|
||||
if (cmd.getArguments() == null) {
|
||||
Seppuku.INSTANCE.getNotificationManager().addNotification("Command Error", "Command has no arguments to tab complete.");
|
||||
continue;
|
||||
}
|
||||
|
||||
//if (matches(split[1], arg)) {
|
||||
//}
|
||||
this.predictedCommands.addAll(Arrays.asList(cmd.getArguments()));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean matches(String input, String cmd) {
|
||||
return cmd.toLowerCase().startsWith(input.toLowerCase());
|
||||
}
|
||||
|
||||
public Value<String> getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ public final class ProjectilesModule extends Module {
|
|||
private final Queue<Vec3d> flightPoint = new ConcurrentLinkedQueue<>();
|
||||
|
||||
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "Width"}, "Pixel width of the projectile path.", 1.0f, 0.1f, 5.0f, 0.1f);
|
||||
public final Value<Color> color = new Value<Color>("Path Color", new String[]{"pathcolor", "color", "c", "pc"}, "Change the color of the predicted path.", new Color(255, 255, 255));
|
||||
public final Value<Integer> alpha = new Value<Integer>("Path Alpha", new String[]{"pathalpha", "opacity", "a", "o", "pa", "po"}, "Alpha value for the predicted path.", 255, 1, 255, 1);
|
||||
public final Value<Color> color = new Value<Color>("PathColor", new String[]{"color", "c", "pc"}, "Change the color of the predicted path.", new Color(255, 255, 255));
|
||||
public final Value<Integer> alpha = new Value<Integer>("PathAlpha", new String[]{"opacity", "a", "o", "pa", "po"}, "Alpha value for the predicted path.", 255, 1, 255, 1);
|
||||
|
||||
public ProjectilesModule() {
|
||||
super("Projectiles", new String[]{"Proj"}, "Projects the possible path of an entity that was fired.", "NONE", -1, ModuleType.RENDER);
|
||||
|
|
|
@ -29,12 +29,16 @@ public final class TracersModule extends Module {
|
|||
|
||||
public final Value<Boolean> players = new Value<Boolean>("Players", new String[]{"Player"}, "Choose to enable on players.", true);
|
||||
public final Value<Color> playersColor = new Value<Color>("PlayersColor", new String[]{"playerscolor", "pc"}, "Change the color of player tracer lines.", new Color(255, 68, 68));
|
||||
|
||||
public final Value<Boolean> mobs = new Value<Boolean>("Mobs", new String[]{"Mob"}, "Choose to enable on mobs.", true);
|
||||
public final Value<Color> mobsColor = new Value<Color>("MobsColor", new String[]{"mobscolor", "mc"}, "Change the color of mob tracer lines.", new Color(255, 170, 0));
|
||||
|
||||
public final Value<Boolean> animals = new Value<Boolean>("Animals", new String[]{"Animal"}, "Choose to enable on animals.", true);
|
||||
public final Value<Color> animalsColor = new Value<Color>("AnimalsColor", new String[]{"animalscolor", "ac"}, "Change the color of animal tracer lines.", new Color(0, 255, 68));
|
||||
|
||||
public final Value<Boolean> vehicles = new Value<Boolean>("Vehicles", new String[]{"Vehic", "Vehicle"}, "Choose to enable on vehicles.", true);
|
||||
public final Value<Color> vehiclesColor = new Value<Color>("VehiclesColor", new String[]{"vehiclescolor", "vc"}, "Change the color of vehicle tracer lines.", new Color(213, 255, 0));
|
||||
|
||||
public final Value<Boolean> items = new Value<Boolean>("Items", new String[]{"Item"}, "Choose to enable on items.", true);
|
||||
public final Value<Color> itemsColor = new Value<Color>("ItemsColor", new String[]{"itemscolor", "ic"}, "Change the color of item tracer lines.", new Color(0, 255, 170));
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package me.rigamortis.seppuku.impl.patch;
|
||||
|
||||
import me.rigamortis.seppuku.Seppuku;
|
||||
import me.rigamortis.seppuku.api.event.player.EventChatKeyTyped;
|
||||
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
||||
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
||||
import me.rigamortis.seppuku.impl.management.PatchManager;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.tree.*;
|
||||
|
||||
import static org.objectweb.asm.Opcodes.*;
|
||||
|
||||
/**
|
||||
* Author Seth
|
||||
* 12/23/2019 @ 4:29 AM.
|
||||
*/
|
||||
public final class GuiChatPatch extends ClassPatch {
|
||||
|
||||
public GuiChatPatch() {
|
||||
super("net.minecraft.client.gui.GuiChat", "bkn");
|
||||
}
|
||||
|
||||
@MethodPatch(
|
||||
mcpName = "keyTyped",
|
||||
notchName = "a",
|
||||
mcpDesc = "(CI)V")
|
||||
public void keyTyped(MethodNode methodNode, PatchManager.Environment env) {
|
||||
final InsnList insnList = new InsnList();
|
||||
insnList.add(new VarInsnNode(ILOAD, 1));
|
||||
insnList.add(new VarInsnNode(ILOAD, 2));
|
||||
insnList.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(this.getClass()), "keyTypedHook", "(CI)Z", false));
|
||||
final LabelNode jmp = new LabelNode();
|
||||
insnList.add(new JumpInsnNode(IFEQ, jmp));
|
||||
insnList.add(new InsnNode(RETURN));
|
||||
insnList.add(jmp);
|
||||
methodNode.instructions.insert(insnList);
|
||||
}
|
||||
|
||||
public static boolean keyTypedHook(char typedChar, int keyCode) {
|
||||
final EventChatKeyTyped event = new EventChatKeyTyped(typedChar, keyCode);
|
||||
Seppuku.INSTANCE.getEventManager().dispatchEvent(event);
|
||||
return event.isCanceled();
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -118,3 +118,4 @@ public net.minecraft.network.play.client.CPacketCloseWindow field_149556_a
|
|||
public net.minecraft.network.play.server.SPacketCloseWindow field_148896_a # windowId
|
||||
public net.minecraft.network.play.server.SPacketSetSlot field_149179_a # windowId
|
||||
public net.minecraft.network.play.server.SPacketSetSlot field_149177_b # slot
|
||||
public net.minecraft.client.gui.GuiChat field_146415_a # inputField
|
||||
|
|
Loading…
Reference in New Issue