Rename and publicly expose LoadStringTable->ImGuiLoadStringTable

This commit is contained in:
Phillip Stephens 2021-05-31 13:09:58 -07:00
parent cc54aad6f0
commit ff8c1b15a1
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
2 changed files with 6 additions and 5 deletions

View File

@ -37,7 +37,7 @@ void ImGuiTextCenter(std::string_view text) {
static std::unordered_map<CAssetId, std::unique_ptr<CDummyWorld>> dummyWorlds; static std::unordered_map<CAssetId, std::unique_ptr<CDummyWorld>> dummyWorlds;
static std::unordered_map<CAssetId, TCachedToken<CStringTable>> stringTables; static std::unordered_map<CAssetId, TCachedToken<CStringTable>> stringTables;
static std::string LoadStringTable(CAssetId stringId, int idx) { std::string ImGuiLoadStringTable(CAssetId stringId, int idx) {
if (!stringId.IsValid()) { if (!stringId.IsValid()) {
return ""s; return ""s;
} }
@ -71,7 +71,7 @@ static std::vector<std::pair<std::string, CAssetId>> ListWorlds() {
if (!stringId.IsValid()) { if (!stringId.IsValid()) {
continue; continue;
} }
worlds.emplace_back(LoadStringTable(stringId, 0), worldId); worlds.emplace_back(ImGuiLoadStringTable(stringId, 0), worldId);
} }
return worlds; return worlds;
} }
@ -88,7 +88,7 @@ static std::vector<std::pair<std::string, TAreaId>> ListAreas(CAssetId worldId)
if (!stringId.IsValid()) { if (!stringId.IsValid()) {
continue; continue;
} }
areas.emplace_back(LoadStringTable(stringId, 0), i); areas.emplace_back(ImGuiLoadStringTable(stringId, 0), i);
} }
return areas; return areas;
} }
@ -782,7 +782,7 @@ void ImGuiConsole::ShowDebugOverlay() {
} }
hasPrevious = true; hasPrevious = true;
const std::string name = LoadStringTable(g_StateManager->GetWorld()->IGetStringTableAssetId(), 0); const std::string name = ImGuiLoadStringTable(g_StateManager->GetWorld()->IGetStringTableAssetId(), 0);
ImGuiStringViewText( ImGuiStringViewText(
fmt::format(FMT_STRING("World Asset ID: 0x{}, Name: {}\n"), g_GameState->CurrentWorldAssetId(), name)); fmt::format(FMT_STRING("World Asset ID: 0x{}, Name: {}\n"), g_GameState->CurrentWorldAssetId(), name));
} }
@ -809,7 +809,7 @@ void ImGuiConsole::ShowDebugOverlay() {
CAssetId stringId = pArea->IGetStringTableAssetId(); CAssetId stringId = pArea->IGetStringTableAssetId();
ImGuiStringViewText( ImGuiStringViewText(
fmt::format(FMT_STRING("Area Asset ID: 0x{}, Name: {}\nArea ID: {}, Active Layer bits: {}\n"), fmt::format(FMT_STRING("Area Asset ID: 0x{}, Name: {}\nArea ID: {}, Active Layer bits: {}\n"),
pArea->GetAreaAssetId(), LoadStringTable(stringId, 0), pArea->GetAreaId(), layerBits)); pArea->GetAreaAssetId(), ImGuiLoadStringTable(stringId, 0), pArea->GetAreaId(), layerBits));
} }
} }
if (m_layerInfo && g_StateManager != nullptr) { if (m_layerInfo && g_StateManager != nullptr) {

View File

@ -14,6 +14,7 @@
namespace metaforce { namespace metaforce {
void ImGuiStringViewText(std::string_view text); void ImGuiStringViewText(std::string_view text);
void ImGuiTextCenter(std::string_view text); void ImGuiTextCenter(std::string_view text);
std::string ImGuiLoadStringTable(CAssetId stringId, int idx);
struct ImGuiEntityEntry { struct ImGuiEntityEntry {
TUniqueId uid = kInvalidUniqueId; TUniqueId uid = kInvalidUniqueId;