Refactoring

This commit is contained in:
GreenComfyTea
2022-07-26 19:27:37 +03:00
parent a20c458629
commit 2f9a8ac6a3
41 changed files with 5939 additions and 18587 deletions

View File

@@ -44,6 +44,9 @@ local ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity"
local ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity"); local ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
local customization_menu = require("MHR_Overlay.UI.customization_menu"); local customization_menu = require("MHR_Overlay.UI.customization_menu");
local label_customization = require("MHR_Overlay.UI.Customizations.label_customization");
local bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
local line_customization = require("MHR_Overlay.UI.Customizations.line_customization");
local drawing = require("MHR_Overlay.UI.drawing"); local drawing = require("MHR_Overlay.UI.drawing");
------------------------INIT MODULES------------------------- ------------------------INIT MODULES-------------------------
@@ -82,9 +85,12 @@ ailment_hook.init_module();
ailment_buildup.init_module(); ailment_buildup.init_module();
customization_menu.init_module(); customization_menu.init_module();
label_customization.init_module();
bar_customization.init_module();
line_customization.init_module();
drawing.init_module();
damage_meter_UI.init_module(); damage_meter_UI.init_module();
drawing.init_module();
large_monster_UI.init_module(); large_monster_UI.init_module();
small_monster_UI.init_module(); small_monster_UI.init_module();
time_UI.init_module(); time_UI.init_module();
@@ -102,55 +108,25 @@ log.info("[MHR Overlay] loaded");
-- #region -- #region
local function main_loop() local function main_loop()
customization_menu.status = "OK"; customization_menu.status = "OK";
singletons.init(); singletons.init();
screen.update_window_size(); screen.update_window_size();
player.update_myself_position(); player.update_myself_position();
quest_status.update_is_online(); quest_status.update_is_online();
quest_status.update_is_result_screen(); quest_status.update_is_result_screen();
quest_status.update_is_host(); quest_status.update_is_host();
time.tick(); time.tick();
player.update_player_list(quest_status.index >= 2); player.update_player_list(quest_status.index >= 2);
if quest_status.index < 2 then if quest_status.index < 2 then
quest_status.update_is_training_area(); quest_status.update_is_training_area();
if quest_status.is_training_area then if quest_status.is_training_area then
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI; local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI; config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI; local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled); config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI;
if not success then
customization_menu.status = "Large monster drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then
local success = pcall(env_creature_UI.draw);
if not success then
customization_menu.status = "Endemic life drawing function threw an exception";
end
end
end
elseif quest_status.is_result_screen then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled); local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
@@ -159,109 +135,158 @@ local function main_loop()
end end
end end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then if config.current_config.damage_meter_UI.enabled and
local success = pcall(time_UI.draw); config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then
if not success then
customization_menu.status = "Time drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
local success = pcall(damage_meter_UI.draw); local success = pcall(damage_meter_UI.draw);
if not success then if not success then
customization_menu.status = "Damage meter drawing function threw an exception"; customization_menu.status = "Damage meter drawing function threw an exception";
end end
end end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then if config.current_config.endemic_life_UI.enabled and
local success = pcall(env_creature_UI.draw); config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then
if not success then
customization_menu.status = "Endemic life drawing function threw an exception";
end
end
elseif quest_status.index == 2 then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = "Large monster drawing function threw an exception";
end
end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.time_UI then
local success = pcall(time_UI.draw);
if not success then
customization_menu.status = "Time drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then
local success = pcall(env_creature_UI.draw); local success = pcall(env_creature_UI.draw);
if not success then if not success then
customization_menu.status = "Endemic life drawing function threw an exception"; customization_menu.status = "Endemic life drawing function threw an exception";
end end
end end
end end
elseif quest_status.is_result_screen then
if config.current_config.small_monster_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
--snow.player.PlayerManager -> local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
-- <PlayerData>k_BackingField -> [0] config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
--Demondrug _AtkUpAlive = 5 1 if dynamic_enabled or static_enabled or highlighted_enabled then
--Mega Demondrug _AtkUpAlive = 7 1 local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
--Armorskin _DefUpAlive = 15 1 if not success then
--Mega Armorskin _DefUpAlive = 25 1 customization_menu.status = "Large monster drawing function threw an exception";
--Might Seed _AtkUpBuffSecond and _AtkUpBuffSecondTimer 1 end
--Demon Powder _AtkUpItemSecond and _AtkUpItemSecondTimer 1 end
--Adamant Seed _DefUpBuffSecond and _DefUpBuffSecondTimer 1
--Hardshell Powder _DefUpItemSecond and _DefUpItemSecondTimer 1
--Dash Juice _StaminaUpBuffSecondTimer 1
--Immunizer _VitalizerTimer 1
-- Attack Up if config.current_config.time_UI.enabled and
-- Defense Up config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then
-- Affinity Up _AtkUpEcSecond and _AtkUpEcSecondTimer local success = pcall(time_UI.draw);
-- Sharpness Loss Reduced if not success then
-- Elemental Attack Boost customization_menu.status = "Time drawing function threw an exception";
-- Divine Protection end
-- Health Regeneration end
-- Natural Healing Up
-- Blight Negated
-- Immunity
-- Stamina Recovery Up
-- Stamina Use Reduced
-- Knockbacks Negated _DefUpEcSecond and _DefUpEcSecondTimer
-- Sonic Barrier
-- Earplugs (S)
-- Earplugs (L)
-- Tremor Negated
-- Enviroment Damage Negated
-- Stun Negated
-- Wind Pressure Negated
-- Gourmet Fish Effect
-- Self Improvement
-- Infernal Melody
--[[ if config.current_config.damage_meter_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
if config.current_config.endemic_life_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then
local success = pcall(env_creature_UI.draw);
if not success then
customization_menu.status = "Endemic life drawing function threw an exception";
end
end
elseif quest_status.index == 2 then
if config.current_config.small_monster_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = "Large monster drawing function threw an exception";
end
end
if config.current_config.time_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.time_UI then
local success = pcall(time_UI.draw);
if not success then
customization_menu.status = "Time drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
if config.current_config.endemic_life_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then
local success = pcall(env_creature_UI.draw);
if not success then
customization_menu.status = "Endemic life drawing function threw an exception";
end
end
end
--snow.player.PlayerManager ->
-- <PlayerData>k_BackingField -> [0]
--Demondrug _AtkUpAlive = 5 1
--Mega Demondrug _AtkUpAlive = 7 1
--Armorskin _DefUpAlive = 15 1
--Mega Armorskin _DefUpAlive = 25 1
--Might Seed _AtkUpBuffSecond and _AtkUpBuffSecondTimer 1
--Demon Powder _AtkUpItemSecond and _AtkUpItemSecondTimer 1
--Adamant Seed _DefUpBuffSecond and _DefUpBuffSecondTimer 1
--Hardshell Powder _DefUpItemSecond and _DefUpItemSecondTimer 1
--Dash Juice _StaminaUpBuffSecondTimer 1
--Immunizer _VitalizerTimer 1
-- Attack Up
-- Defense Up
-- Affinity Up _AtkUpEcSecond and _AtkUpEcSecondTimer
-- Sharpness Loss Reduced
-- Elemental Attack Boost
-- Divine Protection
-- Health Regeneration
-- Natural Healing Up
-- Blight Negated
-- Immunity
-- Stamina Recovery Up
-- Stamina Use Reduced
-- Knockbacks Negated _DefUpEcSecond and _DefUpEcSecondTimer
-- Sonic Barrier
-- Earplugs (S)
-- Earplugs (L)
-- Tremor Negated
-- Enviroment Damage Negated
-- Stun Negated
-- Wind Pressure Negated
-- Gourmet Fish Effect
-- Self Improvement
-- Infernal Melody
--[[
local player_data_array = singletons.player_manager:get_field("<PlayerData>k__BackingField"); local player_data_array = singletons.player_manager:get_field("<PlayerData>k__BackingField");
local player_data = player_data_array:get_element(0); local player_data = player_data_array:get_element(0);
@@ -438,6 +463,7 @@ local function main_loop()
xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer); xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer);
--]] --]]
end end
-- #endregion -- #endregion
----------------------------LOOP----------------------------- ----------------------------LOOP-----------------------------

View File

@@ -12,7 +12,7 @@ local enemy_character_base_after_calc_damage_damage_side_method = enemy_characte
local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy"); local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy");
local check_die_method = enemy_character_base_type_def:get_method("checkDie"); local check_die_method = enemy_character_base_type_def:get_method("checkDie");
local enemy_calc_damage_info_type_def = sdk.find_type_definition("snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide"); local enemy_calc_damage_info_type_def = sdk.find_type_definition("snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide");
local get_attacker_id_method = enemy_calc_damage_info_type_def:get_method("get_AttackerID"); local get_attacker_id_method = enemy_calc_damage_info_type_def:get_method("get_AttackerID");
local get_damage_attacker_type_method = enemy_calc_damage_info_type_def:get_method("get_DamageAttackerType"); local get_damage_attacker_type_method = enemy_calc_damage_info_type_def:get_method("get_DamageAttackerType");
local is_marionette_attack_method = enemy_calc_damage_info_type_def:get_method("get_IsMarionetteAttack"); local is_marionette_attack_method = enemy_calc_damage_info_type_def:get_method("get_IsMarionetteAttack");
@@ -28,7 +28,7 @@ local get_condition_type2_method = enemy_calc_damage_info_type_def:get_method("g
local get_condition_damage3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage3"); local get_condition_damage3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage3");
local get_condition_type3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType3"); local get_condition_type3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType3");
local stock_mystery_core_break_damage_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase.stockMysteryCoreBreakDamage"); local stock_mystery_core_break_damage_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase.stockMysteryCoreBreakDamage");
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager"); local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
@@ -43,7 +43,8 @@ local is_from_host_field = packet_quest_forfeit_type_def:get_field("_IsFromQuest
function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette_attack) function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette_attack)
if is_marionette_attack then if is_marionette_attack then
return "wyvern riding"; return "wyvern riding";
elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or damage_source_type_id == 13 then elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or
damage_source_type_id == 13 then
return "player"; return "player";
elseif damage_source_type_id == 1 or damage_source_type_id == 8 then elseif damage_source_type_id == 1 or damage_source_type_id == 8 then
return "bomb"; return "bomb";
@@ -93,7 +94,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
for enemy, monster in pairs(large_monster.list) do for enemy, monster in pairs(large_monster.list) do
if monster.unique_id == attacker_id then if monster.unique_id == attacker_id then
attacker_id = monster.rider_id; attacker_id = monster.rider_id;
break; break
end end
end end
end end
@@ -161,7 +162,8 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
-- xy = ""; -- xy = "";
--end --end
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack); local damage_source_type = damage_hook.get_damage_source_type(attacker_type,
is_marionette_attack);
local attacking_player = player.get_player(attacker_id); local attacking_player = player.get_player(attacker_id);
@@ -217,7 +219,7 @@ end
--function damage_hook.on_get_finish_shoot_wall_hit_damage_rate(enemy, rate, is_part_damage) --function damage_hook.on_get_finish_shoot_wall_hit_damage_rate(enemy, rate, is_part_damage)
--xy = string.format("enemy: %s\nrate: %s\nis_part_damage: %s", tostring(enemy), tostring(rate), tostring(is_part_damage)); --xy = string.format("enemy: %s\nrate: %s\nis_part_damage: %s", tostring(enemy), tostring(rate), tostring(is_part_damage));
--end --end

View File

