Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Coccocoahelper authored Jun 22, 2024
1 parent ec04646 commit 7c5efdd
Show file tree
Hide file tree
Showing 69 changed files with 463 additions and 554 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
<img src="https://img.shields.io/github/languages/top/Kopamed/Raven-bPLUS" alt="Java"/>
</p>

##### Discontinued due to lack of time, motivation, and because I no longer play.

Raven b+ is built on top of Raven b3, adding quality of life improvements, bug fixes, and much more.<br>
Discord:<br>
<a href="https://discord.gg/QQMQfCRyNP"><img src="https://invidget.switchblade.xyz/QQMQfCRyNP" alt="https://discord.gg/QQMQfCRyNP"/></a><br>
Backup: <br>
<a href="https://discord.gg/XhVt9NMtBE"><img src="https://invidget.switchblade.xyz/XhVt9NMtBE" alt="https://discord.gg/XhVt9NMtBE"/></a><br>
Raven bLITE is built on top of Raven B+, removing all unneeded features.<br>

# Installation
## User
Expand All @@ -42,7 +36,6 @@ Backup: <br>
https://imgur.com/a/X3G5R6W

## Known bugs
- Discord RPC don't work on DARWIN (Mac OS)
- Basically 100 other bugs which are minor but are also getting fixed.

## Improved Modules
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ compileJava {

dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
compile fileTree(dir: "lib", include: "discord-rpc.jar")
compile fileTree(dir: "lib")
}


