Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/main/java/com/cleanroommc/modularui/ModularUIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,55 @@
@Config(modid = ModularUI.ID)
public class ModularUIConfig {

@Config.LangKey("modularui2.config.default_scroll_speed")
@Config.Comment("Amount of pixels scrolled")
@Config.RangeInt(min = 1, max = 100)
public static int defaultScrollSpeed = 30;

@Config.LangKey("modularui2.config.smooth_progress_bar")
@Config.Comment("If progress bar should step in texture pixels or screen pixels. (Screen pixels are way smaller and therefore smoother)")
public static boolean smoothProgressBar = false;

// Default direction
@Config.LangKey("modularui2.config.tooltip_pos")
@Config.Comment("Default tooltip position around the widget or its panel.")
public static RichTooltip.Pos tooltipPos = RichTooltip.Pos.NEXT_TO_MOUSE;

@Config.LangKey("modularui2.config.esc_restore_last_text")
@Config.Comment("If true, pressing ESC key in the text field will restore the last text instead of confirming current one.")
public static boolean escRestoreLastText = false;

@Config.LangKey("modularui2.config.show_slot_overlay")
@Config.Comment("If true, display the slot overlay when the slot is occupied.")
public static boolean showSlotOverlay = true;

@Config.LangKey("modularui2.config.gui_debug_mode")
@Config.Comment("If true, widget outlines and widget information will be drawn.")
public static boolean guiDebugMode = ModularUI.isDevEnv;

@Config.LangKey("modularui2.config.use_dark_theme_by_default")
@Config.Comment("If true and not specified otherwise, screens will try to use the 'vanilla_dark' theme.")
public static boolean useDarkThemeByDefault = false;

@Config.LangKey("modularui2.config.debug_text_color")
@Config.Comment("Debug text color. Prefix Hex values with a #. Common colors can be referred by their name.")
public static String debugTextColor = "#FFAAAAAA";

@Config.LangKey("modularui2.config.debug_outline_color")
@Config.Comment("Debug outline color. Prefix Hex values with a #. Common colors can be referred by their name.")
public static String debugOutlineColor = "#DCB42873";

@Config.LangKey("modularui2.config.enable_test_guis")
@Config.RequiresMcRestart
@Config.Comment("Enables a test block, test item with a test gui and opening a gui by right clicking a diamond.")
public static boolean enableTestGuis = ModularUI.isDevEnv;

@Config.LangKey("modularui2.config.enable_test_overlays")
@Config.RequiresMcRestart
@Config.Comment("Enables a test overlay shown on title screen and watermark shown on every GuiContainer.")
public static boolean enableTestOverlays = false;

//@Config.LangKey("modularui2.config.use_rich_tooltips")
//@Config.Comment("If true, vanilla tooltip will be replaced with MUI's RichTooltip")
//public static boolean replaceVanillaTooltips = false;
}
26 changes: 26 additions & 0 deletions src/main/resources/assets/modularui2/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,29 @@ modularui2.debug.slot_number=§7Slot Number: §3%d
modularui2.debug.shift_click_priority=§7Shift-Click Priority: §3%d
modularui2.debug.disabled=§cDISABLED
modularui2.debug.hovered=§7Hovered: §6%s

# Config
modularui2.config.default_scroll_speed=Scroll Speed
modularui2.config.default_scroll_speed.tooltip=Amount of pixels scrolled
modularui2.config.smooth_progress_bar=Smooth Progress Bar
modularui2.config.smooth_progress_bar.tooltip=If progress bar should step in texture pixels or screen pixels.\n(Screen pixels are way smaller and therefore smoother)
modularui2.config.tooltip_pos=Tooltip Position
modularui2.config.tooltip_pos.tooltip=Default tooltip position around the widget or its panel.
modularui2.config.esc_restore_last_text=ESC Restores Last Text
modularui2.config.esc_restore_last_text.tooltip=If true, pressing ESC key in the text field will restore the last text instead of confirming current one.
modularui2.config.show_slot_overlay=Show Slot Overlay
modularui2.config.show_slot_overlay.tooltip=If true, display the slot overlay when the slot is occupied.
modularui2.config.gui_debug_mode=GUI Debug Mode
modularui2.config.gui_debug_mode.tooltip=If true, widget outlines and widget information will be drawn.
modularui2.config.use_dark_theme_by_default=Use Dark Theme By Default
modularui2.config.use_dark_theme_by_default.tooltip=If true and not specified otherwise, screens will try to use the 'vanilla_dark' theme.
modularui2.config.debug_text_color=Debug Text Color
modularui2.config.debug_text_color.tooltip=Debug text color. Prefix Hex values with a #. Common colors can be referred by their name.
modularui2.config.debug_outline_color=Debug Outline Color
modularui2.config.debug_outline_color.tooltip=Debug outline color. Prefix Hex values with a #. Common colors can be referred by their name.
modularui2.config.enable_test_guis=Enable Test GUIs
modularui2.config.enable_test_guis.tooltip=Enables a test block, test item with a test gui and opening a gui by right clicking a diamond.
modularui2.config.enable_test_overlays=Enable Test Overlays
modularui2.config.enable_test_overlays.tooltip=Enables a test overlay shown on title screen and watermark shown on every GuiContainer.
# modularui2.config.use_rich_tooltips=Enable RichTooltip
# modularui2.config.use_rich_tooltips.tooltip=If true, vanilla tooltip will be replaced with MUI's RichTooltip

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the commented-out lines?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the usage is also commented

//@Config.LangKey("modularui2.config.use_rich_tooltips")
//@Config.Comment("If true, vanilla tooltip will be replaced with MUI's RichTooltip")
//public static boolean replaceVanillaTooltips = false;

/* TODO this currently doesnt work when NEI is installed
@Inject(method = "renderToolTip", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;drawHoveringText(Ljava/util/List;IILnet/minecraft/client/gui/FontRenderer;)V"), cancellable = true)
public void drawItemTooltip(ItemStack stack, int x, int y, CallbackInfo ci, @Local List<String> textLines) {
if (ModularUIConfig.replaceVanillaTooltips && !textLines.isEmpty()) {
RichTooltip.injectRichTooltip(stack, textLines, x, y);
// Canceling vanilla tooltip rendering
ci.cancel();
}
}
@Inject(method = "drawHoveringText", at = @At("HEAD"), cancellable = true, remap = false)
public void drawTooltip(List<String> textLines, int x, int y, FontRenderer font, CallbackInfo ci) {
if (ModularUIConfig.replaceVanillaTooltips && !textLines.isEmpty()) {
RichTooltip.injectRichTooltip(null, textLines, x, y);
// Canceling vanilla tooltip rendering
ci.cancel();
}
}*/