Skip to content

Commit

Permalink
Show HUD In Editor
Browse files Browse the repository at this point in the history
Adds a setting to always show the minecraft hud when using the meteor hud editor
  • Loading branch information
machiecodes committed Jan 1, 2025
1 parent 967d584 commit d0f7265
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import meteordevelopment.meteorclient.gui.tabs.Tabs;
import meteordevelopment.meteorclient.systems.Systems;
import meteordevelopment.meteorclient.systems.config.Config;
import meteordevelopment.meteorclient.systems.hud.screens.HudEditorScreen;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.misc.DiscordPresence;
Expand Down Expand Up @@ -182,6 +183,10 @@ private void onOpenScreen(OpenScreenEvent event) {
}

wasWidgetScreen = event.screen instanceof WidgetScreen;

if (!GuiThemes.get().showHUDInEditor()) return;
if (!(event.screen instanceof HudEditorScreen)) return;
mc.options.hudHidden = false;
}

public static Identifier identifier(String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ public WidgetScreen proxiesScreen() {

public abstract boolean hideHUD();

public abstract boolean showHUDInEditor();

public double textWidth(String text, int length, boolean title) {
return scale(textRenderer().getWidth(text, length, false) * (title ? TITLE_TEXT_SCALE : 1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ public class MeteorGuiTheme extends GuiTheme {
.build()
);

public final Setting<Boolean> showInEditor = sgGeneral.add(new BoolSetting.Builder()
.name("show-in-editor")
.description("Show the HUD when using the Meteor HUD editor.")
.defaultValue(false)
.visible(hideHUD::get)
.build()
);

// Colors

public final Setting<SettingColor> accentColor = color("accent", "Main color of the GUI.", new SettingColor(145, 61, 226));
Expand Down Expand Up @@ -377,6 +385,11 @@ public boolean hideHUD() {
return hideHUD.get();
}

@Override
public boolean showHUDInEditor() {
return showInEditor.get();
}

public class ThreeStateColorSetting {
private final Setting<SettingColor> normal, hovered, pressed;

Expand Down

0 comments on commit d0f7265

Please sign in to comment.