fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.64k stars 118 forks source link

Make Control Settings Accessible From the Pause Menu #877

Closed zicklag closed 3 months ago

zicklag commented 8 months ago

Description

From this comment: https://github.com/fishfolk/jumpy/discussions/709#discussioncomment-6008399

We should have a button to access the settings menu from the pause menu.

Alternatives & Prior Art

No response

domenick-z commented 8 months ago

I would like to contribute to this ,I am a newbie with basic code skills how can i start?

zicklag commented 8 months ago

Hey there! First step would be to get setup with Rust and Git on your machine, if you haven't already.

Then you can clone Jumpy locally, and make sure you can build it:

git clone https://github.com/fishfolk/jumpy.git
cd jumpy
cargo r

Assuming that all works you'll need to know where things are in the code. The code that displays the settings menu can be found here:

https://github.com/fishfolk/jumpy/blob/b4e319d64168465b239239b1380058311bcd90c5/src/ui/main_menu.rs#L109

It runs the widget() function of the ui::main_menu::settings module.

We have our pause menu system here, and if you look in there you can see that it keeps track of which pause menu page it's on, and it renders the correct widget similar to the main_menu.rs example above.

We want to add a new PauseMenuPage variant like PauseMenuPage::Settings, and also a button to switch to that page in the pause menu, and the code to render the settings menu widget when we're on that page.

This isn't much different than what the pause menu is already doing for the map selection, so you can look around at the code that's there for reference. There may be little things here and there that come up that might present questions, so just feel free to ask!

domenick-z commented 8 months ago

Thank you, I will try it tomorrow !

On Sat, 30 Dec 2023 at 20:39, Zicklag @.***> wrote:

Hey there! First step would be to get setup with Rust https://www.rust-lang.org/tools/install and Git https://git-scm.com/book/en/v2/Getting-Started-Installing-Git on your machine, if you haven't already.

Then you can clone Jumpy locally, and make sure you can build it:

git clone https://github.com/fishfolk/jumpy.gitcd jumpy cargo r


Assuming that all works you'll need to know where things are in the code. The code that displays the settings menu can be found here:

https://github.com/fishfolk/jumpy/blob/b4e319d64168465b239239b1380058311bcd90c5/src/ui/main_menu.rs#L109

It runs the widget() https://github.com/fishfolk/jumpy/blob/b4e319d64168465b239239b1380058311bcd90c5/src/ui/main_menu/settings.rs#L37C15-L45 function of the ui::main_menu::settings module.

We have our pause menu system here https://github.com/fishfolk/jumpy/blob/b4e319d64168465b239239b1380058311bcd90c5/src/ui/pause_menu.rs#L16-L23, and if you look in there you can see that it keeps track of which pause menu page it's on, and it renders the correct widget similar to the main_menu.rs example above.

We want to add a new PauseMenuPage https://github.com/fishfolk/jumpy/blob/b4e319d64168465b239239b1380058311bcd90c5/src/ui/pause_menu.rs#L6-L10 variant like PauseMenuPage::Settings, and also a button to switch to that page in the pause menu, and the code to render the settings menu widget when we're on that page.

This isn't much different than what the pause menu is already doing for the map selection, so you can look around at the code that's there for reference. There may be little things here and there that come up that might present questions, so just feel free to ask!

— Reply to this email directly, view it on GitHub https://github.com/fishfolk/jumpy/issues/877#issuecomment-1872581195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARKYCPX72DYFECOQCD7EJLDYMBNUTAVCNFSM6AAAAABAXCFYMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGU4DCMJZGU . You are receiving this because you commented.Message ID: @.***>