Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/menu nav #88

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Feat/menu nav #88

merged 3 commits into from
Nov 6, 2023

Conversation

thombruce
Copy link
Owner

@thombruce thombruce commented Nov 6, 2023

By submitting this pull request, you agree to follow our Code of Conduct: https://github.com/thombruce/.github/blob/main/CODE_OF_CONDUCT.md


Internal use. Do not delete.

  • Tests passing
  • Coverage sufficient
  • Manual review
  • No A11y regression
  • Translations provided or not needed

@thombruce
Copy link
Owner Author

This was a lot to figure out and we're still not all the way there yet. We haven't yet even got a settings menu to transition to.

Also...

  • Test UI navigation with a gamepad
  • Add settings menu and make values changeable/selectable

@thombruce
Copy link
Owner Author

I can now navigate to a settings menu... though I cannot presently navigate back to the start menu. Make sure we can do that - I'd like to be able to do so using "Esc" but a "Back" button is more user-friendly to avoid confusion.

Now I just need to figure out how to make each value (currently listed as a button) configurable...

  • Window Mode (select-like)
  • Language (select-like)
  • Volume (range-like)

I feel like the easiest way to achieve all three is to utilise the unused left and right buttons (though I fear this may conflict with the crate I'm using). When pressing these, the state should change to the next value, the next, the next, and loop back. The range-like volume can handle this by using increments of 0.1 or 0.05 (preferably represented as an integer 0-100).

@thombruce
Copy link
Owner Author

The crate has this locking concept: https://github.com/nicopap/ui-navigation/#locking

For those toggleable values, I could first require that the user select the menu item, then lock the navigation system and use custom Left-Right controls to iterate through values...

Alternatively, though I don't want to get this advanced just now, there are sub- and sub-sub- and sub-sub-sub-menu examples which I'm sure we could control the visual presentation of. Think maybe each item is a sub-menu of the Settings menu, present on screen but requiring you to step into it and back out...

For now... I think the simplest approach is to just make use of the default select behaviour (Space by default, but I've added Return as a working key too). Just step through values as the user is pressing the action key. Not particularly ergonomic, but should get us basic utility with minimal effort (menus will be revisited eventually).

@thombruce
Copy link
Owner Author

Settings menu is actually really involved, so here's what I'm gonna do...

  1. Remove the settings menu for now.
  2. Remove the closing reference to Settings Menu #34 above
  3. Plan to handle the actual settings menu separately

We made good progress here, getting in place a basic UI system. Could use some refactoring, but it does the job.

The settings menu needs to be much like this but also...

  • Modify GameConfig resource values
  • Reflect these changes immediately by updating systems, e.g.
  • On language change, re-send locale.requested in a one-off system (Bevy 0.12 might have a new utility for this 👀)
  • Be separated into rational chunks (i.e. each menu iterator I'm making should be a component defined elsewhere that we're able to reuse - the way I'm trying to cobble it together now is just unwieldy)

@thombruce thombruce marked this pull request as ready for review November 6, 2023 04:37
@thombruce thombruce merged commit b0f5f7d into main Nov 6, 2023
@thombruce thombruce deleted the feat/menu-nav branch November 6, 2023 04:39
This was referenced Nov 6, 2023
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