Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main-gwj
Browse files Browse the repository at this point in the history
  • Loading branch information
Maaack committed May 8, 2024
2 parents 868d1b6 + c3e35b1 commit c1ec19a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ The `examples/` folder contains an example project using inherited scenes from t
- Loading Screen w/ Shader Pre-caching

### How it Works
- `AppConfig.tscn` is set as the first autoload. It loads all the configuration settings from the config file (if it exists).
- `AppConfig.tscn` is set as the first autoload. It calls `AppSettings.gd` to load all the configuration settings from the config file (if it exists) through `Config.gd`.
- `SceneLoader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`LoadingScreen.tscn` by default).
- `Opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`MainMenu.tscn`).
- `MainMenu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `OptionControl.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `Config.gd` to keep settings persistent between runs.
- `Credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `ProjectUISoundController.tscn` is an autload used to apply UI sounds project-wide.
- `ProjectMusicController.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
Expand Down
3 changes: 2 additions & 1 deletion addons/maaacks_game_template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ The `examples/` folder contains an example project using inherited scenes from t
- Loading Screen w/ Shader Pre-caching

### How it Works
- `AppConfig.tscn` is set as the first autoload. It loads all the configuration settings from the config file (if it exists).
- `AppConfig.tscn` is set as the first autoload. It calls `AppSettings.gd` to load all the configuration settings from the config file (if it exists) through `Config.gd`.
- `SceneLoader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`LoadingScreen.tscn` by default).
- `Opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`MainMenu.tscn`).
- `MainMenu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `OptionControl.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `Config.gd` to keep settings persistent between runs.
- `Credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `ProjectUISoundController.tscn` is an autload used to apply UI sounds project-wide.
- `ProjectMusicController.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
Expand Down
25 changes: 24 additions & 1 deletion addons/maaacks_game_template/docs/ExistingProject.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,30 @@ These instructions assume starting with just the contents of `addons/`. This wil
4. Save the scene.


6. Update the game credits / attribution.
6. Add / remove configurable settings to / from menus.


1. Open `MiniOptionsMenu.tscn` or `[Audio|Visual|Input|Game]OptionsMenu.tscn` scenes to edit their options.
2. If an option is not desired, it can always be hidden, or removed entirely (sometimes with some additional work).
3. If a new option is desired, it can be added without writing code.
1. Find the node that contains the existing list of options. Usually, it's a `VBoxContainer`.
2. Add an `OptionControl.tscn` node as a child to the container.
1. `SliderOptionControl.tscn` or `ToggleOptionControl.tscn` can be used if those types match requirements. In that case, skip step 6.
2. `ListOptionControl.tscn` and `Vector2ListOptionControl.tscn` are also available, but more complicated. See the `ScreenResolution` example.
3. Select the `OptionControl` node just added, to edit it in the inspector.
4. Add an `Option Name`. This prefills the `Key` string.
5. Select an `Option Section`. This prefills the `Section` string.
6. Add any kind of `Button`, `Slider`, `LineEdit`, or `TextEdit` to the `OptionControl` node.
7. Save the scene.
4. For options to have an effect outside of the menu, it will need to be referenced by its `key` and `section` from `Config.gd`.
1. `Config.get_config(section, key, default_value)`
5. Validate the values being stored in your local `config.cfg` file.
1. Refer to [Accessing Persistent User Data User](https://docs.godotengine.org/en/stable/tutorials/io/data_paths.html#accessing-persistent-user-data-user) to find Godot user data on your machine.
2. Find the directory that matches your project's name.
3. `config.cfg` should be in the top directory of the project.


7. Update the game credits / attribution.


1. Update the example `ATTRIBUTION.md` with the project's credits.
Expand Down
30 changes: 26 additions & 4 deletions addons/maaacks_game_template/docs/NewProject.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,38 @@ These instructions assume starting with the entire contents of the project folde
4. Save the scene.


5. Update the game credits / attribution.
5. Add / remove configurable settings to / from menus.


1. Open `MiniOptionsMenu.tscn` or `[Audio|Visual|Input|Game]OptionsMenu.tscn` scenes to edit their options.
2. If an option is not desired, it can always be hidden, or removed entirely (sometimes with some additional work).
3. If a new option is desired, it can be added without writing code.
1. Find the node that contains the existing list of options. Usually, it's a `VBoxContainer`.
2. Add an `OptionControl.tscn` node as a child to the container.
1. `SliderOptionControl.tscn` or `ToggleOptionControl.tscn` can be used if those types match requirements. In that case, skip step 6.
2. `ListOptionControl.tscn` and `Vector2ListOptionControl.tscn` are also available, but more complicated. See the `ScreenResolution` example.
3. Select the `OptionControl` node just added, to edit it in the inspector.
4. Add an `Option Name`. This prefills the `Key` string.
5. Select an `Option Section`. This prefills the `Section` string.
6. Add any kind of `Button`, `Slider`, `LineEdit`, or `TextEdit` to the `OptionControl` node.
7. Save the scene.
4. For options to have an effect outside of the menu, it will need to be referenced by its `key` and `section` from `Config.gd`.
1. `Config.get_config(section, key, default_value)`
5. Validate the values being stored in your local `config.cfg` file.
1. Refer to [Accessing Persistent User Data User](https://docs.godotengine.org/en/stable/tutorials/io/data_paths.html#accessing-persistent-user-data-user) to find Godot user data on your machine.
2. Find the directory that matches your project's name.
3. `config.cfg` should be in the top directory of the project.


6. Update the game credits / attribution.


1. Update the example `ATTRIBUTION.md` with the project's credits.
2. Open `Credits.tscn`.
3. Check the `CreditsLabel` has updated with the text.
4. Save the scene.

7. Keep, update, or remove `res://LICENSE.txt`.

6. Keep, update, or remove `res://LICENSE.txt`.

7. Optionally, if using Git for version control, update `.gitignore` to include `addons/`.
8. Optionally, if using Git for version control, update `.gitignore` to include `addons/`.

2 changes: 1 addition & 1 deletion addons/maaacks_game_template/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ description="Template with a main menu, options menus, pause menu, credits, scen
Created in collaboration with members of the Godot Wild Jam community."
author="Marek Belski"
version="0.7.0-rc-1"
version="0.7.0"
script="maaacks_game_template.gd"

0 comments on commit c1ec19a

Please sign in to comment.