mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Minifig editing
This commit is contained in:
@@ -352,6 +352,26 @@ void CharacterComponent::LoadFromXML() {
|
||||
}
|
||||
|
||||
void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* minifig = doc->FirstChildElement("obj")->FirstChildElement("mf");
|
||||
if (!minifig) {
|
||||
Game::logger->Log("CharacterComponent", "Failed to find mf tag while updating XML!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// write minifig information that might have been changed by commands
|
||||
|
||||
minifig->SetAttribute("es", m_Character->GetEyebrows());
|
||||
minifig->SetAttribute("ess", m_Character->GetEyes());
|
||||
minifig->SetAttribute("hc", m_Character->GetHairColor());
|
||||
minifig->SetAttribute("hs", m_Character->GetHairStyle());
|
||||
minifig->SetAttribute("l", m_Character->GetPantsColor());
|
||||
minifig->SetAttribute("lh", m_Character->GetLeftHand());
|
||||
minifig->SetAttribute("ms", m_Character->GetMouth());
|
||||
minifig->SetAttribute("rh", m_Character->GetRightHand());
|
||||
minifig->SetAttribute("t", m_Character->GetShirtColor());
|
||||
|
||||
// done with minifig
|
||||
|
||||
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
Game::logger->Log("CharacterComponent", "Failed to find char tag while updating XML!\n");
|
||||
|
@@ -259,11 +259,12 @@ public:
|
||||
*/
|
||||
void UpdatePlayerStatistic(StatisticID updateID, uint64_t updateValue = 1);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Character info regarding this character, including clothing styles, etc.
|
||||
*/
|
||||
Character* m_Character;
|
||||
Character* m_Character;
|
||||
private:
|
||||
|
||||
|
||||
/**
|
||||
* Whether this character is racing
|
||||
|
Reference in New Issue
Block a user