-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReplayMapChangerGUI.cpp
More file actions
44 lines (40 loc) · 1003 Bytes
/
ReplayMapChangerGUI.cpp
File metadata and controls
44 lines (40 loc) · 1003 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
#include "pch.h"
#include "ReplayMapChanger.h"
void ReplayMapChanger::RenderSettings()
{
if (isInReplay)
{
if (!mapNames.empty())
{
static std::string currentMapName = mapNames.begin()->first;
const char* combo_preview_value = currentMapName.c_str();
if (ImGui::BeginCombo("##MapsCombo", combo_preview_value))
{
for (auto& mapName : mapNames)
{
const bool isSelected = currentMapName == mapName.first;
if (ImGui::Selectable(mapName.first.c_str(), isSelected))
currentMapName = mapName.first;
if (isSelected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (ImGui::Button("Change Map"))
{
std::string mapName = mapNames.at(currentMapName);
gameWrapper->Execute([this, mapName](GameWrapper* gw) {
LoadReplayWithMap(mapName);
});
}
}
else
{
ImGui::TextUnformatted("Unable to get map list at the moment. Try again later.");
}
}
else
{
ImGui::TextUnformatted("Enter a replay first.");
}
}