mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 20:38:03 -08:00
Buffs: Use default values
This commit is contained in:
@@ -69,13 +69,20 @@ local get_value_method = system_array_type_def:get_method("GetValue(System.Int32
|
|||||||
function this.new(type, key, name, level, duration)
|
function this.new(type, key, name, level, duration)
|
||||||
local is_infinite = false;
|
local is_infinite = false;
|
||||||
|
|
||||||
level = level or 1;
|
if name == nil then
|
||||||
|
name = utils.constants.uninitialized_string;
|
||||||
|
end
|
||||||
|
|
||||||
if duration == nil then
|
if duration == nil then
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
if duration == 0 then
|
||||||
is_infinite = true;
|
is_infinite = true;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
level = level or 1;
|
||||||
|
|
||||||
local buff = {};
|
local buff = {};
|
||||||
|
|
||||||
buff.type = type;
|
buff.type = type;
|
||||||
@@ -145,7 +152,7 @@ function this.update()
|
|||||||
if master_player_data ~= nil then
|
if master_player_data ~= nil then
|
||||||
consumables.update(master_player_data);
|
consumables.update(master_player_data);
|
||||||
endemic_life_buffs.update(master_player_data);
|
endemic_life_buffs.update(master_player_data);
|
||||||
skills.update(master_player_data);
|
skills.update(master_player, master_player_data);
|
||||||
dangos.update(master_player_data);
|
dangos.update(master_player_data);
|
||||||
else
|
else
|
||||||
error_handler.report("buffs.update", "Failed to access Data: master_player_data");
|
error_handler.report("buffs.update", "Failed to access Data: master_player_data");
|
||||||
@@ -174,10 +181,6 @@ function this.update()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
|
||||||
buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale);
|
|
||||||
end
|
|
||||||
|
|
||||||
function this.update_timer(buff, timer)
|
function this.update_timer(buff, timer)
|
||||||
if timer < 0 then
|
if timer < 0 then
|
||||||
timer = 0;
|
timer = 0;
|
||||||
@@ -194,6 +197,11 @@ function this.update_timer(buff, timer)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
||||||
|
buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale);
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function this.init_dependencies()
|
function this.init_dependencies()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
||||||
|
|||||||
Reference in New Issue
Block a user