Skip to content

Commit

Permalink
Debug GUI: start at bottom, fix reset, bump LibGUI
Browse files Browse the repository at this point in the history
  • Loading branch information
tal5 committed Jun 5, 2023
1 parent b58b9ba commit cc8789b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ archives_base_name = clientizen

# Dependencies
fabric_version=0.76.0+1.19.4
libgui_version=7.0.0-beta.2+1.19.4
libgui_version=7.1.0+1.19.4
denizencore_version=1.91.0-SNAPSHOT
snakeyaml_version=1.33
devauth_version=1.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.denizenscript.clientizen.mixin.gui.WScrollPanelAccessor;
import com.denizenscript.clientizen.mixin.gui.WTextAccessor;
import io.github.cottonmc.cotton.gui.GuiDescription;
import io.github.cottonmc.cotton.gui.client.BackgroundPainter;
import io.github.cottonmc.cotton.gui.widget.WPlainPanel;
import io.github.cottonmc.cotton.gui.widget.WScrollBar;
Expand All @@ -11,7 +12,7 @@
import io.github.cottonmc.cotton.gui.widget.data.Color;
import io.github.cottonmc.cotton.gui.widget.data.InputResult;
import io.github.cottonmc.cotton.gui.widget.data.Insets;
import net.fabricmc.fabric.api.client.networking.v1.ClientLoginConnectionEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.fabricmc.fabric.api.util.TriState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.Window;
Expand All @@ -24,7 +25,7 @@ public class DebugConsole extends WScrollPanel {
public static StringBuilder debugText = new StringBuilder();

static {
ClientLoginConnectionEvents.DISCONNECT.register((handler, client) -> {
ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> {
debugText = new StringBuilder();
});
}
Expand Down Expand Up @@ -68,6 +69,12 @@ public void onClose() {
textArea = null;
}

@Override
public void validate(GuiDescription description) {
super.validate(description);
verticalScrollBar.setValue(verticalScrollBar.getMaxScrollValue());
}

public static class CustomScrollBar extends WScrollBar {

public int scrollSpeed;
Expand Down

0 comments on commit cc8789b

Please sign in to comment.