diff --git a/MODDING.md b/MODDING.md index 8dea5d9..47be0d9 100644 --- a/MODDING.md +++ b/MODDING.md @@ -32,7 +32,7 @@ There's two folders inside resources; "characters" and "font". "font" holds the one font the whole game uses (Mali, under the SIL Open Font License; see its LICENSE.txt). -"common" holds files characters share (sounds, particles, the cursor and so on). Whenever a character names a file, the game looks in the character's folder first, then in "common", so a character can use anything there as is, or replace it by having its own file at the same path. This includes the taskbar's icons, `gfx/ui/icons.anm2`: one region per icon, named after its button (`talk`, `mood`, `spawn`, `autofeed`, `home`, `stats`, `catalog`, `settings`, `cheats`, `help`, `credits`, plus whatever `icon`s the interaction types name). A character with its own `gfx/ui/icons.anm2` gets its own icons. +"common" holds files characters share (sounds, particles, the cursor and so on). Whenever a character names a file, the game looks in the character's folder first, then in "common", so a character can use anything there as is, or replace it by having its own file at the same path. This includes the taskbar's icons, `gfx/ui/icons.anm2`: one region per icon, named after its button (`talk`, `mood`, `spawn`, `autofeed`, `home`, `stats`, `catalog`, `settings`, `cheats`, `help`, plus whatever `icon`s the interaction types name). A character with its own `gfx/ui/icons.anm2` gets its own icons. EVERYTHING ELSE is stored inside character folders in the "characters" folder; one folder per character, named however you like (the folder name is also the name of its save file). This has all data associated with characters. Think of characters more as tailored game experiences rather than literally being just the characters. Not only is there the character graphics, but backgrounds, items, parameters, etc. These are intensely customizable to suit whatever experience you'd like (within the confines of the engine, of course). @@ -86,7 +86,6 @@ This is the main character file where much of the functionality is stored. It's | `id` | string | What the character's save is named after. Defaults to the folder name; set it to keep the save when renaming the folder. | | `name` | string | Name of the character; will appear in dialogue, stats, etc. Defaults to the folder name. | | `description` | string | A general description of the character; will show in the Select screen. | -| `credits` | string | Credits text shown in the Select screen's Credits tab. | | `color` | [r, g, b], 0-1 | UI accent color for the character. | | `weight` | float, kg | The character's starting weight. | | `weightMax` | float, kg | Maximum weight the character can reach. | diff --git a/resources/characters/braixen/character.json b/resources/characters/braixen/character.json index f91eb5f..ffff4c3 100644 --- a/resources/characters/braixen/character.json +++ b/resources/characters/braixen/character.json @@ -1,7 +1,6 @@ { "name": "Braixen", "description": "A fire-wielding, enigmatic Fox Pokémon. You're her apprentice!", - "credits": "Art, Animation, Dialogue: ShweetMagnet Sound Effects: Pokemon, skunkwhoplunks Commissioned by @FatGirIsHMU on Twitter", "color": [0.901961, 0.156863, 0.160784], "weight": 32, "weightMax": 250, diff --git a/resources/characters/mini/character.json b/resources/characters/mini/character.json index 606d19e..0a27485 100644 --- a/resources/characters/mini/character.json +++ b/resources/characters/mini/character.json @@ -1,7 +1,6 @@ { "name": "Princess Mini", "description": "A sprightly, pampered, petite princess. Don't call her \"Mint\"!", - "credits": "Art, Animation, Dialogue: ShweetMagnet Character: 2x/MerchantAnon Sound Effects: JC Sounds (CC-BY 4.0), artisticdude (CC0), Kronbits (CC0), Vehicle (CC0), pixabay.org, ShweetMagnet Font: DPComic", "color": [0.188, 0.651, 0.424], "weight": 40, "weightMax": 100, diff --git a/resources/characters/snivy/character.json b/resources/characters/snivy/character.json index 29ea3a9..3e1c60e 100644 --- a/resources/characters/snivy/character.json +++ b/resources/characters/snivy/character.json @@ -1,7 +1,6 @@ { "name": "Snivy", "description": "A Grass Snake Pokémon with rather large ambitions.", - "credits": "Art, Animation, Dialogue: ShweetMagnet Character - Pokémon Sound Effects - Pokémon; ShweetMagnet", "color": [0.12, 0.515, 0.115], "weight": 8.1, "weightMax": 200, diff --git a/resources/common/gfx/ui/icons.anm2 b/resources/common/gfx/ui/icons.anm2 index 29c68f4..d461948 100644 --- a/resources/common/gfx/ui/icons.anm2 +++ b/resources/common/gfx/ui/icons.anm2 @@ -18,8 +18,7 @@ {"name": "settings", "crop": [195, 65], "size": [64, 64], "origin": "center"}, {"name": "help", "crop": [260, 65], "size": [64, 64], "origin": "center"}, {"name": "close", "crop": [325, 65], "size": [64, 64], "origin": "center"}, - {"name": "cheats", "crop": [390, 65], "size": [64, 64], "origin": "center"}, - {"name": "credits", "crop": [455, 65], "size": [64, 64], "origin": "center"} + {"name": "cheats", "crop": [390, 65], "size": [64, 64], "origin": "center"} ] } ], diff --git a/resources/common/gfx/ui/icons.png b/resources/common/gfx/ui/icons.png index 516af13..65396ec 100644 Binary files a/resources/common/gfx/ui/icons.png and b/resources/common/gfx/ui/icons.png differ diff --git a/src/character.cpp b/src/character.cpp index 688e297..d8349e8 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -84,7 +84,6 @@ void Character::preview_load(const std::string& path, Renderer& renderer) id = json_string(root, "id", key); name = json_string(root, "name", key); description = json_string(root, "description"); - credits = json_string(root, "credits"); color = json_color(root, "color", color); traits.weight = json_float(root, "weight"); auto texture_get = [&](const char* relative) { @@ -147,7 +146,7 @@ static void interact_parse(object source, InteractArea& area, Character& charact static void character_parse(object root, Character& character, Renderer& renderer, Audio& audio) { json_keys_check(root, - {"id", "name", "description", "credits", "color", "weight", "weightMax", "capacity", "capacityMax", + {"id", "name", "description", "color", "weight", "weightMax", "capacity", "capacityMax", "overstuffedMultiplier", "overstuffedDigestBonus", "caloriesToKilogram", "digestionRate", "digestionRateMin", "digestionRateMax", "digestionTime", "blinkChance", "gurgleChance", "gurgleCapacityMultiplier", "alternate", "stages", "animations", "talk", "blink", "eatAreas", diff --git a/src/character.h b/src/character.h index b219ab7..719414b 100644 --- a/src/character.h +++ b/src/character.h @@ -308,7 +308,6 @@ class Character { public: std::array sounds; - std::string credits; std::string description; std::string folder; std::string id; diff --git a/src/ui.cpp b/src/ui.cpp index fbc31cf..6e49559 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -43,12 +43,12 @@ constexpr float TASKBAR_FIT = 0.8f; constexpr int BUTTONS_FIXED = 9; constexpr float INFO_GAP = 4; constexpr int COOLDOWN_SEGMENTS = 48; -constexpr const char* PANEL_ICONS[] = {"", "stats", "catalog", "settings", "cheats", "credits"}; -constexpr const char* PANEL_NAMES[] = {"", "Stats", "Catalog", "Settings", "Cheats", "Credits"}; +constexpr const char* PANEL_ICONS[] = {"", "stats", "catalog", "settings", "cheats"}; +constexpr const char* PANEL_NAMES[] = {"", "Stats", "Catalog", "Settings", "Cheats"}; constexpr float PREVIEW_FRACTION = 0.68f; constexpr float PREVIEW_WIDTH = 760; constexpr float SELECT_BUTTON_SIZE = 112; -constexpr int SELECT_BUTTONS_FIXED = 2; +constexpr int SELECT_BUTTONS_FIXED = 1; constexpr float KG_TO_G = 1000; constexpr float KG_TO_LB = 2.20462f; constexpr float LB_TO_OZ = 16; @@ -1049,6 +1049,8 @@ void Ui::select_update(std::vector& characters, Settings& settings) { Character& entry = characters[i]; ImGui::PushID(i); + if (i > 0) + ImGui::SameLine(); style_push(entry.color); bool isCurrent = i == characterIndex; if (isCurrent) @@ -1065,18 +1067,13 @@ void Ui::select_update(std::vector& characters, Settings& settings) ImGui::SetItemTooltip("%s", entry.name.c_str()); style_pop(); ImGui::PopID(); - ImGui::SameLine(); } - ImGui::SameLine(0, style.ItemSpacing.x * INFO_GAP / 2); + float gap = style.ItemSpacing.x * (INFO_GAP + 1); + ImGui::SameLine(0, gap); ImVec2 cursor = ImGui::GetCursorScreenPos(); - ImGui::GetWindowDrawList()->AddLine({cursor.x, cursor.y}, {cursor.x, cursor.y + buttonSize}, + cursor.x -= gap / 2; + ImGui::GetWindowDrawList()->AddLine(cursor, {cursor.x, cursor.y + buttonSize}, ImGui::GetColorU32(ImGuiCol_Separator)); - ImGui::SameLine(0, style.ItemSpacing.x * INFO_GAP / 2); - ImGui::BeginDisabled(!selected); - if (icon_button("credits", "Credits", BUTTON_NORMAL)) - panel = PANEL_CREDITS; - ImGui::EndDisabled(); - ImGui::SameLine(); if (icon_button("settings", "Settings", BUTTON_NORMAL)) panel = PANEL_SETTINGS; } @@ -1181,14 +1178,7 @@ void Ui::select_update(std::vector& characters, Settings& settings) if (window_begin(screen, height)) { - if (panel == PANEL_CREDITS && selected) - { - ImGui::PushStyleColor(ImGuiCol_Text, imvec4_get(GRAY)); - ImGui::TextWrapped("%s", selected->credits.empty() ? "No credits listed." : selected->credits.c_str()); - ImGui::PopStyleColor(); - } - else - settings_draw(settings); + settings_draw(settings); window_end(); } } diff --git a/src/ui.h b/src/ui.h index b1559bf..e0f26c5 100644 --- a/src/ui.h +++ b/src/ui.h @@ -23,8 +23,7 @@ enum Panel PANEL_STATS, PANEL_CATALOG, PANEL_SETTINGS, - PANEL_CHEATS, - PANEL_CREDITS + PANEL_CHEATS }; enum ButtonState