diff options
Diffstat (limited to 'src/FbTk/LResource.hh')
-rw-r--r-- | src/FbTk/LResource.hh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/FbTk/LResource.hh b/src/FbTk/LResource.hh index f0f8050..30f0e02 100644 --- a/src/FbTk/LResource.hh +++ b/src/FbTk/LResource.hh | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <string> | 28 | #include <string> |
29 | 29 | ||
30 | #include "Resource.hh" | 30 | #include "Resource.hh" |
31 | #include "Timer.hh" | ||
31 | 32 | ||
32 | namespace FbTk { | 33 | namespace FbTk { |
33 | 34 | ||
@@ -37,11 +38,18 @@ class LResourceManager: public ResourceManager_base { | |||
37 | public: | 38 | public: |
38 | static void convert(ResourceManager &old, const std::string &new_file); | 39 | static void convert(ResourceManager &old, const std::string &new_file); |
39 | 40 | ||
40 | LResourceManager(const std::string &root, Lua &l); | 41 | /** |
42 | * @param root the name of the table where settings will reside | ||
43 | * @param l lua context | ||
44 | * @param autosave delay (in seconds) for automatic saving of resources. Modifying a resource | ||
45 | * starts a timer. If another resource is modified, the timer is restarted. 0 = disabled | ||
46 | */ | ||
47 | LResourceManager(const std::string &root, Lua &l, unsigned int autosave = 0); | ||
41 | void load(const std::string &filename, const std::string &fallback); | 48 | void load(const std::string &filename, const std::string &fallback); |
42 | virtual bool save(const char *filename, const char *); | 49 | virtual bool save(const char *filename, const char *); |
43 | virtual void addResource(Resource_base &r); | 50 | virtual void addResource(Resource_base &r); |
44 | virtual void removeResource(Resource_base &r); | 51 | virtual void removeResource(Resource_base &r); |
52 | virtual void resourceChanged(Resource_base &r); | ||
45 | void setLua(Lua &l); | 53 | void setLua(Lua &l); |
46 | 54 | ||
47 | private: | 55 | private: |
@@ -50,6 +58,7 @@ private: | |||
50 | 58 | ||
51 | Lua *m_l; | 59 | Lua *m_l; |
52 | std::string m_filename; | 60 | std::string m_filename; |
61 | Timer m_savetimer; | ||
53 | }; | 62 | }; |
54 | 63 | ||
55 | } // end namespace FbTk | 64 | } // end namespace FbTk |