bool Monsters::reload() { loaded = false; scriptInterface.reset(); return loadFromXml(true); }
void sphereEpi::setup(){ freq = 400; nodeNum = 3; nodes = new epiNode*[nodeNum]; float r = 0.2f; nodes[0] = new epiNode(r, freq); nodes[1] = new epiNode(r, freq); nodes[2] = new epiNode(r, freq); //nodes[3] = new epiNode(r, freq); for(int i=0; i<nodeNum-1; i++){ nodes[i]->setChild(nodes[i+1]); } nodes[nodeNum-1]->setShowDot(true); name = "default.xml"; spiroData s = loadFromXml(name); setSpiroData(s); sOsc.setup(OSC_SEND_HOST, OSC_SEND_PORT); }
bool Actions::reload(){ this->loaded = false; //unload clear(); //load return loadFromXml(datadir); }
bool ScriptingManager::loadMods() { boost::filesystem::path modsPath(getFilePath(FILE_TYPE_MOD, "")); if(!boost::filesystem::exists(modsPath)) return true; //silently ignore int32_t i = 0; for(boost::filesystem::directory_iterator it(modsPath), end; it != end; ++it) { std::string name = it->leaf(); //deprecated in newer version of boost, use filename() if compilation fails even if deprecations aren't disabled if(!boost::filesystem::is_directory(it->status()) && name.find(".xml") != std::string::npos) { bool enabled; std::cout << "Loading " << name << "..."; if(loadFromXml(name, enabled)) { std::cout << " done"; if(!enabled) std::cout << ", but disabled"; std::cout << "."; } else std::cout << " failed!"; std::cout << std::endl; ++i; } } std::cout << "> " << i << " mods were loaded." << std::endl; modsLoaded = true; return true; }
//-------------------------------------------------------------- void ofxGLWarper::load(string loadFile){ ofxXmlSettings XML; if( !XML.loadFile(loadFile) ){ ofLog(OF_LOG_ERROR, "ofxGLWarper : xml file not loaded. Check file path."); return; } loadFromXml(XML); /* if(!XML.tagExists("corners")){ ofLog(OF_LOG_ERROR, "ofxGLWarper : incorrrect xml formating. No \"corners\" tag found"); return; } XML.pushTag("corners"); if (XML.getNumTags("corner")<4 ) { ofLog(OF_LOG_ERROR, "ofxGLWarper : incorrrect xml formating. less than 4 \"corner\" tags found"); return; } for(int i =0; i<4; i++){ int t = XML.addTag("corner"); XML.pushTag("corner", i); if (XML.tagExists("x") && XML.tagExists("y")){ corners[i].x = XML.getValue("x", double(1.0)); corners[i].y = XML.getValue("y", double(1.0)); } XML.popTag(); } processMatrices(); ofLog(OF_LOG_WARNING, "ofxGLWarper : xml file loaded OK!."); //*/ }
//-------------------------------------------------------------- void ofxGLWarper::load(const string &loadFile){ ofXml XML; if( !XML.load(loadFile) ){ ofLog(OF_LOG_ERROR, "ofxGLWarper : xml file not loaded. Check file path."); return; } loadFromXml(XML); }
void XmlSerializable :: loadFromXml(const QString& s, const char* element_tag, XmlContext* context) { XMLResults results; XMLNode e = XMLNode::parseString(s.toUtf8(), element_tag, &results); if (e.isEmpty()) ntk_throw_exception("Could not parse xml file: " + e.getError(results.error)); loadFromXml(e, element_tag, context); }
bool Skin::loadSkin( File &skinFile, int numberOfChannels) { updateSkin(numberOfChannels); return loadFromXml(skinFile, "squeezer-skin", "1.0"); }
bool Monsters::reload() { loaded = false; delete scriptInterface; scriptInterface = nullptr; monsterScriptList.clear(); return loadFromXml(true); }
void XmlSerializable :: loadFromXml(const QFileInfo& fileinfo, const char* element_tag, XmlContext* context) { ntk_throw_exception_if(!fileinfo.isFile(), "Xml file does not exist."); XMLResults results; XMLNode e = XMLNode::parseFile(fileinfo.absoluteFilePath().toUtf8(), element_tag, &results); if (e.isEmpty()) ntk_throw_exception("Could not parse xml file: " + e.getError(results.error)); loadFromXml(e, element_tag, context); }
bool Store::reload() { categories.clear(); loaded = false; scriptInterface.reset(); return loadFromXml(true); }
bool FeatureIndexer :: loadFromDisk() { QFileInfo f ((m_db.directory() + "/" + getIndexerFilename()).c_str()); if (!f.isFile()) return false; try { loadFromXml(f); } catch (const std::exception& e) { ntk_log() << "Exception received: " << e.what(); return false; } return true; }
bool Commands::reload() { for (const auto& it : commandMap) { Command* command = it.second; command->groupId = 1; command->accountType = ACCOUNT_TYPE_GOD; command->log = true; } g_game.resetCommandTag(); return loadFromXml(); }
bool Skin::loadSkin( File &skinFile, int numberOfChannels, int crestFactor, int meterType) { updateSkin(numberOfChannels, crestFactor, meterType); return loadFromXml(skinFile, "trakmeter-skin", "1.1"); }
bool Items::reload() { clear(); loadFromOtb("data/items/items.otb"); if (!loadFromXml()) { return false; } g_moveEvents->reload(); g_weapons->reload(); g_weapons->loadDefaults(); return true; }
bool Npc::load() { if (isLoaded()) { return true; } reset(); if (!m_scriptInterface) { m_scriptInterface = new NpcScriptInterface(); m_scriptInterface->loadNpcLib("data/npc/lib/npc.lua"); } loaded = loadFromXml(m_filename); return isLoaded(); }
bool Npc::load() { if(isLoaded()){ return true; } reset(); if(!m_scriptInterface){ m_scriptInterface = new NpcScriptInterface(); m_scriptInterface->loadNpcLib(std::string(m_datadir + "npc/scripts/lib/npc.lua")); } loaded = loadFromXml(m_filename); return isLoaded(); }
bool Npc::load() { if (loaded) { return true; } reset(); if (!scriptInterface) { scriptInterface = new NpcScriptInterface(); scriptInterface->loadNpcLib("data/npc/lib/npc.lua"); } loaded = loadFromXml(); return loaded; }
NonPlayerCharacter::NonPlayerCharacter(TiXmlElement* xml, Game * game, b2Vec2 origin) : Character(xml, game, origin) { loadFromXml(xml, origin); targetCharacter = -1; aiPatternsCount = 0; aiPatterns = new int[10]; traverseMove = 0; for (int i = 0; i < movesCount; i++) { if ( compareStrings(moveNames[i], "traverse") ) { traverseMove = i; break; } } }
bool ScriptManager::loadMods() { boost::filesystem::path modsPath(getFilePath(FILE_TYPE_MOD)); if(!boost::filesystem::exists(modsPath)) { std::clog << "[Error - ScriptManager::loadMods] Couldn't locate main directory" << std::endl; return false; } int32_t i = 0, j = 0; bool enabled = false; for(boost::filesystem::directory_iterator it(modsPath), end; it != end; ++it) { std::string s = it->leaf(); if(boost::filesystem::is_directory(it->status()) && (s.size() > 4 ? s.substr(s.size() - 4) : "") != ".xml") continue; std::clog << "> Loading " << s << "..."; if(loadFromXml(s, enabled)) { std::clog << " done"; if(!enabled) { ++j; std::clog << ", but disabled"; } std::clog << "."; } else std::clog << " failed!"; std::clog << std::endl; ++i; } std::clog << "> " << i << " mods were loaded"; if(j) std::clog << " (" << j << " disabled)"; std::clog << "." << std::endl; modsLoaded = true; return true; }
bool Outfits::reload() { allOutfits.clear(); outfitMaps.clear(); bool result = loadFromXml(m_datadir); if (result) { for (AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it) { it->second->setSex(it->second->getSex()); it->second->setCurrentOutfit(it->second->getCurrentOutfit()); } } return result; }
bool JucerDocument::reloadFromDocument() { const String cppContent (cpp->getCodeDocument().getAllContent()); ScopedPointer<XmlElement> newXML (pullMetaDataFromCppFile (cppContent)); if (newXML == nullptr || ! newXML->hasTagName (jucerCompXmlTag)) return false; if (currentXML != nullptr && currentXML->isEquivalentTo (newXML, true)) return true; currentXML = newXML; stopTimer(); resources.loadFromCpp (getCppFile(), cppContent); return loadFromXml (*currentXML); }
//-------------------------------------------------------------- void Scenario::setup(ofxBulletWorldRigid &_world, bool bAddScenarioCover){ loadFromXml(_world); //loadFromJSON(world); //saveToJSON(); if (bAddScenarioCover){ loadBasicScenario(_world, ofVec3f(0,0,0)); addCoverScenario(_world); } ballLimitsBoxSize = 25; // the size of the box that is used to detect is the ball is outside the scenario /* set light position */ lightPos = ofVec3f(0, 10, -15.f); //copy a reference //world = _world; DebugMode = false; }
bool ScriptingManager::loadMods() { boost::filesystem::path modsPath(getFilePath(FILE_TYPE_MOD, "")); if(!boost::filesystem::exists(modsPath)) return true; //silently ignore int32_t i = 0, j = 0; bool enabled = false; for(boost::filesystem::directory_iterator it(modsPath), end; it != end; ++it) { std::string s = BOOST_DIR_ITER_FILENAME(it); if(boost::filesystem::is_directory(it->status()) && (s.size() > 4 ? s.substr(s.size() - 4) : "") != ".xml") continue; std::cout << "> Loading " << s << "..."; if(loadFromXml(s, enabled)) { std::cout << " done"; if(!enabled) { ++j; std::cout << ", but disabled"; } std::cout << "."; } else std::cout << " failed!"; std::cout << std::endl; ++i; } std::cout << "> " << i << " mods were loaded"; if(j) std::cout << " (" << j << " disabled)"; std::cout << "." << std::endl; modsLoaded = true; return true; }
bool JucerDocument::reloadFromDocument() { const String cppContent (cpp->getCodeDocument().getAllContent()); std::unique_ptr<XmlElement> newXML (pullMetaDataFromCppFile (cppContent)); if (newXML == nullptr || ! newXML->hasTagName (jucerCompXmlTag)) return false; if (currentXML != nullptr && currentXML->isEquivalentTo (newXML.get(), true)) return true; currentXML.reset (newXML.release()); stopTimer(); resources.loadFromCpp (getCppFile(), cppContent); bool result = loadFromXml (*currentXML); extractCustomPaintSnippetsFromCppFile (cppContent); return result; }
bool Vocations::reload() { clear(); return loadFromXml(); }
bool BaseEvents::reload() { m_loaded = false; clear(); return loadFromXml(); }
bool Quests::reload() { clear(); return loadFromXml(); }
bool Mounts::reload() { mounts.clear(); return loadFromXml(); }
bool Raids::reload() { clear(); return loadFromXml(); }