Optimize small monster UI drawing function

This commit is contained in:
GreenComfyTea
2023-08-08 13:04:40 +03:00
parent e1d3754733
commit e09c82278d
10 changed files with 49 additions and 73 deletions

View File

@@ -56,24 +56,24 @@ function this.draw(monster, ailment_buildup_UI, cached_config, ailment_buildups_
for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then
if not cached_config.filter.stun then
goto continue
goto continue;
end
elseif id == ailments.poison_id then
if not cached_config.filter.poison then
goto continue
goto continue;
end
elseif id == ailments.blast_id then
if not cached_config.filter.blast then
goto continue
goto continue;
end
else
goto continue
goto continue;
end
if cached_config.settings.time_limit ~= 0 and
time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then
goto continue
goto continue;
end
@@ -154,7 +154,7 @@ function this.draw(monster, ailment_buildup_UI, cached_config, ailment_buildups_
end
if total_buildup == 0 then
goto continue
goto continue;
end
if cached_config.sorting.type == "Normal" then

View File

@@ -147,7 +147,7 @@ function this.stock_damage()
local damage_param = get_damage_param_method:call(enemy);
if damage_param == nil then
error_handler.report("ailment_hook.stock_damage", "Failed to access Data: small_monster -> damage_param");
goto continue
goto continue;
end
local poison_param = poison_param_field:get_data(damage_param);

View File

@@ -312,13 +312,13 @@ function this.update_ailments(enemy, monster)
for id = 0, condition_param_array_length - 1 do
if id == this.stun_id or id == this.poison_id or id == this.blast_id then
goto continue
goto continue;
end
local ailment_param = get_value_method:call(condition_param_array, id);
if ailment_param == nil then
error_handler.report("ailments.update_ailments", "Failed to access Data: ailment_param No. " .. tostring(id));
goto continue
goto continue;
end
this.update_ailment(monster, ailment_param, id);
@@ -559,86 +559,86 @@ function this.draw(monster, ailment_UI, cached_config, ailments_position_on_scre
for id, ailment in pairs(monster.ailments) do
if id == this.paralyze_id then
if not cached_config.filter.paralysis then
goto continue
goto continue;
end
elseif id == this.sleep_id then
if not cached_config.filter.sleep then
goto continue
goto continue;
end
elseif id == this.stun_id then
if not cached_config.filter.stun then
goto continue
goto continue;
end
elseif id == this.flash_id then
if not cached_config.filter.flash then
goto continue
goto continue;
end
elseif id == this.poison_id then
if not cached_config.filter.poison then
goto continue
goto continue;
end
elseif id == this.blast_id then
if not cached_config.filter.blast then
goto continue
goto continue;
end
elseif id == this.exhaust_id then
if not cached_config.filter.exhaust then
goto continue
goto continue;
end
elseif id == this.ride_id then
if not cached_config.filter.ride then
goto continue
goto continue;
end
elseif id == this.water_id then
if not cached_config.filter.waterblight then
goto continue
goto continue;
end
elseif id == this.fire_id then
if not cached_config.filter.fireblight then
goto continue
goto continue;
end
elseif id == this.ice_id then
if not cached_config.filter.iceblight then
goto continue
goto continue;
end
elseif id == this.thunder_id then
if not cached_config.filter.thunderblight then
goto continue
goto continue;
end
elseif id == this.fall_trap_id then
if not cached_config.filter.fall_trap then
goto continue
goto continue;
end
elseif id == this.shock_trap_id then
if not cached_config.filter.shock_trap then
goto continue
goto continue;
end
elseif id == this.capture_id then
if not cached_config.filter.tranq_bomb then
goto continue
goto continue;
end
elseif id == this.koyashi_id then
if not cached_config.filter.dung_bomb then
goto continue
goto continue;
end
elseif id == this.steel_fang_id then
if not cached_config.filter.steel_fang then
goto continue
goto continue;
end
elseif id == this.fall_quick_sand_id then
if not cached_config.filter.quick_sand then
goto continue
goto continue;
end
elseif id == this.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then
goto continue
goto continue;
end
elseif id == this.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then
goto continue
goto continue;
end
else
goto continue
goto continue;
end
if cached_config.settings.hide_ailments_with_zero_buildup
@@ -646,31 +646,31 @@ function this.draw(monster, ailment_UI, cached_config, ailments_position_on_scre
and ailment.buildup_limit ~= 0
and ailment.activate_count == 0
and not ailment.is_active then
goto continue
goto continue;
end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support
and ailment.buildup_limit == 0
and not ailment.is_active then
goto continue
goto continue;
end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue
goto continue;
end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue
goto continue;
end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue
goto continue;
end
if cached_config.settings.time_limit ~= 0
and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit
and not ailment.is_active then
goto continue
goto continue;
end
table.insert(displayed_ailments, ailment);

View File

@@ -316,19 +316,19 @@ function this.draw(monster, part_UI, cached_config, parts_position_on_screen, op
and ((part.break_health == part.break_max_health and part.break_count == 0) or not break_supported)
and ((part.loss_health == part.loss_max_health and not part.is_severed) or not sever_supported)
and ((part.anomaly_health == part.anomaly_max_health) or not anomaly_supported) then
goto continue
goto continue;
end
if (not part_UI.flinch_visibility or not health_supported)
and (not part_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count)
and (not part_UI.loss_visibility or not sever_supported or part.is_severed)
and (not part_UI.anomaly_visibility or not anomaly_supported) then
goto continue
goto continue;
end
if cached_config.settings.time_limit ~= 0 and
time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then
goto continue
goto continue;
end
table.insert(displayed_parts, part);

View File

@@ -129,7 +129,7 @@ function this.update_large_monster(enemy)
-- this is the VERY LEAST thing we should do all the time
-- so the position doesn't lag all over the place
-- due to how infrequently we update the monster(s).
--large_monster.update_position(enemy, monster);
large_monster.update_position(enemy, monster);
if not config.current_config.global_settings.performance.prioritize_large_monsters and updated_monsters[enemy] then
return;
@@ -174,7 +174,7 @@ function this.update_small_monster(enemy)
-- this is the VERY LEAST thing we should do all the time
-- so the position doesn't lag all over the place
-- due to how infrequently we update the monster(s).
--small_monster.update_position(enemy, monster);
small_monster.update_position(enemy, monster);
if updated_monsters[enemy] then
return;