Pull Most Buff Name from the Game

+ Solve Consumable Buff Timer Collisions
This commit is contained in:
GreenComfyTea
2023-09-03 13:36:03 +03:00
parent bf282ca13b
commit 8ae3928fdc
21 changed files with 1082 additions and 948 deletions

View File

@@ -52,6 +52,7 @@ this.vec3 = {};
this.vec4 = {};
this.math = {};
this.unicode = {};
this.sdk = {};
this.constants = {};
this.constants.uninitialized_int = -420;
@@ -442,6 +443,40 @@ function this.unicode.sub(str, i, j)
return string.sub(str, i, b + c - 1);
end
function this.sdk.generate_enum(type_def)
if not type_def then
return {};
end
local fields = type_def:get_fields();
local enum = {};
for i, field in ipairs(fields) do
if field:is_static() then
local name = field:get_name();
local raw_value = field:get_data(nil);
local enum_entry = {
name = name,
value = raw_value;
};
table.insert(enum, enum_entry);
end
end
return enum;
end
function this.sdk.generate_enum_by_typename(type_name)
local type_def = sdk.find_type_definition(type_name);
if not type_def then
return {};
end;
return this.sdk.generate_enum(type_def);
end
function this.init_dependencies()
error_handler = require("MHR_Overlay.Misc.error_handler");
end