Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Lines | void PlayerSettingsControl::CreateWidgets() | ||||
// To prevent recursion, don't handle GUI events right now | // To prevent recursion, don't handle GUI events right now | ||||
m_InGUIUpdate = true; | m_InGUIUpdate = true; | ||||
// Load default civ and player data | // Load default civ and player data | ||||
wxArrayString civNames; | wxArrayString civNames; | ||||
wxArrayString civCodes; | wxArrayString civCodes; | ||||
AtlasMessage::qGetCivData qryCiv; | AtlasMessage::qGetCivData qryCiv; | ||||
qryCiv.Post(); | qryCiv.Post(); | ||||
std::vector<std::vector<std::wstring>> civData = *qryCiv.data; | std::vector<std::string> civData = *qryCiv.data; | ||||
for (const std::vector<std::wstring>& civ : civData) | for (size_t i = 0; i < civData.size(); ++i) | ||||
{ | { | ||||
civCodes.Add(civ[0]); | AtObj civ = AtlasObject::LoadFromJSON(civData[i]); | ||||
civNames.Add(civ[1]); | civNames.Add(wxString::FromUTF8(civ["Name"])); | ||||
civCodes.Add(wxString::FromUTF8(civ["Code"])); | |||||
} | } | ||||
// Load AI data | // Load AI data | ||||
ArrayOfAIData ais(AIData::CompareAIData); | ArrayOfAIData ais(AIData::CompareAIData); | ||||
AtlasMessage::qGetAIData qryAI; | AtlasMessage::qGetAIData qryAI; | ||||
qryAI.Post(); | qryAI.Post(); | ||||
AtObj aiData = AtlasObject::LoadFromJSON(*qryAI.data); | AtObj aiData = AtlasObject::LoadFromJSON(*qryAI.data); | ||||
for (AtIter a = aiData["AIData"]["item"]; a.defined(); ++a) | for (AtIter a = aiData["AIData"]["item"]; a.defined(); ++a) | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator