nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Highlight Actions in UI #444

Open nsmryan opened 2 years ago

nsmryan commented 2 years ago

Use the highlighted UI sprites.

Need messages indicating when buttons are pressed. Currently there is not enough information on button presses to actually do this.

Likely need to emit messages outside of the input system. Perhaps in step or game.rs

nsmryan commented 2 years ago

This is surprisingly tricky. Which keys are held is known to the input system, but this system only reports a single InputAction result.

I don't really want to allow multiple results as it would only be used in this one case. Another location, like main.rs, could check the current held keys and create messages for the display system to indicate which ones are held. It seems like this should be limited to when a key starts to be held and when it is released, not every frame that it is held.

Strangely it looks like I used to log key pressed, but no longer do. This would not have fixed this issue, as the logging was only in text, but it is possible that there would be a way to get that to the display system as well.

nsmryan commented 2 years ago

Another idea is to just check for use-mode, and tell the display system which slot is in use. This is not the same as a held key, but should give the same effect. The same concept could be used with cursor mode skills/items.

nsmryan commented 2 years ago

I realized that we do have the information we need in the display system, and I implemented this concept. It works for both cursor mode and use mode items and skills.