Skip to content

Commit

Permalink
Added a pack management menu to the options menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
Espyo committed Jan 12, 2025
1 parent 5f986e2 commit d8a9c13
Show file tree
Hide file tree
Showing 22 changed files with 1,101 additions and 109 deletions.
Binary file modified game_data/base/graphics/menu_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions game_data/base/gui/options_menu_top.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ description=GUI for the top page of the options menu.
positions{
back=12.0000 5.0000 20.0000 6.0000
header=50.0000 10.0000 50.0000 6.0000
controls=50.0000 27.5000 65.0000 10.0000
graphics=50.0000 42.5000 65.0000 10.0000
audio=50.0000 57.5000 65.0000 10.0000
misc=50.0000 72.5000 60.0000 10.0000
controls=50.0000 25.0000 65.0000 10.0000
graphics=50.0000 37.0000 65.0000 10.0000
audio=50.0000 49.0000 65.0000 10.0000
packs=50.0000 61.0000 65.0000 10.0000
misc=50.0000 73.0000 60.0000 10.0000
advanced=87.0000 86.0000 22.0000 8.0000
tooltip=50.0000 96.0000 96.0000 4.0000
}
icons_to_the_left{
controls=true
graphics=true
audio=true
packs=true
misc=true
}
18 changes: 18 additions & 0 deletions game_data/base/gui/packs_menu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name=Pack management menu
description=GUI for the pack management menu.
positions{
back=12.0000 5.0000 20.0000 6.0000
header=61.0000 5.0000 74.0000 6.0000
list=26.0000 47.0000 48.0000 74.0000
list_scroll=52.0000 47.0000 2.0000 74.0000
info_box=76.0000 47.0000 44.0000 74.0000
pack_name=67.5000 19.0000 25.0000 16.0000
pack_thumbnail=89.0000 19.0000 16.0000 16.0000
pack_description=76.0000 48.5000 42.0000 41.0000
pack_tags=76.0000 73.0000 42.0000 6.0000
pack_maker=65.0000 80.0000 20.0000 6.0000
pack_version=87.0000 80.0000 20.0000 6.0000
restart_warning=35.5000 88.5000 67.0000 5.0000
open_folder=84.0000 88.5000 28.0000 5.0000
tooltip=50.0000 96.0000 96.0000 4.0000
}
4 changes: 2 additions & 2 deletions manual/content/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 id="0.26.0">0.26.0</h2>
<li><span class="cl-a">Added</span> arms out, backflip, called, carrying struggle, climbing, crushed, flailing, lounging, plucking thrown, pushing, shaking, sitting, sliding, and twirling animations to <a href="mob_pikmin.html">Pikmin</a>.</li>
<li><span class="cl-a">Added</span> throwing animations to <a href="mob_leader.html">leaders</a>.</li>
<li><span class="cl-a">Added</span> Pikmin generation animations to <a href="mob_onion.html">Onions</a>.</li>
<li><span class="cl-a">Added</span> a new <a href="area.html">area</a>: Olympian Ruins.</li>
<li><span class="cl-a">Added</span> new <a href="area.html">areas</a>: Olympian Ruins and Turbulent Tundra.</li>
<li><span class="cl-a">Added</span> a new <a href="mob_enemy.html">enemy</a>: Cyclopod.</li>
<li><span class="cl-a">Added</span> new <a href="mob_treasure.html">treasures</a>: Chocolate Square and Chocolate Bar (internally a <a href="mob_resource.html">resource</a> and <a href="mob_pile.html">pile</a> respectively), Soda Cap, Yarn Ball.</li>
<li><span class="cl-a">Added</span> more shadows to objects, including rectangular shadows. (Thanks Helodity).</li>
Expand Down Expand Up @@ -112,7 +112,7 @@ <h2 id="0.26.0">0.26.0</h2>
<li><span class="cl-c">Changed</span> the <code>focus</code> and <code>get_mob_info</code> <a href="script.html">actions</a> to support the same set of target object types.</li>
<li><span class="cl-c">Changed</span> the <code>world_sfx_volume</code> and <code>ui_sfx_volume</code> <a href="gui.html">GUI elements</a> in the options menu to read <code>sound</code> instead of <code>sfx</code>.</li>
<li><span class="cl-c">Changed</span> the internal name of the pause menu and control binds menu <a href="gui.html">GUIs</a> from <code>pause_help</code> and <code>control_binds_menu</code> to <code>help</code> and <code>options_menu_control_binds</code>.</li>
<li><span class="cl-c">Changed</span> the list of menu icons, adding an icon to the third slot for the main menu's help button, and eleventh slot for the particle editor.</li>
<li><span class="cl-c">Changed</span> the list of menu icons, adding an icon for the main menu's help button, for the particle editor, and for the pack management menu.</li>
<li><span class="cl-c">Changed</span> the <code>affects_*</code> properties of <a href="status.html">status effects</a> to be a single <code>affects</code> property.</li>
<li><span class="cl-c">Changed</span> the <code>bud_icon</code> and <code>flower_icon</code> bitmaps to <code>white_bud_icon</code> and <code>white_flower_icon</code>.</li>
<li><span class="cl-c">Changed</span> the properties of <a href="hazard.html">liquids</a>.</li>
Expand Down
24 changes: 24 additions & 0 deletions manual/content/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,30 @@
<td><code>1</code></td>
<td>No</td>
</tr>
<tr>
<th><code>pack_order</code></th>
<td>The order in which each pack is loaded, separated by semicolon. You're better off controlling this from the options menu's pack management menu.</td>
<td><code></code></td>
<td>No</td>
</tr>
<tr>
<th><code>packs_disabled</code></th>
<td>List of packs that are currently disabled, separated by semicolon. You're better off controlling this from the options menu's pack management menu.</td>
<td><code></code></td>
<td>No</td>
</tr>
<tr>
<th><code>particle_editor_grid_interval</code></th>
<td>Space between each grid cell in the particle editor.</td>
<td><code>32</code></td>
<td>No</td>
</tr>
<tr>
<th><code>particle_editor_bg_texture</code></th>
<td>Full path to the background texture for the particle editor, if any.</td>
<td><code>32</code></td>
<td>No</td>
</tr>
<tr>
<th><code>resolution</code></th>
<td>Width and height of the game window. The engine was made with a small-medium resolution in mind, although you can change the window size to anything you want.</td>
Expand Down
9 changes: 8 additions & 1 deletion source/documents/todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Point I left on (so I can continue the next day without losing my train of thought)
Point I left on (so I can continue the next day without losing my train of thought)


