mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 12:28:03 -08:00
Release v1.11
1) Cache config access function-wide where possible; 2) Break and Sever values added to parts; 3) Hooks are now applied in init_module instead of global space; 4) Added checks for submodule (health, stamina, etc) visibility. If not visible, do not pull data.
This commit is contained in:
@@ -23,6 +23,8 @@ local hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterI
|
||||
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
|
||||
|
||||
function damage_meter_UI.get_players(player_info_list)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
-- other players
|
||||
if player_info_list == nil then
|
||||
customization_menu.status = "No player info list";
|
||||
@@ -52,7 +54,7 @@ function damage_meter_UI.get_players(player_info_list)
|
||||
|
||||
local _player = player.get_player(player_id);
|
||||
if _player ~= nil then
|
||||
if player_id == player.myself.id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then
|
||||
if player_id == player.myself.id and cached_config.settings.my_damage_bar_location ~= "Normal" then
|
||||
goto continue;
|
||||
end
|
||||
table.insert(quest_players, _player);
|
||||
@@ -65,11 +67,15 @@ function damage_meter_UI.get_players(player_info_list)
|
||||
end
|
||||
|
||||
function damage_meter_UI.draw()
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
if player.total.display.total_damage == 0 and config.current_config.damage_meter_UI.settings.hide_module_if_total_damage_is_zero then
|
||||
if player.total.display.total_damage == 0 and cached_config.settings.hide_module_if_total_damage_is_zero then
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
|
||||
local quest_players = {};
|
||||
if damage_meter_UI.freeze_displayed_players and damage_meter_UI.last_displayed_players ~= {} then
|
||||
quest_players = damage_meter_UI.last_displayed_players;
|
||||
@@ -84,15 +90,15 @@ function damage_meter_UI.draw()
|
||||
if not damage_meter_UI.freeze_displayed_players then
|
||||
if #quest_players ~= 0 then
|
||||
-- sort here
|
||||
if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
if cached_config.sorting.type == "Normal" and cached_config.sorting.reversed_order then
|
||||
|
||||
local reversed_quest_players = {};
|
||||
for i = #quest_players, 1, -1 do
|
||||
table.insert(reversed_quest_players, quest_players[i]);
|
||||
end
|
||||
quest_players = reversed_quest_players;
|
||||
elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
elseif cached_config.sorting.type == "DPS" then
|
||||
if cached_config.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.dps < right.dps;
|
||||
end);
|
||||
@@ -102,7 +108,7 @@ function damage_meter_UI.draw()
|
||||
end);
|
||||
end
|
||||
else
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
if cached_config.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.display.total_damage < right.display.total_damage;
|
||||
end);
|
||||
@@ -114,9 +120,9 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.settings.my_damage_bar_location == "First" then
|
||||
if cached_config.settings.my_damage_bar_location == "First" then
|
||||
table.insert(quest_players, 1, player.myself);
|
||||
elseif config.current_config.damage_meter_UI.settings.my_damage_bar_location == "Last" then
|
||||
elseif cached_config.settings.my_damage_bar_location == "Last" then
|
||||
table.insert(quest_players, #quest_players + 1, player.myself);
|
||||
elseif #player.list == 0 then
|
||||
table.insert(quest_players, player.myself);
|
||||
@@ -137,19 +143,19 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
|
||||
-- draw
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position);
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
for _, _player in ipairs(quest_players) do
|
||||
|
||||
if _player.display.total_damage == 0 and config.current_config.damage_meter_UI.settings.hide_player_if_player_damage_is_zero then
|
||||
if _player.display.total_damage == 0 and cached_config.settings.hide_player_if_player_damage_is_zero then
|
||||
goto continue1
|
||||
end
|
||||
|
||||
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
|
||||
|
||||
if config.current_config.damage_meter_UI.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
if cached_config.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
|
||||
else
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier;
|
||||
end
|
||||
|
||||
::continue1::
|
||||
@@ -157,12 +163,12 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
|
||||
-- draw total damage
|
||||
if config.current_config.damage_meter_UI.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
|
||||
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
|
||||
return;
|
||||
end
|
||||
|
||||
if not config.current_config.damage_meter_UI.settings.total_damage_offset_is_relative then
|
||||
position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position);
|
||||
if not cached_config.settings.total_damage_offset_is_relative then
|
||||
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
end
|
||||
|
||||
player.draw_total(position_on_screen, 1);
|
||||
|
||||
@@ -21,19 +21,22 @@ function env_creature_UI.draw()
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.endemic_life_UI;
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
for _, creature in pairs(env_creature.list) do
|
||||
|
||||
if config.current_config.endemic_life_UI.settings.max_distance == 0 then
|
||||
if cached_config.settings.max_distance == 0 then
|
||||
break;
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.settings.hide_inactive_creatures and creature.is_inactive then
|
||||
if cached_config.settings.hide_inactive_creatures and creature.is_inactive then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
local position_on_screen = {};
|
||||
|
||||
local world_offset = Vector3f.new(config.current_config.endemic_life_UI.world_offset.x, config.current_config.endemic_life_UI.world_offset.y, config.current_config.endemic_life_UI.world_offset.z);
|
||||
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.world_offset.z);
|
||||
|
||||
position_on_screen = draw.world_to_screen(creature.position + world_offset);
|
||||
|
||||
@@ -41,19 +44,19 @@ function env_creature_UI.draw()
|
||||
goto continue;
|
||||
end
|
||||
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.endemic_life_UI.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.endemic_life_UI.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + cached_config.viewport_offset.y * global_scale_modifier;
|
||||
|
||||
|
||||
creature.distance = (player.myself_position - creature.position):length();
|
||||
|
||||
local opacity_scale = 1;
|
||||
if creature.distance > config.current_config.endemic_life_UI.settings.max_distance then
|
||||
if creature.distance > cached_config.settings.max_distance then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.settings.opacity_falloff then
|
||||
opacity_scale = 1 - (creature.distance / config.current_config.endemic_life_UI.settings.max_distance);
|
||||
if cached_config.settings.opacity_falloff then
|
||||
opacity_scale = 1 - (creature.distance / cached_config.settings.max_distance);
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -93,58 +93,64 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
|
||||
end
|
||||
|
||||
function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster)
|
||||
local cached_config = config.current_config.large_monster_UI.dynamic;
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
local i = 0;
|
||||
for _, monster in ipairs(displayed_monsters) do
|
||||
if config.current_config.large_monster_UI.dynamic.settings.max_distance == 0 then
|
||||
break;
|
||||
end
|
||||
|
||||
if monster.dead_or_captured and config.current_config.large_monster_UI.dynamic.settings.hide_dead_or_captured then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if monster == highlighted_monster then
|
||||
if not config.current_config.large_monster_UI.dynamic.settings.render_highlighted_monster then
|
||||
goto continue;
|
||||
end
|
||||
else
|
||||
if not config.current_config.large_monster_UI.dynamic.settings.render_not_highlighted_monsters then
|
||||
goto continue;
|
||||
end
|
||||
end
|
||||
|
||||
local position_on_screen = {};
|
||||
|
||||
local world_offset = Vector3f.new(config.current_config.large_monster_UI.dynamic.world_offset.x, config.current_config.large_monster_UI.dynamic.world_offset.y, config.current_config.large_monster_UI.dynamic.world_offset.z);
|
||||
|
||||
position_on_screen = draw.world_to_screen(monster.position + world_offset);
|
||||
|
||||
if position_on_screen == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
local opacity_scale = 1;
|
||||
if monster.distance > config.current_config.large_monster_UI.dynamic.settings.max_distance then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if config.current_config.large_monster_UI.dynamic.settings.opacity_falloff then
|
||||
opacity_scale = 1 - (monster.distance / config.current_config.large_monster_UI.dynamic.settings.max_distance);
|
||||
end
|
||||
|
||||
large_monster.draw_dynamic(monster, position_on_screen, opacity_scale);
|
||||
|
||||
i = i + 1;
|
||||
::continue::
|
||||
for _, monster in ipairs(displayed_monsters) do
|
||||
if cached_config.settings.max_distance == 0 then
|
||||
break;
|
||||
end
|
||||
|
||||
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if monster == highlighted_monster then
|
||||
if not cached_config.settings.render_highlighted_monster then
|
||||
goto continue;
|
||||
end
|
||||
else
|
||||
if not cached_config.settings.render_not_highlighted_monsters then
|
||||
goto continue;
|
||||
end
|
||||
end
|
||||
|
||||
local position_on_screen = {};
|
||||
|
||||
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.world_offset.z);
|
||||
|
||||
position_on_screen = draw.world_to_screen(monster.position + world_offset);
|
||||
|
||||
if position_on_screen == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + cached_config.viewport_offset.y * global_scale_modifier;
|
||||
|
||||
local opacity_scale = 1;
|
||||
if monster.distance > cached_config.settings.max_distance then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if cached_config.settings.opacity_falloff then
|
||||
opacity_scale = 1 - (monster.distance / cached_config.settings.max_distance);
|
||||
end
|
||||
|
||||
large_monster.draw_dynamic(monster, position_on_screen, opacity_scale);
|
||||
|
||||
i = i + 1;
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
local cached_config = config.current_config.large_monster_UI.static;
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
-- sort here
|
||||
if config.current_config.large_monster_UI.static.sorting.type == "Normal" and config.current_config.large_monster_UI.static.sorting.reversed_order then
|
||||
if cached_config.sorting.type == "Normal" and cached_config.sorting.reversed_order then
|
||||
local reversed_monsters = {};
|
||||
for i = #displayed_monsters, 1, -1 do
|
||||
table.insert(reversed_monsters, displayed_monsters[i]);
|
||||
@@ -152,8 +158,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
|
||||
displayed_monsters = reversed_monsters;
|
||||
|
||||
elseif config.current_config.large_monster_UI.static.sorting.type == "Health" then
|
||||
if config.current_config.large_monster_UI.static.sorting.reversed_order then
|
||||
elseif cached_config.sorting.type == "Health" then
|
||||
if cached_config.sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.health > right.health;
|
||||
end);
|
||||
@@ -162,8 +168,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
return left.health < right.health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.sorting.type == "Health Percentage" then
|
||||
if config.current_config.large_monster_UI.static.sorting.reversed_order then
|
||||
elseif cached_config.sorting.type == "Health Percentage" then
|
||||
if cached_config.sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.health_percentage > right.health_percentage;
|
||||
end);
|
||||
@@ -172,8 +178,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
return left.health_percentage < right.health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.sorting.type == "Distance" then
|
||||
if config.current_config.large_monster_UI.static.sorting.reversed_order then
|
||||
elseif cached_config.sorting.type == "Distance" then
|
||||
if cached_config.sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.distance > right.distance;
|
||||
end);
|
||||
@@ -184,20 +190,20 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
end
|
||||
end
|
||||
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.large_monster_UI.static.position);
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
|
||||
local i = 0;
|
||||
for _, monster in ipairs(displayed_monsters) do
|
||||
if monster.dead_or_captured and config.current_config.large_monster_UI.static.settings.hide_dead_or_captured then
|
||||
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if monster == highlighted_monster then
|
||||
if not config.current_config.large_monster_UI.static.settings.render_highlighted_monster then
|
||||
if not cached_config.settings.render_highlighted_monster then
|
||||
goto continue;
|
||||
end
|
||||
else
|
||||
if not config.current_config.large_monster_UI.static.settings.render_not_highlighted_monsters then
|
||||
if not cached_config.settings.render_not_highlighted_monsters then
|
||||
goto continue;
|
||||
end
|
||||
end
|
||||
@@ -207,10 +213,10 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
y = position_on_screen.y
|
||||
}
|
||||
|
||||
if config.current_config.large_monster_UI.static.settings.orientation == "Horizontal" then
|
||||
monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
if cached_config.settings.orientation == "Horizontal" then
|
||||
monster_position_on_screen.x = monster_position_on_screen.x + cached_config.spacing.x * i * global_scale_modifier;
|
||||
else
|
||||
monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
monster_position_on_screen.y = monster_position_on_screen.y + cached_config.spacing.y * i * global_scale_modifier;
|
||||
end
|
||||
|
||||
large_monster.draw_static(monster, monster_position_on_screen, 1);
|
||||
@@ -221,13 +227,15 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
end
|
||||
|
||||
function large_monster_UI.draw_highlighted(monster)
|
||||
local cached_config = config.current_config.large_monster_UI.highlighted;
|
||||
|
||||
if monster == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.large_monster_UI.highlighted.position);
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
|
||||
if monster.dead_or_captured and config.current_config.large_monster_UI.highlighted.settings.hide_dead_or_captured then
|
||||
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ function small_monster_UI.draw()
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.small_monster_UI;
|
||||
|
||||
local displayed_monsters = {};
|
||||
|
||||
local enemy_count = get_zako_enemy_count_method:call(singletons.enemy_manager);
|
||||
@@ -40,7 +42,7 @@ function small_monster_UI.draw()
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if monster.dead_or_captured and config.current_config.small_monster_UI.settings.hide_dead_or_captured then
|
||||
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
@@ -48,24 +50,24 @@ function small_monster_UI.draw()
|
||||
::continue::
|
||||
end
|
||||
|
||||
if config.current_config.small_monster_UI.dynamic_positioning.enabled
|
||||
or (not config.current_config.small_monster_UI.dynamic_positioning.enabled and config.current_config.small_monster_UI.static_sorting.type == "Distance") then
|
||||
if cached_config.dynamic_positioning.enabled
|
||||
or (not cached_config.dynamic_positioning.enabled and cached_config.static_sorting.type == "Distance") then
|
||||
for _, monster in ipairs(displayed_monsters) do
|
||||
monster.distance = (player.myself_position - monster.position):length();
|
||||
end
|
||||
end
|
||||
|
||||
if not config.current_config.small_monster_UI.dynamic_positioning.enabled then
|
||||
if not cached_config.dynamic_positioning.enabled then
|
||||
-- sort here
|
||||
if config.current_config.small_monster_UI.static_sorting.type == "Normal" and config.current_config.small_monster_UI.static_sorting.reversed_order then
|
||||
if cached_config.static_sorting.type == "Normal" and cached_config.static_sorting.reversed_order then
|
||||
local reversed_monsters = {};
|
||||
for i = #displayed_monsters, 1, -1 do
|
||||
table.insert(reversed_monsters, displayed_monsters[i]);
|
||||
end
|
||||
displayed_monsters = reversed_monsters;
|
||||
|
||||
elseif config.current_config.small_monster_UI.static_sorting.type == "Health" then
|
||||
if config.current_config.small_monster_UI.static_sorting.reversed_order then
|
||||
elseif cached_config.static_sorting.type == "Health" then
|
||||
if cached_config.static_sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.health > right.health;
|
||||
end);
|
||||
@@ -75,8 +77,8 @@ function small_monster_UI.draw()
|
||||
end);
|
||||
end
|
||||
|
||||
elseif config.current_config.small_monster_UI.static_sorting.type == "Health Percentage" then
|
||||
if config.current_config.small_monster_UI.static_sorting.reversed_order then
|
||||
elseif cached_config.static_sorting.type == "Health Percentage" then
|
||||
if cached_config.static_sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.health_percentage > right.health_percentage;
|
||||
end);
|
||||
@@ -85,8 +87,8 @@ function small_monster_UI.draw()
|
||||
return left.health_percentage < right.health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.small_monster_UI.static_sorting.type == "Distance" then
|
||||
if config.current_config.small_monster_UI.static_sorting.reversed_order then
|
||||
elseif cached_config.static_sorting.type == "Distance" then
|
||||
if cached_config.static_sorting.reversed_order then
|
||||
table.sort(displayed_monsters, function(left, right)
|
||||
return left.distance > right.distance;
|
||||
end);
|
||||
@@ -102,8 +104,8 @@ function small_monster_UI.draw()
|
||||
for _, monster in ipairs(displayed_monsters) do
|
||||
local position_on_screen;
|
||||
|
||||
if config.current_config.small_monster_UI.dynamic_positioning.enabled then
|
||||
local world_offset = Vector3f.new(config.current_config.small_monster_UI.dynamic_positioning.world_offset.x, config.current_config.small_monster_UI.dynamic_positioning.world_offset.y, config.current_config.small_monster_UI.dynamic_positioning.world_offset.z);
|
||||
if cached_config.dynamic_positioning.enabled then
|
||||
local world_offset = Vector3f.new(cached_config.dynamic_positioning.world_offset.x, cached_config.dynamic_positioning.world_offset.y, cached_config.dynamic_positioning.world_offset.z);
|
||||
|
||||
position_on_screen = draw.world_to_screen(monster.position + world_offset);
|
||||
|
||||
@@ -111,31 +113,31 @@ function small_monster_UI.draw()
|
||||
goto continue
|
||||
end
|
||||
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.small_monster_UI.dynamic_positioning.viewport_offset.x;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.small_monster_UI.dynamic_positioning.viewport_offset.y;
|
||||
position_on_screen.x = position_on_screen.x + cached_config.dynamic_positioning.viewport_offset.x;
|
||||
position_on_screen.y = position_on_screen.y + cached_config.dynamic_positioning.viewport_offset.y;
|
||||
else
|
||||
position_on_screen = screen.calculate_absolute_coordinates(config.current_config.small_monster_UI.static_position);
|
||||
if config.current_config.small_monster_UI.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.small_monster_UI.static_spacing.x * i;
|
||||
position_on_screen = screen.calculate_absolute_coordinates(cached_config.static_position);
|
||||
if cached_config.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + cached_config.static_spacing.x * i;
|
||||
|
||||
else
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.small_monster_UI.static_spacing.y * i;
|
||||
position_on_screen.y = position_on_screen.y + cached_config.static_spacing.y * i;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local opacity_scale = 1;
|
||||
if config.current_config.small_monster_UI.dynamic_positioning.enabled then
|
||||
if config.current_config.small_monster_UI.dynamic_positioning.max_distance == 0 then
|
||||
if cached_config.dynamic_positioning.enabled then
|
||||
if cached_config.dynamic_positioning.max_distance == 0 then
|
||||
return;
|
||||
end
|
||||
|
||||
if monster.distance > config.current_config.small_monster_UI.dynamic_positioning.max_distance then
|
||||
if monster.distance > cached_config.dynamic_positioning.max_distance then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if config.current_config.small_monster_UI.dynamic_positioning.opacity_falloff then
|
||||
opacity_scale = 1 - (monster.distance / config.current_config.small_monster_UI.dynamic_positioning.max_distance);
|
||||
if cached_config.dynamic_positioning.opacity_falloff then
|
||||
opacity_scale = 1 - (monster.distance / cached_config.dynamic_positioning.max_distance);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@ end
|
||||
function time_UI.init_UI()
|
||||
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
|
||||
|
||||
time_UI.label.offset.x = time_UI.label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
time_UI.label.offset.y = time_UI.label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
time_UI.label.offset.x = time_UI.label.offset.x * global_scale_modifier;
|
||||
time_UI.label.offset.y = time_UI.label.offset.y * global_scale_modifier;
|
||||
end
|
||||
|
||||
function time_UI.init_module()
|
||||
|
||||
@@ -7,6 +7,8 @@ local language;
|
||||
function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.visibility = visibility;
|
||||
entity.bar = table_helpers.deep_copy(bar);
|
||||
entity.name_label = table_helpers.deep_copy(name_label);
|
||||
@@ -15,25 +17,25 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.name_label.offset.x = entity.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.name_label.offset.y = entity.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.name_label.offset.x = entity.name_label.offset.x * global_scale_modifier;
|
||||
entity.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier;
|
||||
entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
@@ -43,11 +45,13 @@ function ailment_UI_entity.draw_dynamic(ailment, ailment_UI, position_on_screen,
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.large_monster_UI.dynamic.ailments;
|
||||
|
||||
local ailment_name = "";
|
||||
if config.current_config.large_monster_UI.dynamic.ailments.ailment_name_label.include.ailment_name then
|
||||
if cached_config.ailment_name_label.include.ailment_name then
|
||||
ailment_name = ailment.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.dynamic.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
|
||||
end
|
||||
|
||||
@@ -72,11 +76,13 @@ function ailment_UI_entity.draw_static(ailment, ailment_UI, position_on_screen,
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.large_monster_UI.static.ailments;
|
||||
|
||||
local ailment_name = "";
|
||||
if config.current_config.large_monster_UI.static.ailments.ailment_name_label.include.ailment_name then
|
||||
if cached_config.ailment_name_label.include.ailment_name then
|
||||
ailment_name = ailment.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.static.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
|
||||
end
|
||||
|
||||
@@ -101,11 +107,13 @@ function ailment_UI_entity.draw_highlighted(ailment, ailment_UI, position_on_scr
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.large_monster_UI.highlighted.ailments;
|
||||
|
||||
local ailment_name = "";
|
||||
if config.current_config.large_monster_UI.highlighted.ailments.ailment_name_label.include.ailment_name then
|
||||
if cached_config.ailment_name_label.include.ailment_name then
|
||||
ailment_name = ailment.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.highlighted.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
|
||||
end
|
||||
|
||||
@@ -130,11 +138,13 @@ function ailment_UI_entity.draw_small(ailment, ailment_UI, position_on_screen, o
|
||||
return;
|
||||
end
|
||||
|
||||
local cached_config = config.current_config.small_monster_UI.ailments;
|
||||
|
||||
local ailment_name = "";
|
||||
if config.current_config.small_monster_UI.ailments.ailment_name_label.include.ailment_name then
|
||||
if cached_config.ailment_name_label.include.ailment_name then
|
||||
ailment_name = ailment.name .. " ";
|
||||
end
|
||||
if config.current_config.small_monster_UI.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then
|
||||
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
|
||||
end
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ local language;
|
||||
function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label, buildup_value_label, buildup_percentage_label, total_buildup_label, total_buildup_value_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
--entity.visibility = visibility;
|
||||
entity.buildup_bar = table_helpers.deep_copy(buildup_bar);
|
||||
@@ -19,38 +20,39 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
|
||||
entity.total_buildup_label = table_helpers.deep_copy(total_buildup_label);
|
||||
entity.total_buildup_value_label = table_helpers.deep_copy(total_buildup_value_label);
|
||||
|
||||
entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_bar.size.width = entity.buildup_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_bar.size.height = entity.buildup_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * global_scale_modifier;
|
||||
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
|
||||
entity.buildup_bar.size.width = entity.buildup_bar.size.width * global_scale_modifier;
|
||||
entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * global_scale_modifier;
|
||||
entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier;
|
||||
entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.buildup_value_label.offset.x = entity.buildup_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_value_label.offset.y = entity.buildup_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_value_label.offset.x = entity.buildup_value_label.offset.x * global_scale_modifier;
|
||||
entity.buildup_value_label.offset.y = entity.buildup_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.buildup_percentage_label.offset.x = entity.buildup_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_percentage_label.offset.y = entity.buildup_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.buildup_percentage_label.offset.x = entity.buildup_percentage_label.offset.x * global_scale_modifier
|
||||
entity.buildup_percentage_label.offset.y = entity.buildup_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.total_buildup_label.offset.x = entity.total_buildup_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.total_buildup_label.offset.y = entity.total_buildup_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.total_buildup_label.offset.x = entity.total_buildup_label.offset.x * global_scale_modifier;
|
||||
entity.total_buildup_label.offset.y = entity.total_buildup_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.total_buildup_value_label.offset.x = entity.total_buildup_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.total_buildup_value_label.offset.y = entity.total_buildup_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.total_buildup_value_label.offset.x = entity.total_buildup_value_label.offset.x * global_scale_modifier;
|
||||
entity.total_buildup_value_label.offset.y = entity.total_buildup_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
|
||||
|
||||
local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups;
|
||||
|
||||
local player_buildup_bar_percentage = 0;
|
||||
if config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
player_buildup_bar_percentage = _player.buildup_share;
|
||||
else
|
||||
if top_buildup ~= 0 then
|
||||
@@ -58,9 +60,9 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos
|
||||
end
|
||||
end
|
||||
|
||||
if _player.id == player.myself.id and config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
elseif config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
@@ -72,9 +74,10 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos
|
||||
end
|
||||
|
||||
function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
|
||||
local cached_config = config.current_config.large_monster_UI.static.ailment_buildups;
|
||||
|
||||
local player_buildup_bar_percentage = 0;
|
||||
if config.current_config.large_monster_UI.static.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
player_buildup_bar_percentage = _player.buildup_share;
|
||||
else
|
||||
if top_buildup ~= 0 then
|
||||
@@ -82,9 +85,9 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi
|
||||
end
|
||||
end
|
||||
|
||||
if _player.id == player.myself.id and config.current_config.large_monster_UI.static.ailment_buildups.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
elseif config.current_config.large_monster_UI.static.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
@@ -96,9 +99,10 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi
|
||||
end
|
||||
|
||||
function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
|
||||
|
||||
local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups;
|
||||
|
||||
local player_buildup_bar_percentage = 0;
|
||||
if config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
player_buildup_bar_percentage = _player.buildup_share;
|
||||
else
|
||||
if top_buildup ~= 0 then
|
||||
@@ -106,9 +110,9 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI,
|
||||
end
|
||||
end
|
||||
|
||||
if _player.id == player.myself.id and config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
elseif config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
@@ -120,9 +124,10 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI,
|
||||
end
|
||||
|
||||
function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
|
||||
local cached_config = config.current_config.small_monster_UI.ailment_buildups;
|
||||
|
||||
local player_buildup_bar_percentage = 0;
|
||||
if config.current_config.small_monster_UI.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||
player_buildup_bar_percentage = _player.buildup_share;
|
||||
else
|
||||
if top_buildup ~= 0 then
|
||||
@@ -130,9 +135,9 @@ function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, posit
|
||||
end
|
||||
end
|
||||
|
||||
if _player.id == player.myself.id and config.current_config.small_monster_UI.ailment_buildups.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
elseif config.current_config.small_monster_UI.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
|
||||
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
|
||||
|
||||
@@ -7,6 +7,9 @@ function body_part_UI_entity.new(part_visibility, part_name_label,
|
||||
flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label, flinch_percentage_label,
|
||||
break_visibility, break_bar, break_text_label, break_value_label, break_percentage_label,
|
||||
loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
local entity = {};
|
||||
|
||||
entity.part_visibility = part_visibility;
|
||||
@@ -16,91 +19,93 @@ function body_part_UI_entity.new(part_visibility, part_name_label,
|
||||
|
||||
entity.part_name_label = table_helpers.deep_copy(part_name_label);
|
||||
|
||||
entity.part_name_label.offset.x = entity.part_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.part_name_label.offset.y = entity.part_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.part_name_label.offset.x = entity.part_name_label.offset.x * global_scale_modifier;
|
||||
entity.part_name_label.offset.y = entity.part_name_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.flinch_bar = table_helpers.deep_copy(flinch_bar);
|
||||
entity.flinch_text_label = table_helpers.deep_copy(flinch_text_label);
|
||||
entity.flinch_value_label = table_helpers.deep_copy(flinch_value_label);
|
||||
entity.flinch_percentage_label = table_helpers.deep_copy(flinch_percentage_label);
|
||||
|
||||
entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.size.width = entity.flinch_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.size.height = entity.flinch_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * global_scale_modifier;
|
||||
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * global_scale_modifier;
|
||||
entity.flinch_bar.size.width = entity.flinch_bar.size.width * global_scale_modifier;
|
||||
entity.flinch_bar.size.height = entity.flinch_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_text_label.offset.y = entity.flinch_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * global_scale_modifier;
|
||||
entity.flinch_text_label.offset.y = entity.flinch_text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.flinch_value_label.offset.x = entity.flinch_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_value_label.offset.y = entity.flinch_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_value_label.offset.x = entity.flinch_value_label.offset.x * global_scale_modifier;
|
||||
entity.flinch_value_label.offset.y = entity.flinch_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * global_scale_modifier;
|
||||
entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.break_bar = table_helpers.deep_copy(break_bar);
|
||||
entity.break_text_label = table_helpers.deep_copy(break_text_label);
|
||||
entity.break_value_label = table_helpers.deep_copy(break_value_label);
|
||||
entity.break_percentage_label = table_helpers.deep_copy(break_percentage_label);
|
||||
|
||||
entity.break_bar.offset.x = entity.break_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.offset.y = entity.break_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.size.width = entity.break_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.size.height = entity.break_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.offset.x = entity.break_bar.offset.x * global_scale_modifier;
|
||||
entity.break_bar.offset.y = entity.break_bar.offset.y * global_scale_modifier;
|
||||
entity.break_bar.size.width = entity.break_bar.size.width * global_scale_modifier;
|
||||
entity.break_bar.size.height = entity.break_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.break_text_label.offset.x = entity.break_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_text_label.offset.y = entity.break_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_text_label.offset.x = entity.break_text_label.offset.x * global_scale_modifier;
|
||||
entity.break_text_label.offset.y = entity.break_text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.break_value_label.offset.x = entity.break_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_value_label.offset.y = entity.break_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_value_label.offset.x = entity.break_value_label.offset.x * global_scale_modifier;
|
||||
entity.break_value_label.offset.y = entity.break_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * global_scale_modifier;
|
||||
entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.loss_bar = table_helpers.deep_copy(loss_bar);
|
||||
entity.loss_text_label = table_helpers.deep_copy(loss_text_label);
|
||||
entity.loss_value_label = table_helpers.deep_copy(loss_value_label);
|
||||
entity.loss_health_percentage_label = table_helpers.deep_copy(loss_health_percentage_label);
|
||||
|
||||
entity.loss_bar.offset.x = entity.loss_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.offset.y = entity.loss_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.size.width = entity.loss_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.size.height = entity.loss_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.offset.x = entity.loss_bar.offset.x * global_scale_modifier;
|
||||
entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier;
|
||||
entity.loss_bar.size.width = entity.loss_bar.size.width * global_scale_modifier;
|
||||
entity.loss_bar.size.height = entity.loss_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_text_label.offset.y = entity.loss_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * global_scale_modifier;
|
||||
entity.loss_text_label.offset.y = entity.loss_text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.loss_value_label.offset.x = entity.loss_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_value_label.offset.y = entity.loss_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_value_label.offset.x = entity.loss_value_label.offset.x * global_scale_modifier;
|
||||
entity.loss_value_label.offset.y = entity.loss_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * global_scale_modifier;
|
||||
entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scale)
|
||||
local cached_config = config.current_config.large_monster_UI.dynamic.body_parts;
|
||||
|
||||
if not part.body_part_dynamic_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
local part_name = "";
|
||||
if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.part_name then
|
||||
if cached_config.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_max_count then
|
||||
if cached_config.part_name_label.include.break_count then
|
||||
if cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_max_count then
|
||||
elseif cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
end
|
||||
end
|
||||
@@ -110,20 +115,20 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
|
||||
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_health.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_health.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_health.offset.y,
|
||||
visibility = part.body_part_dynamic_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_break.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_break.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_break.offset.y,
|
||||
visibility = part.body_part_dynamic_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_loss.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_loss.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
@@ -162,27 +167,29 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale)
|
||||
local cached_config = config.current_config.large_monster_UI.static.body_parts;
|
||||
|
||||
if not part.body_part_static_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
local part_name = "";
|
||||
if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.part_name then
|
||||
if cached_config.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_max_count then
|
||||
if cached_config.part_name_label.include.break_count then
|
||||
if cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_max_count then
|
||||
elseif cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
end
|
||||
end
|
||||
@@ -192,20 +199,20 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
|
||||
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_health.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_health.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_health.offset.y,
|
||||
visibility = part.body_part_static_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_break.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_break.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_break.offset.y,
|
||||
visibility = part.body_part_static_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_loss.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_loss.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
@@ -244,27 +251,29 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_scale)
|
||||
local cached_config = config.current_config.large_monster_UI.highlighted.body_parts;
|
||||
|
||||
if not part.body_part_highlighted_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
local part_name = "";
|
||||
if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.part_name then
|
||||
if cached_config.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_max_count then
|
||||
if cached_config.part_name_label.include.break_count then
|
||||
if cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_max_count then
|
||||
elseif cached_config.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
end
|
||||
end
|
||||
@@ -274,51 +283,55 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
|
||||
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_health.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_health.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_health.offset.y,
|
||||
visibility = part.body_part_highlighted_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_break.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_break.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_break.offset.y,
|
||||
visibility = part.body_part_highlighted_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_loss.offset.y,
|
||||
x = position_on_screen.x + cached_config.part_loss.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
|
||||
if part.body_part_highlighted_UI.flinch_visibility then
|
||||
local draw_health = part.body_part_highlighted_UI.flinch_visibility and part.max_health > 0;
|
||||
local draw_break = part.body_part_highlighted_UI.break_visibility and part.break_max_health > 0 and part.break_count < part.break_max_count;
|
||||
local draw_loss = part.body_part_highlighted_UI.loss_visibility and part.loss_max_health > 0 and not part.is_severed;
|
||||
|
||||
if draw_health then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
if draw_break then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
if draw_loss then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage);
|
||||
end
|
||||
|
||||
drawing.draw_label(part.body_part_highlighted_UI.part_name_label, position_on_screen, opacity_scale, part_name);
|
||||
|
||||
if part.body_part_highlighted_UI.flinch_visibility then
|
||||
if draw_health then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
if draw_break then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_text_label, break_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
if draw_loss then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_text_label, loss_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage);
|
||||
|
||||
@@ -8,6 +8,8 @@ local language;
|
||||
function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
--entity.visibility = visibility;
|
||||
entity.bar = table_helpers.deep_copy(bar);
|
||||
entity.highlighted_bar = table_helpers.deep_copy(highlighted_bar);
|
||||
@@ -17,39 +19,40 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label
|
||||
entity.value_label = table_helpers.deep_copy(value_label);
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * global_scale_modifier;
|
||||
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * global_scale_modifier;
|
||||
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * global_scale_modifier;
|
||||
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier;
|
||||
entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.dps_label.offset.x = entity.dps_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.dps_label.offset.y = entity.dps_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.dps_label.offset.x = entity.dps_label.offset.x * global_scale_modifier;
|
||||
entity.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * global_scale_modifier;
|
||||
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
local player_include = config.current_config.damage_meter_UI.player_name_label.include.others;
|
||||
local player_include = cached_config.player_name_label.include.others;
|
||||
if _player.id == player.myself.id then
|
||||
player_include = config.current_config.damage_meter_UI.player_name_label.include.myself;
|
||||
player_include = cached_config.player_name_label.include.myself;
|
||||
end
|
||||
|
||||
local player_name_text = "";
|
||||
@@ -76,7 +79,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
end
|
||||
|
||||
local player_damage_bar_percentage = 0;
|
||||
if config.current_config.damage_meter_UI.settings.damage_bar_relative_to == "Total Damage" then
|
||||
if cached_config.settings.damage_bar_relative_to == "Total Damage" then
|
||||
if player.total.display.total_damage ~= 0 then
|
||||
player_damage_bar_percentage = _player.display.total_damage / player.total.display.total_damage;
|
||||
end
|
||||
@@ -86,11 +89,11 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
end
|
||||
end
|
||||
|
||||
if _player.id == player.myself.id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then
|
||||
elseif cached_config.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then
|
||||
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps then
|
||||
elseif cached_config.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps then
|
||||
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
|
||||
@@ -7,25 +7,27 @@ local config;
|
||||
function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.visibility = visibility;
|
||||
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);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -7,6 +7,8 @@ local config;
|
||||
function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.visibility = visibility;
|
||||
entity.bar = table_helpers.deep_copy(bar);
|
||||
entity.text_label = table_helpers.deep_copy(text_label);
|
||||
@@ -14,22 +16,22 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier;
|
||||
entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -7,25 +7,27 @@ local config;
|
||||
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.visibility = visibility;
|
||||
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);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,8 @@ local config;
|
||||
drawing.font = nil;
|
||||
|
||||
function drawing.init_font()
|
||||
drawing.font = d2d.Font.new(config.current_config.global_settings.UI_font.family, config.current_config.global_settings.UI_font.size, config.current_config.global_settings.UI_font.bold, config.current_config.global_settings.UI_font.italic);
|
||||
local cached_config = config.current_config.global_settings.UI_font;
|
||||
drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold, cached_config.italic);
|
||||
end
|
||||
|
||||
function drawing.argb_color_to_abgr_color(argb_color)
|
||||
|
||||
Reference in New Issue
Block a user