@@ -424,9 +424,9 @@ function player.update_player_list_(hunter_info_field_)
local myself_id = get_master_player_id_method:call(singletons.player_manager) or -1; local myself_id = get_master_player_id_method:call(singletons.player_manager) or -1;
--if quest_status.is_online then --if quest_status.is_online then
--myself_id = get_master_player_id_method:call(singletons.player_manager) or -1; --myself_id = get_master_player_id_method:call(singletons.player_manager) or -1;
--else --else
--myself_id = myself_quest_index_field:call(singletons.lobby_manager) or -1; --myself_id = myself_quest_index_field:call(singletons.lobby_manager) or -1;
--end --end
if myself_id == nil then if myself_id == nil then
@@ -447,9 +447,10 @@ function player.update_player_list_(hunter_info_field_)
--end --end
if myself_id ~= player.myself.id then if myself_id ~= player.myself.id then
player.list[player.myself.id] = nil; player.list[player.myself.id] = nil;
player.myself = player.new(myself_id, myself_guid, myself_player_name, myself_master_rank, myself_hunter_rank); player.myself = player.new(myself_id, myself_guid, myself_player_name, myself_master_rank,
player.list[myself_id] = player.myself; myself_hunter_rank);
player.list[myself_id] = player.myself;
end end
-- other players -- other players
@@ -468,13 +469,13 @@ function player.update_player_list_(hunter_info_field_)
for i = 0, count - 1 do for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i); local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then if player_info == nil then
goto continue; goto continue
end end
local player_id = member_index_field:get_data(player_info); local player_id = member_index_field:get_data(player_info);
if player_id == nil then if player_id == nil then
goto continue; goto continue
end end
local player_guid = hunter_unique_id_field:get_data(player_info); local player_guid = hunter_unique_id_field:get_data(player_info);
@@ -494,17 +495,18 @@ function player.update_player_list_(hunter_info_field_)
local player_name = name_field:get_data(player_info); local player_name = name_field:get_data(player_info);
if player_name == nil then if player_name == nil then
goto continue; goto continue
end end
if player.list[player_id] == nil or if player.list[player_id] == nil or
not guid_equals_method:call(player.list[player_id].guid, player_guid) not guid_equals_method:call(player.list[player_id].guid, player_guid)
--player.list[player_id].guid ~= player_guid --player.list[player_id].guid ~= player_guid
then then
local _player = player.new(player_id, player_guid, player_name, player_master_rank, player_hunter_rank); local _player = player.new(player_id, player_guid, player_name, player_master_rank, player_hunter_rank);
player.list[player_id] = _player; player.list[player_id] = _player;
if player_name == player.myself.name and player_hunter_rank == player.myself.hunter_rank and player_master_rank == player.myself.master_rank then if player_name == player.myself.name and player_hunter_rank == player.myself.hunter_rank and
player_master_rank == player.myself.master_rank then
player.myself = _player; player.myself = _player;
end end
end end
@@ -541,8 +543,10 @@ function player.init_total_UI(_player)
_player.damage_UI.total_damage_label.offset.x = _player.damage_UI.total_damage_label.offset.x * global_scale_modifier; _player.damage_UI.total_damage_label.offset.x = _player.damage_UI.total_damage_label.offset.x * global_scale_modifier;
_player.damage_UI.total_damage_label.offset.y = _player.damage_UI.total_damage_label.offset.y * global_scale_modifier; _player.damage_UI.total_damage_label.offset.y = _player.damage_UI.total_damage_label.offset.y * global_scale_modifier;
_player.damage_UI.total_damage_value_label.offset.x = _player.damage_UI.total_damage_value_label.offset.x * global_scale_modifier; _player.damage_UI.total_damage_value_label.offset.x = _player.damage_UI.total_damage_value_label.offset.x *
_player.damage_UI.total_damage_value_label.offset.y = _player.damage_UI.total_damage_value_label.offset.y * global_scale_modifier; global_scale_modifier;
_player.damage_UI.total_damage_value_label.offset.y = _player.damage_UI.total_damage_value_label.offset.y *
global_scale_modifier;
_player.damage_UI.total_dps_label.offset.x = _player.damage_UI.total_dps_label.offset.x * global_scale_modifier; _player.damage_UI.total_dps_label.offset.x = _player.damage_UI.total_dps_label.offset.x * global_scale_modifier;
_player.damage_UI.total_dps_label.offset.y = _player.damage_UI.total_dps_label.offset.y * global_scale_modifier; _player.damage_UI.total_dps_label.offset.y = _player.damage_UI.total_dps_label.offset.y * global_scale_modifier;
@@ -553,8 +557,10 @@ function player.draw(_player, position_on_screen, opacity_scale, top_damage, top
end end
function player.draw_total(position_on_screen, opacity_scale) function player.draw_total(position_on_screen, opacity_scale)
drawing.draw_label(player.total.damage_UI.total_damage_label, position_on_screen, opacity_scale, language.current_language.UI.total_damage); drawing.draw_label(player.total.damage_UI.total_damage_label, position_on_screen, opacity_scale,
drawing.draw_label(player.total.damage_UI.total_damage_value_label, position_on_screen, opacity_scale, player.total.display.total_damage); language.current_language.UI.total_damage);
drawing.draw_label(player.total.damage_UI.total_damage_value_label, position_on_screen, opacity_scale,
player.total.display.total_damage);
drawing.draw_label(player.total.damage_UI.total_dps_label, position_on_screen, opacity_scale, player.total.dps); drawing.draw_label(player.total.damage_UI.total_dps_label, position_on_screen, opacity_scale, player.total.dps);
end end

View File

@@ -51,7 +51,8 @@ function env_creature.init(creature, REcreature)
return; return;
end end
local creature_name = get_env_creature_name_message_method:call(singletons.message_manager, creature_type); local creature_name = get_env_creature_name_message_method:call(singletons.message_manager,
creature_type);
if creature_name ~= nil then if creature_name ~= nil then
creature.name = creature_name; creature.name = creature_name;
end end

View File

@@ -458,16 +458,16 @@ function keyboard.check_hotkeys(hard_keyboard)
local cached_config = config.current_config.global_settings.hotkeys_with_modifiers; local cached_config = config.current_config.global_settings.hotkeys_with_modifiers;
if not (cached_config.all_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.all_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.all_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.all_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.all_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.all_UI.key)) then
local is_any_enabled = config.current_config.time_UI.enabled local is_any_enabled = config.current_config.time_UI.enabled
or config.current_config.small_monster_UI.enabled or config.current_config.small_monster_UI.enabled
or config.current_config.large_monster_UI.dynamic.enabled or config.current_config.large_monster_UI.dynamic.enabled
or config.current_config.large_monster_UI.static.enabled or config.current_config.large_monster_UI.static.enabled
or config.current_config.large_monster_UI.highlighted.enabled or config.current_config.large_monster_UI.highlighted.enabled
or config.current_config.damage_meter_UI.enabled; or config.current_config.damage_meter_UI.enabled;
config.current_config.time_UI.enabled = not is_any_enabled; config.current_config.time_UI.enabled = not is_any_enabled;
config.current_config.small_monster_UI.enabled = not is_any_enabled; config.current_config.small_monster_UI.enabled = not is_any_enabled;
@@ -479,16 +479,16 @@ function keyboard.check_hotkeys(hard_keyboard)
end end
if not (cached_config.small_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.small_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.small_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.small_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.small_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.small_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.small_monster_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.small_monster_UI.key)) then
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled; config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
end end
end end
if not (cached_config.large_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_UI.key)) then
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
or config.current_config.large_monster_UI.static.enabled or config.current_config.large_monster_UI.static.enabled
@@ -501,48 +501,52 @@ function keyboard.check_hotkeys(hard_keyboard)
end end
if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_dynamic_UI.key)) then if get_release_method:call(hard_keyboard,
math.tointeger(cached_config.large_monster_dynamic_UI.key)) then
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled; config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
end end
end end
if not (cached_config.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_static_UI.key)) then if get_release_method:call(hard_keyboard,
math.tointeger(cached_config.large_monster_static_UI.key)) then
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled; config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
end end
end end
if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_highlighted_UI.key)) then if get_release_method:call(hard_keyboard,
config.current_config.large_monster_UI.highlighted.enabled = not config.current_config.large_monster_UI.highlighted.enabled; math.tointeger(cached_config.large_monster_highlighted_UI.key)) then
config.current_config.large_monster_UI.highlighted.enabled = not
config.current_config.large_monster_UI.highlighted.enabled;
end end
end end
if not (cached_config.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.time_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.time_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.time_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.time_UI.key)) then
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled; config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
end end
end end
if not (cached_config.damage_meter_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.damage_meter_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.damage_meter_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.damage_meter_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.damage_meter_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.damage_meter_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.damage_meter_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.damage_meter_UI.key)) then
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled; config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
end end
end end
if not (cached_config.endemic_life_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.endemic_life_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.endemic_life_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.endemic_life_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.endemic_life_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.endemic_life_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.endemic_life_UI.key)) then if get_release_method:call(hard_keyboard, math.tointeger(cached_config.endemic_life_UI.key)) then
config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled; config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled;
end end

View File

@@ -1,4 +1,3 @@
local quest_status = {}; local quest_status = {};
local singletons; local singletons;
local customization_menu; local customization_menu;
@@ -36,7 +35,7 @@ local is_quest_host_method = lobby_manager_type_definition:get_method("isQuestHo
function quest_status.on_changed_game_status(new_quest_status) function quest_status.on_changed_game_status(new_quest_status)
if (quest_status.index < 2 and new_quest_status == 2) if (quest_status.index < 2 and new_quest_status == 2)
or new_quest_status < 2 then or new_quest_status < 2 then
player.init(); player.init();
small_monster.init_list(); small_monster.init_list();

View File

@@ -35,7 +35,9 @@ local height_field = size_type:get_field("h");
function screen.get_game_window_size() function screen.get_game_window_size()
if scene_view == nil then if scene_view == nil then
scene_view = sdk.call_native_func(singletons.scene_manager, sdk.find_type_definition("via.SceneManager"), "get_MainView"); scene_view = sdk.call_native_func(singletons.scene_manager,
sdk.find_type_definition("via.SceneManager")
, "get_MainView");
if scene_view == nil then if scene_view == nil then
--log.error("[MHR_Overlay.lua] No scene view"); --log.error("[MHR_Overlay.lua] No scene view");
@@ -56,7 +58,7 @@ function screen.get_game_window_size()
end end
local screen_height = height_field:get_data(size); local screen_height = height_field:get_data(size);
if screen_height == nil then if screen_height == nil then
--log.error("[MHR_Overlay.lua] No screen height"); --log.error("[MHR_Overlay.lua] No screen height");
return; return;
end end
@@ -74,29 +76,29 @@ function screen.calculate_absolute_coordinates(position)
-- top left -- top left
if position.anchor == "Top-Left" then if position.anchor == "Top-Left" then
return {x = _position.x, y = _position.y}; return { x = _position.x, y = _position.y };
end end
-- top right -- top right
if position.anchor == "Top-Right" then if position.anchor == "Top-Right" then
local screen_x = screen.width - _position.x; local screen_x = screen.width - _position.x;
return {x = screen_x, y = _position.y}; return { x = screen_x, y = _position.y };
end end
-- bottom left -- bottom left
if position.anchor == "Bottom-Left" then if position.anchor == "Bottom-Left" then
local screen_y = screen.height - _position.y; local screen_y = screen.height - _position.y;
return {x = _position.x, y = screen_y}; return { x = _position.x, y = screen_y };
end end
-- bottom right -- bottom right
if position.anchor == "Bottom-Right" then if position.anchor == "Bottom-Right" then
local screen_x = screen.width - _position.x; local screen_x = screen.width - _position.x;
local screen_y = screen.height - _position.y; local screen_y = screen.height - _position.y;
return {x = screen_x, y = screen_y}; return { x = screen_x, y = screen_y };
end end
return {x = _position.x, y = _position.y}; return { x = _position.x, y = _position.y };
end end
function screen.init_module() function screen.init_module()

View File

@@ -268,11 +268,21 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB974A652, foreground = 0xB974A652,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF,
capture_health = 0xB9CCCC33 capture_health = 0xB9CCCC33
} }
} }
}, },
@@ -442,9 +452,17 @@ function config.init()
height = 4 height = 4
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7ff80ce,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -617,9 +635,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -635,9 +661,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -773,14 +807,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -812,7 +855,7 @@ function config.init()
visibility = true, visibility = true,
text = "%s", text = "%s",
offset = { offset = {
x = 15-10, x = 15 - 10,
y = 0 y = 0
}, },
color = 0xFFA3F5F0, color = 0xFFA3F5F0,
@@ -831,7 +874,7 @@ function config.init()
visibility = true, visibility = true,
text = "%.0f/%.0f", -- current_health/max_health text = "%.0f/%.0f", -- current_health/max_health
offset = { offset = {
x = 55-10, x = 55 - 10,
y = 17 y = 17
}, },
color = 0xFFFFFFFF, color = 0xFFFFFFFF,
@@ -889,7 +932,7 @@ function config.init()
bar = { bar = {
visibility = true, visibility = true,
offset = { offset = {
x = 10-10, x = 10 - 10,
y = 17 y = 17
}, },
@@ -898,9 +941,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1003,9 +1054,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1033,8 +1092,7 @@ function config.init()
reversed_order = false reversed_order = false
}, },
filter = filter = {
{
health_break_severe = true, health_break_severe = true,
health_break = true, health_break = true,
health_severe = true, health_severe = true,
@@ -1150,9 +1208,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1236,9 +1302,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999bfff,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1321,9 +1395,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9e57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1502,9 +1584,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7ff80ce,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1677,9 +1767,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -1695,9 +1793,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1837,14 +1943,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -1962,9 +2077,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2067,9 +2190,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2214,9 +2345,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2300,9 +2439,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999BFFF,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2385,9 +2532,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9E57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2567,9 +2722,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7FF80CE,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2742,9 +2905,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -2760,9 +2931,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2773,7 +2952,7 @@ function config.init()
position = { position = {
x = 615, x = 615,
y = 25,--y = 44, y = 25, --y = 44,
anchor = "Top-Right" anchor = "Top-Right"
}, },
@@ -2883,14 +3062,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -2922,7 +3110,7 @@ function config.init()
visibility = true, visibility = true,
text = "%s", text = "%s",
offset = { offset = {
x = 15-10, x = 15 - 10,
y = 0 y = 0
}, },
color = 0xFFA3F5F0, color = 0xFFA3F5F0,
@@ -2999,7 +3187,7 @@ function config.init()
bar = { bar = {
visibility = true, visibility = true,
offset = { offset = {
x = 10-10, x = 10 - 10,
y = 17 y = 17
}, },
@@ -3008,9 +3196,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3113,9 +3309,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3259,9 +3463,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3345,9 +3557,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999BFFF,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3430,9 +3650,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9E57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3611,9 +3839,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7FF80CE,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3786,9 +4022,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -3804,9 +4048,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3860,7 +4112,7 @@ function config.init()
poison_damage = true, poison_damage = true,
blast_damage = true, blast_damage = true,
endemic_life_damage = true, endemic_life_damage = true,
other_damage = true -- note that installations during narwa fight are counted as other damage other_damage = true -- note that installations during narwa fight are counted as other damage
}, },
spacing = { spacing = {
@@ -4125,9 +4377,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA7CCA3F4,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -4143,9 +4403,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -4194,7 +4462,7 @@ function config.init()
end end
function config.load() function config.load()
local loaded_config = json.load_file(config.config_file_name); local loaded_config = json.load_file(config.config_file_name);
if loaded_config ~= nil then if loaded_config ~= nil then
log.info("[MHR Overlay] config.json loaded successfully"); log.info("[MHR Overlay] config.json loaded successfully");
config.current_config = table_helpers.merge(config.default_config, loaded_config); config.current_config = table_helpers.merge(config.default_config, loaded_config);
@@ -4222,7 +4490,8 @@ function config.init_module()
config.load(); config.load();
config.current_config.version = "v2.1.2"; config.current_config.version = "v2.1.2";
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false)); language.update(table_helpers.find_index(language.language_names,
config.current_config.global_settings.language, false));
end end

View File

@@ -96,7 +96,7 @@ language.default_language = {
flash = "Flash", flash = "Flash",
poison = "Poison", poison = "Poison",
blast = "Blast", blast = "Blast",
exhaust ="Exhaust", exhaust = "Exhaust",
ride = "Wyvern Riding", ride = "Wyvern Riding",
waterblight = "Waterblight", waterblight = "Waterblight",
fireblight = "Fireblight", fireblight = "Fireblight",
@@ -207,7 +207,7 @@ language.default_language = {
text_label = "Text Label", text_label = "Text Label",
value_label = "Value Label", value_label = "Value Label",
percentage_label = "Percentage Label", percentage_label = "Percentage Label",
bar = "Bar", bar = "Bar",
width = "Width", width = "Width",
height = "Height", height = "Height",
@@ -392,14 +392,21 @@ language.default_language = {
health_filter = "Health", health_filter = "Health",
break_severe_filter = "Break + Severe", break_severe_filter = "Break + Severe",
break_filter = "Break", break_filter = "Break",
severe_filter = "Severe" severe_filter = "Severe",
outline = "Outline",
thickness = "Thickness",
style = "Style",
inside = "Inside",
outside = "Outside",
center = "Center"
} }
}; };
language.current_language = {}; language.current_language = {};
language.language_names = {"default"}; language.language_names = { "default" };
language.languages = {language.default_language}; language.languages = { language.default_language };
function language.load() function language.load()
local language_files = fs.glob([[MHR Overlay\\languages\\.*json]]); local language_files = fs.glob([[MHR Overlay\\languages\\.*json]]);
@@ -409,7 +416,9 @@ function language.load()
end end
for i, language_file_name in ipairs(language_files) do for i, language_file_name in ipairs(language_files) do
local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json", ""); local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json"
,
"");
local loaded_language = json.load_file(language_file_name); local loaded_language = json.load_file(language_file_name);
if loaded_language ~= nil then if loaded_language ~= nil then
@@ -436,11 +445,10 @@ function language.save(file_name, language_table)
end end
end end
function language.save_default(); function language.save_default()
language.save(language.language_folder .. "en-us.json", language.default_language) language.save(language.language_folder .. "en-us.json", language.default_language)
end end
function language.update(index) function language.update(index)
language.current_language = table_helpers.deep_copy(language.languages[index]); language.current_language = table_helpers.deep_copy(language.languages[index]);
end end

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,13 @@ function table_helpers.deep_copy(original, copies)
copy = {}; copy = {};
copies[original] = copy; copies[original] = copy;
for original_key, original_value in next, original, nil do for original_key, original_value in next, original, nil do
copy[table_helpers.deep_copy(original_key, copies)] = table_helpers.deep_copy(original_value, copies); copy[table_helpers.deep_copy(original_key, copies)] = table_helpers.deep_copy(original_value
,
copies);
end end
setmetatable(copy, table_helpers.deep_copy(getmetatable(original), copies)); setmetatable(copy,
table_helpers.deep_copy(getmetatable(original)
, copies));
end end
else -- number, string, boolean, etc else -- number, string, boolean, etc
copy = original; copy = original;
@@ -36,7 +40,7 @@ function table_helpers.find_index(table, value, nullable)
end end
function table_helpers.merge(...) function table_helpers.merge(...)
local tables_to_merge = {...}; local tables_to_merge = { ... };
assert(#tables_to_merge > 1, "There should be at least two tables to merge them"); assert(#tables_to_merge > 1, "There should be at least two tables to merge them");
for key, table in ipairs(tables_to_merge) do for key, table in ipairs(tables_to_merge) do
@@ -64,11 +68,11 @@ end
function table_helpers.tostring(table) function table_helpers.tostring(table)
if type(table) == "table" then if type(table) == "table" then
local s = "{ \n"; local s = "{ \n";
for k,v in pairs(table) do for k, v in pairs(table) do
if type(k) ~= "number" then if type(k) ~= "number" then
k = "\"" .. k .. "\""; k = "\"" .. k .. "\"";
end end
s = s .. "\t[" .. k .."] = " .. table_helpers.tostring(v) .. ",\n"; s = s .. "\t[" .. k .. "] = " .. table_helpers.tostring(v) .. ",\n";
end end
return s .. "} \n"; return s .. "} \n";
else else

View File

@@ -19,7 +19,7 @@ local unicode_helpers = {};
-- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535) -- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535)
-- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111) -- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111)
local pattern = '[%z\1-\127\194-\244][\128-\191]*'; local pattern = "[%z\1-\127\194-\244][\128-\191]*";
-- helper function -- helper function
function unicode_helpers.relative_position(position, length) function unicode_helpers.relative_position(position, length)
@@ -36,13 +36,13 @@ function unicode_helpers.map(s, f, no_subs)
local i = 0; local i = 0;
if no_subs then if no_subs then
for b, e in s:gmatch('()' .. pattern .. '()') do for b, e in s:gmatch("()" .. pattern .. "()") do
i = i + 1; i = i + 1;
local c = e - b; local c = e - b;
f(i, c, b) f(i, c, b)
end end
else else
for b, c in s:gmatch('()(' .. pattern .. ')') do for b, c in s:gmatch("()(" .. pattern .. ")") do
i = i + 1; i = i + 1;
f(i, c, b); f(i, c, b);
end end
@@ -53,7 +53,7 @@ end
-- generator for the above -- to iterate over all utf8 chars -- generator for the above -- to iterate over all utf8 chars
function unicode_helpers.chars(s, no_subs) function unicode_helpers.chars(s, no_subs)
return coroutine.wrap(function () return coroutine.wrap(function()
return unicode_helpers.map(s, coroutine.yield, no_subs); return unicode_helpers.map(s, coroutine.yield, no_subs);
end); end);
end end
@@ -61,50 +61,49 @@ end
-- like string.sub() but i, j are utf8 strings -- like string.sub() but i, j are utf8 strings
-- a utf8-safe string.sub() -- a utf8-safe string.sub()
function unicode_helpers.sub(string, i, j) function unicode_helpers.sub(string, i, j)
local l = utf8.len(string); local l = utf8.len(string);
i = unicode_helpers.relative_position(i, l); i = unicode_helpers.relative_position(i, l);
j = j and unicode_helpers.relative_position(j, l) or l; j = j and unicode_helpers.relative_position(j, l) or l;
if i < 1 then if i < 1 then
i = 1; i = 1;
end
if j > l then
j = l;
end
if i > j then
return '';
end
local diff = j - i;
local iterator = unicode_helpers.chars(string, true);
-- advance up to i
for _ = 1, i - 1 do
iterator();
end
local c, b = select(2, iterator());
-- i and j are the same, single-charaacter sub
if diff == 0 then
return string.sub(string, b, b + c - 1);
end
i = b;
-- advance up to j
for _ = 1, diff - 1 do
iterator();
end
c, b = select(2, iterator());
return string.sub(string, i, b + c - 1);
end end
if j > l then
j = l;
end
if i > j then
return "";
end
local diff = j - i;
local iterator = unicode_helpers.chars(string, true);
-- advance up to i
for _ = 1, i - 1 do
iterator();
end
local c, b = select(2, iterator());
-- i and j are the same, single-charaacter sub
if diff == 0 then
return string.sub(string, b, b + c - 1);
end
i = b;
-- advance up to j
for _ = 1, diff - 1 do
iterator();
end
c, b = select(2, iterator());
return string.sub(string, i, b + c - 1);
end
function unicode_helpers.init_module() function unicode_helpers.init_module()
end end

