mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-17 02:02:50 +00:00
refactor(dashboard): routes name zones, objects and phrases through GameText
The routes' own zone name helpers and the CDClient's English zone and leaderboard header copies give way to GameText, so every name comes from the locale in the viewer's language; the Network page's world labels, mail, missions, leaderboards, item info (cached per language) and the settings/vanity help strings too. Reward code 4 and the plaque text name their zone from the locale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "CharacterProgress.h"
|
||||
#include "GameText.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
@@ -186,10 +187,8 @@ namespace {
|
||||
for (const auto& [zoneId, s] : stats) zoneIds.insert(zoneId);
|
||||
for (const auto& [zoneId, zone] : catalog.zones) if (zone.released) zoneIds.insert(zoneId);
|
||||
zoneIds.erase(0); // character select
|
||||
const auto& names = ZoneNames();
|
||||
nlohmann::json zones = nlohmann::json::array();
|
||||
for (const auto zoneId : zoneIds) {
|
||||
const auto key = std::to_string(zoneId);
|
||||
const auto zone = catalog.zones.find(zoneId);
|
||||
nlohmann::json summary = nlohmann::json::array();
|
||||
if (zone != catalog.zones.end()) {
|
||||
@@ -206,7 +205,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
const auto category = zone != catalog.zones.end() ? zone->second.category : std::nullopt;
|
||||
zones.push_back({ {"id", zoneId}, {"name", names.contains(key) ? names[key] : nlohmann::json("Zone " + key)}, {"visited", visited.contains(zoneId)},
|
||||
zones.push_back({ {"id", zoneId}, {"name", GameText::ZoneName(zoneId)}, {"visited", visited.contains(zoneId)},
|
||||
{"category", category ? nlohmann::json(*category) : nlohmann::json(nullptr)}, {"stats", stats.contains(zoneId) ? stats[zoneId] : nlohmann::json(nullptr)},
|
||||
{"summary", summary} });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user