Current tasks (tasks being worked on, but not yet committed)
Expand Down Expand Up @@ -205,6 +205,13 @@ Next tasks (roughly sorted most important first)
Barely important format changes
In area geometry files, path stops use the term "nr" to refer to links, even though they contain more than the end stop number
Organize all graphics and sound files into neat sub-folders
Menu refactor
Add a gui.start_transition function so that we don't have to do the responsive = true/false thing when we call gui.start_animation
Some sort of sub-menus manager so we don't have to have half a dozen if(sub_gui) sub_gui.handle_player_action() and stuff like that
Organize the code folders, files, and structs
Move all menus to their own struct
Differentiate between menus as game states, and menus as GUIs
The radar should show where obstacles (blocks_path == true) are, and differentiate between dead and living enemies and leaders
Missions should have a property where the maker can specify their best score (and date)
Add a screenshot, or better yet, a gif to the readme
Manual updates
Expand Down
80 changes: 61 additions & 19 deletions source/documents/vectorial_graphics/menu_icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 35 additions & 8 deletions source/source/content_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ void content_manager::unload_all(const vector<CONTENT_TYPE> &types) {
* @brief Clears all loaded manifests.
*/
void pack_manager::clear_manifests() {
manifests_sans_base_raw.clear();
manifests_with_base_raw.clear();
manifests_sans_base.clear();
manifests_with_base.clear();
}
Expand All @@ -276,11 +278,34 @@ void pack_manager::clear_manifests() {
* @brief Fills in the manifests.
*/
void pack_manager::fill_manifests() {
vector<string> folders = folder_to_vector(FOLDER_PATHS_FROM_ROOT::GAME_DATA, true);
//Raw manifests.
vector<string> raw_folders =
folder_to_vector(FOLDER_PATHS_FROM_ROOT::GAME_DATA, true);

for(size_t f = 0; f < folders.size(); f++) {
if(folders[f] != FOLDER_NAMES::BASE_PACK) {
manifests_sans_base.push_back(folders[f]);
for(size_t f = 0; f < raw_folders.size(); f++) {
if(raw_folders[f] != FOLDER_NAMES::BASE_PACK) {
manifests_sans_base_raw.push_back(raw_folders[f]);
}
}

manifests_with_base_raw.push_back(FOLDER_NAMES::BASE_PACK);
manifests_with_base_raw.insert(
manifests_with_base_raw.end(),
manifests_sans_base_raw.begin(),
manifests_sans_base_raw.end()
);

//Organized manifests.
vector<string> organized_folders =
filter_vector_with_ban_list(raw_folders, game.options.packs_disabled);
organized_folders =
sort_vector_with_preference_list(
organized_folders, game.options.pack_order
);

for(size_t f = 0; f < organized_folders.size(); f++) {
if(organized_folders[f] != FOLDER_NAMES::BASE_PACK) {
manifests_sans_base.push_back(organized_folders[f]);
}
}

Expand All @@ -296,18 +321,20 @@ void pack_manager::fill_manifests() {
/**
* @brief Loads all packs in the manifests, including the base pack.
* This only loads their metadata, not their content!
* This also loads all packs, not just the ones organized via the
* player options.
*/
void pack_manager::load_all() {
for(size_t p = 0; p < manifests_with_base.size(); p++) {
for(size_t p = 0; p < manifests_with_base_raw.size(); p++) {
data_node pack_file =
load_data_file(
FOLDER_PATHS_FROM_ROOT::GAME_DATA + "/" +
manifests_with_base[p] + "/" +
manifests_with_base_raw[p] + "/" +
FILE_NAMES::PACK_DATA
);

pack pack_data;
pack_data.name = manifests_with_base[p];
pack_data.name = manifests_with_base_raw[p];
reader_setter rs(&pack_file);
rs.set("name", pack_data.name);
rs.set("description", pack_data.description);
Expand All @@ -319,7 +346,7 @@ void pack_manager::load_all() {
rs.set("conflicts", pack_data.conflicts);
rs.set("notes", pack_data.notes);

list[manifests_with_base[p]] = pack_data;
list[manifests_with_base_raw[p]] = pack_data;
}
}

Expand Down
10 changes: 8 additions & 2 deletions source/source/content_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ struct pack_manager {

//--- Members ---

//Manifests, sans the base pack.
//Manifests, sans the base pack, organized via the player's options.
vector<string> manifests_sans_base;

//Manifests, with the base pack.
//Manifests, with the base pack, organized via the player's options.
vector<string> manifests_with_base;

//Manifests, sans the base pack, not organized via the player's options.
vector<string> manifests_sans_base_raw;

//Manifests, with the base pack, not organized via the player's options.
vector<string> manifests_with_base_raw;

//List of loaded packs, with the base pack.
map<string, pack> list;
Expand Down
3 changes: 3 additions & 0 deletions source/source/drawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ enum MENU_ICON {
//Options menu audio button.
MENU_ICON_AUDIO,

//Options menu packs button.
MENU_ICON_PACKS,

//Options menu misc. button.
MENU_ICON_OPTIONS_MISC,
};
Expand Down
6 changes: 5 additions & 1 deletion source/source/game_states/main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ void main_menu_state::init_gui_main_page() {
});
};
help_button->on_get_tooltip =
[] () { return "Some quick help and tips about how to play."; };
[] () {
return
"Quick help and tips about how to play. "
"You can also find this in the pause menu.";
};
main_gui.add_item(help_button, "help");

//Options button.
Expand Down
Loading

0 comments on commit d8a9c13

Please sign in to comment.