View File

@@ -21,23 +21,24 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then if id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then
goto continue
end end
local total_buildup = 0; local total_buildup = 0;
@@ -52,7 +53,7 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
end end
table.insert(displayed_players, table.insert(displayed_players,
{ {
["buildup"] = player_buildup, ["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player_id], ["buildup_share"] = ailment.buildup_share[player_id],
["id"] = player_id ["id"] = player_id
@@ -61,7 +62,7 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
end end
if total_buildup == 0 then if total_buildup == 0 then
goto continue; goto continue
end end
if cached_config.sorting.type == "Normal" then if cached_config.sorting.type == "Normal" then
@@ -104,7 +105,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
end end
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.ailment_name_label,
ailment_buildups_position_on_screen, opacity_scale, ailment_name);
local last_j = 0; local last_j = 0;
@@ -114,7 +116,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
}; };
ailment_buildup_UI_entity.draw_dynamic(_player, monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI, ailment_buildup_position_on_screen, opacity_scale, top_buildup); ailment_buildup_UI_entity.draw_dynamic(_player, monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI,
ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j; last_j = j;
end end
@@ -126,9 +129,11 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier;
}; };
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.total_buildup_label, total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.total_buildup_label,
total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup);
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.total_buildup_value_label, total_buildup_position_on_screen, opacity_scale, total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_dynamic_UI.total_buildup_value_label,
total_buildup_position_on_screen, opacity_scale, total_buildup);
ailment_buildups_position_on_screen = { ailment_buildups_position_on_screen = {
x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier,
@@ -152,23 +157,24 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then if id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then
goto continue
end end
local total_buildup = 0; local total_buildup = 0;
@@ -183,7 +189,7 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
end end
table.insert(displayed_players, table.insert(displayed_players,
{ {
["buildup"] = player_buildup, ["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player_id], ["buildup_share"] = ailment.buildup_share[player_id],
["id"] = player_id ["id"] = player_id
@@ -192,7 +198,7 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
end end
if total_buildup == 0 then if total_buildup == 0 then
goto continue; goto continue
end end
if cached_config.sorting.type == "Normal" then if cached_config.sorting.type == "Normal" then
@@ -235,7 +241,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
end end
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.ailment_name_label,
ailment_buildups_position_on_screen, opacity_scale, ailment_name);
local last_j = 0; local last_j = 0;
for j, _player in ipairs(displayed_players) do for j, _player in ipairs(displayed_players) do
@@ -244,7 +251,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
}; };
ailment_buildup_UI_entity.draw_static(_player, monster.ailments[ailments.stun_id].ailment_buildup_static_UI, ailment_buildup_position_on_screen, opacity_scale, top_buildup); ailment_buildup_UI_entity.draw_static(_player, monster.ailments[ailments.stun_id].ailment_buildup_static_UI,
ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j; last_j = j;
end end
@@ -254,9 +262,11 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier;
}; };
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.total_buildup_label, total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.total_buildup_label,
total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup);
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.total_buildup_value_label, total_buildup_position_on_screen, opacity_scale, total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_static_UI.total_buildup_value_label,
total_buildup_position_on_screen, opacity_scale, total_buildup);
ailment_buildups_position_on_screen = { ailment_buildups_position_on_screen = {
x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier,
@@ -280,23 +290,24 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then if id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then
goto continue
end end
local total_buildup = 0; local total_buildup = 0;
@@ -311,7 +322,7 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
end end
table.insert(displayed_players, table.insert(displayed_players,
{ {
["buildup"] = player_buildup, ["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player_id], ["buildup_share"] = ailment.buildup_share[player_id],
["id"] = player_id ["id"] = player_id
@@ -320,7 +331,7 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
end end
if total_buildup == 0 then if total_buildup == 0 then
goto continue; goto continue
end end
if cached_config.sorting.type == "Normal" then if cached_config.sorting.type == "Normal" then
@@ -363,7 +374,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
end end
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.ailment_name_label,
ailment_buildups_position_on_screen, opacity_scale, ailment_name);
local last_j = 0; local last_j = 0;
for j, _player in ipairs(displayed_players) do for j, _player in ipairs(displayed_players) do
@@ -372,7 +384,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
}; };
ailment_buildup_UI_entity.draw_highlighted(_player, monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI, ailment_buildup_position_on_screen, opacity_scale, top_buildup); ailment_buildup_UI_entity.draw_highlighted(_player, monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI
, ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j; last_j = j;
end end
@@ -382,9 +395,11 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier;
}; };
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.total_buildup_label, total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.total_buildup_label,
total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup);
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.total_buildup_value_label, total_buildup_position_on_screen, opacity_scale, total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_highlighted_UI.total_buildup_value_label,
total_buildup_position_on_screen, opacity_scale, total_buildup);
ailment_buildups_position_on_screen = { ailment_buildups_position_on_screen = {
x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier,
@@ -408,23 +423,24 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then if id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit then
goto continue
end end
local total_buildup = 0; local total_buildup = 0;
@@ -439,7 +455,7 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
end end
table.insert(displayed_players, table.insert(displayed_players,
{ {
["buildup"] = player_buildup, ["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player_id], ["buildup_share"] = ailment.buildup_share[player_id],
["id"] = player_id ["id"] = player_id
@@ -448,7 +464,7 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
end end
if total_buildup == 0 then if total_buildup == 0 then
goto continue; goto continue
end end
if cached_config.sorting.type == "Normal" then if cached_config.sorting.type == "Normal" then
@@ -491,7 +507,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
end end
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.ailment_name_label,
ailment_buildups_position_on_screen, opacity_scale, ailment_name);
local last_j = 0; local last_j = 0;
for j, _player in ipairs(displayed_players) do for j, _player in ipairs(displayed_players) do
@@ -500,7 +517,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
}; };
ailment_buildup_UI_entity.draw_small(_player, monster.ailments[ailments.stun_id].ailment_buildup_small_UI, ailment_buildup_position_on_screen, opacity_scale, top_buildup); ailment_buildup_UI_entity.draw_small(_player, monster.ailments[ailments.stun_id].ailment_buildup_small_UI,
ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j; last_j = j;
end end
@@ -510,9 +528,11 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier;
}; };
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.total_buildup_label, total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.total_buildup_label,
total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup);
drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.total_buildup_value_label, total_buildup_position_on_screen, opacity_scale, total_buildup); drawing.draw_label(monster.ailments[ailments.stun_id].ailment_buildup_small_UI.total_buildup_value_label,
total_buildup_position_on_screen, opacity_scale, total_buildup);
ailment_buildups_position_on_screen = { ailment_buildups_position_on_screen = {
x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier,

View File

@@ -50,11 +50,11 @@ function ailment_hook.poison_proc(poison_param)
monster = small_monster.get_monster(enemy); monster = small_monster.get_monster(enemy);
end end
monster.ailments[ailments.poison_id].cached_buildup_share = table_helpers.deep_copy(monster.ailments[ailments.poison_id].buildup_share); monster.ailments[ailments.poison_id].cached_buildup_share = table_helpers.deep_copy(monster.ailments[ailments
.poison_id].buildup_share);
ailments.clear_ailment_contribution(monster, ailments.poison_id); ailments.clear_ailment_contribution(monster, ailments.poison_id);
end end
function ailment_hook.blast_proc(blast_param) function ailment_hook.blast_proc(blast_param)
if blast_param == nil then if blast_param == nil then
return; return;
@@ -89,7 +89,7 @@ function ailment_hook.stock_damage()
for enemy, monster in pairs(large_monster.list) do for enemy, monster in pairs(large_monster.list) do
local damage_param = damage_param_field:get_data(enemy); local damage_param = damage_param_field:get_data(enemy);
if damage_param == nil then if damage_param == nil then
goto continue; goto continue
end end
local poison_param = poison_param_field:get_data(damage_param); local poison_param = poison_param_field:get_data(damage_param);
@@ -101,7 +101,7 @@ function ailment_hook.stock_damage()
for enemy, monster in pairs(small_monster.list) do for enemy, monster in pairs(small_monster.list) do
local damage_param = damage_param_field:get_data(enemy); local damage_param = damage_param_field:get_data(enemy);
if damage_param == nil then if damage_param == nil then
goto continue; goto continue
end end
local poison_param = poison_param_field:get_data(damage_param); local poison_param = poison_param_field:get_data(damage_param);

View File

@@ -42,7 +42,7 @@ ailments.thunder_id = 11;
ailments.fall_trap_id = 12; ailments.fall_trap_id = 12;
ailments.shock_trap_id = 13; ailments.shock_trap_id = 13;
ailments.capture_id = 14 --tranq bomb ailments.capture_id = 14 --tranq bomb
ailments.koyashi_id = 15; --dung bomb ailments.koyashi_id = 15; --dung bomb
ailments.steel_fang_id = 16; ailments.steel_fang_id = 16;
ailments.fall_quick_sand_id = 17; ailments.fall_quick_sand_id = 17;
ailments.fall_otomo_trap_id = 18; ailments.fall_otomo_trap_id = 18;
@@ -260,12 +260,12 @@ function ailments.update_ailments(enemy, monster)
ailments.update_stun_poison_blast_ailments(monster, damage_param); ailments.update_stun_poison_blast_ailments(monster, damage_param);
if not config.current_config.large_monster_UI.dynamic.ailments.visibility if not config.current_config.large_monster_UI.dynamic.ailments.visibility
and not config.current_config.large_monster_UI.static.ailments.visibility and not config.current_config.large_monster_UI.static.ailments.visibility
and not config.current_config.large_monster_UI.highlighted.ailments.visibility and not config.current_config.large_monster_UI.highlighted.ailments.visibility
and not config.current_config.small_monster_UI.ailments.visibility and not config.current_config.small_monster_UI.ailments.visibility
and not config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility and not config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility
and not config.current_config.large_monster_UI.static.ailment_buildups.visibility and not config.current_config.large_monster_UI.static.ailment_buildups.visibility
and not config.current_config.small_monster_UI.ailment_buildups.visibility then and not config.current_config.small_monster_UI.ailment_buildups.visibility then
return; return;
end end
@@ -285,7 +285,7 @@ function ailments.update_ailments(enemy, monster)
for index, ailment_param in ipairs(condition_param_table) do for index, ailment_param in ipairs(condition_param_table) do
local id = index - 1; local id = index - 1;
if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then
goto continue; goto continue
end end
ailments.update_ailment(monster, ailment_param, id); ailments.update_ailment(monster, ailment_param, id);
@@ -312,100 +312,100 @@ function ailments.update_stun_poison_blast_ailments(monster, damage_param)
end end
function ailments.update_ailment(monster, ailment_param, id) function ailments.update_ailment(monster, ailment_param, id)
local is_enable = get_is_enable_method:call(ailment_param); local is_enable = get_is_enable_method:call(ailment_param);
local activate_count = get_activate_count_method:call(ailment_param):get_element(0):get_field("mValue") or 0; local activate_count = get_activate_count_method:call(ailment_param):get_element(0):get_field("mValue") or 0;
local buildup = get_stock_method:call(ailment_param):get_element(0):get_field("mValue"); local buildup = get_stock_method:call(ailment_param):get_element(0):get_field("mValue");
local buildup_limit = get_limit_method:call(ailment_param):get_element(0):get_field("mValue"); local buildup_limit = get_limit_method:call(ailment_param):get_element(0):get_field("mValue");
local timer = get_active_timer_method:call(ailment_param); local timer = get_active_timer_method:call(ailment_param);
local duration = get_active_time_method:call(ailment_param); local duration = get_active_time_method:call(ailment_param);
local is_active = get_is_active_method:call(ailment_param); local is_active = get_is_active_method:call(ailment_param);
if is_enable == nil then if is_enable == nil then
is_enable = true; is_enable = true;
end
if is_enable ~= monster.ailments[id].is_enable then
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].is_enable = is_enable;
if activate_count ~= nil then
if activate_count ~= monster.ailments[id].activate_count then
ailments.update_last_change_time(monster, id);
if id == ailments.stun_id then
ailments.clear_ailment_contribution(monster, ailments.stun_id);
end
end end
monster.ailments[id].activate_count = activate_count;
end
if is_enable ~= monster.ailments[id].is_enable then if buildup ~= nil then
if buildup ~= monster.ailments[id].total_buildup then
ailments.update_last_change_time(monster, id); ailments.update_last_change_time(monster, id);
end end
monster.ailments[id].is_enable = is_enable; monster.ailments[id].total_buildup = buildup;
end
if activate_count ~= nil then if buildup_limit ~= nil then
if activate_count ~= monster.ailments[id].activate_count then if buildup_limit ~= monster.ailments[id].buildup_limit then
ailments.update_last_change_time(monster, id); ailments.update_last_change_time(monster, id);
if id == ailments.stun_id then
ailments.clear_ailment_contribution(monster, ailments.stun_id);
end
end
monster.ailments[id].activate_count = activate_count;
end end
if buildup ~= nil then monster.ailments[id].buildup_limit = buildup_limit;
if buildup ~= monster.ailments[id].total_buildup then end
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].total_buildup = buildup; if buildup ~= nil and buildup_limit ~= nil and buildup_limit ~= 0 then
monster.ailments[id].buildup_percentage = buildup / buildup_limit;
end
if timer ~= nil then
if timer ~= monster.ailments[id].timer then
ailments.update_last_change_time(monster, id);
end end
if buildup_limit ~= nil then monster.ailments[id].timer = timer;
if buildup_limit ~= monster.ailments[id].buildup_limit then end
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].buildup_limit = buildup_limit; if is_active ~= nil then
if is_active ~= monster.ailments[id].is_active then
ailments.update_last_change_time(monster, id);
end end
if buildup ~= nil and buildup_limit ~= nil and buildup_limit ~= 0 then monster.ailments[id].is_active = is_active;
monster.ailments[id].buildup_percentage = buildup / buildup_limit; end
if duration ~= nil and not monster.ailments[id].is_active then
if duration ~= monster.ailments[id].duration then
ailments.update_last_change_time(monster, id);
end end
if timer ~= nil then monster.ailments[id].duration = duration;
if timer ~= monster.ailments[id].timer then end
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].timer = timer; if duration ~= 0 and duration ~= nil then
monster.ailments[id].timer_percentage = timer / monster.ailments[id].duration;
end
if is_active then
if timer < 0 then
timer = 0;
end end
if is_active ~= nil then local minutes_left = math.floor(timer / 60);
if is_active ~= monster.ailments[id].is_active then local seconds_left = timer - 60 * minutes_left;
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].is_active = is_active; if duration ~= 0 then
end
if duration ~= nil and not monster.ailments[id].is_active then
if duration ~= monster.ailments[id].duration then
ailments.update_last_change_time(monster, id);
end
monster.ailments[id].duration = duration;
end
if duration ~= 0 and duration ~= nil then
monster.ailments[id].timer_percentage = timer / monster.ailments[id].duration; monster.ailments[id].timer_percentage = timer / monster.ailments[id].duration;
end end
if is_active then monster.ailments[id].minutes_left = minutes_left;
if timer < 0 then monster.ailments[id].seconds_left = seconds_left;
timer = 0; end
end
local minutes_left = math.floor(timer / 60);
local seconds_left = timer - 60 * minutes_left;
if duration ~= 0 then
monster.ailments[id].timer_percentage = timer / monster.ailments[id].duration;
end
monster.ailments[id].minutes_left = minutes_left;
monster.ailments[id].seconds_left = seconds_left;
end
end end
function ailments.update_last_change_time(monster, id) function ailments.update_last_change_time(monster, id)
@@ -438,110 +438,115 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end 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 if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -601,110 +606,115 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end 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 if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -763,110 +773,115 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end 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 if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -924,110 +939,115 @@ function ailments.draw_small(monster, ailments_position_on_screen, opacity_scale
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end 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 if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -1087,7 +1107,8 @@ end
function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailment_buildup) function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailment_buildup)
if monster == nil or player == nil or (ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id) then if monster == nil or player == nil or
(ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id) then
return; return;
end end
@@ -1097,7 +1118,8 @@ function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailm
end end
-- accumulate this buildup for this attacker -- accumulate this buildup for this attacker
monster.ailments[ailment_type].buildup[attacker_id] = (monster.ailments[ailment_type].buildup[attacker_id] or 0) + ailment_buildup; monster.ailments[ailment_type].buildup[attacker_id] = (monster.ailments[ailment_type].buildup[attacker_id] or 0) +
ailment_buildup;
ailments.calculate_ailment_contribution(monster, ailment_type); ailments.calculate_ailment_contribution(monster, ailment_type);
end end

View File

@@ -44,7 +44,6 @@ function body_part.new(id, name)
return part; return part;
end end
function body_part.init_dynamic_UI(part) function body_part.init_dynamic_UI(part)
local cached_config = config.current_config.large_monster_UI.dynamic.body_parts; local cached_config = config.current_config.large_monster_UI.dynamic.body_parts;
@@ -205,21 +204,21 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.health_break_severe then if not cached_config.filter.health_break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health_break then if not cached_config.filter.health_break then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.health_severe then if not cached_config.filter.health_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health then if not cached_config.filter.health then
goto continue; goto continue
end end
end end
end end
@@ -227,39 +226,42 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.break_severe then if not cached_config.filter.break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.break_ then if not cached_config.filter.break_ then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.severe then if not cached_config.filter.severe then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
end end
end end
if cached_config.settings.hide_undamaged_parts if cached_config.settings.hide_undamaged_parts
and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported) and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported)
and ((part.break_health == part.break_max_health and part.break_count == 0) or not break_supported) 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 severe_supported) then and ((part.loss_health == part.loss_max_health and not part.is_severed) or not severe_supported) then
goto continue; goto continue
end end
if (not part.body_part_dynamic_UI.flinch_visibility or not health_supported) if (not part.body_part_dynamic_UI.flinch_visibility or not health_supported)
and (not part.body_part_dynamic_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count) and
and (not part.body_part_dynamic_UI.loss_visibility or not severe_supported or part.is_severed) then (not part.body_part_dynamic_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count
goto continue; )
and (not part.body_part_dynamic_UI.loss_visibility or not severe_supported or part.is_severed) then
goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then
goto continue
end end
table.insert(displayed_parts, part); table.insert(displayed_parts, part);
@@ -387,21 +389,21 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.health_break_severe then if not cached_config.filter.health_break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health_break then if not cached_config.filter.health_break then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.health_severe then if not cached_config.filter.health_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health then if not cached_config.filter.health then
goto continue; goto continue
end end
end end
end end
@@ -409,39 +411,42 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.break_severe then if not cached_config.filter.break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.break_ then if not cached_config.filter.break_ then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.severe then if not cached_config.filter.severe then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
end end
end end
if cached_config.settings.hide_undamaged_parts if cached_config.settings.hide_undamaged_parts
and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported) and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported)
and ((part.break_health == part.break_max_health and part.break_count == 0) or not break_supported) 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 severe_supported) then and ((part.loss_health == part.loss_max_health and not part.is_severed) or not severe_supported) then
goto continue; goto continue
end end
if (not part.body_part_static_UI.flinch_visibility or not health_supported) if (not part.body_part_static_UI.flinch_visibility or not health_supported)
and (not part.body_part_static_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count) and
and (not part.body_part_static_UI.loss_visibility or not severe_supported or part.is_severed) then (not part.body_part_static_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count
goto continue; )
and (not part.body_part_static_UI.loss_visibility or not severe_supported or part.is_severed) then
goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then
goto continue
end end
@@ -570,21 +575,21 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.health_break_severe then if not cached_config.filter.health_break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health_break then if not cached_config.filter.health_break then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.health_severe then if not cached_config.filter.health_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.health then if not cached_config.filter.health then
goto continue; goto continue
end end
end end
end end
@@ -592,39 +597,42 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s
if break_supported then if break_supported then
if severe_supported then if severe_supported then
if not cached_config.filter.break_severe then if not cached_config.filter.break_severe then
goto continue; goto continue
end end
else else
if not cached_config.filter.break_ then if not cached_config.filter.break_ then
goto continue; goto continue
end end
end end
else else
if severe_supported then if severe_supported then
if not cached_config.filter.severe then if not cached_config.filter.severe then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
end end
end end
if cached_config.settings.hide_undamaged_parts if cached_config.settings.hide_undamaged_parts
and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported) and ((part.health == part.max_health and part.flinch_count == 0) or not health_supported)
and ((part.break_health == part.break_max_health and part.break_count == 0) or not break_supported) 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 severe_supported) then and ((part.loss_health == part.loss_max_health and not part.is_severed) or not severe_supported) then
goto continue; goto continue
end end
if (not part.body_part_highlighted_UI.flinch_visibility or not health_supported) if (not part.body_part_highlighted_UI.flinch_visibility or not health_supported)
and (not part.body_part_highlighted_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count) and (
and (not part.body_part_highlighted_UI.loss_visibility or not severe_supported or part.is_severed) then not part.body_part_highlighted_UI.break_visibility or not break_supported or part.break_count >= part.break_max_count
goto continue; )
and (not part.body_part_highlighted_UI.loss_visibility or not severe_supported or part.is_severed) then
goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - part.last_change_time > cached_config.settings.time_limit then
goto continue
end end
table.insert(displayed_parts, part); table.insert(displayed_parts, part);

View File

