27 Commits

Author SHA1 Message Date
Zachary Hall
20dfc6ba71
Add hunger, hunger bar, and related functions on the Player struct. (#1210)
* Add hunger and hunger bar
 - New functions added to Player struct in game.zig to use and heal hunger.
 - If an attempt is made to use more hunger than there is available, the player is killed.
 - Hunger bar uses placeholder icons.
 - Hunger bar is based on the health bar
 -  Hunger bar is anchored to the left of the hotbar, rather than the right like the health bar.

* Don't kill player when hunger runs out.
- Don't use hunger when there's not enough to use
- Allow for code to know if hunger was used, so that is can handle not having enough hunger.

* New hunger textures

* Desaturate the highlight a little

* Return true if hunger was already true.

* Fix formatting

* Rename hunger to energy, and fix other issues.

* Make energy synchronized between client and server

Also removes the functions that add/remove energy on the game.Player struct

* Run formatter

* Fix incorrect formatting by formatter.

* Remove AddHunger struct and addHunger function

 - Keep base operation so things like accessories and food can use it when syncing

* Fix formatting again.

---------

Co-authored-by: Carrie <carriecapp9@gmail.com>
2025-03-23 17:06:21 +01:00
Carrie
5f722274b1 Tweak ui textures/contrast 2024-12-02 20:11:00 +01:00
careeoki
fabed5a4a0
Basalt blocks & Lamp (#764)
* Add basalt blocks, add lamp block

* Tweak lamp top, make torch light warmer, uranium glass light dimmer, lamp cooler

* Minor texture changes

* Tweak torch light

* Less light from uranium glass, tweak lamp

* Tweak torch light
2024-11-03 22:37:49 +01:00
Zachary Hall
e6fa7498c6
Game controller support (#717)
* Refactor getting X positions of buttons in preparation for not moving the window when clicking the buttons

* Initial support for controllers

* Basic controller support

* Allow runtime download of gamecontrollerdb.txt

* Add new gamepad cursor asset, and use it.

* Various improvements
Allow saving and configuring gamepad mappings
Add gamepad sensitivity, for camera only
Adjust multipliers in usage of gamepad axes
Prompt for downloading controller mappings, and allow configuration

* Refactor startup window handling so that controller settings does not duplicate code, or have to detect if startup has finished

* Clamp cursor position to window size when changing via gamepad

* Add deadzone

* Implement changes requested

* Follow more suggestions

* Use atomics

* Use orelse for oldState in Gamepads.update

* Implement requested changes

* Fix accidental removal of whitespace on two empty lines

* Fix incorrect formatting on blank line due to Vim expanding tabs to spaces

* Fix build errors.

* Change unusual orelse usage with better if expression

* Add resettable keys

* Revert "Add resettable keys"

This reverts commit 902f032ec834161dcaac97cbe596788e0110e870.

* Update controller support

* Fix things I forgot about

* Fix more things

* Implement most requested changes and change button text to be more clear

* Update controller support

* Hopefully fix format without breaking it.

* Refactor getting X positions of buttons in preparation for not moving the window when clicking the buttons

* Initial support for controllers

* Basic controller support

* Allow runtime download of gamecontrollerdb.txt

* Add new gamepad cursor asset, and use it.

* Various improvements
Allow saving and configuring gamepad mappings
Add gamepad sensitivity, for camera only
Adjust multipliers in usage of gamepad axes
Prompt for downloading controller mappings, and allow configuration

* Refactor startup window handling so that controller settings does not duplicate code, or have to detect if startup has finished

* Clamp cursor position to window size when changing via gamepad

* Add deadzone

* Implement changes requested

* Follow more suggestions

* Use atomics

* Use orelse for oldState in Gamepads.update

* Implement requested changes

* Fix build errors.

* Change unusual orelse usage with better if expression

* Add resettable keys

* Revert "Add resettable keys"

This reverts commit 902f032ec834161dcaac97cbe596788e0110e870.

* Update controller support

* Fix things I forgot about

* Fix more things

* Implement most requested changes and change button text to be more clear

* Update controller support

* Hopefully fix format without breaking it.

* Implement suggestions

* Update controller mapping downloading to be more automatic

* Fix parameter in Window.Gamepad.ControllerMappingDownloadTask.isStillNeeded

* Revert order of window opening and opening next startup window in openStartupWindow

* Only download controller mappings the first moment a controller is plugged in

* Open controller mapping download UI when actually downloading mappings, or at startup if they have started before GUI initialization but haven't finished yet.

* Don't unnecessarily try to download controller mappings at init when it will be done once the first update happens anyways.

* Implement requested changes

* Remove debugging log output

* Implement changes to download_controller_mappings.zig
2024-10-14 17:31:59 +02:00
careeoki
952d93c45e
UI changes (#584)
* UI colour balancing+ design changes

* New world icons

* Update titlebar icons to match other icons

* Tweak raw meat palette
2024-07-22 09:34:13 +02:00
IntegratedQuantum
412d5b93b8 Improve world selection and creation interfaces.
fixes #577
fixes #576
fixes #575
2024-07-20 16:32:09 +02:00
careeoki
72b8c2ce41
New hearts (#567)
* Redesign heart icons

* Fix indentation

* Fix indentation again

* Change half heart

* Fix scaling, fix formatting

* Fix formatting?????

* Fix formatting

* Fix Formmamting
2024-07-14 21:18:16 +02:00
IntegratedQuantum
669ab890cc Title bars can now be revealed by pressing a button in the pause menu.
This removes the ugly triangle from the top left of all windows and makes it harder to accidentally move around windows.

fixes #536
2024-06-30 11:00:25 +02:00
IntegratedQuantum
647cd924c5 Make the hotbar item slots transparent.
fixes #414
2024-05-28 15:59:51 +02:00
careeoki
b7f701caca
UI Texture Update (#406)
* Update UI textures

* Update Inventory UI textures

* Update heart textures

* New X texture

* Make Scrollbar thicker

* Revert previous commit

* Thicken creative inventory scrollbar again

* Change X again

---------

Co-authored-by: Archbirdplus <archbirdplus@gmail.com>
2024-05-28 11:21:59 +02:00
IntegratedQuantum
448f2b0f1f Use a 9-slice texture to draw a button outline.
fixes #379

Also using separate texture for the selection/pressed state of buttons and checkboxes to allow more artistic freedom.
2024-05-24 14:53:43 +02:00
IntegratedQuantum
0e04734c68 Adda pause menu.
Progress on #100
2024-05-18 18:23:07 +02:00
IntegratedQuantum
3b5b9fec8a Add till++'s beloved thin white line back to the item slots. 2023-04-03 20:25:24 +02:00
IntegratedQuantum
e0321c6cbf Various ui improvements proposed by @till++ 2023-04-03 19:01:49 +02:00
IntegratedQuantum
71159060a3 Use an icon for the crafting button. 2023-04-01 12:32:40 +02:00
IntegratedQuantum
da8f6ac9cb Add inventory crafting. 2023-03-31 20:37:39 +02:00
IntegratedQuantum
642624c94d Add the ItemSlot component. 2023-03-23 13:08:29 +01:00
IntegratedQuantum
77610c0064 Add the chat gui and set the default text color to white. 2023-03-22 13:59:46 +01:00
IntegratedQuantum
ef0f9ebf67 Allow ungrabbing the mouse by pressing escape and add a way to show the title bar of transparent windows. 2023-03-20 18:37:26 +01:00
IntegratedQuantum
9c20b463e3 Add a simple healthbar. 2023-03-19 23:25:31 +01:00
IntegratedQuantum
ba8856bd35 Add the crosshair. 2023-03-18 22:54:05 +01:00
IntegratedQuantum
fbb28869f6 Allow closing windows and zooming in/out. 2023-03-15 19:02:40 +01:00
IntegratedQuantum
b8f5b84322 Text can now be scrolled. 2023-03-11 17:45:20 +01:00
IntegratedQuantum
1c12ba3459 Add a texture for text fields. 2023-03-10 16:53:21 +01:00
IntegratedQuantum
df73bc964e Add a Checkbox. 2023-03-01 16:43:05 +01:00
IntegratedQuantum
b5e8ba4d20 Add a Slider component. 2023-03-01 10:55:41 +01:00
IntegratedQuantum
61e2e417a2 Add textures for the button and window. 2023-02-24 13:25:59 +01:00