mirror of
https://github.com/Miasmusa/Shadow.git
synced 2024-11-25 08:47:51 -05:00
performance + theme update
we been rendering the hud twice this entire time lmfao
This commit is contained in:
parent
af5292a4b4
commit
45713942a9
3 changed files with 56 additions and 49 deletions
|
@ -11,33 +11,40 @@ public class SipoverV1 implements Theme {
|
|||
return "Sipover V1";
|
||||
}
|
||||
|
||||
static Color accent = new Color(0x3AD99D),
|
||||
header = new Color(0xFF1D2525, true),
|
||||
module = new Color(0xFF171E1F, true),
|
||||
config = new Color(0xFF111A1A, true),
|
||||
active = new Color(21, 157, 204, 255),
|
||||
inactive = new Color(66, 66, 66, 255);
|
||||
|
||||
@Override
|
||||
public Color getAccent() {
|
||||
return new Color(0xc7f4ff);
|
||||
return accent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getHeader() {
|
||||
return new Color(0xFF1D2525, true);
|
||||
return header;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getModule() {
|
||||
return new Color(0xFF171E1F, true);
|
||||
return module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getConfig() {
|
||||
return new Color(0xFF111A1A, true);
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getActive() {
|
||||
return new Color(200, 200, 225, 255);
|
||||
return active;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getInactive() {
|
||||
return new Color(80, 80, 80, 255);
|
||||
return inactive;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ import java.net.http.HttpRequest;
|
|||
import java.net.http.HttpResponse;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -87,6 +86,7 @@ public class HomeScreen extends AntiAliasedScreen implements FastTickable {
|
|||
public void resize(MinecraftClient client, int width, int height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
clearChildren();
|
||||
initWidgets();
|
||||
}
|
||||
|
||||
|
|
|
@ -143,48 +143,48 @@ public class Hud extends Module {
|
|||
|
||||
@Override
|
||||
public void onHudRender() {
|
||||
if (CoffeeClientMain.client.getNetworkHandler() == null) {
|
||||
return;
|
||||
}
|
||||
if (CoffeeClientMain.client.player == null) {
|
||||
return;
|
||||
}
|
||||
MatrixStack ms = Renderer.R3D.getEmptyMatrixStack();
|
||||
double heightOffsetLeft = 0, heightOffsetRight = 0;
|
||||
if (CoffeeClientMain.client.options.debugEnabled) {
|
||||
double heightAccordingToMc = 9;
|
||||
List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetLeftText();
|
||||
List<String> rt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetRightText();
|
||||
heightOffsetLeft = 2 + heightAccordingToMc * (lt.size() + 3);
|
||||
heightOffsetRight = 2 + heightAccordingToMc * rt.size() + 5;
|
||||
}
|
||||
if (!shouldNoConnectionDropDown()) {
|
||||
if (serverNotResponding != null) {
|
||||
serverNotResponding.duration = 0;
|
||||
}
|
||||
} else {
|
||||
if (serverNotResponding == null) {
|
||||
serverNotResponding = Notification.create(-1, "", true, "Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived));
|
||||
}
|
||||
serverNotResponding.contents = new String[]{"Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived)};
|
||||
}
|
||||
if (!NotificationRenderer.topBarNotifications.contains(serverNotResponding)) {
|
||||
serverNotResponding = null;
|
||||
}
|
||||
makeSureIsInitialized();
|
||||
|
||||
if (modules.getValue()) {
|
||||
ms.push();
|
||||
ms.translate(0, heightOffsetRight, 0);
|
||||
drawModuleList(ms);
|
||||
ms.pop();
|
||||
}
|
||||
ms.push();
|
||||
ms.translate(0, heightOffsetLeft, 0);
|
||||
drawTopLeft(ms);
|
||||
ms.pop();
|
||||
|
||||
HudRenderer.getInstance().render();
|
||||
// if (CoffeeClientMain.client.getNetworkHandler() == null) {
|
||||
// return;
|
||||
// }
|
||||
// if (CoffeeClientMain.client.player == null) {
|
||||
// return;
|
||||
// }
|
||||
// MatrixStack ms = Renderer.R3D.getEmptyMatrixStack();
|
||||
// double heightOffsetLeft = 0, heightOffsetRight = 0;
|
||||
// if (CoffeeClientMain.client.options.debugEnabled) {
|
||||
// double heightAccordingToMc = 9;
|
||||
// List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetLeftText();
|
||||
// List<String> rt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetRightText();
|
||||
// heightOffsetLeft = 2 + heightAccordingToMc * (lt.size() + 3);
|
||||
// heightOffsetRight = 2 + heightAccordingToMc * rt.size() + 5;
|
||||
// }
|
||||
// if (!shouldNoConnectionDropDown()) {
|
||||
// if (serverNotResponding != null) {
|
||||
// serverNotResponding.duration = 0;
|
||||
// }
|
||||
// } else {
|
||||
// if (serverNotResponding == null) {
|
||||
// serverNotResponding = Notification.create(-1, "", true, "Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived));
|
||||
// }
|
||||
// serverNotResponding.contents = new String[]{"Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived)};
|
||||
// }
|
||||
// if (!NotificationRenderer.topBarNotifications.contains(serverNotResponding)) {
|
||||
// serverNotResponding = null;
|
||||
// }
|
||||
// makeSureIsInitialized();
|
||||
//
|
||||
// if (modules.getValue()) {
|
||||
// ms.push();
|
||||
// ms.translate(0, heightOffsetRight, 0);
|
||||
// drawModuleList(ms);
|
||||
// ms.pop();
|
||||
// }
|
||||
// ms.push();
|
||||
// ms.translate(0, heightOffsetLeft, 0);
|
||||
// drawTopLeft(ms);
|
||||
// ms.pop();
|
||||
//
|
||||
// HudRenderer.getInstance().render();
|
||||
}
|
||||
|
||||
void drawTopLeft(MatrixStack ms) {
|
||||
|
|
Loading…
Reference in a new issue