Skip to content

Commit

Permalink
add chroma, opaque block outlines, and config descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolij committed Jul 11, 2024
1 parent d922e28 commit 16d0dca
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,100 +20,155 @@ public class NolijiumConfigImpl implements Cloneable {

//region Options
@ZsonField(comment = """
Removes darkness and all client-side lighting calculations, resulting in a decent performance boost on some systems.
May cause issues with shaders, dynamic lighting, and light overlay mods.
DEFAULT: `false`""")
public boolean enableGamma = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideAllToasts = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideAdvancementToasts = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideRecipeToasts = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideSystemToasts = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideTutorialToasts = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean hideParticles = false;

@ZsonField(comment = """
DEFAULT: `[ ]`""")
public ArrayList<String> hideParticlesByID = new ArrayList<>();

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean disableTextureAnimations = false;

@ZsonField(comment = """
DEFAULT: `false`""")
public boolean revertDamageCameraTilt = false;

@ZsonField(comment = """
Changes the number of messages kept in chat history (100 in vanilla).
DEFAULT: `100`""")
public int maxChatHistory = 100;

@ZsonField(comment = """
If enabled, a HUD will be drawn on the screen showing useful performance statistics.
DEFAULT: `false`""")
public boolean hudEnabled = false;

@ZsonField(comment = """
The horizontal alignment of the HUD.
OPTIONS: `LEFT`, `RIGHT`
DEFAULT: `LEFT`""")
public Alignment.X hudAlignmentX = Alignment.X.LEFT;

@ZsonField(comment = """
The vertical alignment of the HUD.
OPTIONS: `TOP`, `BOTTOM`
DEFAULT: `TOP`""")
public Alignment.Y hudAlignmentY = Alignment.Y.TOP;

@ZsonField(comment = """
The HUD will be offset this many pixels horizontally from the screen edge.
DEFAULT: `5`""")
public int hudMarginX = 5;

@ZsonField(comment = """
The HUD will be offset this many pixels vertically from the screen edge.
DEFAULT: `5`""")
public int hudMarginY = 5;

@ZsonField(comment = """
If enabled, a background will be drawn behind HUD text.
DEFAULT: `true`""")
public boolean hudBackground = true;

@ZsonField(comment = """
If enabled, HUD text will be drawn with a shadow.
DEFAULT: `true`""")
public boolean hudShadow = true;

@ZsonField(comment = """
The HUD refresh rate (in ticks). `0` will refresh it every frame.
Lower values may reduce performance.
DEFAULT: `5`""")
public int hudRefreshRateTicks = 5;

@ZsonField(comment = """
Determines much information about FPS should be displayed in the HUD.
OPTIONS:
`NONE`: No FPS information will be displayed in the HUD.
`SIMPLE`: HUD will display a simple, accurate FPS value.
`EXTENDED`: HUD will display FPS, as well as a MIN (0.1% low), MAX (high), and AVG (average) FPS value.
DEFAULT: `SIMPLE`""")
public DetailLevel hudShowFPS = DetailLevel.SIMPLE;

@ZsonField(comment = """
The amount of frame time history to keep (in seconds).
Larger values will result in smoother average values, at the cost of higher memory usage if average FPS is very high.
Only applicable if `hudShowFPS` is set to `EXTENDED`.
DEFAULT: `10.0`""")
public double hudFrameTimeBufferSize = 10D;

@ZsonField(comment = """
If enabled, the HUD will show CPU usage.
DEFAULT: `false`""")
public boolean hudShowCPU = false;

@ZsonField(comment = """
If enabled, the HUD will show Memory usage.
DEFAULT: `false`""")
public boolean hudShowMemory = false;

@ZsonField(comment = """
If enabled, the HUD will show the player's coordinates.
DEFAULT: `false`""")
public boolean hudShowCoordinates = false;

@ZsonField(comment = """
Reverts the fix for MC-26678.
DEFAULT: `false`""")
public boolean revertDamageCameraTilt = false;

@ZsonField(comment = """
Removes transparency from block outlines.
DEFAULT: `false`""")
public boolean enableOpaqueBlockOutlines = false;

@ZsonField(comment = """
Disables animations for water, lava, fire, etc.
DEFAULT: `false`""")
public boolean disableTextureAnimations = false;

@ZsonField(comment = """
Disables all toast messages.
DEFAULT: `false`""")
public boolean hideAllToasts = false;

@ZsonField(comment = """
Disables toast messages for receiving Advancements.
DEFAULT: `false`""")
public boolean hideAdvancementToasts = false;

@ZsonField(comment = """
Disables toast messages for unlocking Recipes.
DEFAULT: `false`""")
public boolean hideRecipeToasts = false;

@ZsonField(comment = """
Disables toasts for System messages.
DEFAULT: `false`""")
public boolean hideSystemToasts = false;

@ZsonField(comment = """
Disables the Tutorial.
DEFAULT: `false`""")
public boolean hideTutorialToasts = false;

@ZsonField(comment = """
Prevents all particles from rendering.
DEFAULT: `false`""")
public boolean hideParticles = false;

@ZsonField(comment = """
Prevents specific particles from rendering based on their ID. For example, `minecraft:block`.
Also supports modded particles.
DEFAULT: `[ ]`""")
public ArrayList<String> hideParticlesByID = new ArrayList<>();

@ZsonField(comment = """
Higher values cycle faster. Lower values cycle slower.
DEFAULT: `0.5`""")
public double chromaSpeed = 0.5D;

@ZsonField(comment = """
Enable Chroma on block outlines.
DEFAULT: `false`""")
public boolean enableChromaBlockOutlines = false;

@ZsonField(comment = """
Enable Chroma on tooltip outlines.
DEFAULT: `false`""")
public boolean enableChromaToolTips = false;
//endregion

private static final int EXPECTED_VERSION = 1;
Expand Down
78 changes: 42 additions & 36 deletions api/src/main/resources/assets/nolijium/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,67 @@
{
"nolijium.utilities": "Utilities",
"nolijium.options.enable_gamma.name": "Enable Gamma Brightness",
"nolijium.options.enable_gamma.tooltip": "",
"nolijium.options.max_chat_history.name": "Max Chat History Size",
"nolijium.options.max_chat_history.tooltip": "",
"nolijium.messages": "%d Messages",
"nolijium.options.enable_gamma.tooltip": "Removes darkness and all client-side lighting calculations, resulting in a decent performance boost on some systems.\nMay cause issues with shaders, dynamic lighting, and light overlay mods.",
"nolijium.options.max_chat_history.name": "Maximum Chat History Size",
"nolijium.options.max_chat_history.tooltip": "Changes the number of messages kept in chat history (100 in vanilla).",
"nolijium.messages": "%d messages",
"nolijium.unlimited": "Unlimited",
"nolijium.options.hud_enabled.name": "Enable HUD",
"nolijium.options.hud_enabled.tooltip": "",
"nolijium.options.hud_enabled.tooltip": "If enabled, a HUD will be drawn on the screen showing useful performance statistics.",
"nolijium.options.hud_alignment_x.name": "HUD X Alignment",
"nolijium.options.hud_alignment_x.tooltip": "",
"nolijium.options.hud_alignment_x.tooltip": "The horizontal alignment of the HUD.",
"nolijium.options.hud_alignment_y.name": "HUD Y Alignment",
"nolijium.options.hud_alignment_y.tooltip": "",
"nolijium.options.hud_alignment_y.tooltip": "The vertical alignment of the HUD.",
"nolijium.options.hud_margin_x.name": "HUD X Margin",
"nolijium.options.hud_margin_x.tooltip": "",
"nolijium.options.hud_margin_x.tooltip": "The HUD will be offset this many pixels horizontally from the screen edge.",
"nolijium.options.hud_margin_y.name": "HUD Y Margin",
"nolijium.options.hud_margin_y.tooltip": "",
"nolijium.options.hud_margin_y.tooltip": "The HUD will be offset this many pixels vertically from the screen edge.",
"nolijium.pixels": "%dpx",
"nolijium.options.hud_background.name": "Draw Background Behind HUD",
"nolijium.options.hud_background.tooltip": "",
"nolijium.options.hud_shadow.name": "Enable Shadow for HUD Text",
"nolijium.options.hud_shadow.tooltip": "",
"nolijium.options.hud_background.name": "HUD Background",
"nolijium.options.hud_background.tooltip": "If enabled, a background will be drawn behind HUD text.",
"nolijium.options.hud_shadow.name": "HUD Text Shadow",
"nolijium.options.hud_shadow.tooltip": "If enabled, HUD text will be drawn with a shadow.",
"nolijium.options.hud_refresh_rate_ticks.name": "HUD Refresh Rate",
"nolijium.options.hud_refresh_rate_ticks.tooltip": "",
"nolijium.options.hud_refresh_rate_ticks.tooltip": "The HUD will refresh its contents this often. The \"I paid for the whole CPU\" option will refresh it every frame.\nLower values may reduce performance.",
"nolijium.ticks": "%d tick(s)",
"nolijium.every_frame": "I paid for the whole CPU",
"nolijium.options.hud_show_fps.name": "Show FPS in HUD",
"nolijium.options.hud_show_fps.tooltip": "",
"nolijium.none": "None",
"nolijium.simple": "Simple",
"nolijium.extended": "Extended",
"nolijium.options.hud_show_fps.name": "HUD FPS Display",
"nolijium.options.hud_show_fps.tooltip": "Determines much information about FPS should be displayed in the HUD.\nNONE: No FPS information will be displayed in the HUD.\nSIMPLE: HUD will display a simple, accurate FPS value.\nEXTENDED: HUD will display FPS, as well as a MIN (0.1% low), MAX (high), and AVG (average) FPS value.",
"nolijium.options.hud_frame_time_buffer_size.name": "Frame Time Buffer Size",
"nolijium.options.hud_frame_time_buffer_size.tooltip": "",
"nolijium.options.hud_frame_time_buffer_size.tooltip": "The amount of frame time history to keep (in seconds).\nLarger values will result in smoother average values, at the cost of higher memory usage if average FPS is very high.\nOnly applicable if HUD FPS Display is set to EXTENDED.",
"nolijium.seconds": "%d second(s)",
"nolijium.options.hud_show_cpu.name": "Show CPU Usage in HUD",
"nolijium.options.hud_show_cpu.tooltip": "",
"nolijium.options.hud_show_memory.name": "Show Memory Usage in HUD",
"nolijium.options.hud_show_memory.tooltip": "",
"nolijium.options.hud_show_coordinates.name": "Show Coordinates in HUD",
"nolijium.options.hud_show_coordinates.tooltip": "",
"nolijium.options.hud_show_cpu.name": "HUD CPU Usage Display",
"nolijium.options.hud_show_cpu.tooltip": "If enabled, the HUD will show CPU usage.",
"nolijium.options.hud_show_memory.name": "HUD Memory Usage Display",
"nolijium.options.hud_show_memory.tooltip": "If enabled, the HUD will show Memory usage.",
"nolijium.options.hud_show_coordinates.name": "HUD Coordinates Display",
"nolijium.options.hud_show_coordinates.tooltip": "If enabled, the HUD will show the player's coordinates.",
"nolijium.toggles": "Toggles",
"nolijium.options.revert_damage_camera_tilt.name": "Revert Damage Tilt Fix",
"nolijium.options.revert_damage_camera_tilt.tooltip": "",
"nolijium.options.revert_damage_camera_tilt.tooltip": "Reverts the fix for MC-26678.",
"nolijium.options.enable_opaque_block_outlines.name": "Enable Opaque Block Outlines",
"nolijium.options.enable_opaque_block_outlines.tooltip": "Removes transparency from block outlines.",
"nolijium.options.disable_block_animations.name": "Disable Texture Animations",
"nolijium.options.disable_block_animations.tooltip": "",
"nolijium.options.disable_block_animations.tooltip": "Disables animations for water, lava, fire, etc.",
"nolijium.options.disable_all_toasts.name": "Disable All Toasts",
"nolijium.options.disable_all_toasts.tooltip": "",
"nolijium.options.disable_all_toasts.tooltip": "Disables all toast messages.",
"nolijium.options.disable_advancement_toasts.name": "Disable Advancement Toasts",
"nolijium.options.disable_advancement_toasts.tooltip": "",
"nolijium.options.disable_advancement_toasts.tooltip": "Disables toast messages for receiving Advancements.",
"nolijium.options.disable_recipe_toasts.name": "Disable Recipe Toasts",
"nolijium.options.disable_recipe_toasts.tooltip": "",
"nolijium.options.disable_recipe_toasts.tooltip": "Disables toast messages for unlocking Recipes.",
"nolijium.options.disable_system_toasts.name": "Disable System Toasts",
"nolijium.options.disable_system_toasts.tooltip": "",
"nolijium.options.disable_system_toasts.tooltip": "Disables toasts for System messages.",
"nolijium.options.disable_tutorial_toasts.name": "Disable Tutorial Toasts",
"nolijium.options.disable_tutorial_toasts.tooltip": "",
"nolijium.options.disable_tutorial_toasts.tooltip": "Disables the Tutorial.",
"nolijium.particles": "Particles",
"nolijium.options.disable_particles.name": "Disable All Particles",
"nolijium.options.disable_particles.tooltip": "",
"nolijium.particle_id": "Enable %s particles"
"nolijium.options.disable_particles.name": "Hide Particles",
"nolijium.options.disable_particles.tooltip": "Prevents all particles from rendering.",
"nolijium.particle_id": "Allow %s particles.",
"nolijium.chroma": "Chroma",
"nolijium.options.chroma_speed.name": "Chroma Speed",
"nolijium.options.chroma_speed.tooltip": "Higher values cycle faster. Lower values cycle slower.",
"nolijium.options.enable_chroma_block_outlines.name": "Enable Chroma Block Outlines",
"nolijium.options.enable_chroma_block_outlines.tooltip": "Enable Chroma on block outlines.",
"nolijium.options.enable_chroma_tooltips.name": "Enable Chroma Tool Tips",
"nolijium.options.enable_chroma_tooltips.tooltip": "Enable Chroma on tool tips."
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void acceptEvent(OptionGUIConstructionEvent event) {
final List<OptionGroup> utilitiesPage = new ArrayList<>();
final List<OptionGroup> togglesPage = new ArrayList<>();
final List<OptionGroup> particlesPage = new ArrayList<>();
final List<OptionGroup> chromaPage = new ArrayList<>();

utilitiesPage.add(OptionGroup.createBuilder()
.setId(id("utilities"))
Expand Down Expand Up @@ -194,6 +195,13 @@ public void acceptEvent(OptionGUIConstructionEvent event) {
(config, value) -> config.revertDamageCameraTilt = value,
config -> config.revertDamageCameraTilt)
.build())
.add(OptionImpl.createBuilder(boolean.class, storage)
.setId(id("enable_opaque_block_outlines", boolean.class))
.setControl(TickBoxControl::new)
.setBinding(
(config, value) -> config.enableOpaqueBlockOutlines = value,
config -> config.enableOpaqueBlockOutlines)
.build())
.add(OptionImpl.createBuilder(boolean.class, storage)
.setId(id("disable_block_animations", boolean.class))
.setControl(TickBoxControl::new)
Expand Down Expand Up @@ -285,6 +293,32 @@ else if (value && present)

particlesPage.add(particlesByIdBuilder.build());

chromaPage.add(OptionGroup.createBuilder()
.setId(id("chroma"))
.add(OptionImpl.createBuilder(int.class, storage)
.setId(id("chroma_speed", int.class))
.setControl(option ->
new SliderControl(option, 1, 30, 1, v -> Component.literal("%.1f".formatted(v * 0.1D))))
.setBinding(
(config, value) -> config.chromaSpeed = value * 0.1D,
config -> (int) (config.chromaSpeed * 10))
.build())
.add(OptionImpl.createBuilder(boolean.class, storage)
.setId(id("enable_chroma_block_outlines", boolean.class))
.setControl(TickBoxControl::new)
.setBinding(
(config, value) -> config.enableChromaBlockOutlines = value,
config -> config.enableChromaBlockOutlines)
.build())
.add(OptionImpl.createBuilder(boolean.class, storage)
.setId(id("enable_chroma_tooltips", boolean.class))
.setControl(TickBoxControl::new)
.setBinding(
(config, value) -> config.enableChromaToolTips = value,
config -> config.enableChromaToolTips)
.build())
.build());

event.getPages().add(new OptionPage(
id("utilities"),
Component.translatable("nolijium.utilities"),
Expand All @@ -300,6 +334,11 @@ else if (value && present)
Component.translatable("nolijium.particles"),
ImmutableList.copyOf(particlesPage)
));
event.getPages().add(new OptionPage(
id("chroma"),
Component.translatable("nolijium.chroma"),
ImmutableList.copyOf(chromaPage)
));
}

}
Loading

0 comments on commit 16d0dca

Please sign in to comment.