@@ -204,10 +204,14 @@ function large_monster.init_dynamic_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x *
monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y *
monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height *
global_scale_modifier;
monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -263,10 +267,14 @@ function large_monster.init_static_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x *
monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y *
monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height *
global_scale_modifier;
monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -319,10 +327,14 @@ function large_monster.init_highlighted_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x *
monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y *
monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height
* global_scale_modifier;
monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -402,7 +414,8 @@ local get_mario_player_index_method = mario_param_type:get_method("get_MarioPlay
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos"); local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
function large_monster.update_position(enemy, monster) function large_monster.update_position(enemy, monster)
if not config.current_config.large_monster_UI.dynamic.enabled and config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then if not config.current_config.large_monster_UI.dynamic.enabled and
config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then
return; return;
end end
@@ -434,8 +447,8 @@ function large_monster.update(enemy, monster)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
@@ -452,14 +465,14 @@ function large_monster.update_health(enemy, monster)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.health.visibility if not cached_config.dynamic.health.visibility
and not cached_config.static.health.visibility and not cached_config.static.health.visibility
and not cached_config.highlighted.health.visibility then and not cached_config.highlighted.health.visibility then
return nil; return nil;
end end
@@ -492,14 +505,14 @@ function large_monster.update_stamina(enemy, monster, stamina_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.stamina.visibility if not cached_config.dynamic.stamina.visibility
and not cached_config.static.stamina.visibility and not cached_config.static.stamina.visibility
and not cached_config.highlighted.stamina.visibility then and not cached_config.highlighted.stamina.visibility then
return; return;
end end
@@ -516,11 +529,11 @@ function large_monster.update_stamina(enemy, monster, stamina_param)
monster.is_tired = is_tired; monster.is_tired = is_tired;
end end
monster.stamina = get_stamina_method:call(stamina_param) or monster.stamina; monster.stamina = get_stamina_method:call(stamina_param) or monster.stamina;
monster.max_stamina = get_max_stamina_method:call(stamina_param) or monster.max_stamina; monster.max_stamina = get_max_stamina_method:call(stamina_param) or monster.max_stamina;
monster.missing_stamina = monster.max_stamina - monster.stamina; monster.missing_stamina = monster.max_stamina - monster.stamina;
if monster.max_stamina ~= 0 then if monster.max_stamina ~= 0 then
monster.stamina_percentage = monster.stamina / monster.max_stamina; monster.stamina_percentage = monster.stamina / monster.max_stamina;
end end
end end
@@ -529,14 +542,14 @@ function large_monster.update_stamina_timer(enemy, monster, stamina_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.stamina.visibility if not cached_config.dynamic.stamina.visibility
and not cached_config.static.stamina.visibility and not cached_config.static.stamina.visibility
and not cached_config.highlighted.stamina.visibility then and not cached_config.highlighted.stamina.visibility then
return; return;
end end
@@ -576,14 +589,14 @@ function large_monster.update_rage(enemy, monster, anger_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.rage.visibility if not cached_config.dynamic.rage.visibility
and not cached_config.static.rage.visibility and not cached_config.static.rage.visibility
and not cached_config.highlighted.rage.visibility then and not cached_config.highlighted.rage.visibility then
return; return;
end end
@@ -597,7 +610,7 @@ function large_monster.update_rage(enemy, monster, anger_param)
monster.rage_point = get_anger_point_method:call(anger_param) or monster.rage_point; monster.rage_point = get_anger_point_method:call(anger_param) or monster.rage_point;
monster.rage_limit = get_limit_anger_method:call(anger_param)or monster.rage_limit; monster.rage_limit = get_limit_anger_method:call(anger_param) or monster.rage_limit;
if monster.rage_limit ~= 0 then if monster.rage_limit ~= 0 then
monster.rage_percentage = monster.rage_point / monster.rage_limit; monster.rage_percentage = monster.rage_point / monster.rage_limit;
@@ -608,14 +621,14 @@ function large_monster.update_rage_timer(enemy, monster, anger_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.rage.visibility if not cached_config.dynamic.rage.visibility
and not cached_config.static.rage.visibility and not cached_config.static.rage.visibility
and not cached_config.highlighted.rage.visibility then and not cached_config.highlighted.rage.visibility then
return; return;
end end
@@ -654,26 +667,26 @@ function large_monster.update_parts(enemy, monster, physical_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
and not cached_config.static.enabled and not cached_config.static.enabled
and not cached_config.highlighted.enabled then and not cached_config.highlighted.enabled then
return; return;
end end
if not cached_config.dynamic.body_parts.visibility if not cached_config.dynamic.body_parts.visibility
and not cached_config.static.body_parts.visibility and not cached_config.static.body_parts.visibility
and not cached_config.highlighted.body_parts.visibility then and not cached_config.highlighted.body_parts.visibility then
return; return;
end end
if not cached_config.dynamic.body_parts.part_health.visibility if not cached_config.dynamic.body_parts.part_health.visibility
and not cached_config.dynamic.body_parts.part_break.visibility and not cached_config.dynamic.body_parts.part_break.visibility
and not cached_config.dynamic.body_parts.part_loss.visibility and not cached_config.dynamic.body_parts.part_loss.visibility
and not cached_config.static.body_parts.part_health.visibility and not cached_config.static.body_parts.part_health.visibility
and not cached_config.static.body_parts.part_break.visibility and not cached_config.static.body_parts.part_break.visibility
and not cached_config.static.body_parts.part_loss.visibility and not cached_config.static.body_parts.part_loss.visibility
and not cached_config.highlighted.body_parts.part_health.visibility and not cached_config.highlighted.body_parts.part_health.visibility
and not cached_config.highlighted.body_parts.part_break.visibility and not cached_config.highlighted.body_parts.part_break.visibility
and not cached_config.highlighted.body_parts.part_loss.visibility then and not cached_config.highlighted.body_parts.part_loss.visibility then
return; return;
end end
@@ -713,7 +726,7 @@ function large_monster.update_parts(enemy, monster, physical_param)
if part == nil then if part == nil then
local part_name = part_names.get_part_name(monster.id, part_id); local part_name = part_names.get_part_name(monster.id, part_id);
if part_name == nil then if part_name == nil then
goto continue; goto continue
else else
part = body_part.new(part_id, part_name); part = body_part.new(part_id, part_name);
monster.parts[part_id] = part; monster.parts[part_id] = part;
@@ -721,8 +734,8 @@ function large_monster.update_parts(enemy, monster, physical_param)
end end
if cached_config.dynamic.body_parts.part_health.visibility if cached_config.dynamic.body_parts.part_health.visibility
or cached_config.static.body_parts.part_health.visibility or cached_config.static.body_parts.part_health.visibility
or cached_config.highlighted.body_parts.part_health.visibility then or cached_config.highlighted.body_parts.part_health.visibility then
local part_vital = physical_param:call("getVital", 1, i); local part_vital = physical_param:call("getVital", 1, i);
if part_vital ~= nil then if part_vital ~= nil then
local part_current = part_vital:call("get_Current") or -1; local part_current = part_vital:call("get_Current") or -1;
@@ -734,8 +747,8 @@ function large_monster.update_parts(enemy, monster, physical_param)
end end
if cached_config.dynamic.body_parts.part_break.visibility if cached_config.dynamic.body_parts.part_break.visibility
or cached_config.static.body_parts.part_break.visibility or cached_config.static.body_parts.part_break.visibility
or cached_config.highlighted.body_parts.part_break.visibility then or cached_config.highlighted.body_parts.part_break.visibility then
local part_break_vital = physical_param:call("getVital", 2, i); local part_break_vital = physical_param:call("getVital", 2, i);
if part_break_vital ~= nil then if part_break_vital ~= nil then
local part_break_current = part_break_vital:call("get_Current") or -1; local part_break_current = part_break_vital:call("get_Current") or -1;
@@ -753,8 +766,8 @@ function large_monster.update_parts(enemy, monster, physical_param)
end end
if cached_config.dynamic.body_parts.part_loss.visibility if cached_config.dynamic.body_parts.part_loss.visibility
or cached_config.static.body_parts.part_loss.visibility or cached_config.static.body_parts.part_loss.visibility
or cached_config.highlighted.body_parts.part_loss.visibility then or cached_config.highlighted.body_parts.part_loss.visibility then
local part_loss_vital = physical_param:call("getVital", 3, i); local part_loss_vital = physical_param:call("getVital", 3, i);
if part_loss_vital ~= nil then if part_loss_vital ~= nil then
local part_loss_current = part_loss_vital:call("get_Current") or -1; local part_loss_current = part_loss_vital:call("get_Current") or -1;
@@ -799,7 +812,7 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
if cached_config.monster_name_label.include.scrown_thresholds then if cached_config.monster_name_label.include.scrown_thresholds then
monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border, monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border,
100 * monster.big_border, 100 * monster.king_border); 100 * monster.big_border, 100 * monster.king_border);
end end
if monster.health < monster.capture_health then if monster.health < monster.capture_health then
@@ -842,18 +855,23 @@ 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, 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);
local last_part_position_on_screen = body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_dynamic(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then
ailments_position_on_screen = { ailments_position_on_screen = {
x = last_part_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * global_scale_modifier, x = last_part_position_on_screen.x +
y = last_part_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * global_scale_modifier config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * global_scale_modifier,
y = last_part_position_on_screen.y +
config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * global_scale_modifier
}; };
end end
end end
@@ -884,7 +902,7 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
if cached_config.monster_name_label.include.scrown_thresholds then if cached_config.monster_name_label.include.scrown_thresholds then
monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border, monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border,
100 * monster.big_border, 100 * monster.king_border); 100 * monster.big_border, 100 * monster.king_border);
end end
if monster.health < monster.capture_health then if monster.health < monster.capture_health then
@@ -932,7 +950,9 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
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);
local last_part_position_on_screen = body_part.draw_static(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_static(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then
@@ -969,7 +989,7 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
if cached_config.monster_name_label.include.scrown_thresholds then if cached_config.monster_name_label.include.scrown_thresholds then
monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border, monster_name_text = monster_name_text .. string.format("<=%.0f >=%.0f >=%.0f", 100 * monster.small_border,
100 * monster.big_border, 100 * monster.king_border); 100 * monster.big_border, 100 * monster.king_border);
end end
if monster.health < monster.capture_health then if monster.health < monster.capture_health then
@@ -1011,12 +1031,15 @@ 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, 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);
local last_part_position_on_screen = body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_highlighted(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then
@@ -1031,7 +1054,7 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_screen, opacity_scale); ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_screen, opacity_scale);
end end
function large_monster.init_list() function large_monster.init_list()
large_monster.list = {}; large_monster.list = {};
end end

View File

@@ -37,19 +37,19 @@ local updates_this_tick = 0;
-- the reason for this is that the hooks on all the monsters' update functions -- the reason for this is that the hooks on all the monsters' update functions
-- causes a HUGE performance hit (adds ~3+ ms to UpdateBehavior and frame time) -- causes a HUGE performance hit (adds ~3+ ms to UpdateBehavior and frame time)
re.on_pre_application_entry("UpdateBehavior", function() re.on_pre_application_entry("UpdateBehavior", function()
tick_count = tick_count + 1; tick_count = tick_count + 1;
updates_this_tick = 0; updates_this_tick = 0;
if num_known_monsters ~= 0 and num_updated_monsters >= num_known_monsters or tick_count >= num_known_monsters * 2 then if num_known_monsters ~= 0 and num_updated_monsters >= num_known_monsters or tick_count >= num_known_monsters * 2 then
recorded_monsters = {}; recorded_monsters = {};
updated_monsters = {}; updated_monsters = {};
known_big_monsters = {}; known_big_monsters = {};
last_update_tick = 0; last_update_tick = 0;
tick_count = 0; tick_count = 0;
num_known_monsters = 0; num_known_monsters = 0;
num_updated_monsters = 0; num_updated_monsters = 0;
updates_this_tick = 0; updates_this_tick = 0;
end end
end) end)
function monster_hook.update_monster(enemy) function monster_hook.update_monster(enemy)
@@ -57,10 +57,10 @@ function monster_hook.update_monster(enemy)
return; return;
end end
if not recorded_monsters[enemy] then if not recorded_monsters[enemy] then
num_known_monsters = num_known_monsters + 1; num_known_monsters = num_known_monsters + 1;
recorded_monsters[enemy] = true; recorded_monsters[enemy] = true;
end end
-- saves on a method call. -- saves on a method call.
if not known_big_monsters[enemy] then if not known_big_monsters[enemy] then
@@ -83,8 +83,8 @@ function monster_hook.update_large_monster(enemy)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled and if not cached_config.dynamic.enabled and
not cached_config.static.enabled and not cached_config.static.enabled and
not cached_config.highlighted.enabled then not cached_config.highlighted.enabled then
return; return;
end end
@@ -101,7 +101,8 @@ function monster_hook.update_large_monster(enemy)
-- is it old tick? -- is it old tick?
-- is update limit reached? -- is update limit reached?
if tick_count == last_update_tick and updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then if tick_count == last_update_tick and
updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then
return; return;
end end
@@ -142,7 +143,8 @@ function monster_hook.update_small_monster(enemy)
-- is it old tick? -- is it old tick?
-- is update limit reached? -- is update limit reached?
if tick_count == last_update_tick and updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then if tick_count == last_update_tick and
updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then
return; return;
end end
@@ -244,7 +246,8 @@ function monster_hook.init_module()
end); end);
sdk.hook(anger_add_method, function(args) sdk.hook(anger_add_method, function(args)
pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]), sdk.to_managed_object(args[4])); pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]),
sdk.to_managed_object(args[4]));
end, function(retval) end, function(retval)
return retval; return retval;
end); end);

View File

@@ -197,7 +197,7 @@ function small_monster.draw(monster, position_on_screen, opacity_scale)
ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen, opacity_scale); ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen, opacity_scale);
end end
function small_monster.init_list() function small_monster.init_list()
small_monster.list = {}; small_monster.list = {};
end end

View File

@@ -44,18 +44,18 @@ function damage_meter_UI.get_players(player_info_list)
local player_info = get_item_method:call(player_info_list, i); local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then if player_info == nil then
goto continue; goto continue
end end
local player_id = member_index_field:get_data(player_info); local player_id = member_index_field:get_data(player_info);
if player_id == nil then if player_id == nil then
goto continue; goto continue
end end
local _player = player.get_player(player_id); local _player = player.get_player(player_id);
if _player ~= nil then if _player ~= nil then
if _player == player.myself and cached_config.settings.my_damage_bar_location ~= "Normal" then if _player == player.myself and cached_config.settings.my_damage_bar_location ~= "Normal" then
goto continue; goto continue
end end
table.insert(quest_players, _player); table.insert(quest_players, _player);
end end
@@ -145,15 +145,15 @@ function damage_meter_UI.draw()
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
for _, _player in ipairs(quest_players) do for _, _player in ipairs(quest_players) do
if _player.display.total_damage == 0 and cached_config.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 continue; goto continue
end end
if _player == player.myself then if _player == player.myself then
if cached_config.settings.hide_myself then if cached_config.settings.hide_myself then
goto continue; goto continue
end end
elseif cached_config.settings.hide_other_players then elseif cached_config.settings.hide_other_players then
goto continue; goto continue
end end
player.draw(_player, position_on_screen, 1, top_damage, top_dps); player.draw(_player, position_on_screen, 1, top_damage, top_dps);

View File

@@ -25,21 +25,22 @@ function env_creature_UI.draw()
for REcreature, creature in pairs(env_creature.list) do for REcreature, creature in pairs(env_creature.list) do
if cached_config.settings.max_distance == 0 then if cached_config.settings.max_distance == 0 then
break; break
end end
if cached_config.settings.hide_inactive_creatures and creature.is_inactive then if cached_config.settings.hide_inactive_creatures and creature.is_inactive then
goto continue; goto continue
end end
local position_on_screen = {}; local position_on_screen = {};
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.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); position_on_screen = draw.world_to_screen(creature.position + world_offset);
if position_on_screen == nil then if position_on_screen == nil then
goto continue; goto continue
end end
position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier; position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier;
@@ -49,7 +50,7 @@ function env_creature_UI.draw()
local opacity_scale = 1; local opacity_scale = 1;
if creature.distance > cached_config.settings.max_distance then if creature.distance > cached_config.settings.max_distance then
goto continue; goto continue
end end
if cached_config.settings.opacity_falloff then if cached_config.settings.opacity_falloff then
@@ -61,7 +62,6 @@ function env_creature_UI.draw()
end end
end end
function env_creature_UI.init_module() function env_creature_UI.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons"); singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config"); config = require("MHR_Overlay.Misc.config");

View File

@@ -53,13 +53,13 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
local enemy = get_boss_enemy_method:call(singletons.enemy_manager, i); local enemy = get_boss_enemy_method:call(singletons.enemy_manager, i);
if enemy == nil then if enemy == nil then
customization_menu.status = "No enemy"; customization_menu.status = "No enemy";
goto continue; goto continue
end end
local monster = large_monster.list[enemy]; local monster = large_monster.list[enemy];
if monster == nil then if monster == nil then
customization_menu.status = "No monster hp entry"; customization_menu.status = "No monster hp entry";
goto continue; goto continue
end end
if monster.dead_or_captured or not monster.is_disp_icon_mini_map then if monster.dead_or_captured or not monster.is_disp_icon_mini_map then
@@ -79,7 +79,7 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
end end
if dynamic_enabled then if dynamic_enabled then
large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster); --large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster);
end end
if highlighted_enabled then if highlighted_enabled then
@@ -87,7 +87,7 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
end end
if static_enabled then if static_enabled then
large_monster_UI.draw_static(displayed_monsters, highlighted_monster); --large_monster_UI.draw_static(displayed_monsters, highlighted_monster);
end end
end end
@@ -98,31 +98,32 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster)
local i = 0; local i = 0;
for _, monster in ipairs(displayed_monsters) do for _, monster in ipairs(displayed_monsters) do
if cached_config.settings.max_distance == 0 then if cached_config.settings.max_distance == 0 then
break; break
end end
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
goto continue; goto continue
end end
if monster == highlighted_monster then if monster == highlighted_monster then
if not cached_config.settings.render_highlighted_monster then if not cached_config.settings.render_highlighted_monster then
goto continue; goto continue
end end
else else
if not cached_config.settings.render_not_highlighted_monsters then if not cached_config.settings.render_not_highlighted_monsters then
goto continue; goto continue
end end
end end
local position_on_screen = {}; local position_on_screen = {};
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.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(monster.position + world_offset); position_on_screen = draw.world_to_screen(monster.position + world_offset);
if position_on_screen == nil then if position_on_screen == nil then
goto continue; goto continue
end end
position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier; position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier;
@@ -130,7 +131,7 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster)
local opacity_scale = 1; local opacity_scale = 1;
if monster.distance > cached_config.settings.max_distance then if monster.distance > cached_config.settings.max_distance then
goto continue; goto continue
end end
if cached_config.settings.opacity_falloff then if cached_config.settings.opacity_falloff then
@@ -194,16 +195,16 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
local i = 0; local i = 0;
for _, monster in ipairs(displayed_monsters) do for _, monster in ipairs(displayed_monsters) do
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
goto continue; goto continue
end end
if monster == highlighted_monster then if monster == highlighted_monster then
if not cached_config.settings.render_highlighted_monster then if not cached_config.settings.render_highlighted_monster then
goto continue; goto continue
end end
else else
if not cached_config.settings.render_not_highlighted_monsters then if not cached_config.settings.render_not_highlighted_monsters then
goto continue; goto continue
end end
end end
@@ -215,7 +216,7 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
if cached_config.settings.orientation == "Horizontal" then 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; monster_position_on_screen.x = monster_position_on_screen.x + cached_config.spacing.x * i * global_scale_modifier;
else else
monster_position_on_screen.y = monster_position_on_screen.y + cached_config.spacing.y * i * global_scale_modifier; monster_position_on_screen.y = monster_position_on_screen.y + cached_config.spacing.y * i * global_scale_modifier;
end end
large_monster.draw_static(monster, monster_position_on_screen, 1); large_monster.draw_static(monster, monster_position_on_screen, 1);

View File

@@ -33,17 +33,17 @@ function small_monster_UI.draw()
local enemy = get_zako_enemy_method:call(singletons.enemy_manager, i); local enemy = get_zako_enemy_method:call(singletons.enemy_manager, i);
if enemy == nil then if enemy == nil then
customization_menu.status = "No enemy"; customization_menu.status = "No enemy";
goto continue; goto continue
end end
local monster = small_monster.list[enemy]; local monster = small_monster.list[enemy];
if monster == nil then if monster == nil then
customization_menu.status = "No monster hp entry"; customization_menu.status = "No monster hp entry";
goto continue; goto continue
end end
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
goto continue; goto continue
end end
table.insert(displayed_monsters, monster); table.insert(displayed_monsters, monster);
@@ -51,7 +51,7 @@ function small_monster_UI.draw()
end end
if cached_config.dynamic_positioning.enabled if cached_config.dynamic_positioning.enabled
or (not cached_config.dynamic_positioning.enabled and cached_config.static_sorting.type == "Distance") then or (not cached_config.dynamic_positioning.enabled and cached_config.static_sorting.type == "Distance") then
for _, monster in ipairs(displayed_monsters) do for _, monster in ipairs(displayed_monsters) do
monster.distance = (player.myself_position - monster.position):length(); monster.distance = (player.myself_position - monster.position):length();
end end
@@ -105,7 +105,9 @@ function small_monster_UI.draw()
local position_on_screen; local position_on_screen;
if cached_config.dynamic_positioning.enabled then 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); 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); position_on_screen = draw.world_to_screen(monster.position + world_offset);
@@ -135,7 +137,7 @@ function small_monster_UI.draw()
end end
if monster.distance > cached_config.dynamic_positioning.max_distance then if monster.distance > cached_config.dynamic_positioning.max_distance then
goto continue; goto continue
end end
if cached_config.dynamic_positioning.opacity_falloff then if cached_config.dynamic_positioning.opacity_falloff then

View File

@@ -17,7 +17,7 @@ function time_UI.draw()
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position); local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position);
drawing.draw_label(time_UI.label , position_on_screen, 1, elapsed_minutes, elapsed_seconds); drawing.draw_label(time_UI.label, position_on_screen, 1, elapsed_minutes, elapsed_seconds);
end end
function time_UI.init_UI() function time_UI.init_UI()

View File

@@ -21,6 +21,8 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la
entity.bar.offset.y = entity.bar.offset.y * 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.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier; entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.name_label.offset.x = entity.name_label.offset.x * 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.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier;
@@ -60,13 +62,15 @@ function ailment_UI_entity.draw_dynamic(ailment, ailment_UI, position_on_screen,
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left); drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left,
ailment.seconds_left);
else else
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage); drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup, ailment.buildup_limit); drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup,
ailment.buildup_limit);
drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage); drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage);
end end
end end
@@ -91,13 +95,15 @@ function ailment_UI_entity.draw_static(ailment, ailment_UI, position_on_screen,
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left); drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left,
ailment.seconds_left);
else else
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage); drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup, ailment.buildup_limit); drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup,
ailment.buildup_limit);
drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage); drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage);
end end
end end
@@ -122,13 +128,15 @@ function ailment_UI_entity.draw_highlighted(ailment, ailment_UI, position_on_scr
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left); drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left,
ailment.seconds_left);
else else
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage); drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup, ailment.buildup_limit); drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup,
ailment.buildup_limit);
drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage); drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage);
end end
end end
@@ -153,13 +161,15 @@ function ailment_UI_entity.draw_small(ailment, ailment_UI, position_on_screen, o
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left); drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left,
ailment.seconds_left);
else else
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage); drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup, ailment.buildup_limit); drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup,
ailment.buildup_limit);
drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage); drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage);
end end
end end

View File

@@ -5,7 +5,9 @@ local config;
local player; local player;
local language; 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) 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 entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -24,11 +26,16 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * 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.width = entity.buildup_bar.size.width * global_scale_modifier;
entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier; entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier;
entity.buildup_bar.outline.thickness = entity.buildup_bar.outline.thickness * global_scale_modifier;
entity.buildup_bar.outline.offset = entity.buildup_bar.outline.offset * global_scale_modifier;
entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * 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.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.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.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * global_scale_modifier;
entity.highlighted_buildup_bar.outline.thickness = entity.highlighted_buildup_bar.outline.thickness *
global_scale_modifier;
entity.highlighted_buildup_bar.outline.offset = entity.highlighted_buildup_bar.outline.offset * global_scale_modifier;
entity.player_name_label.offset.x = entity.player_name_label.offset.x * 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.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
@@ -48,12 +55,13 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
return entity; return entity;
end end
function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) 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 cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
if cached_config.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; player_buildup_bar_percentage = _player.buildup_share;
else else
if top_buildup ~= 0 then if top_buildup ~= 0 then
player_buildup_bar_percentage = _player.buildup / top_buildup; player_buildup_bar_percentage = _player.buildup / top_buildup;
@@ -61,24 +69,29 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos
end end
if _player.id == player.myself.id and cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) 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 cached_config = config.current_config.large_monster_UI.static.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
if cached_config.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; player_buildup_bar_percentage = _player.buildup_share;
else else
if top_buildup ~= 0 then if top_buildup ~= 0 then
player_buildup_bar_percentage = _player.buildup / top_buildup; player_buildup_bar_percentage = _player.buildup / top_buildup;
@@ -86,24 +99,29 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi
end end
if _player.id == player.myself.id and cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) 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 cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
if cached_config.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; player_buildup_bar_percentage = _player.buildup_share;
else else
if top_buildup ~= 0 then if top_buildup ~= 0 then
player_buildup_bar_percentage = _player.buildup / top_buildup; player_buildup_bar_percentage = _player.buildup / top_buildup;
@@ -111,16 +129,20 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI,
end end
if _player.id == player.myself.id and cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
@@ -128,7 +150,7 @@ function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, posit
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
if cached_config.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; player_buildup_bar_percentage = _player.buildup_share;
else else
if top_buildup ~= 0 then if top_buildup ~= 0 then
player_buildup_bar_percentage = _player.buildup / top_buildup; player_buildup_bar_percentage = _player.buildup / top_buildup;
@@ -136,16 +158,20 @@ function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, posit
end end
if _player.id == player.myself.id and cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.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); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.init_module() function ailment_buildup_UI_entity.init_module()

View File

