Closed stackotter closed 1 year ago
Hey @stackotter Can I work on this ?
Yep definitely! Let me know if you need any help at any point
Hey, just checking whether you’re still planning on doing this issue or not so that I can free it up for someone else to try if you’ve changed your mind. All good if you just haven’t had the time yet, no rush at all
Hey Hi @stackotter . Yes I am interested on working on this issue. Sorry for the delay here. I hope to complete this issue by this week.
Hi, that’s perfectly ok :)
Hi @chinmaym07 any updates? I'm happy to keep you assigned if you still want to do it eventually (but it's not Hacktoberfest anymore so I'm guessing you won't)
Done
These features are both relatively small and interlinked so I have lumped them into a single issue. Currently the hotbar is rendered in every gamemode, but it definitely shouldn't be in spectator mode.
The gamemode check for GUI rendering should go in the
update
method ofGUI
inGUI.swift
. None of the code should run when the player is in a gamemode that doesn't render GUI. Add anoGUI
property to theGamemode
struct that only returns true in spectator mode and then use that in the check just so that it's a bit more generic (maybe plugins will eventually be able to add custom gamemodes). Technically the crosshair shows up while in spectator mode when the player is looking at an entity and is close enough to interact with it (jump to its camera), however this is not required yet if you don't feel up to that, just add a// TODO:
comments for someone to come back to later.To implement GUI toggling you can add a boolean
isVisible
property toGUIState
and then also use that inupdate
along withgamemode.noGUI
. You can then add atoggleGUI
input to theInput
enum (inInput.swift
). Then you can add a default key binding in theKeymap
struct (usef1
like vanilla does). Then you can add a case to the switch statement in theupdate
method of thePlayerInputSystem
struct to handle thetoggleGUI
input. You will then be able to test out the new shortcut (given that you will already have a Delta Client config file from before you added the keyboard shortcut, you will not get the default keybind and you will need to bind it manually, but for new users the default will be used).That walkthrough should hopefully give you a pretty good start, but if you get stuck feel free to join the Discord server and ask for help. There are quite a few contributors there (including me) who'll be more than happy to give you a hand 🙂