mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 12:28:03 -08:00
Static and dynamic positioning of large monster UI are now separated.
This commit is contained in:
29
MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua
Normal file
29
MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local stamina_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
|
||||
function stamina_UI_entity.new(bar, text_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
|
||||
entity.bar = table_helpers.deep_copy(bar);
|
||||
entity.text_label = table_helpers.deep_copy(text_label);
|
||||
entity.value_label = table_helpers.deep_copy(value_label);
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity_scale)
|
||||
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage);
|
||||
|
||||
drawing.draw_label(stamina_UI.text_label, position_on_screen, opacity_scale);
|
||||
drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, monster.stamina, monster.max_stamina);
|
||||
drawing.draw_label(stamina_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.stamina_percentage);
|
||||
end
|
||||
|
||||
function stamina_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
end
|
||||
|
||||
return stamina_UI_entity;
|
||||
Reference in New Issue
Block a user