Skip to content

Commit 340f7b1

Browse files
authored
Merge branch 'praydog:master' into master
2 parents 1adb8c4 + c633636 commit 340f7b1

5 files changed

Lines changed: 180 additions & 6 deletions

File tree

dependencies/lua/src/ldebug.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
783783
va_start(argp, fmt);
784784
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
785785
va_end(argp);
786-
if (isLua(ci)) /* if Lua function, add source:line information */
786+
if (isLua(ci)) { /* if Lua function, add source:line information */
787787
luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
788+
setobjs2s(L, L->top - 2, L->top - 1); /* remove 'msg' from the stack */
789+
L->top--;
790+
}
788791
luaG_errormsg(L);
789792
}
790793

dependencies/lua/src/lvm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,10 @@ void luaV_concat (lua_State *L, int total) {
656656
/* collect total length and number of strings */
657657
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
658658
size_t l = vslen(s2v(top - n - 1));
659-
if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl))
659+
if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) {
660+
L->top = top - total; /* pop strings to avoid wasting stack */
660661
luaG_runerror(L, "string length overflow");
662+
}
661663
tl += l;
662664
}
663665
if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */
@@ -672,7 +674,7 @@ void luaV_concat (lua_State *L, int total) {
672674
setsvalue2s(L, top - n, ts); /* create result */
673675
}
674676
total -= n-1; /* got 'n' strings to create 1 new */
675-
L->top -= n-1; /* popped 'n' strings and pushed one */
677+
L->top = top - (n - 1); /* popped 'n' strings and pushed one */
676678
} while (total > 1); /* repeat until only 1 result left */
677679
}
678680

include/reframework/API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#endif
88

99
#define REFRAMEWORK_PLUGIN_VERSION_MAJOR 1
10-
#define REFRAMEWORK_PLUGIN_VERSION_MINOR 14
10+
#define REFRAMEWORK_PLUGIN_VERSION_MINOR 15
1111
#define REFRAMEWORK_PLUGIN_VERSION_PATCH 0
1212

1313
#define REFRAMEWORK_RENDERER_D3D11 0

