minor refactor

This commit is contained in:
MihailRis 2025-01-03 13:50:25 +03:00
parent 9d7816a286
commit 3187243a7d
4 changed files with 5 additions and 4 deletions

View File

@ -8,6 +8,8 @@ using runnable = std::function<void()>;
template<class T> using supplier = std::function<T()>;
template<class T> using consumer = std::function<void(T)>;
using KeyCallback = std::function<bool()>;
// data sources
using wstringsupplier = std::function<std::wstring()>;
using doublesupplier = std::function<double()>;

View File

@ -247,7 +247,7 @@ runnable lua::create_runnable(State* L) {
};
}
supplier<bool> lua::create_simple_handler(State* L) {
KeyCallback lua::create_simple_handler(State* L) {
auto funcptr = create_lambda_handler(L);
return [=]() -> bool {
getglobal(L, LAMBDAS_TABLE);

View File

@ -574,7 +574,7 @@ namespace lua {
}
runnable create_runnable(lua::State*);
supplier<bool> create_simple_handler(lua::State*);
KeyCallback create_simple_handler(lua::State*);
scripting::common_func create_lambda(lua::State*);
scripting::common_func create_lambda_nothrow(lua::State*);

View File

@ -4,6 +4,7 @@
#include <unordered_map>
#include <vector>
#include "delegates.hpp"
#include "typedefs.hpp"
#include "input.hpp"
@ -20,8 +21,6 @@ class Events {
static uint currentFrame;
static bool cursor_drag;
public:
using KeyCallback = std::function<bool()>;
static int scroll;
static glm::vec2 delta;
static glm::vec2 cursor;