@@ -4,9 +4,12 @@ local table_helpers;
local drawing; local drawing;
function body_part_UI_entity.new(part_visibility, part_name_label, function body_part_UI_entity.new(part_visibility, part_name_label,
flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label, flinch_percentage_label, flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label,
break_visibility, break_bar, break_text_label, break_value_label, break_percentage_label, flinch_percentage_label,
loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_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 global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -31,6 +34,8 @@ function body_part_UI_entity.new(part_visibility, part_name_label,
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * 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.width = entity.flinch_bar.size.width * global_scale_modifier;
entity.flinch_bar.size.height = entity.flinch_bar.size.height * global_scale_modifier; entity.flinch_bar.size.height = entity.flinch_bar.size.height * global_scale_modifier;
entity.flinch_bar.outline.thickness = entity.flinch_bar.outline.thickness * global_scale_modifier;
entity.flinch_bar.outline.offset = entity.flinch_bar.outline.offset * global_scale_modifier;
entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * 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_text_label.offset.y = entity.flinch_text_label.offset.y * global_scale_modifier;
@@ -50,6 +55,8 @@ function body_part_UI_entity.new(part_visibility, part_name_label,
entity.break_bar.offset.y = entity.break_bar.offset.y * 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.width = entity.break_bar.size.width * global_scale_modifier;
entity.break_bar.size.height = entity.break_bar.size.height * global_scale_modifier; entity.break_bar.size.height = entity.break_bar.size.height * global_scale_modifier;
entity.break_bar.outline.thickness = entity.break_bar.outline.thickness * global_scale_modifier;
entity.break_bar.outline.offset = entity.break_bar.outline.offset * global_scale_modifier;
entity.break_text_label.offset.x = entity.break_text_label.offset.x * 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_text_label.offset.y = entity.break_text_label.offset.y * global_scale_modifier;
@@ -69,6 +76,8 @@ function body_part_UI_entity.new(part_visibility, part_name_label,
entity.loss_bar.offset.y = entity.loss_bar.offset.y * 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.width = entity.loss_bar.size.width * global_scale_modifier;
entity.loss_bar.size.height = entity.loss_bar.size.height * global_scale_modifier; entity.loss_bar.size.height = entity.loss_bar.size.height * global_scale_modifier;
entity.loss_bar.outline.thickness = entity.loss_bar.outline.thickness * global_scale_modifier;
entity.loss_bar.outline.offset = entity.loss_bar.outline.offset * global_scale_modifier;
entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * 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_text_label.offset.y = entity.loss_text_label.offset.y * global_scale_modifier;
@@ -111,7 +120,8 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
end end
local health_string = string.format("%.0f/%.0f", part.health, part.max_health); local health_string = string.format("%.0f/%.0f", part.health, part.max_health);
local break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health); local break_health_string = string.format("%.0f/%.0f", part.break_health,
part.break_max_health);
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
local flinch_position_on_screen = { local flinch_position_on_screen = {
@@ -137,32 +147,42 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
drawing.draw_bar(part.body_part_dynamic_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage); drawing.draw_bar(part.body_part_dynamic_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
end end
if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and
drawing.draw_bar(part.body_part_dynamic_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage); part.break_count < part.break_max_count then
drawing.draw_bar(part.body_part_dynamic_UI.break_bar, break_position_on_screen, opacity_scale,
part.break_health_percentage);
end end
if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
drawing.draw_bar(part.body_part_dynamic_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage); drawing.draw_bar(part.body_part_dynamic_UI.loss_bar, loss_position_on_screen, opacity_scale,
part.loss_health_percentage);
end end
drawing.draw_label(part.body_part_dynamic_UI.part_name_label, position_on_screen, opacity_scale, part_name); drawing.draw_label(part.body_part_dynamic_UI.part_name_label, position_on_screen, opacity_scale, part_name);
if part.body_part_dynamic_UI.flinch_visibility then if part.body_part_dynamic_UI.flinch_visibility then
drawing.draw_label(part.body_part_dynamic_UI.flinch_text_label, flinch_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_dynamic_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_dynamic_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string); drawing.draw_label(part.body_part_dynamic_UI.flinch_value_label, flinch_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_dynamic_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage); health_string);
drawing.draw_label(part.body_part_dynamic_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale,
100 * part.health_percentage);
end end
if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and
part.break_count < part.break_max_count then
drawing.draw_label(part.body_part_dynamic_UI.break_text_label, break_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_dynamic_UI.break_text_label, break_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_dynamic_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string); drawing.draw_label(part.body_part_dynamic_UI.break_value_label, break_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_dynamic_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage); break_health_string);
drawing.draw_label(part.body_part_dynamic_UI.break_percentage_label, break_position_on_screen, opacity_scale,
100 * part.break_health_percentage);
end end
if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
drawing.draw_label(part.body_part_dynamic_UI.loss_text_label, loss_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_dynamic_UI.loss_text_label, loss_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_dynamic_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string); drawing.draw_label(part.body_part_dynamic_UI.loss_value_label, loss_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_dynamic_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage); loss_health_string);
drawing.draw_label(part.body_part_dynamic_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale,
100 * part.loss_health_percentage);
end end
end end
@@ -195,7 +215,8 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
end end
local health_string = string.format("%.0f/%.0f", part.health, part.max_health); local health_string = string.format("%.0f/%.0f", part.health, part.max_health);
local break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health); local break_health_string = string.format("%.0f/%.0f", part.break_health,
part.break_max_health);
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
local flinch_position_on_screen = { local flinch_position_on_screen = {
@@ -222,7 +243,8 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
end end
if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
drawing.draw_bar(part.body_part_static_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage); drawing.draw_bar(part.body_part_static_UI.break_bar, break_position_on_screen, opacity_scale,
part.break_health_percentage);
end end
if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
@@ -234,19 +256,24 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
if part.body_part_static_UI.flinch_visibility then if part.body_part_static_UI.flinch_visibility then
drawing.draw_label(part.body_part_static_UI.flinch_text_label, flinch_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_static_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_static_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string); drawing.draw_label(part.body_part_static_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string);
drawing.draw_label(part.body_part_static_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage); drawing.draw_label(part.body_part_static_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale,
100 * part.health_percentage);
end end
if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
drawing.draw_label(part.body_part_static_UI.break_text_label, break_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_static_UI.break_text_label, break_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_static_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string); drawing.draw_label(part.body_part_static_UI.break_value_label, break_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_static_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage); break_health_string);
drawing.draw_label(part.body_part_static_UI.break_percentage_label, break_position_on_screen, opacity_scale,
100 * part.break_health_percentage);
end end
if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
drawing.draw_label(part.body_part_static_UI.loss_text_label, loss_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_static_UI.loss_text_label, loss_position_on_screen, opacity_scale);
drawing.draw_label(part.body_part_static_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string); drawing.draw_label(part.body_part_static_UI.loss_value_label, loss_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_static_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage); loss_health_string);
drawing.draw_label(part.body_part_static_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale,
100 * part.loss_health_percentage);
end end
end end
@@ -279,7 +306,8 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
end end
local health_string = string.format("%.0f/%.0f", part.health, part.max_health); local health_string = string.format("%.0f/%.0f", part.health, part.max_health);
local break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health); local break_health_string = string.format("%.0f/%.0f", part.break_health,
part.break_max_health);
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
local flinch_position_on_screen = { local flinch_position_on_screen = {
@@ -302,39 +330,49 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
}; };
local draw_health = part.body_part_highlighted_UI.flinch_visibility and part.max_health > 0; 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_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; 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 if draw_health then
drawing.draw_bar(part.body_part_highlighted_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage); drawing.draw_bar(part.body_part_highlighted_UI.flinch_bar, flinch_position_on_screen, opacity_scale,
part.health_percentage);
end end
if draw_break 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); drawing.draw_bar(part.body_part_highlighted_UI.break_bar, break_position_on_screen, opacity_scale,
part.break_health_percentage);
end end
if draw_loss 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); drawing.draw_bar(part.body_part_highlighted_UI.loss_bar, loss_position_on_screen, opacity_scale,
part.loss_health_percentage);
end end
drawing.draw_label(part.body_part_highlighted_UI.part_name_label, position_on_screen, opacity_scale, part_name); drawing.draw_label(part.body_part_highlighted_UI.part_name_label, position_on_screen, opacity_scale, part_name);
if draw_health 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_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_value_label, flinch_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_highlighted_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage); health_string);
drawing.draw_label(part.body_part_highlighted_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale,
100 * part.health_percentage);
end end
if draw_break 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_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_value_label, break_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_highlighted_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage); 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 end
if draw_loss 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_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_value_label, loss_position_on_screen, opacity_scale,
drawing.draw_label(part.body_part_highlighted_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage); 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);
end end
end end

View File

@@ -5,7 +5,8 @@ local config;
local player; local player;
local language; local language;
function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label, percentage_label, cart_count_label) function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label,
percentage_label, cart_count_label)
local entity = {}; local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -24,16 +25,21 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label
entity.bar.offset.y = entity.bar.offset.y * 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.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier; entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * 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.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.width = entity.highlighted_bar.size.width * global_scale_modifier;
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier; entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier;
entity.highlighted_bar.outline.thickness = entity.highlighted_bar.outline.thickness * global_scale_modifier;
entity.highlighted_bar.outline.offset = entity.highlighted_bar.outline.offset * global_scale_modifier;
entity.player_name_label.offset.x = entity.player_name_label.offset.x * 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.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit * global_scale_modifier; entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit *
global_scale_modifier;
entity.dps_label.offset.x = entity.dps_label.offset.x * 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.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier;
@@ -117,20 +123,28 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
end end
if _player.id == player.myself.id then if _player.id == player.myself.id then
if _player.damage_UI.hunter_rank_label.include.myself.master_rank and _player.damage_UI.hunter_rank_label.include.myself.hunter_rank then if _player.damage_UI.hunter_rank_label.include.myself.master_rank and
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d:%d", _player.master_rank, _player.hunter_rank)); _player.damage_UI.hunter_rank_label.include.myself.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d:%d", _player.master_rank, _player.hunter_rank));
elseif _player.damage_UI.hunter_rank_label.include.myself.master_rank then elseif _player.damage_UI.hunter_rank_label.include.myself.master_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d", _player.master_rank)); drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.master_rank));
elseif _player.damage_UI.hunter_rank_label.include.myself.hunter_rank then elseif _player.damage_UI.hunter_rank_label.include.myself.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d", _player.hunter_rank)); drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.hunter_rank));
end end
else else
if _player.damage_UI.hunter_rank_label.include.others.master_rank and _player.damage_UI.hunter_rank_label.include.others.hunter_rank then if _player.damage_UI.hunter_rank_label.include.others.master_rank and
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d:%d", _player.master_rank, _player.hunter_rank)); _player.damage_UI.hunter_rank_label.include.others.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d:%d", _player.master_rank, _player.hunter_rank));
elseif _player.damage_UI.hunter_rank_label.include.others.master_rank then elseif _player.damage_UI.hunter_rank_label.include.others.master_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d", _player.master_rank)); drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.master_rank));
elseif _player.damage_UI.hunter_rank_label.include.others.hunter_rank then elseif _player.damage_UI.hunter_rank_label.include.others.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, string.format("%d", _player.hunter_rank)); drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.hunter_rank));
end end
end end

View File

@@ -19,6 +19,8 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
entity.bar.offset.y = entity.bar.offset.y * 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.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier; entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * 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.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;

View File

@@ -20,6 +20,8 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
entity.bar.offset.y = entity.bar.offset.y * 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.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier; entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * 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.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier;
@@ -45,7 +47,8 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale
drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_timer_percentage); drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_timer_percentage);
drawing.draw_label(rage_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.rage); drawing.draw_label(rage_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.rage);
drawing.draw_label(rage_UI.timer_label, position_on_screen, opacity_scale, monster.rage_minutes_left, monster.rage_seconds_left); drawing.draw_label(rage_UI.timer_label, position_on_screen, opacity_scale, monster.rage_minutes_left,
monster.rage_seconds_left);
else else
drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_percentage); drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_percentage);

View File

@@ -46,7 +46,8 @@ function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity
if monster.is_tired then if monster.is_tired then
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.tired_timer_percentage); drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.tired_timer_percentage);
drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left, monster.tired_seconds_left); drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left,
monster.tired_seconds_left);
else else
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage); drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage);

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,8 @@ drawing.font = nil;
function drawing.init_font() function drawing.init_font()
local cached_config = config.current_config.global_settings.UI_font; 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); drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold,
cached_config.italic);
end end
function drawing.argb_color_to_abgr_color(argb_color) function drawing.argb_color_to_abgr_color(argb_color)
@@ -31,7 +32,7 @@ function drawing.color_to_argb(color)
end end
function drawing.argb_to_color(alpha, red, green, blue) function drawing.argb_to_color(alpha, red, green, blue)
return 0x1000000 * alpha + 0x10000 * red + 0x100 * green + blue; return 0x1000000 * alpha + 0x10000 * red + 0x100 * green + blue;
end end
function drawing.limit_text_size(text, size_limit) function drawing.limit_text_size(text, size_limit)
@@ -44,7 +45,7 @@ function drawing.limit_text_size(text, size_limit)
local text_width, text_height = drawing.font:measure(limited_text); local text_width, text_height = drawing.font:measure(limited_text);
if text_width < size_limit then if text_width < size_limit then
break; break
else else
limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "..."; limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "...";
end end
@@ -54,7 +55,7 @@ function drawing.limit_text_size(text, size_limit)
end end
function drawing.scale_color_opacity(color, scale) function drawing.scale_color_opacity(color, scale)
local alpha, red, green, blue = drawing.color_to_argb(color); local alpha, red, green, blue = drawing.color_to_argb(color);
local new_alpha = math.floor(alpha * scale); local new_alpha = math.floor(alpha * scale);
if new_alpha < 0 then new_alpha = 0; end if new_alpha < 0 then new_alpha = 0; end
if new_alpha > 255 then new_alpha = 255; end if new_alpha > 255 then new_alpha = 255; end
@@ -64,8 +65,8 @@ end
function drawing.scale_bar_opacity(bar, scale) function drawing.scale_bar_opacity(bar, scale)
if bar == nil if bar == nil
or scale == nil or scale == nil
or not bar.visibility then or not bar.visibility then
return; return;
end end
@@ -75,8 +76,8 @@ end
function drawing.scale_label_opacity(label, scale) function drawing.scale_label_opacity(label, scale)
if label == nil if label == nil
or scale == nil or scale == nil
or not label.visibility then or not label.visibility then
return; return;
end end
@@ -86,11 +87,11 @@ end
function drawing.draw_label(label, position, opacity_scale, ...) function drawing.draw_label(label, position, opacity_scale, ...)
if label == nil if label == nil
or not label.visibility then or not label.visibility then
return; return;
end end
local text = string.format(label.text, table.unpack({...})); local text = string.format(label.text, table.unpack({ ... }));
local position_x = position.x + label.offset.x; local position_x = position.x + label.offset.x;
local position_y = position.y + label.offset.y; local position_y = position.y + label.offset.y;
@@ -124,8 +125,9 @@ function drawing.draw_label(label, position, opacity_scale, ...)
end end
function drawing.draw_bar(bar, position, opacity_scale, percentage) function drawing.draw_bar(bar, position, opacity_scale, percentage)
if bar == nil if bar == nil
or not bar.visibility then or not bar.visibility then
return; return;
end end
@@ -137,63 +139,160 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
percentage = 0; percentage = 0;
end end
local position_x = position.x + bar.offset.x; local outline_visibility = bar.outline.visibility;
local position_y = position.y + bar.offset.y; local style = bar.outline.style; -- Inside/Center/Outside
local foreground_width = bar.size.width * percentage;
local background_width = bar.size.width - foreground_width;
local new_foreground_color = bar.colors.foreground; local outline_thickness = bar.outline.thickness;
local new_background_color = bar.colors.background; if not outline_visibility then
outline_thickness = 0;
end
local half_outline_thickness = outline_thickness / 2;
local outline_offset = bar.outline.offset;
if outline_thickness == 0 then
outline_offset = 0;
end
local half_outline_offset = outline_offset / 2;
local outline_position_x = 0;
local outline_position_y = 0;
local outline_width = 0;
local outline_height = 0;
local position_x = 0;
local position_y = 0;
local foreground_width = 0;
local background_width = 0;
local height = 0;
if style == "Inside" then
outline_position_x = position.x + bar.offset.x + half_outline_thickness;
outline_position_y = position.y + bar.offset.y + half_outline_thickness;
outline_width = bar.size.width - outline_thickness;
outline_height = bar.size.height - outline_thickness;
position_x = outline_position_x + half_outline_thickness + outline_offset;
position_y = outline_position_y + half_outline_thickness + outline_offset;
local width = outline_width - outline_thickness - outline_offset - outline_offset;
foreground_width = width * percentage;
background_width = width - foreground_width;
height = outline_height - outline_thickness - outline_offset - outline_offset;
elseif style == "Center" then
outline_position_x = position.x + bar.offset.x - half_outline_offset;
outline_position_y = position.y + bar.offset.y - half_outline_offset;
outline_width = bar.size.width + outline_offset;
outline_height = bar.size.height + outline_offset;
position_x = outline_position_x + half_outline_thickness + outline_offset;
position_y = outline_position_y + half_outline_thickness + outline_offset;
local width = outline_width - outline_thickness - outline_offset - outline_offset;
foreground_width = width * percentage;
background_width = width - foreground_width;
height = outline_height - outline_thickness - outline_offset - outline_offset;
else
position_x = position.x + bar.offset.x;
position_y = position.y + bar.offset.y;
local width = bar.size.width;
height = bar.size.height;
foreground_width = width * percentage;
background_width = width - foreground_width;
outline_position_x = position_x - half_outline_thickness - outline_offset;
outline_position_y = position_y - half_outline_thickness - outline_offset;
outline_width = width + outline_thickness + outline_offset + outline_offset;
outline_height = height + outline_thickness + outline_offset + outline_offset;
end
local foreground_color = bar.colors.foreground;
local background_color = bar.colors.background;
local outline_color = bar.colors.outline;
if opacity_scale < 1 then if opacity_scale < 1 then
new_foreground_color = drawing.scale_color_opacity(new_foreground_color, opacity_scale); foreground_color = drawing.scale_color_opacity(foreground_color, opacity_scale);
new_background_color = drawing.scale_color_opacity(new_background_color, opacity_scale); background_color = drawing.scale_color_opacity(background_color, opacity_scale);
outline_color = drawing.scale_color_opacity(outline_color, opacity_scale);
end
local use_d2d = d2d ~= nil;
-- outline
if outline_thickness ~= 0 then
if use_d2d then
d2d.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_thickness,
outline_color);
else
outline_color = drawing.argb_color_to_abgr_color(outline_color);
draw.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_color);
end
end end
-- foreground -- foreground
if d2d ~= nil then if foreground_width ~= 0 then
d2d.fill_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color); if use_d2d then
else d2d.fill_rect(position_x, position_y, foreground_width, height, foreground_color);
new_foreground_color = drawing.argb_color_to_abgr_color(new_foreground_color);
draw.filled_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color) else
foreground_color = drawing.argb_color_to_abgr_color(foreground_color);
draw.filled_rect(position_x, position_y, foreground_width, height, foreground_color)
end
end end
-- background -- background
if d2d ~= nil then if background_width ~= 0 then
d2d.fill_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color); if use_d2d then
else d2d.fill_rect(position_x + foreground_width, position_y, background_width, height, background_color);
new_background_color = drawing.argb_color_to_abgr_color(new_background_color); else
draw.filled_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color) background_color = drawing.argb_color_to_abgr_color(background_color);
draw.filled_rect(position_x + foreground_width, position_y, background_width, height, background_color)
end
end end
end end
function drawing.draw_capture_line(health_UI, position, opacity_scale, percentage) function drawing.draw_capture_line(health_UI, position, opacity_scale, percentage)
if health_UI == nil if health_UI == nil
or not health_UI.visibility or not health_UI.visibility
or health_UI.bar == nil or health_UI.bar == nil
or not health_UI.bar.visibility or not health_UI.bar.visibility
or health_UI.bar.capture_line == nil or health_UI.bar.capture_line == nil
or not health_UI.bar.capture_line.visibility 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 + health_UI.bar.offset.x + health_UI.bar.capture_line.offset.x + health_UI.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 + health_UI.bar.offset.y + health_UI.bar.capture_line.offset.y; local position_y = position.y + health_UI.bar.offset.y + health_UI.bar.capture_line.offset.y;
local color = health_UI.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, health_UI.bar.capture_line.size.width, health_UI.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, health_UI.bar.capture_line.size.width, health_UI.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

