Remove getkeys (doesn't actually work)
This commit is contained in:
parent
9d1552c246
commit
aa5078fb5b
@ -160,6 +160,7 @@ namespace game
|
|||||||
WEAK symbol<void(lua_State* s, int index)> hksi_lua_pushvalue{0x2DE040};
|
WEAK symbol<void(lua_State* s, int index)> hksi_lua_pushvalue{0x2DE040};
|
||||||
WEAK symbol<HashTable*(lua_State* s, unsigned int arraySize, unsigned int hashSize)> Hashtable_Create{0x2C8290};
|
WEAK symbol<HashTable*(lua_State* s, unsigned int arraySize, unsigned int hashSize)> Hashtable_Create{0x2C8290};
|
||||||
WEAK symbol<HksObject*(HashTable* t, HksObject* result, HksObject* key)> Hashtable_getNextHash{0x2D5150};
|
WEAK symbol<HksObject*(HashTable* t, HksObject* result, HksObject* key)> Hashtable_getNextHash{0x2D5150};
|
||||||
|
WEAK symbol<void(lua_State* s, const HksObject* tbl, HksObject* key, HksObject* retval)> hks_obj_next{0x2DA850};
|
||||||
WEAK symbol<cclosure*(lua_State* s, lua_function function, int num_upvalues,
|
WEAK symbol<cclosure*(lua_State* s, lua_function function, int num_upvalues,
|
||||||
int internal_, int profilerTreatClosureAsFunc)> cclosure_Create{0x2C84B0};
|
int internal_, int profilerTreatClosureAsFunc)> cclosure_Create{0x2C84B0};
|
||||||
}
|
}
|
||||||
|
@ -1071,25 +1071,11 @@ namespace ui_scripting::lua
|
|||||||
table.set(name, convert({s, value}));
|
table.set(name, convert({s, value}));
|
||||||
};
|
};
|
||||||
|
|
||||||
table_type[sol::meta_function::length] = [](const table& table)
|
|
||||||
{
|
|
||||||
return table.size();
|
|
||||||
};
|
|
||||||
|
|
||||||
table_type["getkeys"] = [](const table& table, const sol::this_state s)
|
|
||||||
{
|
|
||||||
std::vector<sol::lua_value> result;
|
|
||||||
const auto keys = table.get_keys();
|
|
||||||
|
|
||||||
for (const auto& key : keys)
|
|
||||||
{
|
|
||||||
result.push_back(convert(s, key));
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
state["luiglobals"] = table((*::game::hks::lua_state)->globals.v.table);
|
state["luiglobals"] = table((*::game::hks::lua_state)->globals.v.table);
|
||||||
|
state["CoD"] = state["luiglobals"]["CoD"];
|
||||||
|
state["LUI"] = state["luiglobals"]["LUI"];
|
||||||
|
state["Engine"] = state["luiglobals"]["Engine"];
|
||||||
|
state["Game"] = state["luiglobals"]["Game"];
|
||||||
|
|
||||||
auto function_type = state.new_usertype<function>("function_");
|
auto function_type = state.new_usertype<function>("function_");
|
||||||
|
|
||||||
|
@ -52,25 +52,6 @@ namespace ui_scripting
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
arguments table::get_keys() const
|
|
||||||
{
|
|
||||||
arguments keys{};
|
|
||||||
auto current = this->ptr->m_hashPart;
|
|
||||||
|
|
||||||
while (current->m_key.t)
|
|
||||||
{
|
|
||||||
keys.push_back(current->m_key);
|
|
||||||
current++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int table::size() const
|
|
||||||
{
|
|
||||||
return static_cast<unsigned int>(this->get_keys().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
void table::set(const value& key, const value& value) const
|
void table::set(const value& key, const value& value) const
|
||||||
{
|
{
|
||||||
set_field(*this, key, value);
|
set_field(*this, key, value);
|
||||||
|
@ -29,9 +29,6 @@ namespace ui_scripting
|
|||||||
table();
|
table();
|
||||||
table(game::hks::HashTable* ptr_);
|
table(game::hks::HashTable* ptr_);
|
||||||
|
|
||||||
arguments get_keys() const;
|
|
||||||
unsigned int size() const;
|
|
||||||
|
|
||||||
value get(const value& key) const;
|
value get(const value& key) const;
|
||||||
void set(const value& key, const value& value) const;
|
void set(const value& key, const value& value) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user