diff --git a/res/scripts/stdcmd.lua b/res/scripts/stdcmd.lua index 48741102..0db4d208 100644 --- a/res/scripts/stdcmd.lua +++ b/res/scripts/stdcmd.lua @@ -51,7 +51,7 @@ console.add_command( ) console.add_command( - "obj.tp obj:sel=$obj.id x:num~pos.x y:num~pos.y z:num~pos.z", + "tp obj:sel=$obj.id x:num~pos.x y:num~pos.y z:num~pos.z", "Teleport object", function (args, kwargs) player.set_pos(unpack(args)) diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index 2240acee..8b012b8a 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -369,7 +369,7 @@ void TextBox::click(GUI*, int x, int y) { } void TextBox::mouseMove(GUI*, int x, int y) { - ssize_t index = calcIndexAt(x, y); + ptrdiff_t index = calcIndexAt(x, y); setCaret(index); extendSelection(index); resetMaxLocalCaret(); @@ -656,7 +656,7 @@ void TextBox::setCaret(size_t position) { } } -void TextBox::setCaret(ssize_t position) { +void TextBox::setCaret(ptrdiff_t position) { if (position < 0) { setCaret(static_cast(input.length() + position + 1)); } else { diff --git a/src/graphics/ui/elements/TextBox.hpp b/src/graphics/ui/elements/TextBox.hpp index 183a5ec7..ee59b778 100644 --- a/src/graphics/ui/elements/TextBox.hpp +++ b/src/graphics/ui/elements/TextBox.hpp @@ -120,7 +120,7 @@ namespace gui { /// @brief Set caret position in the text /// @param position integer in range [-text.length(), text.length()] - virtual void setCaret(ssize_t position); + virtual void setCaret(ptrdiff_t position); /// @brief Select part of the text /// @param start index of the first selected character diff --git a/src/logic/scripting/lua/libgui.cpp b/src/logic/scripting/lua/libgui.cpp index d2e72d8a..ffcd55ac 100644 --- a/src/logic/scripting/lua/libgui.cpp +++ b/src/logic/scripting/lua/libgui.cpp @@ -363,7 +363,7 @@ static void p_set_text(UINode* node, int idx) { } static void p_set_caret(UINode* node, int idx) { if (auto box = dynamic_cast(node)) { - box->setCaret(static_cast(state->tointeger(idx))); + box->setCaret(static_cast(state->tointeger(idx))); } } static void p_set_editable(UINode* node, int idx) {