Skip to content

Commit

Permalink
Uploaded June-July m6 release with compiled .jar
Browse files Browse the repository at this point in the history
  • Loading branch information
plaincube committed Jul 4, 2022
1 parent 47656ee commit 046e6df
Show file tree
Hide file tree
Showing 2,858 changed files with 13,018 additions and 13,242 deletions.
Binary file added DefiantCE 2022 m6 June-July.zip
Binary file not shown.
420 changes: 420 additions & 0 deletions m6/2022/june-july/eclipse/.metadata/.log

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

public class drpc {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.Hero.clickgui.util;

import java.awt.Color;

//Deine Imports
import bastion.defiant.Defiant;

/**
* Made by HeroCode
* it's free to use
* but you have to credit me
*
* @author HeroCode
*/
public class ColorUtil {

public static Color getClickGUIColor(){
return new Color((int)Defiant.instance.settingsManager.getSettingByName("GuiRed").getValDouble(), (int)Defiant.instance.settingsManager.getSettingByName("GuiGreen").getValDouble(), (int)Defiant.instance.settingsManager.getSettingByName("GuiBlue").getValDouble());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package bastion.defiantce.extensions;

public class DiscordRP {

public boolean running = true;
private long created = 0;

public void start() {

this.created = System.currentTimeMillis();

DiscordEventHandlers

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package de.Hero.clickgui.elements;

import de.Hero.clickgui.ClickGUI;
import de.Hero.clickgui.elements.menu.ElementComboBox;
import de.Hero.clickgui.util.FontUtil;
import de.Hero.settings.Setting;

/**
* Made by HeroCode
* it's free to use
* but you have to credit me
*
* @author HeroCode
*/
public class Element {
public ClickGUI clickgui;
public ModuleButton parent;
public Setting set;
public double offset;
public double x;
public double y;
public double width;
public double height;

public String setstrg;

public boolean comboextended;

public void setup(){
clickgui = parent.parent.clickgui;
}

public void update(){
/*
* Richtig positionieren! Offset wird von ClickGUI aus bestimmt, sodass
* nichts ineinander gerendert wird
*/
x = parent.x + parent.width + 2;
y = parent.y + offset;
width = parent.width + 10;
height = 15;

/*
* Title der Box bestimmen und falls n�tig die Breite der CheckBox
* erweitern
*/
String sname = set.getName();
if(set.isCheck()){
setstrg = sname.substring(0, 1).toUpperCase() + sname.substring(1, sname.length());
double textx = x + width - FontUtil.getStringWidth(setstrg);
if (textx < x + 13) {
width += (x + 13) - textx + 1;
}
}else if(set.isCombo()){
height = comboextended ? set.getOptions().size() * (FontUtil.getFontHeight() + 2) + 15 : 15;

setstrg = sname.substring(0, 1).toUpperCase() + sname.substring(1, sname.length());
int longest = FontUtil.getStringWidth(setstrg);
for (String s : set.getOptions()) {
int temp = FontUtil.getStringWidth(s);
if (temp > longest) {
longest = temp;
}
}
double textx = x + width - longest;
if (textx < x) {
width += x - textx + 1;
}
}else if(set.isSlider()){
setstrg = sname.substring(0, 1).toUpperCase() + sname.substring(1, sname.length());
String displayval = "" + Math.round(set.getValDouble() * 100D)/ 100D;
String displaymax = "" + Math.round(set.getMax() * 100D)/ 100D;
double textx = x + width - FontUtil.getStringWidth(setstrg) - FontUtil.getStringWidth(displaymax) - 4;
if (textx < x) {
width += x - textx + 1;
}
}
}

public void drawScreen(int mouseX, int mouseY, float partialTicks) {}

public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
return isHovered(mouseX, mouseY);
}

public void mouseReleased(int mouseX, int mouseY, int state) {}

public boolean isHovered(int mouseX, int mouseY)
{

return mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
package de.Hero.clickgui.elements;

import java.awt.Color;
import java.io.IOException;
import java.util.ArrayList;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;

import org.lwjgl.input.Keyboard;

import de.Hero.clickgui.Panel;
import de.Hero.clickgui.elements.menu.ElementCheckBox;
import de.Hero.clickgui.elements.menu.ElementComboBox;
import de.Hero.clickgui.elements.menu.ElementSlider;
import de.Hero.clickgui.util.ColorUtil;
import de.Hero.clickgui.util.FontUtil;
import de.Hero.settings.Setting;
import me.gamrboy4life.paradox.Paradox;
import me.gamrboy4life.paradox.module.Module;

//Deine Imports

/**
* Made by HeroCode
* it's free to use
* but you have to credit me
*
* @author HeroCode
*/
public class ModuleButton {
public Module mod;
public ArrayList<Element> menuelements;
public Panel parent;
public double x;
public double y;
public double width;
public double height;
public boolean extended = false;
public boolean listening = false;

/*
* Konstrukor
*/
public ModuleButton(Module imod, Panel pl) {
mod = imod;
height = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 2;
parent = pl;
menuelements = new ArrayList<Element>();
/*
* Settings wurden zuvor in eine ArrayList eingetragen
* dieses SettingSystem hat 3 Konstruktoren je nach
* verwendetem Konstruktor �ndert sich die Value
* bei .isCheck() usw. so kann man ganz einfach ohne
* irgendeinen Aufwand bestimmen welches Element
* f�r ein Setting ben�tigt wird :>
*/
if (Paradox.instance.settingsManager.getSettingsByMod(imod) != null)
for (Setting s : Paradox.instance.settingsManager.getSettingsByMod(imod)) {
if (s.isCheck()) {
menuelements.add(new ElementCheckBox(this, s));
} else if (s.isSlider()) {
menuelements.add(new ElementSlider(this, s));
} else if (s.isCombo()) {
menuelements.add(new ElementComboBox(this, s));
}
}

}

/*
* Rendern des Elements
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
Color temp = ColorUtil.getClickGUIColor();
int color = new Color(temp.getRed(), temp.getGreen(), temp.getBlue(), 150).getRGB();

/*
* Ist das Module an, wenn ja dann soll
* #ein neues Rechteck in Gr��e des Buttons den Knopf als Toggled kennzeichnen
* #sich der Text anders f�rben
*/
int textcolor = 0xffafafaf;
if (mod.isToggled()) {
Gui.drawRect(x - 2, y, x + width + 2, y + height + 1, color);
textcolor = 0xffefefef;
}

/*
* Ist die Maus �ber dem Element, wenn ja dann soll der Button sich anders f�rben
*/
if (isHovered(mouseX, mouseY)) {
Gui.drawRect(x - 2, y, x + width + 2, y + height + 1, 0x55111111);
}

/*
* Den Namen des Modules in die Mitte (x und y) rendern
*/
FontUtil.drawTotalCenteredStringWithShadow(mod.getName(), x + width / 2, y + 1 + height / 2, textcolor);
}

/*
* 'true' oder 'false' bedeutet hat der Nutzer damit interagiert und
* sollen alle anderen Versuche der Interaktion abgebrochen werden?
*/
public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
if (!isHovered(mouseX, mouseY))
return false;

/*
* Rechtsklick, wenn ja dann Module togglen,
*/
if (mouseButton == 0) {
mod.toggle();

if(Paradox.instance.settingsManager.getSettingByName("Sound").getValBoolean())
Minecraft.getMinecraft().thePlayer.playSound("random.click", 0.5f, 0.5f);
} else if (mouseButton == 1) {
/*
* Wenn ein Settingsmenu existiert dann sollen alle Settingsmenus
* geschlossen werden und dieses ge�ffnet/geschlossen werden
*/
if (menuelements != null && menuelements.size() > 0) {
boolean b = !this.extended;
Paradox.instance.clickGUI.closeAllSettings();
this.extended = b;

if(Paradox.instance.settingsManager.getSettingByName("Sound").getValBoolean())
if(extended)Minecraft.getMinecraft().thePlayer.playSound("tile.piston.out", 1f, 1f);else Minecraft.getMinecraft().thePlayer.playSound("tile.piston.in", 1f, 1f);
}
} else if (mouseButton == 2) {
/*
* MidClick => Set keybind (wait for next key)
*/
listening = true;
}
return true;
}

public boolean keyTyped(char typedChar, int keyCode) throws IOException {
/*
* Wenn listening, dann soll der n�chster Key (abgesehen 'ESCAPE') als Keybind f�r mod
* danach soll nicht mehr gewartet werden!
*/
if (listening) {
if (keyCode != Keyboard.KEY_ESCAPE) {
//Client.sendChatMessage("Bound '" + mod.getName() + "'" + " to '" + Keyboard.getKeyName(keyCode) + "'");
mod.setKey(keyCode);;
} else {
//Client.sendChatMessage("Unbound '" + mod.getName() + "'");
mod.setKey(Keyboard.KEY_NONE);;
}
listening = false;
return true;
}
return false;
}

public boolean isHovered(int mouseX, int mouseY) {
return mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
}

}
Loading

0 comments on commit 046e6df

Please sign in to comment.