Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show HUD In Editor #5077

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
machiecodes marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading