Changeset 6051 for code/branches/menu/src/libraries
- Timestamp:
- Nov 12, 2009, 7:41:20 PM (15 years ago)
- Location:
- code/branches/menu/src/libraries/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menu/src/libraries/core/GUIManager.cc
r6048 r6051 121 121 // setup scripting 122 122 luaState_.reset(new LuaState()); 123 rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua", "GUI"); 124 // This is necessary to ensure that input events also use the right resource info when triggering lua functions 125 luaState_->setDefaultResourceInfo(this->rootFileInfo_); 123 126 scriptModule_.reset(new LuaScriptModule(luaState_->getInternalLuaState())); 124 127 … … 135 138 136 139 // Initialise the basic lua code 137 rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua", "GUI");138 140 this->luaState_->doFile("InitialiseGUI.lua", "GUI", false); 139 141 -
code/branches/menu/src/libraries/core/LuaState.cc
r6024 r6051 116 116 } 117 117 118 void LuaState::includeString(const std::string& code, shared_ptr<ResourceInfo>sourceFileInfo)118 void LuaState::includeString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo) 119 119 { 120 120 // Parse string with provided include parser (otherwise don't preparse at all) … … 138 138 } 139 139 140 void LuaState::doString(const std::string& code, shared_ptr<ResourceInfo>sourceFileInfo)140 void LuaState::doString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo) 141 141 { 142 142 // Save the oold source file info -
code/branches/menu/src/libraries/core/LuaState.h
r5781 r6051 57 57 58 58 void doFile(const std::string& filename, const std::string& resourceGroup = "General", bool bSearchOtherPaths = true); // tolua_export 59 void doString(const std::string& code, shared_ptr<ResourceInfo>sourceFileInfo = shared_ptr<ResourceInfo>());59 void doString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo = shared_ptr<ResourceInfo>()); 60 60 61 61 void includeFile(const std::string& filename, const std::string& resourceGroup = "General", bool bSearchOtherPaths = true); // tolua_export 62 void includeString(const std::string& code, shared_ptr<ResourceInfo>sourceFileInfo = shared_ptr<ResourceInfo>());62 void includeString(const std::string& code, const shared_ptr<ResourceInfo>& sourceFileInfo = shared_ptr<ResourceInfo>()); 63 63 64 64 void luaPrint(const std::string& str); // tolua_export … … 71 71 void setIncludeParser(std::string (*function)(const std::string&)) { includeParseFunction_ = function; } 72 72 lua_State* getInternalLuaState() { return luaState_; } 73 74 void setDefaultResourceInfo(const shared_ptr<ResourceInfo>& sourceFileInfo) { this->sourceFileInfo_ = sourceFileInfo; } 75 const shared_ptr<ResourceInfo>& getDefaultResourceInfo() { return this->sourceFileInfo_; } 73 76 74 77 static bool addToluaInterface(int (*function)(lua_State*), const std::string& name);
Note: See TracChangeset
for help on using the changeset viewer.