Expand Down
10 changes: 5 additions & 5 deletions src/main/java/keystrokesmod/client/clickgui/raven/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ClickGui() {
Module.ModuleCategory[] values;
int categoryAmount = (values = Module.ModuleCategory.values()).length;

for(int category = 0; category < categoryAmount; ++category) {
for (int category = 0; category < categoryAmount; ++category) {
Module.ModuleCategory moduleCategory = values[category];
CategoryComponent currentModuleCategory = new CategoryComponent(moduleCategory);
currentModuleCategory.setY(topOffset);
Expand Down Expand Up @@ -74,7 +74,7 @@ public void drawScreen(int x, int y, float p) {

float speed = 4890;

if(latestVersion.isNewerThan(clientVersion)){
if (latestVersion.isNewerThan(clientVersion)) {
int margin = 2;
int rows = 1;
for (int i = Raven.updateText.length-1; i >= 0; i--) {
Expand Down Expand Up @@ -117,7 +117,7 @@ public void mouseClicked(int x, int y, int mouseButton) throws IOException {
Iterator<CategoryComponent> btnCat = categoryList.iterator();

terminal.mouseDown(x, y, mouseButton);
if(terminal.overPosition(x, y)) return;
if (terminal.overPosition(x, y)) return;

while(true) {
CategoryComponent category;
Expand Down Expand Up @@ -152,7 +152,7 @@ public void mouseClicked(int x, int y, int mouseButton) throws IOException {

public void mouseReleased(int x, int y, int s) {
terminal.mouseReleased(x, y, s);
if(terminal.overPosition(x, y)) return;
if (terminal.overPosition(x, y)) return;

if (s == 0) {
Iterator<CategoryComponent> btnCat = categoryList.iterator();
Expand Down Expand Up @@ -181,7 +181,7 @@ public void mouseReleased(int x, int y, int s) {
}
}
}
if(Raven.clientConfig != null){
if (Raven.clientConfig != null) {
Raven.clientConfig.saveConfig();
}
}
Expand Down
102 changes: 51 additions & 51 deletions src/main/java/keystrokesmod/client/clickgui/raven/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Terminal implements Component {
private double windowStartDragY;
private double mouseStartDragX;
private double mouseStartDragY;
public Terminal(){
public Terminal() {
this.x = 0;
this.y = 0;
this.width = 300;
Expand All @@ -60,17 +60,17 @@ public static void clearTerminal() {
out.clear();
}

public void show(){
public void show() {
this.hidden = false;
}

public void hide(){
public void hide() {
this.hidden = true;
}

@Override
public void draw() {
if(hidden) return;
if (hidden) return;

//this.barHeight = mc.displayHeight / 90;
double desiredTextSize = barHeight * 0.65;
Expand Down Expand Up @@ -107,7 +107,7 @@ public void draw() {
0xff2D3742
);

if(opened){
if (opened) {
Gui.drawRect(x,
y + barHeight,
x + width,
Expand Down Expand Up @@ -162,7 +162,7 @@ public void draw() {
false
);

if(opened) {
if (opened) {
ArrayList<String> currentOut = new ArrayList<>(out);
currentOut.add(prefix + inputText);
String currentLine;
Expand All @@ -172,7 +172,7 @@ public void draw() {
for (int j = currentOut.size() - 1; j >= end; j--) {
currentLine = currentOut.get(j);
String[] splitUpLine = splitUpLine(currentLine, maxTextWidth, scaleFactor);
for(int i = splitUpLine.length - 1; i >= 0; i--){
for (int i = splitUpLine.length - 1; i >= 0; i--) {
if (linesPrinted >= maxLines) {
break;
}
Expand All @@ -198,14 +198,14 @@ public void draw() {
topMargin,
new Color(32,194,14).getRGB()
);
if(currentLine.startsWith(finalInputLine))
if (currentLine.startsWith(finalInputLine))
cursorY = (int) (topMargin / coordFactor);
}


}
GL11.glPopMatrix();
if(opened){
if (opened) {
Gui.drawRect(
cursorX,
cursorY,
Expand All @@ -217,12 +217,12 @@ public void draw() {
}

private String[] splitUpLine(String currentLine, float maxTextWidth, double scaleSize) {
if(fr.getStringWidth(currentLine) * scaleSize <= maxTextWidth){
if (fr.getStringWidth(currentLine) * scaleSize <= maxTextWidth) {
return new String[] {currentLine};
} else {
for(int i = currentLine.length(); i >= 0; i--){
for (int i = currentLine.length(); i >= 0; i--) {
String newLine = currentLine.substring(0, i);
if(fr.getStringWidth(newLine) * scaleSize <= maxTextWidth){
if (fr.getStringWidth(newLine) * scaleSize <= maxTextWidth) {
return mergeArray(
new String[]{newLine},
splitUpLine(currentLine.substring(i, currentLine.length()), maxTextWidth, scaleSize)
Expand All @@ -245,11 +245,11 @@ public static String[] mergeArray(String[] arr1, String[] arr2)

@Override
public void update(int x, int y) {
if(hidden) return;
if(dragging){
if (hidden) return;
if (dragging) {
this.x = (int) (windowStartDragX + (x - mouseStartDragX));
this.y = (int) (windowStartDragY + (y - mouseStartDragY));
} else if(resizing){
} else if (resizing) {
int newWidth = Math.max(x, this.x + minWidth) - this.x;
int newHeight = Math.max(y, this.y + minHeight) - this.y;
this.width = newWidth;
Expand All @@ -260,75 +260,75 @@ public void update(int x, int y) {
@Override
public void mouseDown(int x, int y, int b) {
focused = false;
if(hidden) return;
if(overToggleButton(x, y) && b == 0){
if (hidden) return;
if (overToggleButton(x, y) && b == 0) {
this.opened = !opened;
}
else if(overBar(x, y)){
if(b == 0){
else if (overBar(x, y)) {
if (b == 0) {
dragging = true;
mouseStartDragX = x;
mouseStartDragY = y;
windowStartDragX = this.x;
windowStartDragY = this.y;
} else if(b==1){
} else if (b==1) {
this.opened = !opened;
}
} else if (overResize(x, y) && b == 0){
} else if (overResize(x, y) && b == 0) {
this.resizing = true;
} else if(overWindow(x, y) && b == 0){
} else if (overWindow(x, y) && b == 0) {
this.focused = true;
}
}

@Override
public void mouseReleased(int x, int y, int m) {
if(hidden) return;
if(dragging){
if (hidden) return;
if (dragging) {
dragging = false;
} else if (resizing){
} else if (resizing) {
resizing = false;
}
}

@Override
public void keyTyped(char t, int k) {
if(!focused) return;
if (!focused) return;

if(k == 28){ //enter
if (k == 28) { //enter
out.add(prefix + inputText);
proccessInput();
inputText = "";
backCharsCursor=0;
} else if(k == 14){ //backspace
if(inputText.substring(0, inputText.length() - backCharsCursor).length() > 0){
if(backCharsCursor == 0){
} else if (k == 14) { //backspace
if (inputText.substring(0, inputText.length() - backCharsCursor).length() > 0) {
if (backCharsCursor == 0) {
inputText = inputText.substring(0, inputText.length() - 1);
} else {
String deletable = inputText.substring(0, inputText.length() - backCharsCursor);
String appendable = inputText.substring(inputText.length() - backCharsCursor, inputText.length());
if(deletable.length() > 0){
if (deletable.length() > 0) {
deletable = deletable.substring(0, deletable.length() - 1);
}
inputText = deletable + appendable;
}
}
} else if(k == 15){ // tab
} else if (k == 15) { // tab
addCharToInput(" ");
} else if(k == 203){
if(backCharsCursor < inputText.length()){
} else if (k == 203) {
if (backCharsCursor < inputText.length()) {
backCharsCursor++;
}
} else if(k == 205){
if(backCharsCursor > 0){
} else if (k == 205) {
if (backCharsCursor > 0) {
backCharsCursor--;
}
} else {
if (!containsElement(acceptableKeycodes, k)) {
return;
}
String e = String.valueOf(t);
if(!e.isEmpty())
if (!e.isEmpty())
addCharToInput(e);
}
//up arrow 200
Expand All @@ -341,15 +341,15 @@ public void keyTyped(char t, int k) {
}

private boolean containsElement(int[] acceptableKeycodes, int k) {
for(int i : acceptableKeycodes){
if(i == k)
for (int i : acceptableKeycodes) {
if (i == k)
return true;
}
return false;
}

private void addCharToInput(String e){
if(backCharsCursor == 0){
private void addCharToInput(String e) {
if (backCharsCursor == 0) {
inputText += e;
} else {
String deletable = inputText.substring(0, inputText.length() - backCharsCursor);
Expand All @@ -366,7 +366,7 @@ private void proccessInput() {
String[] args = hasArgs ? inputText.substring(command.length() + 1, inputText.length()).split(" ") : new String[0];

Raven.commandManager.executeCommand(command, args);
} catch (IndexOutOfBoundsException fuck){}
} catch (IndexOutOfBoundsException fuck) {}

}
}
Expand All @@ -381,34 +381,34 @@ public int getHeight() {
return height;
}

public boolean overPosition(int x, int y){
if(hidden) return false;
public boolean overPosition(int x, int y) {
if (hidden) return false;
return opened ? overWindow(x, y) : overBar(x, y);
}

public boolean overBar(int x, int y){
public boolean overBar(int x, int y) {
return x >= this.x && x <= this.x + width && y >= this.y && y <= this.y + barHeight;
}

public boolean overWindow(int x, int y){
if(!opened) return false;
public boolean overWindow(int x, int y) {
if (!opened) return false;
return x >= this.x && x <= this.x + width && y >= this.y && y <= this.y + height;
}

public boolean overResize(int x, int y){
public boolean overResize(int x, int y) {
return x >= this.x + width - resizeButtonSize && x <= this.x + width && y >= this.y + height - resizeButtonSize && y <= this.y + height;
}

public boolean overToggleButton(int x, int y){
public boolean overToggleButton(int x, int y) {
return x >= this.x + width - barHeight && x <= this.x + width && y >= this.y && y <= this.y + barHeight;
}

public void setLocation(int x, int y){
public void setLocation(int x, int y) {
this.x = x;
this.y = y;
}

public void setSize(int width, int height){
public void setSize(int width, int height) {
this.width = width;
this.height = height;
}
Expand Down
Loading

0 comments on commit 7c5efdd

Please sign in to comment.