Skip to content

Add night vision presets - #5

Open
FrCynda wants to merge 4 commits into
MarioS271:mainfrom
FrCynda:presets
Open

FrCynda wants to merge 4 commits into
MarioS271:mainfrom
FrCynda:presets

Conversation

@FrCynda

@FrCynda FrCynda commented Aug 24, 2026

Copy link
Copy Markdown

Adds five presets: Slow adaptation, Adaptive, Always, Never, and Custom.

Moving the sliders switches to Custom. Default is Always, so current behaviour stays the same.

Based on the curve PR.

AI helped fix a small bug where preset selection was resetting auto_nv.

FrCynda added 4 commits August 24, 2026 03:32
Night vision is all-or-nothing today: the toggle drops you straight into the
full potion effect. This makes it a curve instead - a lit strength, a dark
strength, the light level counted as lit, an exponent for the shape, and a
fade speed. VisionHandler recomputes the target every client tick and eases
towards it; a GameRenderer mixin returns that value from the night vision
scale so the vignette follows it.

Off by default (nv_curve = false), so nothing changes unless you turn it on.

The Forge mixin block in build.forge.gradle.kts was commented out because
there were no mixins to build a refmap from - there is one now, so it goes
back in.

scripts/NightVisionCurveCheck.java is a plain javac/java -ea check for the
curve maths, including the hand-edited-config values the sliders cannot reach.
Sliders for the five curve values plus the toggle, with English, German and
Austrian strings.
Five curve values is a lot to ask of someone who just wants the mod to work.
The preset dropdown covers the useful combinations and moves the sliders into
an Advanced subcategory underneath; touching a slider reads back as Custom.

Always is the mod's current behaviour, so the default preset is what everyone
already has.

The preset applies in the saving runnable rather than in its own save consumer:
Cloth saves entries in order and cascades into subcategories, so the Advanced
sliders would otherwise write their unchanged values back over it.
@MarioS271 MarioS271 self-assigned this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants