mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Pull Most Buff Name from the Game
+ Solve Consumable Buff Timer Collisions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user