summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/updaterwindow.cpp23
-rw-r--r--src/gui/updaterwindow.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index a1c625c32..eb2fe2f82 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -522,6 +522,7 @@ void UpdaterWindow::loadUpdates()
UpdaterWindow::addUpdateFile(resman, mUpdatesDir, fixPath,
mUpdateFiles[mUpdateIndex].name, false);
}
+ loadManaPlusUpdates(mUpdatesDir, resman);
}
void UpdaterWindow::loadLocalUpdates(std::string dir)
@@ -546,6 +547,28 @@ void UpdaterWindow::loadLocalUpdates(std::string dir)
UpdaterWindow::addUpdateFile(resman, dir, fixPath,
updateFiles[updateIndex].name, false);
}
+ loadManaPlusUpdates(dir, resman);
+}
+
+void UpdaterWindow::loadManaPlusUpdates(std::string dir,
+ ResourceManager *resman)
+{
+ std::string fixPath = dir + "/fix";
+ std::vector<updateFile> updateFiles
+ = loadXMLFile(fixPath + "/" + xmlUpdateFile);
+
+ for (unsigned int updateIndex = 0;
+ updateIndex < updateFiles.size(); updateIndex ++)
+ {
+ std::string name = updateFiles[updateIndex].name;
+ if (strStartWith(name, "manaplus_"))
+ {
+ struct stat statbuf;
+ std::string file = fixPath + "/" + name;
+ if (!stat(file.c_str(), &statbuf))
+ resman->addToSearchPath(file, false);
+ }
+ }
}
void UpdaterWindow::addUpdateFile(ResourceManager *resman, std::string path,
diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h
index f8ee4e29c..5a9c95d9f 100644
--- a/src/gui/updaterwindow.h
+++ b/src/gui/updaterwindow.h
@@ -113,6 +113,8 @@ class UpdaterWindow : public Window, public gcn::ActionListener,
std::string fixPath, std::string file,
bool append);
+ static void loadManaPlusUpdates(std::string dir, ResourceManager *resman);
+
int updateState;
private: