示例#1
0
文件: game.cpp 项目: vincele/xoreos
void Game::loadTalkTables(const Common::UString &dir, uint32 priority, ChangeList &res,
                          Aurora::Language language) {

	if (EventMan.quitRequested())
		return;

	const Common::UString tlkDir =
		Common::FilePath::findSubDirectory(ResMan.getDataBase(), dir + "/data/talktables", true);

	Common::FileList files(tlkDir, 0);

	files.sort(true);
	files.relativize(tlkDir);

	const Common::UString languageTLK  = DragonAge2Engine::getLanguageString(language) +   ".tlk";
	const Common::UString languageTLKP = DragonAge2Engine::getLanguageString(language) + "_p.tlk";
	for (Common::FileList::const_iterator f = files.begin(); f != files.end(); ++f) {
		if        (f->toLower().endsWith(languageTLK)) {
			Common::UString tlk = *f;
			tlk.truncate(tlk.size() - languageTLK.size());

			loadTalkTable(tlk, "", language, priority++, res);
		} else if (f->toLower().endsWith(languageTLKP)) {
			Common::UString tlk = *f;
			tlk.truncate(tlk.size() - languageTLKP.size());

			loadTalkTable(tlk, "_p", language, priority++, res);
		}
	}
}
示例#2
0
文件: game.cpp 项目: farmboy0/xoreos
void Game::getModules(std::vector<Common::UString> &modules) {
	modules.clear();

	Common::UString moduleDir = ConfigMan.getString("KOTOR_moduleDir");
	if (moduleDir.empty())
		return;

	Common::FileList mods;
	mods.addDirectory(moduleDir);

	for (Common::FileList::const_iterator m = mods.begin(); m != mods.end(); ++m) {
		Common::UString file = m->toLower();
		if (!file.endsWith("_s.rim"))
			continue;

		file = Common::FilePath::getStem(file);
		file.truncate(file.size() - Common::UString("_s").size());

		modules.push_back(file);
	}

	std::sort(modules.begin(), modules.end(), Common::UString::iless());
}