Skip to content

feat(goggles_overlay): add new overlay tooltips and toggle shortcut#10485

Open
TomasCabrita wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
TomasCabrita:feat/engineer_goggles_overlay
Open

feat(goggles_overlay): add new overlay tooltips and toggle shortcut#10485
TomasCabrita wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
TomasCabrita:feat/engineer_goggles_overlay

Conversation

@TomasCabrita

Copy link
Copy Markdown

This commit introduces the option to toggle the overlay exposed by the Engineer’s Goggles and adds new relevant information about several blocks. The improvements made are:

Goggle Toggle: A new client-side keyboard shortcut (with no default key binding) that allows toggling the overlay on and off without removing the item from the helmet slot.
Filter Display: Shows items inside a machine’s filter without having to take it out of the machine and hover in the inventory. Possible states: if there is nothing on the filter, this tooltip doesn’t show up; if there is a single item, shows “Allow Item” and the respective item; if there is an empty FilterItem, shows “Empty Filter”; if there is a FilterItem with at least one item, shows a summary of all filtered items. This overlay was added to the following block entities: Basin, Brass Funnel, Deployer, Mechanical Roller, Mechanical Saw, Smart Chute, Smart Fluid Pipe, Smart Observer, Threshold Switch, and Item Hatch.
Kinetic Rotation Direction: Shows the direction the block is spinning, since it’s hard to tell when they are spinning at high speeds. Possible states: if the block isn’t spinning, this tooltip doesn't show up; if spinning clockwise, shows “Clockwise”; if spinning counter-clockwise, shows “Counter-Clockwise”. This overlay was added to the following block entities: Creative Motor, Shaft / Cogwheels, Gantry Shaft, Water Wheel, and Windmill Bearing. Encased Fan Direction: Shows whether the fan’s airflow direction is inwards or outwards, as well as the range it reaches. Possible states: if the fan isn’t working, shows “Not Spinning”; if working clockwise, shows “Outward” and the respective range; if working counter-clockwise, shows “Inward” and the respective range. Pulse Mechanisms Info: Shows how much time is left until Pulse Timers and Pulse Repeaters emit the next pulse, as well as how much active time remains on a Pulse Extender. Possible States: for a Pulse Timer or Pulse Repeater, shows a timer that begins at 0 and counts up to the max pulse time defined by the player; for a Pulse Extender, shows a timer that begins at the max pulse time remaining defined by the player and counts down to 0.
Blaze Burner Fuel Time: Shows how much time a Blaze Burner has until it runs out of fuel. Possible States: if there is no fuel, shows “No Fuel”; if it consumed a Creative Blaze Cake and entered creative mode, shows “Infinite”; if it consumed normal fuel, shows a progress bar with an indicator (“Low”, “Medium”, or “High”), along with the remaining capacity percentage, and a timer counting down to 0.
Added tests to all the implementations above.

Note on test limitations: Goggle tooltip rendering is client-only, so tests instead invoke the underlying block entity methods directly in a server-safe path, using plain Component calls rather than the normal client-side formatting pipeline.

This commit introduces the option to toggle the overlay exposed by the
Engineer’s Goggles and adds new relevant information about several
blocks. The improvements made are:

Goggle Toggle: A new client-side keyboard shortcut (with no default
key binding) that allows toggling the overlay on and off without
removing the item from the helmet slot.
Filter Display: Shows items inside a machine’s filter without having
to take it out of the machine and hover in the inventory. Possible
states: if there is nothing on the filter, this tooltip doesn’t show
up; if there is a single item, shows “Allow Item” and the respective
item; if there is an empty FilterItem, shows “Empty Filter”; if
there is a FilterItem with at least one item, shows a summary of all
filtered items. This overlay was added to the following block
entities: Basin, Brass Funnel, Deployer, Mechanical Roller,
Mechanical Saw, Smart Chute, Smart Fluid Pipe, Smart Observer,
Threshold Switch, and Item Hatch.
Kinetic Rotation Direction: Shows the direction the block is
spinning, since it’s hard to tell when they are spinning at high
speeds. Possible states: if the block isn’t spinning, this tooltip
doesn't show up; if spinning clockwise, shows “Clockwise”; if
spinning counter-clockwise, shows “Counter-Clockwise”. This overlay
was added to the following block entities: Creative Motor,
Shaft / Cogwheels, Gantry Shaft, Water Wheel, and Windmill Bearing.
Encased Fan Direction: Shows whether the fan’s airflow direction is
inwards or outwards, as well as the range it reaches. Possible
states: if the fan isn’t working, shows “Not Spinning”; if working
clockwise, shows “Outward” and the respective range; if working
counter-clockwise, shows “Inward” and the respective range.
Pulse Mechanisms Info: Shows how much time is left until Pulse
Timers and Pulse Repeaters emit the next pulse, as well as how much
active time remains on a Pulse Extender. Possible States: for a
Pulse Timer or Pulse Repeater, shows a timer that begins at 0 and
counts up to the max pulse time defined by the player; for a Pulse
Extender, shows a timer that begins at the max pulse time remaining
defined by the player and counts down to 0.
Blaze Burner Fuel Time: Shows how much time a Blaze Burner has
until it runs out of fuel. Possible States: if there is no fuel,
shows “No Fuel”; if it consumed a Creative Blaze Cake and entered
creative mode, shows “Infinite”; if it consumed normal fuel, shows a
progress bar with an indicator (“Low”, “Medium”, or “High”), along
with the remaining capacity percentage, and a timer counting down
to 0.
Added tests to all the implementations above.

Note on test limitations: Goggle tooltip rendering is client-only,
so tests instead invoke the underlying block entity methods directly
in a server-safe path, using plain Component calls rather than the
normal client-side formatting pipeline.

Co-authored-by: Tiago Cachadinha <tiago.cachadinha@tecnico.ulisboa.pt>
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.

1 participant