From 047468345a44b3f05a570d971860d2d6d1ce7b31 Mon Sep 17 00:00:00 2001 From: bestkakkoii Date: Sun, 21 Jan 2024 20:46:12 -0800 Subject: [PATCH] minor --- SaSH/net/database.h | 1 + SaSH/script_lua/clua.cpp | 5 +++++ SaSH/script_lua/luasystem.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/SaSH/net/database.h b/SaSH/net/database.h index 1310306..e04230f 100644 --- a/SaSH/net/database.h +++ b/SaSH/net/database.h @@ -1490,6 +1490,7 @@ namespace sa QString family = ""; QString petname = ""; QString item_name = ""; + std::tuple xy() const { return std::make_tuple(x, y); } std::string getName() const { return util::toConstData(name); } std::string getFreeName() const { return util::toConstData(freeName); } std::string getFamily() const { return util::toConstData(family); } diff --git a/SaSH/script_lua/clua.cpp b/SaSH/script_lua/clua.cpp index dfce5b9..fc01b0c 100644 --- a/SaSH/script_lua/clua.cpp +++ b/SaSH/script_lua/clua.cpp @@ -1329,6 +1329,7 @@ class CLuaDialog return ""; } + bool isValid() const { GameDevice& gamedevice = GameDevice::getInstance(index_); return gamedevice.worker->isDialogVisible(); } long long getWindowType() const { GameDevice& gamedevice = GameDevice::getInstance(index_); return gamedevice.worker->currentDialog.get().windowtype; } long long getButtonType() const { GameDevice& gamedevice = GameDevice::getInstance(index_); return gamedevice.worker->currentDialog.get().buttontype; } long long getDialogId() const { GameDevice& gamedevice = GameDevice::getInstance(index_); return gamedevice.worker->currentDialog.get().dialogid; } @@ -1748,6 +1749,7 @@ class CLuaDebug if (!l.isEmpty()) { + std::sort(l.begin(), l.end()); msg = l.join("\n"); } else @@ -3407,6 +3409,7 @@ void CLua::open_syslibs(sol::state& lua) sol::constructors(), sol::meta_function::index, &CLuaDialog::operator[], "contains", &CLuaDialog::contains, + "valid", sol::property(&CLuaDialog::isValid), "type", sol::property(&CLuaDialog::getWindowType), "button", sol::property(&CLuaDialog::getButtonType), "id", sol::property(&CLuaDialog::getDialogId), @@ -3976,12 +3979,14 @@ void CLua::open_maplibs(sol::state& lua) lua.collect_garbage(); lua.new_usertype ("UnitStruct", + "valid", sol::readonly(&sa::map_unit_t::isVisible), "visible", sol::readonly(&sa::map_unit_t::isVisible), "walkable", sol::readonly(&sa::map_unit_t::walkable), "id", sol::readonly(&sa::map_unit_t::id), "modelid", sol::readonly(&sa::map_unit_t::modelid), "x", sol::readonly(&sa::map_unit_t::x), "y", sol::readonly(&sa::map_unit_t::y), + "xy", &sa::map_unit_t::xy, "dir", sol::readonly(&sa::map_unit_t::dir), "level", sol::readonly(&sa::map_unit_t::level), "namecolor", sol::readonly(&sa::map_unit_t::nameColor), diff --git a/SaSH/script_lua/luasystem.cpp b/SaSH/script_lua/luasystem.cpp index 7d6d47b..615d2e2 100644 --- a/SaSH/script_lua/luasystem.cpp +++ b/SaSH/script_lua/luasystem.cpp @@ -542,6 +542,7 @@ long long CLuaSystem::print(sol::object ocontent, sol::object ocolor, sol::this_ if (!l.isEmpty()) { + std::sort(l.begin(), l.end()); msg = l.join("\n"); } else