mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-18 10:42:49 +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 "CharacterTools.h"
|
||||
#include "GameText.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
@@ -72,14 +73,9 @@ namespace {
|
||||
for (auto& inventory : summary["inventories"]) for (auto& item : inventory["items"]) item["name"] = ClientAssets::ItemName(item["lot"].get<LOT>());
|
||||
}
|
||||
|
||||
nlohmann::json ZoneName(uint32_t zone) {
|
||||
const auto& zones = ZoneNames();
|
||||
const auto key = std::to_string(zone);
|
||||
return zones.contains(key) ? zones[key] : nlohmann::json("Zone " + key);
|
||||
}
|
||||
|
||||
nlohmann::json WithZones(nlohmann::json rows) {
|
||||
for (auto& row : rows) row["zone_name"] = ZoneName(row.value("zone_id", 0u));
|
||||
for (auto& row : rows) row["zone_name"] = GameText::ZoneName(row.value("zone_id", 0u));
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user