From 1b75d8b8e279b319ab5f03dee09ed31fed51b12c Mon Sep 17 00:00:00 2001 From: Indev Date: Wed, 30 Oct 2024 20:34:53 +0300 Subject: [PATCH 1/2] Fix mapmusname global in lua being renamed to (*mapmusname) --- src/dehacked.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index e1f3adba2..dc4288be5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9149,7 +9149,6 @@ int LUA_EnumLib(lua_State *L) PUSHGETTER(globalweather, u8); PUSHGETTER(levelskynum, i32); PUSHGETTER(globallevelskynum, i32); - PUSHGETTER((*mapmusname), str); PUSHGETTER(mapmusflags, u16); PUSHGETTER(mapmusposition, u32); PUSHGETTER(gravity, fxp); @@ -9166,6 +9165,11 @@ int LUA_EnumLib(lua_State *L) PUSHGETTER(racecountdown, u32); PUSHGETTER(exitcountdown, u32); + lua_pushcfunction(L, lua_glib_new_getter); + lua_pushliteral(L, "mapmusname"); + lua_glib_push_str_getter(L, mapmusname); + lua_call(L, 2, 0); + lua_pushcfunction(L, lua_glib_new_getter); lua_pushliteral(L, "mariomode"); lua_pushcfunction(L, lua_enumlib_mariomode_get); From b21776183e3637ac74ec70ad8ca749106eac5d12 Mon Sep 17 00:00:00 2001 From: Indev Date: Wed, 30 Oct 2024 22:14:17 +0300 Subject: [PATCH 2/2] Add shift+insert shortcut for pasting text --- src/m_textinput.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/m_textinput.c b/src/m_textinput.c index a73511f77..83adbf8bf 100644 --- a/src/m_textinput.c +++ b/src/m_textinput.c @@ -118,6 +118,15 @@ static void M_TextInputToWordBegin(textinput_t *input, boolean move_sel) if (move_sel) input->select = input->cursor; } +static void M_TextInputPaste(textinput_t *input) +{ + const char *paste = I_ClipboardPaste(); + if (input->select != input->cursor) + M_TextInputDelSelection(input); + if (paste != NULL) + M_TextInputAddString(input, paste); +} + void M_TextInputInit(textinput_t *input, char *buffer, size_t buffer_size) { input->buffer = buffer; @@ -147,6 +156,12 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key) || key == KEY_LALT || key == KEY_RALT) return false; + if (shiftdown && key == KEY_INS) + { + M_TextInputPaste(input); + return true; + } + if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown)) { if (key == 'x' || key == 'X') @@ -168,11 +183,7 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key) } else if (key == 'v' || key == 'V') { - const char *paste = I_ClipboardPaste(); - if (input->select != input->cursor) - M_TextInputDelSelection(input); - if (paste != NULL) - M_TextInputAddString(input, paste); + M_TextInputPaste(input); return true; } else if (key == 'w' || key == 'W')