From 2f8391089798e027a8e63905a206cecb88b8f831 Mon Sep 17 00:00:00 2001 From: jyelon Date: Tue, 14 Apr 2026 17:16:46 -0400 Subject: [PATCH] A bit of research on mouse clicks --- Content/Luprex/lxPlayerController.uasset | 4 ++-- Content/Widgets/WB_Hotkeys.uasset | 4 ++-- Content/Widgets/WB_Menu.uasset | 4 ++-- luprex/cpp/core/world-core.cpp | 27 +++++++++++++++++++++--- luprex/lua/control.lst | 1 + 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Content/Luprex/lxPlayerController.uasset b/Content/Luprex/lxPlayerController.uasset index 482a7bf1..71454a5e 100644 --- a/Content/Luprex/lxPlayerController.uasset +++ b/Content/Luprex/lxPlayerController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:021c1bf078750c9926fc0d459affb456a6bbac6461be89fabfdd8a98bb12eb91 -size 152368 +oid sha256:d83ee5c9814613ba4dfa2ecb67825597b0c511ec875e240f2b6fe1ccd255b704 +size 149833 diff --git a/Content/Widgets/WB_Hotkeys.uasset b/Content/Widgets/WB_Hotkeys.uasset index 46c1dd76..5cfed7a1 100644 --- a/Content/Widgets/WB_Hotkeys.uasset +++ b/Content/Widgets/WB_Hotkeys.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2585183c86857cb4adff06a5aafdca74a454d0ef0f2c4b02dc9c1ad1b3b66b17 -size 312290 +oid sha256:0f71256d141fd446321d1a5d492b9e36f919faa803d7fed6b56900f907374c80 +size 318118 diff --git a/Content/Widgets/WB_Menu.uasset b/Content/Widgets/WB_Menu.uasset index d58eb453..163d5c96 100644 --- a/Content/Widgets/WB_Menu.uasset +++ b/Content/Widgets/WB_Menu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:96cdc7748c45229bb09f179be195cabfe429c1bce6d1376f6bf2b65368fe3948 -size 259793 +oid sha256:f9caf2ce8866815ae2e59e5a71fe59601d274fb26be5210e60a0ccbf81082b28 +size 296366 diff --git a/luprex/cpp/core/world-core.cpp b/luprex/cpp/core/world-core.cpp index 9d85e7da..3372078f 100644 --- a/luprex/cpp/core/world-core.cpp +++ b/luprex/cpp/core/world-core.cpp @@ -394,7 +394,14 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view // Get the actor and place, C++ version. Make sure both exist. Tangible *tactor = tangible_get(actor_id); Tangible *tplace = tangible_get(place_id); - if ((tactor == nullptr) || (tplace == nullptr)) { + if (tactor == nullptr) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("no such actor tangible"); + return; + } + if (tplace == nullptr) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("no such place tangible"); return; } @@ -408,6 +415,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view classname = datasb.read_string_limit(100); funcname = datasb.read_string_limit(100); } catch (const StreamException &ex) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("datapack passed to probe_lua_call was corrupted"); return; } @@ -419,6 +428,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view LS.rawget(actor, tangibles, actor_id); LS.rawget(place, tangibles, place_id); if (!LS.istable(actor) || !LS.istable(place)) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("probe_lua_call failed to properly look up actor or place"); return; } @@ -433,11 +444,19 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view // Get the true classname. This also checks validity of the class. classname = LS.classname(lclass); - if (classname.empty()) return; + if (classname.empty()) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("classname is not a valid class"); + return; + } // Get the function from the class. LS.rawget(lfunc, lclass, funcname); - if (!LS.isfunction(lfunc)) return; + if (!LS.isfunction(lfunc)) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("function does not exist"); + return; + } // Call the closure. int calltop = lua_gettop(L); @@ -449,6 +468,8 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view nargs++; } } catch (const StreamException &exc) { + retvals->write_lua_value_type(LuaValueType::STRING); + retvals->write_string("could not pass parameters to lua (bug)"); return; } diff --git a/luprex/lua/control.lst b/luprex/lua/control.lst index fc2e8c43..fb1cc88b 100644 --- a/luprex/lua/control.lst +++ b/luprex/lua/control.lst @@ -5,4 +5,5 @@ ut-table.lua hotkeys.lua +menu.lua login.lua