- worked on better inventory / general ui
~ more than 10800 lines of code (just counting .hpp's and .cpp's)
+
+6/15/2016:
+==========
+
+ - fixed major indentation problem with tinyxml
+ - windows build actually works first try..???
+ - everybody's pushed and merged and stuff
+ - item rendering stuff
+ "I'm also trying to make it so that other entities can use items.. if that makes sense."
+ - Andy
-3
+4
+
+
canSprint
0
canJump
0
Slow
-1
+0
for (const auto &xf : xmlFiles) {
if (xf[0] != '.') {
XMLDocument xmld;
- auto file = xmlFolder + xf;
- xmld.LoadFile(file.c_str());
+ auto file = (xmlFolder + xf).c_str();
+ xmld.LoadFile(file);
auto xmle = xmld.FirstChildElement("World");
xmle->DeleteAttribute("dindex");
xmle = xmle->NextSiblingElement();
}
- xmld.SaveFile(file.c_str(), false);
+ xmld.SaveFile(file, false);
}
}
void NPC::interact() { //have the npc's interact back to the player
std::thread([this]{
std::vector<XMLElement *> dopt;
- XMLDocument xml;
+ XMLDocument *xml;
XMLElement *exml,*oxml;
static unsigned int oldidx = 9999;
loc.y += 5;
- canMove=false;
- left = (player->loc.x < loc.x);
- right = !left;
+ // freeze the npc, face the player
+ canMove = false;
+ left = (player->loc.x < loc.x);
+ right = !left;
+ // if there's actual scripted stuff to do, do it
if (dialogCount && dialogIndex != 9999) {
// load the XML file and find the dialog tags
- if (outnabout == 0)
- xml.LoadFile(currentXML.c_str());
- else if (outnabout < 0)
- xml.LoadFile((xmlFolder + currentWorld->getToLeft()).c_str());
- else
- xml.LoadFile((xmlFolder + currentWorld->getToRight()).c_str());
+ if (outnabout == 0) {
+ xml = ¤tXMLDoc;
+ } else if (outnabout < 0) {
+ xml = new XMLDocument();
+ xml->LoadFile((xmlFolder + currentWorld->getToLeft()).c_str());
+ } else {
+ xml = new XMLDocument();
+ xml->LoadFile((xmlFolder + currentWorld->getToRight()).c_str());
+ }
COMMONAIFUNC:
idx = 0;
stop = false;
- exml = xml.FirstChildElement("Dialog");
+ exml = xml->FirstChildElement("Dialog");
// search for the dialog block associated with this npc
while (exml->StrAttribute("name") != name)
}
// asdlfkj
- if (exml->GetText() == nullptr)
+ auto txml = exml->FirstChildElement("content");
+ if (txml == nullptr)
goto OTHERSTUFF;
- ptr = exml->GetText() - 1;
+ ptr = txml->GetText() - 1;
while (*++ptr && isspace(*ptr));
// handle dialog options
<gotox playerMove="0" advance="1">-600</gotox>
</text>
<text id="1">
- ...
- <gotox>700</gotox>
+ <gotox>700</gotox>
<set id="Slow" value="0"/>
+ <content>
+ ...
+ </content>
</text>
</Dialog>
</text>
<text id="1">
...
- <gotox>1000</gotox>
+ <gotox>1000</gotox>
<set id="Slow" value="0"/>
<set id="canSprint" value="1"/>
</text>
<Dialog name="Bob">
<text id="0" nextid="1" pause="true">
Hey. Have a Dank MayMay :)
- <give id="Dank MayMay" count="1"/></text>
+ <give id="Dank MayMay" count="1"/></text>
<text id="1" nextid="2">
What? You want another Dank MayMay?
</text>
<text id="2" nextid="3" pause="true">
K.
- <give id="Dank MayMay" count="1"/></text>
+ <give id="Dank MayMay" count="1"/></text>
<text id="3" nextid="4">
Well... I'm out of Dank MayMays.
</text>
<text id="4">
Have a sword though.
- <give id="Wood Sword" count="1"/></text>
+ <give id="Wood Sword" count="1"/></text>
</Dialog>