View File

@@ -71,6 +71,7 @@
"capture_line": "Capture Line", "capture_line": "Capture Line",
"cart_count": "Cart Count", "cart_count": "Cart Count",
"cart_count_label": "Cart Count Label", "cart_count_label": "Cart Count Label",
"center": "Center",
"color": "Color", "color": "Color",
"colors": "Colors", "colors": "Colors",
"creature_name_label": "Creature Name Label", "creature_name_label": "Creature Name Label",
@@ -134,6 +135,7 @@
"hunter_rank": "Hunter Rank", "hunter_rank": "Hunter Rank",
"hunter_rank_label": "Hunter Rank Label", "hunter_rank_label": "Hunter Rank Label",
"include": "Include", "include": "Include",
"inside": "Inside",
"installation_damage": "Installation Damage", "installation_damage": "Installation Damage",
"italic": "Italic", "italic": "Italic",
"join_time": "Join Time", "join_time": "Join Time",
@@ -172,6 +174,8 @@
"other_damage": "Other Damage", "other_damage": "Other Damage",
"other_players": "Other Players", "other_players": "Other Players",
"otomo_damage": "Buddy Damage", "otomo_damage": "Buddy Damage",
"outline": "Outline",
"outside": "Outside",
"part_health": "Part Health", "part_health": "Part Health",
"part_name": "Part Name", "part_name": "Part Name",
"part_name_label": "Part Name Label", "part_name_label": "Part Name Label",
@@ -209,7 +213,9 @@
"static_spacing": "Static Spacing", "static_spacing": "Static Spacing",
"statically_positioned": "Statically Positioned", "statically_positioned": "Statically Positioned",
"status": "Status", "status": "Status",
"style": "Style",
"text_label": "Text Label", "text_label": "Text Label",
"thickness": "Thickness",
"time_UI": "Time UI", "time_UI": "Time UI",
"time_label": "Time Label", "time_label": "Time Label",
"time_limit": "Time Limit (seconds)", "time_limit": "Time Limit (seconds)",

View File

@@ -71,6 +71,7 @@
"capture_line": "포획 표시선", "capture_line": "포획 표시선",
"cart_count": "수레 횟수", "cart_count": "수레 횟수",
"cart_count_label": "수레 횟수 정보", "cart_count_label": "수레 횟수 정보",
"center": "Center",
"color": "색상", "color": "색상",
"colors": "색상", "colors": "색상",
"creature_name_label": "환경생물 이름 정보", "creature_name_label": "환경생물 이름 정보",
@@ -134,6 +135,7 @@
"hunter_rank": "헌터 랭크", "hunter_rank": "헌터 랭크",
"hunter_rank_label": "헌터 랭크 정보", "hunter_rank_label": "헌터 랭크 정보",
"include": "포함", "include": "포함",
"inside": "Inside",
"installation_damage": "설비 대미지", "installation_damage": "설비 대미지",
"italic": "기울임", "italic": "기울임",
"join_time": "참가 시간", "join_time": "참가 시간",
@@ -172,6 +174,8 @@
"other_damage": "기타 대미지", "other_damage": "기타 대미지",
"other_players": "다른 헌터", "other_players": "다른 헌터",
"otomo_damage": "동반자 대미지", "otomo_damage": "동반자 대미지",
"outline": "Outline",
"outside": "Outside",
"part_health": "부위 수치", "part_health": "부위 수치",
"part_name": "부위", "part_name": "부위",
"part_name_label": "부위 정보", "part_name_label": "부위 정보",
@@ -209,7 +213,9 @@
"static_spacing": "고정 간격", "static_spacing": "고정 간격",
"statically_positioned": "고정 위치 UI", "statically_positioned": "고정 위치 UI",
"status": "상태", "status": "상태",
"style": "Style",
"text_label": "텍스트 정보", "text_label": "텍스트 정보",
"thickness": "Thickness",
"time_UI": "시간 UI", "time_UI": "시간 UI",
"time_label": "시간 정보", "time_label": "시간 정보",
"time_limit": "시간 제한 (단위: 초)", "time_limit": "시간 제한 (단위: 초)",

View File

@@ -71,6 +71,7 @@
"capture_line": "Линия здоровья захвата", "capture_line": "Линия здоровья захвата",
"cart_count": "Кол-во потерь сознания", "cart_count": "Кол-во потерь сознания",
"cart_count_label": "Метка кол-ва потерь сознания", "cart_count_label": "Метка кол-ва потерь сознания",
"center": "Центр",
"color": "Цвет", "color": "Цвет",
"colors": "Цвета", "colors": "Цвета",
"creature_name_label": "Метка имени существа", "creature_name_label": "Метка имени существа",
@@ -134,6 +135,7 @@
"hunter_rank": "Ранг охотника", "hunter_rank": "Ранг охотника",
"hunter_rank_label": "Метка ранга охотника", "hunter_rank_label": "Метка ранга охотника",
"include": "Элементы", "include": "Элементы",
"inside": "Внутри",
"installation_damage": "Урон от установок", "installation_damage": "Урон от установок",
"italic": "Курсив", "italic": "Курсив",
"join_time": "Время присоединения", "join_time": "Время присоединения",
@@ -172,6 +174,8 @@
"other_damage": "Другой урон", "other_damage": "Другой урон",
"other_players": "Другие игроки", "other_players": "Другие игроки",
"otomo_damage": "Урон от отомо", "otomo_damage": "Урон от отомо",
"outline": "Обводка",
"outside": "Снаружи",
"part_health": "Здоровье части", "part_health": "Здоровье части",
"part_name": "Имя части тела", "part_name": "Имя части тела",
"part_name_label": "Метка имени части тела", "part_name_label": "Метка имени части тела",
@@ -209,7 +213,9 @@
"static_spacing": "Статичное расстояние между элементами", "static_spacing": "Статичное расстояние между элементами",
"statically_positioned": "Рассположенный статично", "statically_positioned": "Рассположенный статично",
"status": "Статус", "status": "Статус",
"style": "Стиль",
"text_label": "Текстовая метка", "text_label": "Текстовая метка",
"thickness": "Thickness",
"time_UI": "Интерфейс времени", "time_UI": "Интерфейс времени",
"time_label": "Метка времени", "time_label": "Метка времени",
"time_limit": "Ограничение по времени", "time_limit": "Ограничение по времени",

View File

@@ -71,6 +71,7 @@
"capture_line": "可捕捉线", "capture_line": "可捕捉线",
"cart_count": "Cart Count", "cart_count": "Cart Count",
"cart_count_label": "Cart Count Label", "cart_count_label": "Cart Count Label",
"center": "Center",
"color": "颜色", "color": "颜色",
"colors": "颜色", "colors": "颜色",
"creature_name_label": "生物名标签", "creature_name_label": "生物名标签",
@@ -134,6 +135,7 @@
"hunter_rank": "猎人等級", "hunter_rank": "猎人等級",
"hunter_rank_label": "猎人等级标签", "hunter_rank_label": "猎人等级标签",
"include": "包含", "include": "包含",
"inside": "Inside",
"installation_damage": "设备伤害", "installation_damage": "设备伤害",
"italic": "斜体", "italic": "斜体",
"join_time": "加入时间", "join_time": "加入时间",
@@ -172,6 +174,8 @@
"other_damage": "Other Damage", "other_damage": "Other Damage",
"other_players": "其他玩家", "other_players": "其他玩家",
"otomo_damage": "随从伤害", "otomo_damage": "随从伤害",
"outline": "Outline",
"outside": "Outside",
"part_health": "Part Health", "part_health": "Part Health",
"part_name": "部位名", "part_name": "部位名",
"part_name_label": "部位名标签", "part_name_label": "部位名标签",
@@ -209,7 +213,9 @@
"static_spacing": "固定间距", "static_spacing": "固定间距",
"statically_positioned": "固定位置", "statically_positioned": "固定位置",
"status": "状态", "status": "状态",
"style": "Style",
"text_label": "文字标签", "text_label": "文字标签",
"thickness": "Thickness",
"time_UI": "时间UI", "time_UI": "时间UI",
"time_label": "时间标签", "time_label": "时间标签",
"time_limit": "时间限制(秒)", "time_limit": "时间限制(秒)",

View File

@@ -71,6 +71,7 @@
"capture_line": "可捕捉標記線", "capture_line": "可捕捉標記線",
"cart_count": "Cart Count", "cart_count": "Cart Count",
"cart_count_label": "Cart Count Label", "cart_count_label": "Cart Count Label",
"center": "Center",
"color": "調色盤", "color": "調色盤",
"colors": "調色盤", "colors": "調色盤",
"creature_name_label": "環境生物名稱", "creature_name_label": "環境生物名稱",
@@ -134,6 +135,7 @@
"hunter_rank": "獵人等級", "hunter_rank": "獵人等級",
"hunter_rank_label": "獵人等級", "hunter_rank_label": "獵人等級",
"include": "細部資訊調整", "include": "細部資訊調整",
"inside": "Inside",
"installation_damage": "設備傷害", "installation_damage": "設備傷害",
"italic": "斜體", "italic": "斜體",
"join_time": "加入時間", "join_time": "加入時間",
@@ -172,6 +174,8 @@
"other_damage": "Other Damage", "other_damage": "Other Damage",
"other_players": "其他玩家", "other_players": "其他玩家",
"otomo_damage": "隨從傷害", "otomo_damage": "隨從傷害",
"outline": "Outline",
"outside": "Outside",
"part_health": "Part Health", "part_health": "Part Health",
"part_name": "部位名稱", "part_name": "部位名稱",
"part_name_label": "部位名稱", "part_name_label": "部位名稱",
@@ -209,7 +213,9 @@
"static_spacing": "固定魔物資訊的間距", "static_spacing": "固定魔物資訊的間距",
"statically_positioned": "固定的魔物資訊", "statically_positioned": "固定的魔物資訊",
"status": "狀態", "status": "狀態",
"style": "Style",
"text_label": "文字", "text_label": "文字",
"thickness": "Thickness",
"time_UI": "時間 UI", "time_UI": "時間 UI",
"time_label": "時間", "time_label": "時間",
"time_limit": "時限 (秒)", "time_limit": "時限 (秒)",