From 91c3c2efdafabb6de8317ea1912905986b366d48 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:54:52 +0100 Subject: [PATCH] improve flags in UI --- src/game_api/flags.hpp | 658 +++++++++++++++++++---------------------- src/injected/ui.cpp | 7 +- 2 files changed, 316 insertions(+), 349 deletions(-) diff --git a/src/game_api/flags.hpp b/src/game_api/flags.hpp index 954e91c2d..d13b09060 100644 --- a/src/game_api/flags.hpp +++ b/src/game_api/flags.hpp @@ -40,321 +40,321 @@ std::array themes_short{ }; std::array entity_flags{ - "1: Invisible", - "2: Indestructable/special floor", - "3: Solid (wall)", - "4: Passes through objects", - "5: Passes through everything", - "6: Take no damage", - "7: Throwable/Knockbackable", - "8: Is platform", - "9: Climbable (as rope/ladder)", - "10: No gravity", - "11: Interact with liquid", - "12: Stunnable", - "13: Collides walls", - "14: Interact with semisolids?", - "15: Can be stomped", - "16: Power stomps", - "17: Facing left", - "18: Pickupable", - "19: Usable item?", - "20: Enable button prompt", - "21: Interact with webs", - "22: Can be carried through exit", - "23: Shop item", - "24: Shop floor (break to aggro)", - "25: Passes through player", - "26: Exploded", - "27: Crushed", - "28: Pause AI and physics", - "29: Dead", - "30: Character", - "31: Movable", - "32: Use overlay draw depth", + "Invisible", + "Indestructable/special floor", + "Solid (wall)", + "Passes through objects", + "Passes through everything", + "Take no damage", + "Throwable/Knockbackable", + "Is platform", + "Climbable (as rope/ladder)", + "No gravity", + "Interact with liquid", + "Stunnable", + "Collides walls", + "Interact with semisolids?", + "Can be stomped", + "Power stomps", + "Facing left", + "Pickupable", + "Usable item?", + "Enable button prompt", + "Interact with webs", + "Can be carried through exit", + "Shop item", + "Shop floor (break to aggro)", + "Passes through player", + "Exploded", + "Crushed", + "Pause AI and physics", + "Dead", + "Character", + "Movable", + "Use overlay draw depth", }; std::array more_flags{ - "1: Take damage on collision after throw", - "2: Revived (HH)", - "3: Blocks shield", - "4: Passes through shield", - "5: Being moved by shield", - "6: Just spawned?", - "7: Done spawning?", - "8: Stuck in something", - "9: Stuck in something, 1 frame later", - "10: Pitchers mitt antigravity", - "11: Swimming", - "12: Hit ground", - "13: Hit wall", - "14: Falling", - "15: Cursed effect", - "16: Elixir buff", - "17: Disable input", - "18: Shop item held by player", - "19: Falling platform something", - "20: Yangs turkey", - "21: Floor can be decorated", - "22: Disable collision", - "23: JumpWhipped to shorthop", - "24: ", - "25: ", - "26: ", - "27: ", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "Take damage on collision after throw", + "Revived (HH)", + "Blocks shield", + "Passes through shield", + "Being moved by shield", + "Just spawned?", + "Done spawning?", + "Stuck in something", + "Stuck in something, 1 frame later", + "Pitchers mitt antigravity", + "Swimming", + "Hit ground", + "Hit wall", + "Falling", + "Cursed effect", + "Elixir buff", + "Disable input", + "Shop item held by player", + "Falling platform something", + "Yangs turkey", + "Floor can be decorated", + "Disable collision", + "JumpWhipped to shorthop", + "", + "", + "", + "", + "", + "", + "", + "", + "", }; std::array entity_type_properties_flags{ - "1: Apply solid block beautification", - "2: Treat as FLOORSTYLED", - "3: ", - "4: ", - "5: Squirts blood on damage", - "6: Climbable (as wall)", - "7: ", - "8: Fireproof", - "9: Double fire and explosive damage", - "10: Is on fire/lights on fire", - "11: Poison immunity", - "12: Poisons arrows when hit", - "13: Curse immunity", - "14: Cursed pot effect (curses you when destroyed closeby)", - "15: ", - "16: ", - "17: ", - "18: Can be carried through layer doors", - "19: ", - "20: ", - "21: Can spawn monsters on top", - "22: ", - "23: Can be cloned", - "24: Can be bubbled", - "25: Can be telefragged", - "26: Disable updates?", - "27: Kill entity when overlay lost?", - "28: Unused", - "29: Unused", - "30: Unused", - "31: Unused", - "32: Unused", + "Apply solid block beautification", + "Treat as FLOORSTYLED", + "Unknown", + "Unknown", + "Squirts blood on damage", + "Climbable (as wall)", + "Unknown", + "Fireproof", + "Double fire and explosive damage", + "Is on fire/lights on fire", + "Poison immunity", + "Poisons arrows when hit", + "Curse immunity", + "Cursed pot effect (curses you when destroyed closeby)", + "Unknown", + "Unknown", + "Unknown", + "Can be carried through layer doors", + "Unknown", + "Unknown", + "Can spawn monsters on top", + "Unknown", + "Can be cloned", + "Can be bubbled", + "Can be telefragged", + "Disable updates?", + "Kill entity when overlay lost?", + "", + "", + "", + "", + "", }; std::array level_flags{ - "1: Upbeat dwelling intro music played", - "2: ", - "3: Running tutorial speedrun", - "4: Level has pet", - "5: Level has Tun/shop?", - "6: Tun killed?", - "7: Ghost pot level?", - "8: Dead are restless", - "9: Bees/Metal clanking/Oppression", - "10: Angry shopkeeper", - "11: Angry Tun", - "12: Angry caveman shopkeeper", - "13: Angry ghist shopkeeper", - "14: Angry Yang", - "15: Angry Tusk", - "16: Angry Waddler", - "17: Shop level?", - "18: Dark level (draw halo)", - "19: Altar destroyed", - "20: Allow pause", - "21: Hide hud, transition", - "22: Hide hud, camp", - "23: Have clover", - "24: Show forgiveness toast", - "25: ", - "26: Daily challenge options", - "27: ", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "Upbeat dwelling intro music played", + "Unknown", + "Running tutorial speedrun", + "Level has pet", + "Level has Tun/shop?", + "Tun killed?", + "Ghost pot level?", + "Dead are restless", + "Bees/Metal clanking/Oppression", + "Angry shopkeeper", + "Angry Tun", + "Angry caveman shopkeeper", + "Angry ghist shopkeeper", + "Angry Yang", + "Angry Tusk", + "Angry Waddler", + "Shop level?", + "Dark level (draw halo)", + "Altar destroyed", + "Allow pause", + "Hide hud, transition", + "Hide hud, camp", + "Have clover", + "Show forgiveness toast", + "Unknown", + "Daily challenge options", + "", + "", + "", + "", + "", + "", }; std::array journal_flags{ - "1: I was a pacifist", - "2: I was a vegan", - "3: I was a vegetarian", - "4: I was a petty criminal", - "5: I was a wanted criminal", - "6: I was a crime lord", - "7: I was a king", - "8: I was a queen", - "9: I was a fool", - "10: I was an eggplant", - "11: I didn't care for treasure", - "12: I liked pets", - "13: I loved pets", - "14: I took damage", - "15: I survived death once", - "16: I slayed Kingu", - "17: I slayed Osiris", - "18: I defeated Tiamat", - "19: I defeated Hundun", - "20: I became one with the Cosmos", - "21: I eventually died", - "22: ", - "23: ", - "24: ", - "25: ", - "26: ", - "27: ", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "I was a pacifist", + "I was a vegan", + "I was a vegetarian", + "I was a petty criminal", + "I was a wanted criminal", + "I was a crime lord", + "I was a king", + "I was a queen", + "I was a fool", + "I was an eggplant", + "I didn't care for treasure", + "I liked pets", + "I loved pets", + "I took damage", + "I survived death once", + "I slayed Kingu", + "I slayed Osiris", + "I defeated Tiamat", + "I defeated Hundun", + "I became one with the Cosmos", + "I eventually died", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", }; std::array quest_flags{ - "1: Reset", - "2: Dark level spawned in world", - "3: Vault spawned in world", - "4: Next level has shopkeeper outpost (if possible)", - "5: Shop spawned", - "6: Shortcut used", - "7: Seeded mode", - "8: Daily challenge mode", - "9: Caveman Shopkeeper aggroed", - "10: Waddler aggroed", - "11: Shop bought out", - "12: Eggplant crown picked up", - "13: ", - "14: ", - "15: ", - "16: ", - "17: Udjat eye spawned", - "18: Black market spawned", - "19: Drill spawned", - "20: ", - "21: ", - "22: ", - "23: ", - "24: ", - "25: Moon challenge spawned", - "26: Star challenge spawned", - "27: Sun challenge spawned", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "Reset", + "Dark level spawned in world", + "Vault spawned in world", + "Next level has shopkeeper outpost (if possible)", + "Shop spawned", + "Shortcut used", + "Seeded mode", + "Daily challenge mode", + "Caveman Shopkeeper aggroed", + "Waddler aggroed", + "Shop bought out", + "Eggplant crown picked up", + "", + "", + "", + "", + "Udjat eye spawned", + "Black market spawned", + "Drill spawned", + "", + "", + "", + "", + "", + "Moon challenge spawned", + "Star challenge spawned", + "Sun challenge spawned", + "", + "", + "", + "", + "", }; std::array presence_flags{ - "1: Udjat eye", - "2: Black market", - "3: Vlad's castle/drill", - "4: ", - "5: ", - "6: ", - "7: ", - "8: ", - "9: Moon challenge", - "10: Star challenge", - "11: Sun challenge", - "12: ", - "13: ", - "14: ", - "15: ", - "16: ", - "17: ", - "18: ", - "19: ", - "20: ", - "21: ", - "22: ", - "23: ", - "24: ", - "25: ", - "26: ", - "27: ", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "Udjat eye", + "Black market", + "Vlad's castle/drill", + "", + "", + "", + "", + "", + "Moon challenge", + "Star challenge", + "Sun challenge", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", }; std::array illumination_flags{ - "1: Disable light1", - "2: Enable light2", - "3: Enable light3", - "4: Enable light4", - "5: Unknown", - "6: Unknown", // always on by default - "7: Modulate brightness_multiplier", - "8: Unknown", + "Disable light1", + "Enable light2", + "Enable light3", + "Enable light4", + "Unknown", + "Unknown", // always on by default + "Modulate brightness_multiplier", + "Unknown", }; std::array special_visibility_flags{ - "1: Crust embedded items shown", - "2: Crust embedded items shown (level transition)", - "3: ", - "4: ", - "5: ", - "6: ", - "7: ", - "8: ", - "9: Compass door markers shown", - "10: Compass door markers shown (level transition)", - "11: ", - "12: ", - "13: ", - "14: ", - "15: ", - "16: ", - "17: Special compass door markers shown", - "18: Special compass door markers shown (level transition)", - "19: ", - "20: ", - "21: ", - "22: ", - "23: ", - "24: ", + "Crust embedded items shown", + "Crust embedded items shown (level transition)", + "", + "", + "", + "", + "", + "", + "Compass door markers shown", + "Compass door markers shown (level transition)", + "", + "", + "", + "", + "", + "", + "Special compass door markers shown", + "Special compass door markers shown (level transition)", + "", + "", + "", + "", + "", + "", }; std::array basecamp_dialogue_win_flags{ - "1: Ana Spelunky saved", - "2: Margaret Tunnel saved", - "3: Colin Northward saved", - "4: Roffy D. Sloth saved", - "5: Alto Singh saved", - "6: Liz Mutton saved", - "7: Nekka The Eagle saved", - "8: LISE project saved", - "9: Coco Von Diamonds saved", - "10: Manfred Tunnel saved", - "11: Little Jay saved", - "12: Tina Flan saved", - "13: Valerie Crump saved", - "14: Au saved", - "15: Demi Von Diamonds saved", - "16: Pilot saved", - "17: Princess Airyn saved", - "18: Dirk Yamaoka saved", - "19: Tiamat win", - "20: Hundun win", - "21: ", - "22: ", - "23: ", - "24: ", - "25: ", - "26: ", - "27: ", - "28: ", - "29: ", - "30: ", - "31: ", - "32: ", + "Ana Spelunky saved", + "Margaret Tunnel saved", + "Colin Northward saved", + "Roffy D. Sloth saved", + "Alto Singh saved", + "Liz Mutton saved", + "Nekka The Eagle saved", + "LISE project saved", + "Coco Von Diamonds saved", + "Manfred Tunnel saved", + "Little Jay saved", + "Tina Flan saved", + "Valerie Crump saved", + "Au saved", + "Demi Von Diamonds saved", + "Pilot saved", + "Princess Airyn saved", + "Dirk Yamaoka saved", + "Tiamat win", + "Hundun win", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", }; std::array places_flags{ @@ -596,40 +596,6 @@ std::array shortcut_flags{ "5-1: Golden Key (Unlocked)", }; -/*std::array empty_flags{ - "1: ", -"2: ", -"3: ", -"4: ", -"5: ", -"6: ", -"7: ", -"8: ", -"9: ", -"10: ", -"11: ", -"12: ", -"13: ", -"14: ", -"15: ", -"16: ", - "17: ", -"18: ", -"19: ", -"20: ", -"21: ", -"22: ", -"23: ", -"24: ", -"25: ", -"26: ", -"27: ", -"28: ", -"29: ", -"30: ", -"31: ", -"32: ",};*/ - std::array button_flags{ "Jp", "Wp", @@ -741,36 +707,36 @@ std::array pause_types{ }; std::array levelgen_flags{ - "1: Should generate path", - "2: Can spawn vault", - "3: Can spawn shops", - "4: Can have outpost?", - "5: Should spawn hard floor decorations", - "6: Apply ambient occlusion", - "7: Should spawn behind-floor and below-floorstyled decorations", - "8: unknown", + "Should generate path", + "Can spawn vault", + "Can spawn shops", + "Can have outpost?", + "Should spawn hard floor decorations", + "Apply ambient occlusion", + "Should spawn behind-floor and below-floorstyled decorations", + "Unknown", }; std::array levelgen_flags2{ - "1: Spawns background decorations on ground (ceiling if false)", - "2: Spawns fake ladder/chain midbg?", - "3: Spawn entrance door background (Ignored in 7-1 to 7-2 transition)", - "4: Procedural backlayer door midbg indicator related", - "5: Spawn backlayer border/background", - "6: Should spawn procedural backlayers", - "7: Should spawn backlayer torches", - "8: Has ghost", + "Spawns background decorations on ground (ceiling if false)", + "Spawns fake ladder/chain midbg?", + "Spawn entrance door background (Ignored in 7-1 to 7-2 transition)", + "Procedural backlayer door midbg indicator related", + "Spawn backlayer border/background", + "Should spawn procedural backlayers", + "Should spawn backlayer torches", + "Has ghost", }; std::array levelgen_flags3{ - "1: Can spawn angry NPCs", - "2: Can echo", - "3: Can spawn Dead are Restless", - "4: Can spawn procedural skeletons", - "5: Can have quests?", - "6: Can spawn player coffins", - "7: unknown", - "8: unknown", + "Can spawn angry NPCs", + "Can echo", + "Can spawn Dead are Restless", + "Can spawn procedural skeletons", + "Can have quests?", + "Can spawn player coffins", + "Unknown", + "Unknown", }; std::array level_chances{ diff --git a/src/injected/ui.cpp b/src/injected/ui.cpp index eae247ca0..9f6151730 100644 --- a/src/injected/ui.cpp +++ b/src/injected/ui.cpp @@ -3481,7 +3481,7 @@ void render_light(const char* name, LightParams* light) } template -void render_flags(const std::array names_array, T* flag_field) +void render_flags(const std::array names_array, T* flag_field, bool show_number = true) { for (int idx{0}; idx < SIZE && idx < sizeof(T) * 8; ++idx) { @@ -3490,7 +3490,8 @@ void render_flags(const std::array names_array, T* flag_field T value = (T)std::pow(2, idx); bool on = (*flag_field & value) == value; - if (ImGui::Checkbox(names_array[idx], &on)) + if (names_array[idx][0] != '\0' && + ImGui::Checkbox(show_number ? fmt::format("{}: {}", idx + 1, names_array[idx]).c_str() : names_array[idx], &on)) { *flag_field ^= value; } @@ -5806,7 +5807,7 @@ void render_options() if (submenu("Frame advance / Engine pause type")) { ImGui::PushID("PauseType"); - render_flags(pause_types, &g_pause_type); + render_flags(pause_types, &g_pause_type, false); ImGui::PopID(); endmenu(); }