Add compass item/HUD - #3351
Conversation
|
Please run Cubyz formatter (https://github.com/PixelGuys/Cubyz/blob/master/docs/CONTRIBUTING.md#disable-zigs-automatic-formatter) instead of the zig one |
|
You need to run the formatter also on your zon files |
|
This pr will help out with exploring a lot |
|
I personally never used a compass like this in any game. Also the interface isn't particularly immersive, it would be nicer for the hand item to be animated. |
I agree with you. Was just a rough proof of concept for the time being to get more aquatinted with zig. I've got more ideas for it in the future once I have time. The waypoint idea would probably be cool. Maybe have different types of compasses for hidden structures or something like that. Would love to hear your thoughts |
|
With how big the render distance is, it's more immersive to just climb a rock and look around than to use a compass in your hud. |
Yeah, it could be useful as a way to find secret structures. |
What this adds
A horizontal scrolling compass.
Compass direction
Cubyz didn't previously have any concept of cardinal directions in the f3 menu, so this introduces it in the form of an item: yaw
0(camera.rotation[2] == 0, facing+Y) is defined as North, with the heading increasing clockwise (N → E → S → W), matching howcamera.directionis already computed elsewhere in the engine. This seemed like the most natural default given the existing rotation math, but very open to feedback if a different convention is preferred.Files that i edited/added
src/gui/windows/compass.zig(new) — the HUD window and all 6 themesassets/cubyz/items/compass.zig.zon(new) — item definitionassets/cubyz/items/textures/compass.png(new) — item textureassets/cubyz/recipes/compass_recipes.zig.zon(new) — crafting recipesrc/gui/windows/_list.zig— registers the new windowsrc/settings.zig— addscompassEnabledandcompassStylepersisted settingssrc/gui/windows/graphics.zig— adds the Compass toggle checkbox and theme-selection slider to the Graphics menuHappy to adjust the visual design, themes, or add texture-based backgrounds for the themes that would benefit from them (Parchment, Forest, Stone, Iron) if that's wanted — currently they're transparent colored rectangles rather than textured.