Converter now adds a Dummy-Trigger to the xml. Copy and customize it in the Levelx.xml to create actual triggers.
This commit is contained in:
parent
8a7f7da0a8
commit
b4e9218e95
@ -150,3 +150,16 @@
|
|||||||
<skydome>
|
<skydome>
|
||||||
<texture>skydome.png</texture>
|
<texture>skydome.png</texture>
|
||||||
</skydome>
|
</skydome>
|
||||||
|
|
||||||
|
<trigger>
|
||||||
|
<name>-</name>
|
||||||
|
<xPosition>0.0</xPosition>
|
||||||
|
<yPosition>0.0</yPosition>
|
||||||
|
<zPosition>0.0</zPosition>
|
||||||
|
<distance>1.0</distance>
|
||||||
|
<isBiggerThan>false</isBiggerThan>
|
||||||
|
<idGreen>0</idGreen>
|
||||||
|
<idBlue>0</idBlue>
|
||||||
|
<objectNum>1</objectNum>
|
||||||
|
<functionPointer>-</functionPointer>
|
||||||
|
</trigger>
|
||||||
|
@ -39,6 +39,7 @@ Converter::Converter(std::string level){
|
|||||||
doc->LoadFile(charXmlFile);
|
doc->LoadFile(charXmlFile);
|
||||||
if (doc->ErrorID()!=0){
|
if (doc->ErrorID()!=0){
|
||||||
printf("Could not open xml, creating new xml.\n");
|
printf("Could not open xml, creating new xml.\n");
|
||||||
|
//Create all global Elements with Dummy-Values
|
||||||
std::vector<XMLElement*> lightAttributes;
|
std::vector<XMLElement*> lightAttributes;
|
||||||
lightAttributes.push_back(doc->NewElement("xOffset"));
|
lightAttributes.push_back(doc->NewElement("xOffset"));
|
||||||
lightAttributes.push_back(doc->NewElement("yOffset"));
|
lightAttributes.push_back(doc->NewElement("yOffset"));
|
||||||
@ -94,6 +95,40 @@ Converter::Converter(std::string level){
|
|||||||
doc->InsertEndChild(fogColour);
|
doc->InsertEndChild(fogColour);
|
||||||
doc->InsertEndChild(directionalLight);
|
doc->InsertEndChild(directionalLight);
|
||||||
doc->InsertEndChild(skydome);
|
doc->InsertEndChild(skydome);
|
||||||
|
|
||||||
|
//Create a Dummy-trigger
|
||||||
|
XMLElement* trigger = doc->NewElement("trigger");
|
||||||
|
doc->InsertEndChild(trigger);
|
||||||
|
XMLElement* name = doc->NewElement("name");
|
||||||
|
XMLElement* xPosition = doc->NewElement("xPosition");
|
||||||
|
XMLElement* yPosition = doc->NewElement("yPosition");
|
||||||
|
XMLElement* zPosition = doc->NewElement("zPosition");
|
||||||
|
XMLElement* distance = doc->NewElement("distance");
|
||||||
|
XMLElement* isBiggerThan = doc->NewElement("isBiggerThan");
|
||||||
|
XMLElement* idGreen = doc->NewElement("idGreen");
|
||||||
|
XMLElement* idBlue = doc->NewElement("idBlue");
|
||||||
|
XMLElement* objectNum = doc->NewElement("objectNum");
|
||||||
|
XMLElement* functionPointer = doc->NewElement("functionPointer");
|
||||||
|
name->SetText("-");
|
||||||
|
xPosition->SetText("0.0");
|
||||||
|
yPosition->SetText("0.0");
|
||||||
|
zPosition->SetText("0.0");
|
||||||
|
distance->SetText("1.0");
|
||||||
|
isBiggerThan->SetText("false");
|
||||||
|
idGreen->SetText("0");
|
||||||
|
idBlue->SetText("0");
|
||||||
|
objectNum->SetText("1");
|
||||||
|
functionPointer->SetText("-");
|
||||||
|
trigger->InsertEndChild(name);
|
||||||
|
trigger->InsertEndChild(xPosition);
|
||||||
|
trigger->InsertEndChild(yPosition);
|
||||||
|
trigger->InsertEndChild(zPosition);
|
||||||
|
trigger->InsertEndChild(distance);
|
||||||
|
trigger->InsertEndChild(isBiggerThan);
|
||||||
|
trigger->InsertEndChild(idGreen);
|
||||||
|
trigger->InsertEndChild(idBlue);
|
||||||
|
trigger->InsertEndChild(objectNum);
|
||||||
|
trigger->InsertEndChild(functionPointer);
|
||||||
}else{
|
}else{
|
||||||
XMLElement* thisComposition = doc->FirstChildElement("composition");
|
XMLElement* thisComposition = doc->FirstChildElement("composition");
|
||||||
int idGreen, idBlue;
|
int idGreen, idBlue;
|
||||||
|
Loading…
Reference in New Issue
Block a user