mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Fix Capture Line showing when health is hidden
This commit is contained in:
@@ -841,7 +841,8 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
|
|||||||
};
|
};
|
||||||
|
|
||||||
health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale);
|
health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale);
|
||||||
drawing.draw_capture_line(monster.health_dynamic_UI.bar, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
|
||||||
|
drawing.draw_capture_line(monster.health_dynamic_UI, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
||||||
|
|
||||||
stamina_UI_entity.draw(monster, monster.stamina_dynamic_UI, stamina_position_on_screen, opacity_scale);
|
stamina_UI_entity.draw(monster, monster.stamina_dynamic_UI, stamina_position_on_screen, opacity_scale);
|
||||||
rage_UI_entity.draw(monster, monster.rage_dynamic_UI, rage_position_on_screen, opacity_scale);
|
rage_UI_entity.draw(monster, monster.rage_dynamic_UI, rage_position_on_screen, opacity_scale);
|
||||||
@@ -925,7 +926,8 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
|
|||||||
};
|
};
|
||||||
|
|
||||||
health_UI_entity.draw(monster, monster.health_static_UI, health_position_on_screen, opacity_scale);
|
health_UI_entity.draw(monster, monster.health_static_UI, health_position_on_screen, opacity_scale);
|
||||||
drawing.draw_capture_line(monster.health_static_UI.bar, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
|
||||||
|
drawing.draw_capture_line(monster.health_static_UI, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
||||||
|
|
||||||
stamina_UI_entity.draw(monster, monster.stamina_static_UI, stamina_position_on_screen, opacity_scale);
|
stamina_UI_entity.draw(monster, monster.stamina_static_UI, stamina_position_on_screen, opacity_scale);
|
||||||
rage_UI_entity.draw(monster, monster.rage_static_UI, rage_position_on_screen, opacity_scale);
|
rage_UI_entity.draw(monster, monster.rage_static_UI, rage_position_on_screen, opacity_scale);
|
||||||
@@ -1009,7 +1011,7 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
|
|||||||
};
|
};
|
||||||
|
|
||||||
health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale);
|
health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale);
|
||||||
drawing.draw_capture_line(monster.health_highlighted_UI.bar, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
drawing.draw_capture_line(monster.health_highlighted_UI, health_position_on_screen, opacity_scale, monster.capture_percentage);
|
||||||
|
|
||||||
stamina_UI_entity.draw(monster, monster.stamina_highlighted_UI, stamina_position_on_screen, opacity_scale);
|
stamina_UI_entity.draw(monster, monster.stamina_highlighted_UI, stamina_position_on_screen, opacity_scale);
|
||||||
rage_UI_entity.draw(monster, monster.rage_highlighted_UI, rage_position_on_screen, opacity_scale);
|
rage_UI_entity.draw(monster, monster.rage_highlighted_UI, rage_position_on_screen, opacity_scale);
|
||||||
|
|||||||
@@ -165,31 +165,33 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.draw_capture_line(bar, position, opacity_scale, percentage)
|
function drawing.draw_capture_line(health_UI, position, opacity_scale, percentage)
|
||||||
if bar == nil
|
if health_UI == nil
|
||||||
or bar.capture_line == nil
|
or not health_UI.visibility
|
||||||
or not bar.visibility
|
or health_UI.bar == nil
|
||||||
or not bar.capture_line.visibility
|
or not health_UI.bar.visibility
|
||||||
|
or health_UI.bar.capture_line == nil
|
||||||
|
or not health_UI.bar.capture_line.visibility
|
||||||
or percentage >= 1
|
or percentage >= 1
|
||||||
or percentage <= 0 then
|
or percentage <= 0 then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local position_x = position.x + bar.offset.x + bar.capture_line.offset.x + bar.size.width * percentage;
|
local position_x = position.x + health_UI.bar.offset.x + health_UI.bar.capture_line.offset.x + health_UI.bar.size.width * percentage;
|
||||||
local position_y = position.y + bar.offset.y + bar.capture_line.offset.y;
|
local position_y = position.y + health_UI.bar.offset.y + health_UI.bar.capture_line.offset.y;
|
||||||
|
|
||||||
local color = bar.capture_line.color;
|
local color = health_UI.bar.capture_line.color;
|
||||||
|
|
||||||
if opacity_scale < 1 then
|
if opacity_scale < 1 then
|
||||||
color = drawing.scale_color_opacity(color, opacity_scale);
|
color = drawing.scale_color_opacity(color, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
if d2d ~= nil then
|
if d2d ~= nil then
|
||||||
d2d.fill_rect(position_x, position_y, bar.capture_line.size.width, bar.capture_line.size.height, color);
|
d2d.fill_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height, color);
|
||||||
else
|
else
|
||||||
color = drawing.argb_color_to_abgr_color(color);
|
color = drawing.argb_color_to_abgr_color(color);
|
||||||
draw.filled_rect(position_x, position_y, bar.capture_line.size.width, bar.capture_line.size.height, color)
|
draw.filled_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height, color)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user