mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
some fixes in MainWindow move
This commit is contained in:
@@ -32,6 +32,18 @@ LuaObject::~LuaObject()
|
||||
releaseLuaFieldsTable();
|
||||
}
|
||||
|
||||
bool LuaObject::hasLuaField(const std::string& field)
|
||||
{
|
||||
bool ret = false;
|
||||
if(m_fieldsTableRef != -1) {
|
||||
g_lua.getRef(m_fieldsTableRef);
|
||||
g_lua.getField(field); // push the field value
|
||||
ret = !g_lua.isNil();
|
||||
g_lua.pop(2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void LuaObject::releaseLuaFieldsTable()
|
||||
{
|
||||
if(m_fieldsTableRef != -1) {
|
||||
|
@@ -40,6 +40,8 @@ public:
|
||||
template<typename R, typename... T>
|
||||
R callLuaField(const std::string& field, const T&... args);
|
||||
|
||||
bool hasLuaField(const std::string& field);
|
||||
|
||||
/// Sets a field in this lua object
|
||||
template<typename T>
|
||||
void setLuaField(const std::string& key, const T& value);
|
||||
|
Reference in New Issue
Block a user