Skip to content

Commit 27904da

Browse files
committed
Overlay: Improved level select + map names
1 parent c414a1f commit 27904da

4 files changed

Lines changed: 193 additions & 9 deletions

File tree

C2ModLoader/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ set(SOURCES
9898
Utils/Sha256.cpp
9999
Utils/Style.cpp
100100
Utils/UiScale.cpp
101+
WadNames.cpp
101102
)
102103

103104
# ImGui Core + Backends

C2ModLoader/Overlay/Components/LevelSelect.cpp

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "ModApi.h"
44
#include "Utils/Fonts.h"
5+
#include "WadNames.h"
56
#include "imgui.h"
67

78
#include <cctype>
@@ -148,7 +149,6 @@ void RenderLevelSelect() {
148149
std::string tribeName = "Tribe " + std::to_string(tribe);
149150

150151
if (ImGui::CollapsingHeader(tribeName.c_str())) {
151-
ImGui::Indent();
152152

153153
// Group by type + level
154154
std::map<std::pair<int, int>, std::vector<const WadLevel *>> levelMap;
@@ -160,17 +160,28 @@ void RenderLevelSelect() {
160160
WadFileType type = static_cast<WadFileType>(typeAndLevel.first);
161161
int levelNum = typeAndLevel.second;
162162
std::string levelHeader = std::string(wadFileTypeNames[type + 1]) + " " + std::to_string(levelNum);
163-
if (ImGui::TreeNode(levelHeader.c_str())) {
164-
for (const auto *wadLevel : levelMaps) {
165-
std::string buttonLabel = "Map " + std::to_string(wadLevel->map) + " (" + wadLevel->filename + ")";
166-
if (ImGui::Button(buttonLabel.c_str())) {
167-
api->GotoLevel(wadLevel->tribe, wadLevel->level, wadLevel->map, wadLevel->type);
168-
}
163+
164+
ImGui::Separator();
165+
ImGui::Text("%s", levelHeader.c_str());
166+
ImGui::Spacing();
167+
168+
for (const auto *wadLevel : levelMaps) {
169+
std::string lookupKey = "wads/" + wadLevel->filename;
170+
std::string wadName = wadNames.count(lookupKey) ? wadNames[lookupKey] : "";
171+
if (!wadName.empty()) {
172+
ImGui::Text("%s", wadName.c_str());
173+
} else {
174+
ImGui::Text("%s", wadLevel->filename.c_str());
175+
}
176+
std::string buttonLabel = "Map " + std::to_string(wadLevel->map) + " (" + wadLevel->filename + ")";
177+
if (ImGui::Button(buttonLabel.c_str())) {
178+
api->GotoLevel(wadLevel->tribe, wadLevel->level, wadLevel->map, wadLevel->type);
169179
}
170-
ImGui::TreePop();
180+
ImGui::Spacing();
171181
}
182+
183+
ImGui::Spacing();
172184
}
173-
ImGui::Unindent();
174185
}
175186
ImGui::PopID();
176187
}

C2ModLoader/WadNames.cpp

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
#include "WadNames.h"
2+
3+
// https://github.com/hdc0/Croc-2-mods/blob/master/doc/files.md
4+
5+
std::map<std::string, std::string> wadNames = {
6+
{"ads.dll", "Audio Playback Library"},
7+
{"Croc2.exe", "Game executable"},
8+
{"Loading.bmp", "Loading screen"},
9+
{"Loading0.bmp", "Loading screen (EN)"},
10+
{"Loading1.bmp", "Loading screen (FR)"},
11+
{"Loading2.bmp", "Loading screen (DE)"},
12+
{"Loading3.bmp", "Loading screen (IT)"},
13+
{"Loading4.bmp", "Loading screen (ES)"},
14+
{"Loading5.bmp", "Loading screen (NL)"},
15+
{"Loading6.bmp", "Loading screen (SE)"},
16+
{"logos.avi", "Publisher and developer logos"},
17+
{"Trademarks.bmp", "Splash screen"},
18+
{"music/CBK2.asf", "Music: \"Cannon Boat Keith\""},
19+
{"music/CBKLead.asf", "Music: \"CBK Lead Up\""},
20+
{"music/ChooCave.asf", "Music: \"Choo Cave\""},
21+
{"music/ChooOut.asf", "Music: \"Choo Outside\""},
22+
{"music/GTower.asf", "Music: \"Goo Manchoo Tower\""},
23+
{"music/JBarren1.asf", "Music: \"Barren Wheels One\""},
24+
{"music/JBarren2.asf", "Music: \"Forest Barren\""},
25+
{"music/JGoldRock.asf", "Music: \"Gold Rock Race\""},
26+
{"music/JHub1.asf", "Music: \"Hub Tribe 1\"/\"Hub Tribe 3\""},
27+
{"music/JHub2.asf", "Music: \"Hub Tribe 2\"/\"Hub Tribe 4\""},
28+
{"music/JIce2.asf", "Music: \"Ice Land\""},
29+
{"music/JIceCave.asf", "Music: \"Ice Cave\"/\"Ice Cave One\""},
30+
{"music/JInca1.asf", "Music: \"Inca Babies One\""},
31+
{"music/JJungle3.asf", "Music: \"Find The Key\""},
32+
{"music/JMine2.asf", "Music: \"The Mine\""},
33+
{"music/JRedAnt1.asf", "Music: \"Red Ant Lair\""},
34+
{"music/JRedAnt120.asf", "Music: \"Red Ant Bomb\""},
35+
{"music/JRedAnt25.asf", "Music: \"Red Ant Fast Lair\""},
36+
{"music/JThiefCave.asf", "Music: \"Thief Cave\""},
37+
{"music/JThiefJungle.asf", "Music: \"Thief Jungle\""},
38+
{"music/JTitle.asf", "Music: \"Croc\'s Theme\""},
39+
{"music/JVenus.asf", "Music: \"Venus\""},
40+
{"music/JVenusLead.asf", "Music: \"Venus Lead Up\""},
41+
{"music/KBarren1.asf", "Music: \"Barren Wheels Two\""},
42+
{"music/KBarren3.asf", "Music: \"Barren Three\""},
43+
{"music/KCave1.asf", "Music: \"Cave One\""},
44+
{"music/KCmCave.asf", "Music: \"Caveman Cave One\""},
45+
{"music/KCmCave2.asf", "Music: \"Caveman Cave Two\""},
46+
{"music/KDante1.asf", "Music: \"Dante One\""},
47+
{"music/KDante2.asf", "Music: \"Dante Two\""},
48+
{"music/KDungeon.asf", "Music: \"Dungeon\""},
49+
{"music/KFlavio.asf", "Music: \"Flavio\""},
50+
{"music/KGlide.asf", "Music: \"Glider\""},
51+
{"music/KIncaCave.asf", "Music: \"Inca Babies Two\""},
52+
{"music/KJungle3.asf", "Music: \"Jungle Two\""},
53+
{"music/KLLLarry.asf", "Music: \"Lava Lamp Larry\""},
54+
{"music/KMasher.asf", "Music: \"Masher\""},
55+
{"music/KMasherLead.asf", "Music: \"Masher Lead Up\""},
56+
{"music/KRiverRace.asf", "Music: \"River Race\""},
57+
{"music/KSnowball.asf", "Music: \"Snowball\""},
58+
{"music/KSoveena.asf", "Music: \"Soveena\""},
59+
{"music/KSoveenaLead.asf", "Music: \"Soveena Lead Up\""},
60+
{"music/KWaterfall.asf", "Music: \"Waterfall\""},
61+
{"wads/defanim.wad", ""},
62+
{"wads/fesound.wad", ""},
63+
64+
{"wads/t0i0m000.wad", "Main menu: main menu"},
65+
{"wads/t0i0m001.wad", "Main menu: options menu"},
66+
{"wads/t0i0m002.wad", "Main menu: new game"},
67+
{"wads/t0i0m003.wad", "Main menu: game over"},
68+
{"wads/t0i0m004.wad", "Main menu: save slot selection"},
69+
{"wads/t0i0m006.wad", ""},
70+
{"wads/t0i0m999.wad", ""},
71+
{"wads/t0l0m005.wad", "Main menu: credits"},
72+
{"wads/t0l1m002.dem", "Input data for \"The Village Masher\" demo"},
73+
{"wads/t0l1m002.wad", "Demo map \"The Village Masher\""},
74+
{"wads/T0L1M003.DEM", "Input data for \"Burning Down the Forest\" demo"},
75+
{"wads/t0l1m003.wad", "Demo map \"Burning Down the Forest\""},
76+
{"wads/T0L1M004.DEM", "Input data for \"Find the Wheels in the Jungle!\" demo"},
77+
{"wads/t0l1m004.wad", "Demo map \"Find the Wheels in the Jungle!\""},
78+
{"wads/t0l1m005.dem", "Input data for \"HEY! He Stole my lunch!\" demo"},
79+
{"wads/t0l1m005.wad", "Demo map \"HEY! He Stole my lunch!\""},
80+
{"wads/t0l1m006.wad", "Demo map \"Save the Ice Trapped Gobbos!\""},
81+
{"wads/T0L1M007.DEM", "Input data for \"Find 3 Lost Treasure Chests\" demo"},
82+
{"wads/t0l1m007.wad", "Demo map \"Find 3 Lost Treasure Chests\""},
83+
84+
{"wads/t1b1m001.wad", "Soveena The Squid (Part 1)"},
85+
{"wads/t1b1m002.wad", "Soveena The Squid (Part 2)"},
86+
{"wads/t1b2m001.wad", "Cannon Boat Keith"},
87+
{"wads/t1i1m001.a00", ""},
88+
{"wads/t1i1m001.wad", "Main Game Intro"},
89+
{"wads/t1i1m002.a00", ""},
90+
{"wads/t1i1m002.wad", "Sailor Village (New game cutscene)"},
91+
{"wads/t1i2m001.a00", ""},
92+
{"wads/t1i2m001.wad", "Cannon Boat Keith (Cutscene)"},
93+
{"wads/t1l1m001.wad", "Sailor Village"},
94+
{"wads/t1l1m004.wad", "Swap Meet Pete (Sailor Village)"},
95+
{"wads/t1l2m001.wad", "Find the Key! Save the Gobbo!"},
96+
{"wads/t1l2m002.wad", ""},
97+
{"wads/t1l3m001.wad", "Find 5 Lost Treasure Chests"},
98+
{"wads/t1l4m001.wad", "Get the Gobbo\'s Sandwich!"},
99+
{"wads/t1l5m001.wad", "Croc Vs Dantini Boat Race"},
100+
{"wads/t1l6m001.wad", "Save the Bird from the Thief"},
101+
{"wads/t1s1m001.wad", "Sailor Tribe - Secret Mine"},
102+
103+
{"wads/t2b1m001.wad", "Flavio the Thermal Fish"},
104+
{"wads/t2b2m001.wad", "Lava Lamp Larry"},
105+
{"wads/t2i2m001.a00", ""},
106+
{"wads/t2i2m001.wad", "Lava Lamp Larry (Cutscene)"},
107+
{"wads/t2l1m001.wad", "Cossack Village"},
108+
{"wads/t2l1m004.wad", "Swap Meet Pete (Cossack Village)"},
109+
{"wads/t2l2m001.wad", "Save the Ice Trapped Gobbos!"},
110+
{"wads/t2l3m001.wad", "Chase the Choo Choo Train"},
111+
{"wads/t2l5m001.wad", "It\'s just Snowball Madness!"},
112+
{"wads/t2l6m001.wad", "Hang Glider Valley"},
113+
{"wads/t2l7m001.wad", "KaBooom! It\'s Roger Red Ant"},
114+
{"wads/t2s1m001.wad", "Cossack Tribe - Secret Ice Cap"},
115+
116+
{"wads/t3b1m001.wad", "Venus Fly Von-Trappe (Part 1)"},
117+
{"wads/t3b1m002.wad", "Venus Fly Von-Trappe (Part 2)"},
118+
{"wads/t3b2m001.wad", "The Village Masher (Part 1)"},
119+
{"wads/t3b2m002.wad", "The Village Masher (Part 2)"},
120+
{"wads/t3i1m001.a00", ""},
121+
{"wads/t3i1m001.wad", "The Village Masher (Cutscene)"},
122+
{"wads/t3l1m001.wad", "Caveman Village"},
123+
{"wads/t3l1m004.wad", "Swap Meet Pete (Caveman Village)"},
124+
{"wads/t3l2m001.wad", "Find the Wheels in the Jungle!"},
125+
{"wads/t3l3m001.wad", "Find the Wheels in the Mine!"},
126+
{"wads/t3l4m001.wad", "Race Day at Goldrock"},
127+
{"wads/t3l5m001.wad", "Climb The Devil\'s Tower"},
128+
{"wads/t3l7m001.wad", "Save 50 Trapped Gobbos!"},
129+
{"wads/t3s1m001.wad", "Caveman Tribe - Secret Mine"},
130+
131+
{"wads/t4b1m001.wad", "Dante\'s Peak"},
132+
{"wads/t4b2m001.a00", ""},
133+
{"wads/t4b2m001.wad", "Dante\'s Final Fight"},
134+
{"wads/t4i1m001.a00", ""},
135+
{"wads/t4i1m001.wad", "Dante\'s Peak (Cutscene)"},
136+
{"wads/t4i2m001.a00", ""},
137+
{"wads/t4i2m001.wad", "Default new map (Ending cutscene)"},
138+
{"wads/t4l1m001.wad", "Inca Village"},
139+
{"wads/t4l1m004.wad", "Swap Meet Pete (Inca Village)"},
140+
{"wads/t4l2m001.wad", "Save 30 Gobbo babies!"},
141+
{"wads/t4l3m001.wad", "Up the Waterfall"},
142+
{"wads/t4l5m001.wad", "Bride of the Dungeon of Defright"},
143+
{"wads/t4l6m001.wad", "Goo Man Chu\'s Tower"},
144+
{"wads/t4s1m001.wad", "Inca Tribe - Secret Maze"},
145+
146+
{"wads/t5l2m001.wad", "Secret Sailor Village"},
147+
{"wads/t5l2m002.wad", "Sailor Secret 1"},
148+
{"wads/t5l2m003.wad", "Sailor Secret 2"},
149+
{"wads/t5l2m004.wad", "Sailor Secret 3"},
150+
{"wads/t5l2m005.wad", "Sailor Secret 4"},
151+
{"wads/t5l2m006.wad", "Sailor Secret 5"},
152+
153+
{"wads/t5l3m001.wad", "Secret Cossack Village"},
154+
{"wads/t5l3m002.wad", "Cossack Secret 1"},
155+
{"wads/t5l3m003.wad", "Cossack Secret 2"},
156+
{"wads/t5l3m004.wad", "Cossack Secret 3"},
157+
{"wads/t5l3m005.wad", "Cossack Secret 4"},
158+
{"wads/t5l3m006.wad", "Cossack Secret 5"},
159+
160+
{"wads/t5l4m001.wad", "Secret Caveman Village"},
161+
{"wads/t5l4m002.wad", "Caveman Secret 1"},
162+
{"wads/t5l4m003.wad", "Caveman Secret 2"},
163+
{"wads/t5l4m004.wad", "Caveman Secret 3"},
164+
{"wads/t5l4m005.wad", "Caveman Secret 4"},
165+
{"wads/t5l4m006.wad", "Caveman Secret 5"},
166+
};

C2ModLoader/WadNames.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
#include <map>
4+
#include <string>
5+
6+
extern std::map<std::string, std::string> wadNames;

0 commit comments

Comments
 (0)