summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-01 18:45:31 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-01 18:45:31 +0300
commit49f27fffbe07e66a3047812a838f03d7636cc4a9 (patch)
tree68996fa1dfc002e239513af1a92d1ffd69539204 /src/gui
parent69108c8a2892cf87a3d425b5e82e0eadbb5f7fa9 (diff)
downloadplus-49f27fffbe07e66a3047812a838f03d7636cc4a9.tar.gz
plus-49f27fffbe07e66a3047812a838f03d7636cc4a9.tar.bz2
plus-49f27fffbe07e66a3047812a838f03d7636cc4a9.tar.xz
plus-49f27fffbe07e66a3047812a838f03d7636cc4a9.zip
Add chat command /testparticle for testing particle effects on player.
Command: /testparticle particle.xml - set particle effect on player. /testparticle - remove particle effect. Each second it check for particle file update and reloading it if need.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/updaterwindow.cpp9
-rw-r--r--src/gui/updaterwindow.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index 28efe9499..80ff0c580 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -925,6 +925,15 @@ bool UpdaterWindow::validateFile(const std::string &filePath,
return adler == hash;
}
+unsigned long UpdaterWindow::getFileHash(const std::string &filePath)
+{
+ int size = 0;
+ char *buf = static_cast<char*>(ResourceManager::loadFile(filePath, size));
+ if (!buf)
+ return 0;
+ return Net::Download::adlerBuffer(buf, size);
+}
+
void UpdaterWindow::handleLink(const std::string &link,
gcn::MouseEvent *event A_UNUSED)
{
diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h
index 440344367..e317e3f95 100644
--- a/src/gui/updaterwindow.h
+++ b/src/gui/updaterwindow.h
@@ -145,6 +145,8 @@ class UpdaterWindow final : public Window,
static void unloadManaPlusUpdates(const std::string &dir,
const ResourceManager *const resman);
+ static unsigned long getFileHash(const std::string &filePath);
+
private:
void download();