xx 2 лет назад
Родитель
Сommit
bf0891b1dc
2 измененных файлов с 10 добавлено и 1 удалено
  1. 6 0
      src/module/globalfuns.cpp
  2. 4 1
      src/module/globalfuns.h

+ 6 - 0
src/module/globalfuns.cpp

@@ -5,6 +5,11 @@
 #include "core/global.h"
 #include "core/app.h"
 static ylib::counter<uint64> s_counter_guid;
+std::string module::globalfuncs::website_dir(sol::this_state ts)
+{
+	GET_APP;
+	return app->config->website.dir;
+}
 void module::globalfuncs::regist(sol::state* lua)
 {
 	lua->set_function("set_ptr", module::globalfuncs::set_ptr);
@@ -13,6 +18,7 @@ void module::globalfuncs::regist(sol::state* lua)
 	lua->set_function("make_software_guid", module::globalfuncs::make_software_guid);
 	lua->set_function("throw_string", module::globalfuncs::throw_string);
 	lua->set_function("print", module::globalfuncs::print);
+	lua->set_function("website_dir", module::globalfuncs::website_dir);
 
 }
 std::string module::globalfuncs::make_software_guid()

+ 4 - 1
src/module/globalfuns.h

@@ -44,7 +44,10 @@ namespace module
 		/// </summary>
 		/// <param name="msg"></param>
 		static void throw_string(const std::string& msg);
-
+		/// <summary>
+		/// 网站目录
+		/// </summary>
+		static std::string website_dir(sol::this_state ts);
 
 		static void regist(sol::state* lua);
 	};