include/reframework/API.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,12 @@ class API {
609609
reframework::InvokeRet invoke(API::ManagedObject* obj, const std::vector<void*>& args) {
610610
static const auto fn = API::s_instance->sdk()->method->invoke;
611611
reframework::InvokeRet out{};
612-
613-
auto result = fn(*this, obj, (void**)&args[0], args.size() * sizeof(void*), &out, sizeof(out));
612+
REFrameworkResult result;
613+
if (args.size() == 0) {
614+
result = fn(*this, obj, nullptr, 0, &out, sizeof(out));
615+
} else {
616+
result = fn(*this, obj, (void**)&args[0], args.size() * sizeof(void*), &out, sizeof(out));
617+
}
614618

615619
#ifdef REFRAMEWORK_API_EXCEPTIONS
616620
if (result != REFRAMEWORK_ERROR_NONE) {

src/mods/bindings/ImGui.cpp

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,6 +2238,171 @@ void bindings::open_imgui(ScriptState* s) {
22382238
"IsHovered", ImGuiTableColumnFlags_IsHovered
22392239
);
22402240

2241+
imgui.new_enum("ImGuiKey",
2242+
2243+
// Keys
2244+
"Key_None", ImGuiKey_None,
2245+
"Key_Tab", ImGuiKey_Tab,
2246+
"Key_LeftArrow", ImGuiKey_LeftArrow,
2247+
"Key_RightArrow", ImGuiKey_RightArrow,
2248+
"Key_UpArrow", ImGuiKey_UpArrow,
2249+
"Key_DownArrow", ImGuiKey_DownArrow,
2250+
"Key_PageUp", ImGuiKey_PageUp,
2251+
"Key_PageDown", ImGuiKey_PageDown,
2252+
"Key_Home", ImGuiKey_Home,
2253+
"Key_End", ImGuiKey_End,
2254+
"Key_Insert", ImGuiKey_Insert,
2255+
"Key_Delete", ImGuiKey_Delete,
2256+
"Key_Backspace", ImGuiKey_Backspace,
2257+
"Key_Space", ImGuiKey_Space,
2258+
"Key_Enter", ImGuiKey_Enter,
2259+
"Key_Escape", ImGuiKey_Escape,
2260+
"Key_LeftCtrl", ImGuiKey_LeftCtrl,
2261+
"Key_LeftShift", ImGuiKey_LeftShift,
2262+
"Key_LeftAlt", ImGuiKey_LeftAlt,
2263+
"Key_LeftSuper", ImGuiKey_LeftSuper,
2264+
"Key_RightCtrl", ImGuiKey_RightCtrl,
2265+
"Key_RightShift", ImGuiKey_RightShift,
2266+
"Key_RightAlt", ImGuiKey_RightAlt,
2267+
"Key_RightSuper", ImGuiKey_RightSuper,
2268+
"Key_Menu", ImGuiKey_Menu,
2269+
"Key_0", ImGuiKey_0,
2270+
"Key_1", ImGuiKey_1,
2271+
"Key_2", ImGuiKey_2,
2272+
"Key_3", ImGuiKey_3,
2273+
"Key_4", ImGuiKey_4,
2274+
"Key_5", ImGuiKey_5,
2275+
"Key_6", ImGuiKey_6,
2276+
"Key_7", ImGuiKey_7,
2277+
"Key_8", ImGuiKey_8,
2278+
"Key_9", ImGuiKey_9,
2279+
"Key_A", ImGuiKey_A,
2280+
"Key_B", ImGuiKey_B,
2281+
"Key_C", ImGuiKey_C,
2282+
"Key_D", ImGuiKey_D,
2283+
"Key_E", ImGuiKey_E,
2284+
"Key_F", ImGuiKey_F,
2285+
"Key_G", ImGuiKey_G,
2286+
"Key_H", ImGuiKey_H,
2287+
"Key_I", ImGuiKey_I,
2288+
"Key_J", ImGuiKey_J,
2289+
"Key_K", ImGuiKey_K,
2290+
"Key_L", ImGuiKey_L,
2291+
"Key_M", ImGuiKey_M,
2292+
"Key_N", ImGuiKey_N,
2293+
"Key_O", ImGuiKey_O,
2294+
"Key_P", ImGuiKey_P,
2295+
"Key_Q", ImGuiKey_Q,
2296+
"Key_R", ImGuiKey_R,
2297+
"Key_S", ImGuiKey_S,
2298+
"Key_T", ImGuiKey_T,
2299+
"Key_U", ImGuiKey_U,
2300+
"Key_V", ImGuiKey_V,
2301+
"Key_W", ImGuiKey_W,
2302+
"Key_X", ImGuiKey_X,
2303+
"Key_Y", ImGuiKey_Y,
2304+
"Key_Z", ImGuiKey_Z,
2305+
"Key_F1", ImGuiKey_F1,
2306+
"Key_F2", ImGuiKey_F2,
2307+
"Key_F3", ImGuiKey_F3,
2308+
"Key_F4", ImGuiKey_F4,
2309+
"Key_F5", ImGuiKey_F5,
2310+
"Key_F6", ImGuiKey_F6,
2311+
"Key_F7", ImGuiKey_F7,
2312+
"Key_F8", ImGuiKey_F8,
2313+
"Key_F9", ImGuiKey_F9,
2314+
"Key_F10", ImGuiKey_F10,
2315+
"Key_F11", ImGuiKey_F11,
2316+
"Key_F12", ImGuiKey_F12,
2317+
"Key_F13", ImGuiKey_F13,
2318+
"Key_F14", ImGuiKey_F14,
2319+
"Key_F15", ImGuiKey_F15,
2320+
"Key_F16", ImGuiKey_F16,
2321+
"Key_F17", ImGuiKey_F17,
2322+
"Key_F18", ImGuiKey_F18,
2323+
"Key_F19", ImGuiKey_F19,
2324+
"Key_F20", ImGuiKey_F20,
2325+
"Key_F21", ImGuiKey_F21,
2326+
"Key_F22", ImGuiKey_F22,
2327+
"Key_F23", ImGuiKey_F23,
2328+
"Key_F24", ImGuiKey_F24,
2329+
"Key_Apostrophe", ImGuiKey_Apostrophe,
2330+
"Key_Comma", ImGuiKey_Comma,
2331+
"Key_Minus", ImGuiKey_Minus,
2332+
"Key_Period", ImGuiKey_Period,
2333+
"Key_Slash", ImGuiKey_Slash,
2334+
"Key_Semicolon", ImGuiKey_Semicolon,
2335+
"Key_Equal", ImGuiKey_Equal,
2336+
"Key_LeftBracket", ImGuiKey_LeftBracket,
2337+
"Key_Backslash", ImGuiKey_Backslash,
2338+
"Key_RightBracket", ImGuiKey_RightBracket,
2339+
"Key_GraveAccent", ImGuiKey_GraveAccent,
2340+
"Key_CapsLock", ImGuiKey_CapsLock,
2341+
"Key_ScrollLock", ImGuiKey_ScrollLock,
2342+
"Key_NumLock", ImGuiKey_NumLock,
2343+
"Key_PrintScreen", ImGuiKey_PrintScreen,
2344+
"Key_Pause", ImGuiKey_Pause,
2345+
"Key_Keypad0", ImGuiKey_Keypad0,
2346+
"Key_Keypad1", ImGuiKey_Keypad1,
2347+
"Key_Keypad2", ImGuiKey_Keypad2,
2348+
"Key_Keypad3", ImGuiKey_Keypad3,
2349+
"Key_Keypad4", ImGuiKey_Keypad4,
2350+
"Key_Keypad5", ImGuiKey_Keypad5,
2351+
"Key_Keypad6", ImGuiKey_Keypad6,
2352+
"Key_Keypad7", ImGuiKey_Keypad7,
2353+
"Key_Keypad8", ImGuiKey_Keypad8,
2354+
"Key_Keypad9", ImGuiKey_Keypad9,
2355+
"Key_KeypadDecimal", ImGuiKey_KeypadDecimal,
2356+
"Key_KeypadDivide", ImGuiKey_KeypadDivide,
2357+
"Key_KeypadMultiply", ImGuiKey_KeypadMultiply,
2358+
"Key_KeypadSubtract", ImGuiKey_KeypadSubtract,
2359+
"Key_KeypadAdd", ImGuiKey_KeypadAdd,
2360+
"Key_KeypadEnter", ImGuiKey_KeypadEnter,
2361+
"Key_KeypadEqual", ImGuiKey_KeypadEqual,
2362+
"Key_AppBack", ImGuiKey_AppBack,
2363+
"Key_AppForward", ImGuiKey_AppForward,
2364+
"Key_Oem102", ImGuiKey_Oem102,
2365+
"Key_GamepadStart", ImGuiKey_GamepadStart,
2366+
"Key_GamepadBack", ImGuiKey_GamepadBack,
2367+
"Key_GamepadFaceLeft", ImGuiKey_GamepadFaceLeft,
2368+
"Key_GamepadFaceRight", ImGuiKey_GamepadFaceRight,
2369+
"Key_GamepadFaceUp", ImGuiKey_GamepadFaceUp,
2370+
"Key_GamepadFaceDown", ImGuiKey_GamepadFaceDown,
2371+
"Key_GamepadDpadLeft", ImGuiKey_GamepadDpadLeft,
2372+
"Key_GamepadDpadRight", ImGuiKey_GamepadDpadRight,
2373+
"Key_GamepadDpadUp", ImGuiKey_GamepadDpadUp,
2374+
"Key_GamepadDpadDown", ImGuiKey_GamepadDpadDown,
2375+
"Key_GamepadL1", ImGuiKey_GamepadL1,
2376+
"Key_GamepadR1", ImGuiKey_GamepadR1,
2377+
"Key_GamepadL2", ImGuiKey_GamepadL2,
2378+
"Key_GamepadR2", ImGuiKey_GamepadR2,
2379+
"Key_GamepadL3", ImGuiKey_GamepadL3,
2380+
"Key_GamepadR3", ImGuiKey_GamepadR3,
2381+
"Key_GamepadLStickLeft", ImGuiKey_GamepadLStickLeft,
2382+
"Key_GamepadLStickRight", ImGuiKey_GamepadLStickRight,
2383+
"Key_GamepadLStickUp", ImGuiKey_GamepadLStickUp,
2384+
"Key_GamepadLStickDown", ImGuiKey_GamepadLStickDown,
2385+
"Key_GamepadRStickLeft", ImGuiKey_GamepadRStickLeft,
2386+
"Key_GamepadRStickRight", ImGuiKey_GamepadRStickRight,
2387+
"Key_GamepadRStickUp", ImGuiKey_GamepadRStickUp,
2388+
"Key_GamepadRStickDown", ImGuiKey_GamepadRStickDown,
2389+
"Key_MouseLeft", ImGuiKey_MouseLeft,
2390+
"Key_MouseRight", ImGuiKey_MouseRight,
2391+
"Key_MouseMiddle", ImGuiKey_MouseMiddle,
2392+
"Key_MouseX1", ImGuiKey_MouseX1,
2393+
"Key_MouseX2", ImGuiKey_MouseX2,
2394+
"Key_MouseWheelX", ImGuiKey_MouseWheelX,
2395+
"Key_MouseWheelY", ImGuiKey_MouseWheelY,
2396+
2397+
// Modifiers
2398+
"Mod_None", ImGuiMod_None,
2399+
"Mod_Ctrl", ImGuiMod_Ctrl,
2400+
"Mod_Shift", ImGuiMod_Shift,
2401+
"Mod_Alt", ImGuiMod_Alt,
2402+
"Mod_Super", ImGuiMod_Super,
2403+
"Mod_Mask_", ImGuiMod_Mask_
2404+
);
2405+
22412406
lua["imgui"] = imgui;
22422407

22432408
auto imguizmo = lua.create_table();

0 commit comments

Comments
 (0)