增加睡眠
This commit is contained in:
@@ -20,6 +20,7 @@ If you have any questions, please contact us: 1585346868@qq.com Or visit our web
|
||||
#include "util/counter.hpp"
|
||||
#include "util/codec.h"
|
||||
#include "util/time.h"
|
||||
#include "util/system.h"
|
||||
#include "core/global.h"
|
||||
#include "core/app.h"
|
||||
#include "core/statemanager.h"
|
||||
@@ -90,6 +91,10 @@ std::optional<int64> module::globalfuncs::toint(const sol::object& obj)
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
void module::globalfuncs::sleep_msec(int msec)
|
||||
{
|
||||
system::sleep_msec(msec);
|
||||
}
|
||||
void module::globalfuncs::regist(sol::state* lua)
|
||||
{
|
||||
lua->set_function("fw_set_ptr", module::globalfuncs::set_ptr);
|
||||
@@ -104,6 +109,7 @@ void module::globalfuncs::regist(sol::state* lua)
|
||||
lua->set_function("fw_now_sec", ylib::time::now_sec);
|
||||
lua->set_function("fw_create_env", module::globalfuncs::create_env);
|
||||
lua->set_function("fw_toint", module::globalfuncs::toint);
|
||||
lua->set_function("fw_sleep_msec", module::globalfuncs::sleep_msec);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ namespace module
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static std::optional<int64> toint(const sol::object& arg);
|
||||
|
||||
/// <summary>
|
||||
/// 延迟
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static void sleep_msec(int msec);
|
||||
|
||||
static void regist(sol::state* lua);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user