Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
bestkakkoii authored and bestkakkoii committed Jan 22, 2024
1 parent 7c0df65 commit 0474683
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions SaSH/net/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ namespace sa
QString family = "";
QString petname = "";
QString item_name = "";
std::tuple<long long, long long> 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); }
Expand Down
5 changes: 5 additions & 0 deletions SaSH/script_lua/clua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -1748,6 +1749,7 @@ class CLuaDebug

if (!l.isEmpty())
{
std::sort(l.begin(), l.end());
msg = l.join("\n");
}
else
Expand Down Expand Up @@ -3407,6 +3409,7 @@ void CLua::open_syslibs(sol::state& lua)
sol::constructors<CLuaDialog(long long)>(),
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),
Expand Down Expand Up @@ -3976,12 +3979,14 @@ void CLua::open_maplibs(sol::state& lua)
lua.collect_garbage();

lua.new_usertype <sa::map_unit_t>("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),
Expand Down
1 change: 1 addition & 0 deletions SaSH/script_lua/luasystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0474683

Please sign in to comment.