]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/NasalSys.hxx
#545: Fix ATC chatter sound settings being ignored
[flightgear.git] / src / Scripting / NasalSys.hxx
index 6d64e5097ba66f3ddfd4dd01902178c047bae76d..ceff996dab1531375abb4d1243424db55e8e8933 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/misc/sg_dir.hxx>
 #include <simgear/nasal/nasal.h>
 #include <simgear/scene/model/modellib.hxx>
 #include <simgear/xml/easyxml.hxx>
@@ -24,7 +25,7 @@ public:
 
     // Loads a nasal script from an external file and inserts it as a
     // global module of the specified name.
-    void loadModule(SGPath file, const char* moduleName);
+    bool loadModule(SGPath file, const char* moduleName);
 
     // Simple hook to run arbitrary source code.  Returns a bool to
     // indicate successful execution.  Does *not* return any Nasal
@@ -53,7 +54,7 @@ public:
     // Callbacks for command and timer bindings
     virtual bool handleCommand(const SGPropertyNode* arg);
 
-    void createModule(const char* moduleName, const char* fileName,
+    bool createModule(const char* moduleName, const char* fileName,
                       const char* src, int len, const SGPropertyNode* cmdarg=0,
                       int argc=0, naRef*args=0);
 
@@ -65,6 +66,7 @@ public:
 private:
     friend class FGNasalScript;
     friend class FGNasalListener;
+    friend class FGNasalModuleListener;
 
     //
     // FGTimer subclass for handling Nasal timer callbacks.
@@ -85,6 +87,9 @@ private:
     static int _listenerId;
 
     void loadPropertyScripts();
+    void loadPropertyScripts(SGPropertyNode* n);
+    void loadScriptDirectory(simgear::Dir nasalDir);
+    void addModule(string moduleName, simgear::PathList scripts);
     void hashset(naRef hash, const char* key, naRef val);
     void logError(naContext);
     naRef parse(const char* filename, const char* buf, int len);