diff --git a/reframework/autorun/MHR_Overlay/Damage_Meter/damage_hook.lua b/reframework/autorun/MHR_Overlay/Damage_Meter/damage_hook.lua index 77ac05f..3eed8a7 100644 --- a/reframework/autorun/MHR_Overlay/Damage_Meter/damage_hook.lua +++ b/reframework/autorun/MHR_Overlay/Damage_Meter/damage_hook.lua @@ -22,12 +22,6 @@ local get_elemental_damage_method = enemy_calc_damage_info_type_def:get_method(" local get_condition_damage_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage"); local get_condition_type_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType"); -sdk.hook(enemy_character_base_after_calc_damage_damage_side, function(args) - pcall(damage_hook.update_damage, args); -end, function(retval) - return retval; -end); - function damage_hook.update_damage(args) local enemy = sdk.to_managed_object(args[2]); if enemy == nil then @@ -109,9 +103,6 @@ function damage_hook.update_damage(args) end local attacking_player = player.get_player(attacker_id); - if attacking_player == nil then - --return; - end local monster; if is_large_monster then @@ -138,6 +129,12 @@ function damage_hook.init_module() small_monster = require("MHR_Overlay.Monsters.small_monster"); large_monster = require("MHR_Overlay.Monsters.large_monster"); ailments = require("MHR_Overlay.Monsters.ailments"); + + sdk.hook(enemy_character_base_after_calc_damage_damage_side, function(args) + pcall(damage_hook.update_damage, args); + end, function(retval) + return retval; + end); end return damage_hook; \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Damage_Meter/player.lua b/reframework/autorun/MHR_Overlay/Damage_Meter/player.lua index 1054ade..fd41cbd 100644 --- a/reframework/autorun/MHR_Overlay/Damage_Meter/player.lua +++ b/reframework/autorun/MHR_Overlay/Damage_Meter/player.lua @@ -191,70 +191,72 @@ function player.update_display(_player) _player.display.elemental_damage = 0; _player.display.ailment_damage = 0; - if config.current_config.damage_meter_UI.tracked_monster_types.small_monsters then - if config.current_config.damage_meter_UI.tracked_damage_types.player_damage then + local cached_config = config.current_config.damage_meter_UI; + + if cached_config.tracked_monster_types.small_monsters then + if cached_config.tracked_damage_types.player_damage then player.merge_damage(_player.display, _player.small_monsters); end - if config.current_config.damage_meter_UI.tracked_damage_types.bomb_damage then + if cached_config.tracked_damage_types.bomb_damage then player.merge_damage(_player.display, _player.small_monsters.bombs); end - if config.current_config.damage_meter_UI.tracked_damage_types.kunai_damage then + if cached_config.tracked_damage_types.kunai_damage then player.merge_damage(_player.display, _player.small_monsters.kunai); end - if config.current_config.damage_meter_UI.tracked_damage_types.installation_damage then + if cached_config.tracked_damage_types.installation_damage then player.merge_damage(_player.display, _player.small_monsters.installations); end - if config.current_config.damage_meter_UI.tracked_damage_types.otomo_damage then + if cached_config.tracked_damage_types.otomo_damage then player.merge_damage(_player.display, _player.small_monsters.otomo); end - if config.current_config.damage_meter_UI.tracked_damage_types.monster_damage then + if cached_config.tracked_damage_types.monster_damage then player.merge_damage(_player.display, _player.small_monsters.monster); end - if config.current_config.damage_meter_UI.tracked_damage_types.poison_damage then + if cached_config.tracked_damage_types.poison_damage then player.merge_damage(_player.display, _player.small_monsters.poison); end - if config.current_config.damage_meter_UI.tracked_damage_types.blast_damage then + if cached_config.tracked_damage_types.blast_damage then player.merge_damage(_player.display, _player.small_monsters.blast); end end - if config.current_config.damage_meter_UI.tracked_monster_types.large_monsters then - if config.current_config.damage_meter_UI.tracked_damage_types.player_damage then + if cached_config.tracked_monster_types.large_monsters then + if cached_config.tracked_damage_types.player_damage then player.merge_damage(_player.display, _player.large_monsters); end - if config.current_config.damage_meter_UI.tracked_damage_types.bomb_damage then + if cached_config.tracked_damage_types.bomb_damage then player.merge_damage(_player.display, _player.large_monsters.bombs); end - if config.current_config.damage_meter_UI.tracked_damage_types.kunai_damage then + if cached_config.tracked_damage_types.kunai_damage then player.merge_damage(_player.display, _player.large_monsters.kunai); end - if config.current_config.damage_meter_UI.tracked_damage_types.installation_damage then + if cached_config.tracked_damage_types.installation_damage then player.merge_damage(_player.display, _player.large_monsters.installations); end - if config.current_config.damage_meter_UI.tracked_damage_types.otomo_damage then + if cached_config.tracked_damage_types.otomo_damage then player.merge_damage(_player.display, _player.large_monsters.otomo); end - if config.current_config.damage_meter_UI.tracked_damage_types.monster_damage then + if cached_config.tracked_damage_types.monster_damage then player.merge_damage(_player.display, _player.large_monsters.monster); end - if config.current_config.damage_meter_UI.tracked_damage_types.poison_damage then + if cached_config.tracked_damage_types.poison_damage then player.merge_damage(_player.display, _player.large_monsters.poison); end - if config.current_config.damage_meter_UI.tracked_damage_types.blast_damage then + if cached_config.tracked_damage_types.blast_damage then player.merge_damage(_player.display, _player.large_monsters.blast); end end @@ -498,32 +500,37 @@ function player.update_player_list_on_quest() end function player.init_UI(_player) + local cached_config = config.current_config.damage_meter_UI; + _player.damage_UI = damage_UI_entity.new( - config.current_config.damage_meter_UI.damage_bar, - config.current_config.damage_meter_UI.highlighted_damage_bar, - config.current_config.damage_meter_UI.player_name_label, - config.current_config.damage_meter_UI.dps_label, - config.current_config.damage_meter_UI.hunter_rank_label, - config.current_config.damage_meter_UI.damage_value_label, - config.current_config.damage_meter_UI.damage_percentage_label + cached_config.damage_bar, + cached_config.highlighted_damage_bar, + cached_config.player_name_label, + cached_config.dps_label, + cached_config.hunter_rank_label, + cached_config.damage_value_label, + cached_config.damage_percentage_label ); end function player.init_total_UI(_player) + local cached_config = config.current_config.damage_meter_UI; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + _player.damage_UI = { - total_damage_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_damage_label), - total_damage_value_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_damage_value_label), - total_dps_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_dps_label) + total_damage_label = table_helpers.deep_copy(cached_config.total_damage_label), + total_damage_value_label = table_helpers.deep_copy(cached_config.total_damage_value_label), + total_dps_label = table_helpers.deep_copy(cached_config.total_dps_label) }; - _player.damage_UI.total_damage_label.offset.x = _player.damage_UI.total_damage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - _player.damage_UI.total_damage_label.offset.y = _player.damage_UI.total_damage_label.offset.y * config.current_config.global_settings.modifiers.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_value_label.offset.x = _player.damage_UI.total_damage_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - _player.damage_UI.total_damage_value_label.offset.y = _player.damage_UI.total_damage_value_label.offset.y * config.current_config.global_settings.modifiers.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.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 * config.current_config.global_settings.modifiers.global_scale_modifier; - _player.damage_UI.total_dps_label.offset.y = _player.damage_UI.total_dps_label.offset.y * config.current_config.global_settings.modifiers.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; end function player.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps) diff --git a/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature.lua b/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature.lua index 5162056..4a4d138 100644 --- a/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature.lua +++ b/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature.lua @@ -62,13 +62,11 @@ end function env_creature.init_UI(creature) creature.name_label = table_helpers.deep_copy(config.current_config.endemic_life_UI.creature_name_label); - creature.name_label.offset.x = creature.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - creature.name_label.offset.y = creature.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; -end + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; ---local get_game_object_method = sdk.find_type_definition("via.Component"):get_method("get_GameObject"); ---local get_transform_method = sdk.find_type_definition("via.GameObject"):get_method("get_Transform"); ---local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position"); + creature.name_label.offset.x = creature.name_label.offset.x * global_scale_modifier; + creature.name_label.offset.y = creature.name_label.offset.y * global_scale_modifier; +end function env_creature.update(REcreature) if not config.current_config.endemic_life_UI.enabled then @@ -82,33 +80,6 @@ function env_creature.update(REcreature) creature.position = position; end - --[[ - if creature.game_object == nil then - creature.game_object = get_game_object_method:call(REcreature); - - if creature.game_object == nil then - customization_menu.status = "No enemy game object"; - return; - end - end - - if creature.transform == nil then - creature.transform = get_transform_method:call(creature.game_object); - if creature.transform == nil then - customization_menu.status = "No enemy transform"; - return; - end - end - - local position = get_position_method:call(creature.transform); - if position == nil then - customization_menu.status = "No enemy position"; - return; - end - - creature.position = position; - --]] - local is_inactive = creature_is_inactive_field:get_data(REcreature); if is_inactive ~= nil then creature.is_inactive = is_inactive; diff --git a/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature_hook.lua b/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature_hook.lua index c0ff607..e8d7f4f 100644 --- a/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature_hook.lua +++ b/reframework/autorun/MHR_Overlay/Endemic_Life/env_creature_hook.lua @@ -5,11 +5,6 @@ local time; local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase"); local environment_creature_base_update_method = environment_creature_base_type_def:get_method("update"); -sdk.hook(environment_creature_base_update_method, function(args) - pcall(env_creature_hook.update_env_creature, sdk.to_managed_object(args[2])); -end, function(retval) - return retval; -end); function env_creature_hook.update_env_creature(REcreature) if not config.current_config.endemic_life_UI.enabled then @@ -23,6 +18,12 @@ function env_creature_hook.init_module() config = require("MHR_Overlay.Misc.config"); env_creature = require("MHR_Overlay.Endemic_Life.env_creature"); time = require("MHR_Overlay.Game_Handler.time"); + + sdk.hook(environment_creature_base_update_method, function(args) + pcall(env_creature_hook.update_env_creature, sdk.to_managed_object(args[2])); + end, function(retval) + return retval; + end); end return env_creature_hook; \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Game_Handler/keyboard.lua b/reframework/autorun/MHR_Overlay/Game_Handler/keyboard.lua index 3a8a19e..60f32da 100644 --- a/reframework/autorun/MHR_Overlay/Game_Handler/keyboard.lua +++ b/reframework/autorun/MHR_Overlay/Game_Handler/keyboard.lua @@ -348,13 +348,15 @@ function keyboard.check_modifiers(hard_keyboard) end function keyboard.register_hotkey(hard_keyboard) + local cached_config = config.current_config.global_settings.hotkeys_with_modifiers; + if customization_menu.all_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.all_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.all_UI.key = key; + cached_config.all_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.all_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.all_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.all_UI.key = key; customization_menu.all_UI_waiting_for_key = false; return true; end @@ -362,10 +364,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.small_monster_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key = key; + cached_config.small_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.small_monster_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.small_monster_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.small_monster_UI.key = key; customization_menu.small_monster_UI_waiting_for_key = false; return true; end @@ -373,10 +375,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.large_monster_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key = key; + cached_config.large_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.large_monster_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.large_monster_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.large_monster_UI.key = key; customization_menu.large_monster_UI_waiting_for_key = false; return true; end @@ -384,10 +386,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.large_monster_dynamic_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key = key; + cached_config.large_monster_dynamic_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.large_monster_dynamic_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.large_monster_dynamic_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.large_monster_dynamic_UI.key = key; customization_menu.large_monster_dynamic_UI_waiting_for_key = false; return true; end @@ -395,10 +397,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.large_monster_static_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key = key; + cached_config.large_monster_static_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.large_monster_static_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.large_monster_static_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.large_monster_static_UI.key = key; customization_menu.large_monster_static_UI_waiting_for_key = false; return true; end @@ -406,10 +408,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.large_monster_highlighted_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key = key; + cached_config.large_monster_highlighted_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.large_monster_highlighted_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.large_monster_highlighted_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.large_monster_highlighted_UI.key = key; customization_menu.large_monster_highlighted_UI_waiting_for_key = false; return true; end @@ -417,10 +419,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.time_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.time_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key = key; + cached_config.time_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.time_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.time_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.time_UI.key = key; customization_menu.time_UI_waiting_for_key = false; return true; end @@ -428,10 +430,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.damage_meter_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key = key; + cached_config.damage_meter_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.damage_meter_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.damage_meter_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.damage_meter_UI.key = key; customization_menu.damage_meter_UI_waiting_for_key = false; return true; end @@ -439,10 +441,10 @@ function keyboard.register_hotkey(hard_keyboard) elseif customization_menu.endemic_life_UI_waiting_for_key then for key, key_name in pairs(keyboard.keys) do if get_release_method:call(hard_keyboard, key) then - config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; - config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.shift = keyboard.hotkey_modifiers_down.shift; - config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.alt = keyboard.hotkey_modifiers_down.alt; - config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.key = key; + cached_config.endemic_life_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl; + cached_config.endemic_life_UI.shift = keyboard.hotkey_modifiers_down.shift; + cached_config.endemic_life_UI.alt = keyboard.hotkey_modifiers_down.alt; + cached_config.endemic_life_UI.key = key; customization_menu.endemic_life_UI_waiting_for_key = false; return true; end @@ -453,10 +455,12 @@ function keyboard.register_hotkey(hard_keyboard) end function keyboard.check_hotkeys(hard_keyboard) - if not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.all_UI.key)) then + 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) + 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 + 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 or config.current_config.small_monster_UI.enabled @@ -474,18 +478,18 @@ function keyboard.check_hotkeys(hard_keyboard) end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key)) then + 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.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 config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key)) then + 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.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 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.highlighted.enabled; @@ -496,50 +500,50 @@ function keyboard.check_hotkeys(hard_keyboard) end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key)) then + 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.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 config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key)) then + 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.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 config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key)) then + 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.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 config.current_config.large_monster_UI.highlighted.enabled = not config.current_config.large_monster_UI.highlighted.enabled; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key)) then + 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.alt and not keyboard.hotkey_modifiers_down.alt) 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; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key)) then + 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.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 config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled; end end - if not (config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) - and not (config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.shift and not keyboard.hotkey_modifiers_down.shift) - and not (config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.alt and not keyboard.hotkey_modifiers_down.alt) then - if get_release_method:call(hard_keyboard, math.tointeger(config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.key)) then + 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.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 config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled; end end diff --git a/reframework/autorun/MHR_Overlay/Game_Handler/quest_status.lua b/reframework/autorun/MHR_Overlay/Game_Handler/quest_status.lua index a7aa4e4..b5579f6 100644 --- a/reframework/autorun/MHR_Overlay/Game_Handler/quest_status.lua +++ b/reframework/autorun/MHR_Overlay/Game_Handler/quest_status.lua @@ -41,10 +41,6 @@ function quest_status.update(args) end end -sdk.hook(on_changed_game_status, function(args) - pcall(quest_status.update, args); -end, function(retval) return retval; end); - function quest_status.init() if singletons.quest_manager == nil then return; @@ -121,6 +117,10 @@ function quest_status.init_module() time = require("MHR_Overlay.Game_Handler.time"); quest_status.init(); + + sdk.hook(on_changed_game_status, function(args) + pcall(quest_status.update, args); + end, function(retval) return retval; end); end return quest_status; \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua b/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua index a214a1b..eec6df0 100644 --- a/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua +++ b/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua @@ -65,9 +65,11 @@ function screen.get_game_window_size() end function screen.calculate_absolute_coordinates(position) + local global_position_modifier = config.current_config.global_settings.modifiers.global_position_modifier; + local _position = { - x = position.x * config.current_config.global_settings.modifiers.global_position_modifier; - y = position.y * config.current_config.global_settings.modifiers.global_position_modifier; + x = position.x * global_position_modifier; + y = position.y * global_position_modifier; } -- top left diff --git a/reframework/autorun/MHR_Overlay/Game_Handler/time.lua b/reframework/autorun/MHR_Overlay/Game_Handler/time.lua index 57e1f7c..c8452fb 100644 --- a/reframework/autorun/MHR_Overlay/Game_Handler/time.lua +++ b/reframework/autorun/MHR_Overlay/Game_Handler/time.lua @@ -43,21 +43,23 @@ function time.tick() end function time.update_players_dps() + local cached_config = config.current_config.damage_meter_UI.settings; + local new_total_dps = 0; for _, _player in pairs(player.list) do if _player.join_time == -1 then _player.join_time = time.total_elapsed_seconds; end - if config.current_config.damage_meter_UI.settings.dps_mode == "Quest Time" then + if cached_config.dps_mode == "Quest Time" then if time.total_elapsed_seconds > 0 then _player.dps = _player.display.total_damage / time.total_elapsed_seconds; end - elseif config.current_config.damage_meter_UI.settings.dps_mode == "Join Time" then + elseif cached_config.dps_mode == "Join Time" then if time.total_elapsed_seconds - _player.join_time > 0 then _player.dps = _player.display.total_damage / (time.total_elapsed_seconds - _player.join_time); end - elseif config.current_config.damage_meter_UI.settings.dps_mode == "First Hit" then + elseif cached_config.dps_mode == "First Hit" then if time.total_elapsed_seconds - _player.first_hit_time > 0 then _player.dps = _player.display.total_damage / (time.total_elapsed_seconds - _player.first_hit_time); end diff --git a/reframework/autorun/MHR_Overlay/Misc/config.lua b/reframework/autorun/MHR_Overlay/Misc/config.lua index 69993e6..d447d8e 100644 --- a/reframework/autorun/MHR_Overlay/Misc/config.lua +++ b/reframework/autorun/MHR_Overlay/Misc/config.lua @@ -734,6 +734,7 @@ function config.init() include = { monster_name = true, + monster_id = false, crown = true, size = true, crown_thresholds = false @@ -1050,7 +1051,7 @@ function config.init() } }, - parts = { + body_parts = { visibility = false, offset = { @@ -1742,6 +1743,7 @@ function config.init() include = { monster_name = true, + monster_id = false, crown = true, size = true, crown_thresholds = false @@ -2058,7 +2060,7 @@ function config.init() } }, - parts = { + body_parts = { visibility = false, offset = { @@ -2732,6 +2734,7 @@ function config.init() include = { monster_name = true, + monster_id = false, crown = true, size = true, crown_thresholds = false diff --git a/reframework/autorun/MHR_Overlay/Misc/language.lua b/reframework/autorun/MHR_Overlay/Misc/language.lua index ef03fee..76a4277 100644 --- a/reframework/autorun/MHR_Overlay/Misc/language.lua +++ b/reframework/autorun/MHR_Overlay/Misc/language.lua @@ -41,6 +41,11 @@ language.default_language = { right_cutwing = "Cutwing R", head_mud = "Head (Mud)", + body_mud = "Body (Mud)", + arms_mud = "Arms (Mud)", + torso_mud = "Torso (Mud)", + left_leg_mud = "Leg L (Mud)", + right_leg_mud = "Leg R (Mud)", tail_mud = "Tail (Mud)", tail_windsac = "Tail (Windsac)", @@ -54,7 +59,9 @@ language.default_language = { dorsal_fin = "Dorsal Fin", carapace = "Carapace", spinning = "Spinning", - rock = "Rock" + rock = "Rock", + + tail_tip = "Tail Tip" }, ailments = { @@ -327,7 +334,9 @@ language.default_language = { break_health = "Break Health", break_health_percentage = "Break Health Percentage", loss_health = "Sever Health", - loss_health_percentage = "Sever Health Percentage" + loss_health_percentage = "Sever Health Percentage", + + monster_id = "Monster ID" } }; diff --git a/reframework/autorun/MHR_Overlay/Monsters/ailment_buildup.lua b/reframework/autorun/MHR_Overlay/Monsters/ailment_buildup.lua index 3e282f6..b841760 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/ailment_buildup.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/ailment_buildup.lua @@ -11,29 +11,32 @@ local table_helpers; local drawing; function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_screen, opacity_scale) - if not config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility then + local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + if not cached_config.visibility then return; end for id, ailment in pairs(monster.ailments) do if id == ailments.stun_id then - if not config.current_config.large_monster_UI.dynamic.ailment_buildups.filter.stun then + if not cached_config.filter.stun then goto continue; end elseif id == ailments.poison_id then - if not config.current_config.large_monster_UI.dynamic.ailment_buildups.filter.poison then + if not cached_config.filter.poison then goto continue; end elseif id == ailments.blast_id then - if not config.current_config.large_monster_UI.dynamic.ailment_buildups.filter.blast then + if not cached_config.filter.blast then goto continue; end else goto continue; end - if config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -61,8 +64,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre goto continue; end - if config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.type == "Normal" then - if config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.id < right.id; end); @@ -71,8 +74,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre return left.id > right.id; end); end - elseif config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup < right.buildup; end); @@ -81,8 +84,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre return left.buildup > right.buildup; end); end - elseif config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup_share < right.buildup_share; end); @@ -94,10 +97,10 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre end local ailment_name = ""; - if config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -107,8 +110,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre local last_j = 0; for j, _player in ipairs(displayed_players) do local ailment_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (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); @@ -119,8 +122,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre local total_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.x * last_j * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.y * last_j * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * 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); @@ -128,8 +131,8 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre 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 = { - x = total_buildup_position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = total_buildup_position_on_screen.y + 17 + config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, + y = total_buildup_position_on_screen.y + 17 + cached_config.ailment_spacing.y * global_scale_modifier }; ::continue:: @@ -139,29 +142,32 @@ function ailment_buildup.draw_dynamic(monster, ailment_buildups_position_on_scre end function ailment_buildup.draw_static(monster, ailment_buildups_position_on_screen, opacity_scale) - if not config.current_config.large_monster_UI.static.ailment_buildups.visibility then + local cached_config = config.current_config.large_monster_UI.static.ailment_buildups; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + if not cached_config.visibility then return; end for id, ailment in pairs(monster.ailments) do if id == ailments.stun_id then - if not config.current_config.large_monster_UI.static.ailment_buildups.filter.stun then + if not cached_config.filter.stun then goto continue; end elseif id == ailments.poison_id then - if not config.current_config.large_monster_UI.static.ailment_buildups.filter.poison then + if not cached_config.filter.poison then goto continue; end elseif id == ailments.blast_id then - if not config.current_config.large_monster_UI.static.ailment_buildups.filter.blast then + if not cached_config.filter.blast then goto continue; end else goto continue; end - if config.current_config.large_monster_UI.static.ailment_buildups.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.static.ailment_buildups.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -189,8 +195,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree goto continue; end - if config.current_config.large_monster_UI.static.ailment_buildups.sorting.type == "Normal" then - if config.current_config.large_monster_UI.static.ailment_buildups.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.id < right.id; end); @@ -199,8 +205,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree return left.id > right.id; end); end - elseif config.current_config.large_monster_UI.static.ailment_buildups.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.static.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup < right.buildup; end); @@ -209,8 +215,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree return left.buildup > right.buildup; end); end - elseif config.current_config.large_monster_UI.static.ailment_buildups.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.static.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup_share < right.buildup_share; end); @@ -222,10 +228,10 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree end local ailment_name = ""; - if config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -234,8 +240,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree local last_j = 0; for j, _player in ipairs(displayed_players) do local ailment_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (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); @@ -244,8 +250,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree end local total_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.x * last_j * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.y * last_j * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * 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); @@ -253,8 +259,8 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree 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 = { - x = total_buildup_position_on_screen.x + config.current_config.large_monster_UI.static.ailment_buildups.ailment_spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = total_buildup_position_on_screen.y + 17 + config.current_config.large_monster_UI.static.ailment_buildups.ailment_spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, + y = total_buildup_position_on_screen.y + 17 + cached_config.ailment_spacing.y * global_scale_modifier }; ::continue:: @@ -264,29 +270,32 @@ function ailment_buildup.draw_static(monster, ailment_buildups_position_on_scree end function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_screen, opacity_scale) - if not config.current_config.large_monster_UI.highlighted.ailment_buildups.visibility then + local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + if not cached_config.visibility then return; end for id, ailment in pairs(monster.ailments) do if id == ailments.stun_id then - if not config.current_config.large_monster_UI.highlighted.ailment_buildups.filter.stun then + if not cached_config.filter.stun then goto continue; end elseif id == ailments.poison_id then - if not config.current_config.large_monster_UI.highlighted.ailment_buildups.filter.poison then + if not cached_config.filter.poison then goto continue; end elseif id == ailments.blast_id then - if not config.current_config.large_monster_UI.highlighted.ailment_buildups.filter.blast then + if not cached_config.filter.blast then goto continue; end else goto continue; end - if config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -314,8 +323,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ goto continue; end - if config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.type == "Normal" then - if config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.id < right.id; end); @@ -324,8 +333,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ return left.id > right.id; end); end - elseif config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup < right.buildup; end); @@ -334,8 +343,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ return left.buildup > right.buildup; end); end - elseif config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup_share < right.buildup_share; end); @@ -347,10 +356,10 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ end local ailment_name = ""; - if config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -359,8 +368,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ local last_j = 0; for j, _player in ipairs(displayed_players) do local ailment_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (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); @@ -369,8 +378,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ end local total_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.x * last_j * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.y * last_j * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * 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); @@ -378,8 +387,8 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ 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 = { - x = total_buildup_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = total_buildup_position_on_screen.y + 17 + config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, + y = total_buildup_position_on_screen.y + 17 + cached_config.ailment_spacing.y * global_scale_modifier }; ::continue:: @@ -389,29 +398,32 @@ function ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_ end function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen, opacity_scale) - if not config.current_config.small_monster_UI.ailment_buildups.visibility then + local cached_config = config.current_config.small_monster_UI.ailment_buildups; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + if not cached_config.visibility then return; end for id, ailment in pairs(monster.ailments) do if id == ailments.stun_id then - if not config.current_config.small_monster_UI.ailment_buildups.filter.stun then + if not cached_config.filter.stun then goto continue; end elseif id == ailments.poison_id then - if not config.current_config.small_monster_UI.ailment_buildups.filter.poison then + if not cached_config.filter.poison then goto continue; end elseif id == ailments.blast_id then - if not config.current_config.small_monster_UI.ailment_buildups.filter.blast then + if not cached_config.filter.blast then goto continue; end else goto continue; end - if config.current_config.small_monster_UI.ailment_buildups.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.small_monster_UI.ailment_buildups.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -439,8 +451,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen goto continue; end - if config.current_config.small_monster_UI.ailment_buildups.sorting.type == "Normal" then - if config.current_config.small_monster_UI.ailment_buildups.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.id < right.id; end); @@ -449,8 +461,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen return left.id > right.id; end); end - elseif config.current_config.small_monster_UI.ailment_buildups.sorting.type == "Buildup" then - if config.current_config.small_monster_UI.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup < right.buildup; end); @@ -459,8 +471,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen return left.buildup > right.buildup; end); end - elseif config.current_config.small_monster_UI.ailment_buildups.sorting.type == "Buildup Percentage" then - if config.current_config.small_monster_UI.ailment_buildups.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_players, function(left, right) return left.buildup_share < right.buildup_share; end); @@ -472,10 +484,10 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen end local ailment_name = ""; - if config.current_config.small_monster_UI.ailment_buildups.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.small_monster_UI.ailment_buildups.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -484,8 +496,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen local last_j = 0; for j, _player in ipairs(displayed_players) do local ailment_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.small_monster_UI.ailment_buildups.player_spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.small_monster_UI.ailment_buildups.player_spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (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); @@ -494,8 +506,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen end local total_buildup_position_on_screen = { - x = ailment_buildups_position_on_screen.x + config.current_config.small_monster_UI.ailment_buildups.player_spacing.x * last_j * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailment_buildups_position_on_screen.y + config.current_config.small_monster_UI.ailment_buildups.player_spacing.y * last_j * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * 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); @@ -503,8 +515,8 @@ function ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen 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 = { - x = total_buildup_position_on_screen.x + config.current_config.small_monster_UI.ailment_buildups.ailment_spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = total_buildup_position_on_screen.y + 17 + config.current_config.small_monster_UI.ailment_buildups.ailment_spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = total_buildup_position_on_screen.x + cached_config.ailment_spacing.x * global_scale_modifier, + y = total_buildup_position_on_screen.y + 17 + cached_config.ailment_spacing.y * global_scale_modifier }; ::continue:: diff --git a/reframework/autorun/MHR_Overlay/Monsters/ailment_hook.lua b/reframework/autorun/MHR_Overlay/Monsters/ailment_hook.lua index d65d959..21eb39e 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/ailment_hook.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/ailment_hook.lua @@ -20,18 +20,6 @@ local stock_damage_method = enemy_damage_param_type_def:get_method("stockDamage" local poison_param_field = enemy_damage_param_type_def:get_field("_PoisonParam"); local blast_param_field = enemy_damage_param_type_def:get_field("_BlastParam"); -sdk.hook(stock_damage_method, function(args) - pcall(ailment_hook.stock_damage); -end, function(retval) - return retval; -end); - -sdk.hook(on_poison_activate_proc_method, function(args) - pcall(ailment_hook.poison_proc, sdk.to_managed_object(args[2])); -end, function(retval) - return retval; -end); - function ailment_hook.poison_proc(poison_param) if poison_param == nil then return; @@ -54,7 +42,7 @@ function ailment_hook.poison_proc(poison_param) monster = small_monster.get_monster(enemy); end - monster.ailments[ailments.poison_id].cashed_buildup_share = monster.ailments[ailments.poison_id].buildup_share; + monster.ailments[ailments.poison_id].cached_buildup_share = monster.ailments[ailments.poison_id].buildup_share; ailments.clear_ailment_contribution(monster, ailments.poison_id); end @@ -92,6 +80,18 @@ function ailment_hook.init_module() config = require("MHR_Overlay.Misc.config"); ailments = require("MHR_Overlay.Monsters.ailments"); table_helpers = require("MHR_Overlay.Misc.table_helpers"); + + sdk.hook(stock_damage_method, function(args) + pcall(ailment_hook.stock_damage); + end, function(retval) + return retval; + end); + + sdk.hook(on_poison_activate_proc_method, function(args) + pcall(ailment_hook.poison_proc, sdk.to_managed_object(args[2])); + end, function(retval) + return retval; + end); end return ailment_hook; \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Monsters/ailments.lua b/reframework/autorun/MHR_Overlay/Monsters/ailments.lua index b4dc45d..dbdb9d5 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/ailments.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/ailments.lua @@ -140,7 +140,7 @@ function ailments.init_ailments() _ailments[ailments.poison_id].buildup = {}; _ailments[ailments.poison_id].buildup_share = {}; - _ailments[ailments.poison_id].cashed_buildup_share = {}; + _ailments[ailments.poison_id].cached_buildup_share = {}; _ailments[ailments.blast_id].buildup = {}; _ailments[ailments.blast_id].buildup_share = {}; @@ -161,54 +161,62 @@ function ailments.init_ailment_buildup_UI(_ailments) end function ailments.init_ailment_buildup_dynamic_UI(_ailments) + local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups; + _ailments[ailments.stun_id].ailment_buildup_dynamic_UI = ailment_buildup_UI_entity.new( - config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar, - config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar, - config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label, - config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label, - config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label, - config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label, - config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label, - config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label + cached_config.buildup_bar, + cached_config.highlighted_buildup_bar, + cached_config.ailment_name_label, + cached_config.player_name_label, + cached_config.buildup_value_label, + cached_config.buildup_percentage_label, + cached_config.total_buildup_label, + cached_config.total_buildup_value_label ); end function ailments.init_ailment_buildup_static_UI(_ailments) + local cached_config = config.current_config.large_monster_UI.static.ailment_buildups; + _ailments[ailments.stun_id].ailment_buildup_static_UI = ailment_buildup_UI_entity.new( - config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar, - config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar, - config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label, - config.current_config.large_monster_UI.static.ailment_buildups.player_name_label, - config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label, - config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label, - config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label, - config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label + cached_config.buildup_bar, + cached_config.highlighted_buildup_bar, + cached_config.ailment_name_label, + cached_config.player_name_label, + cached_config.buildup_value_label, + cached_config.buildup_percentage_label, + cached_config.total_buildup_label, + cached_config.total_buildup_value_label ); end function ailments.init_ailment_buildup_highlighted_UI(_ailments) + local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups; + _ailments[ailments.stun_id].ailment_buildup_highlighted_UI = ailment_buildup_UI_entity.new( - config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar, - config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar, - config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label, - config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label, - config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label, - config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label, - config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label, - config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label + cached_config.buildup_bar, + cached_config.highlighted_buildup_bar, + cached_config.ailment_name_label, + cached_config.player_name_label, + cached_config.buildup_value_label, + cached_config.buildup_percentage_label, + cached_config.total_buildup_label, + cached_config.total_buildup_value_label ); end function ailments.init_ailment_buildup_small_UI(_ailments) + local cached_config = config.current_config.small_monster_UI.ailment_buildups; + _ailments[ailments.stun_id].ailment_buildup_small_UI = ailment_buildup_UI_entity.new( - config.current_config.small_monster_UI.ailment_buildups.buildup_bar, - config.current_config.small_monster_UI.ailment_buildups.highlighted_buildup_bar, - config.current_config.small_monster_UI.ailment_buildups.ailment_name_label, - config.current_config.small_monster_UI.ailment_buildups.player_name_label, - config.current_config.small_monster_UI.ailment_buildups.buildup_value_label, - config.current_config.small_monster_UI.ailment_buildups.buildup_percentage_label, - config.current_config.small_monster_UI.ailment_buildups.total_buildup_label, - config.current_config.small_monster_UI.ailment_buildups.total_buildup_value_label + cached_config.buildup_bar, + cached_config.highlighted_buildup_bar, + cached_config.ailment_name_label, + cached_config.player_name_label, + cached_config.buildup_value_label, + cached_config.buildup_percentage_label, + cached_config.total_buildup_label, + cached_config.total_buildup_value_label ); end @@ -253,7 +261,7 @@ function ailments.update_ailments(enemy, monster) end ailments.update_stun_poison_blast_ailments(monster, damage_param); - + 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.highlighted.ailments.visibility @@ -276,6 +284,7 @@ function ailments.update_ailments(enemy, monster) return; end + for index, ailment_param in ipairs(condition_param_table) do local id = index - 1; if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then @@ -307,7 +316,7 @@ end function ailments.update_ailment(monster, ailment_param, id) 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"); + 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_limit = get_limit_method:call(ailment_param):get_element(0):get_field("mValue"); local timer = get_active_timer_method:call(ailment_param); @@ -315,13 +324,16 @@ function ailments.update_ailment(monster, ailment_param, id) local is_active = get_is_active_method:call(ailment_param); if is_enable ~= nil then - if is_enable ~= monster.ailments[id].is_enable then - ailments.update_last_change_time(monster, id); - end - - monster.ailments[id].is_enable = is_enable; + 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); @@ -435,30 +447,33 @@ function ailments.update_poison_blast(monster, poison_param, blast_param) end function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.dynamic.ailments; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + --sort parts here local displayed_ailments = {}; for REpart, ailment in pairs(monster.ailments) do - if config.current_config.large_monster_UI.dynamic.ailments.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 ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.dynamic.ailments.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 not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.dynamic.ailments.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; end - if config.current_config.large_monster_UI.dynamic.ailments.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; end - if config.current_config.large_monster_UI.dynamic.ailments.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; end - if config.current_config.large_monster_UI.dynamic.ailments.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.dynamic.ailments.settings.time_limit and not ailment.is_active then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then goto continue; end @@ -467,8 +482,8 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca end - if config.current_config.large_monster_UI.dynamic.ailments.sorting.type == "Normal" then - if config.current_config.large_monster_UI.dynamic.ailments.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.id > right.id; end); @@ -477,8 +492,8 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.dynamic.ailments.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.dynamic.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.total_buildup > right.total_buildup; end); @@ -487,8 +502,8 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca return left.total_buildup < right.total_buildup; end); end - elseif config.current_config.large_monster_UI.dynamic.ailments.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.dynamic.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.buildup_percentage > right.buildup_percentage; end); @@ -501,8 +516,8 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca for j, ailment in ipairs(displayed_ailments) do local ailment_position_on_screen = { - x = ailments_position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailments.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailments_position_on_screen.y + config.current_config.large_monster_UI.dynamic.ailments.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailments_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = ailments_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } ailment_UI_entity.draw_dynamic(ailment, monster.ailment_dynamic_UI, ailment_position_on_screen, opacity_scale); end @@ -511,31 +526,33 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca end function ailments.draw_static(monster, ailments_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.static.ailments; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; --sort parts here local displayed_ailments = {}; for REpart, ailment in pairs(monster.ailments) do - if config.current_config.large_monster_UI.static.ailments.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 ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.static.ailments.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 not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.static.ailments.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; end - if config.current_config.large_monster_UI.static.ailments.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; end - if config.current_config.large_monster_UI.static.ailments.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; end - if config.current_config.large_monster_UI.static.ailments.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.static.ailments.settings.time_limit and not ailment.is_active then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then goto continue; end @@ -544,8 +561,8 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal end - if config.current_config.large_monster_UI.static.ailments.sorting.type == "Normal" then - if config.current_config.large_monster_UI.static.ailments.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.id > right.id; end); @@ -554,8 +571,8 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.static.ailments.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.static.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.total_buildup > right.total_buildup; end); @@ -564,8 +581,8 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal return left.total_buildup < right.total_buildup; end); end - elseif config.current_config.large_monster_UI.static.ailments.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.static.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.buildup_percentage > right.buildup_percentage; end); @@ -578,8 +595,8 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal for j, ailment in ipairs(displayed_ailments) do local ailment_position_on_screen = { - x = ailments_position_on_screen.x + config.current_config.large_monster_UI.static.ailments.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailments_position_on_screen.y + config.current_config.large_monster_UI.static.ailments.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailments_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = ailments_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } ailment_UI_entity.draw_static(ailment, monster.ailment_static_UI, ailment_position_on_screen, opacity_scale); @@ -587,30 +604,33 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal end function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.highlighted.ailments; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + --sort parts here local displayed_ailments = {}; for id, ailment in pairs(monster.ailments) do - if config.current_config.large_monster_UI.highlighted.ailments.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 ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.highlighted.ailments.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 not ailment.is_active then goto continue; end - if config.current_config.large_monster_UI.highlighted.ailments.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; end - if config.current_config.large_monster_UI.highlighted.ailments.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; end - if config.current_config.large_monster_UI.highlighted.ailments.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; end - if config.current_config.large_monster_UI.highlighted.ailments.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.large_monster_UI.highlighted.ailments.settings.time_limit and not ailment.is_active then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then goto continue; end @@ -618,8 +638,8 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity ::continue:: end - if config.current_config.large_monster_UI.highlighted.ailments.sorting.type == "Normal" then - if config.current_config.large_monster_UI.highlighted.ailments.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.id > right.id; end); @@ -628,8 +648,8 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.highlighted.ailments.sorting.type == "Buildup" then - if config.current_config.large_monster_UI.highlighted.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.total_buildup > right.total_buildup; end); @@ -638,8 +658,8 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity return left.total_buildup < right.total_buildup; end); end - elseif config.current_config.large_monster_UI.highlighted.ailments.sorting.type == "Buildup Percentage" then - if config.current_config.large_monster_UI.highlighted.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) return left.buildup_percentage > right.buildup_percentage; end); @@ -652,8 +672,8 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity for j, ailment in ipairs(displayed_ailments) do local ailment_position_on_screen = { - x = ailments_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailments_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailments_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = ailments_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } ailment_UI_entity.draw_highlighted(ailment, monster.ailment_highlighted_UI, ailment_position_on_screen, opacity_scale); @@ -661,30 +681,33 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity end function ailments.draw_small(monster, ailments_position_on_screen, opacity_scale) + local cached_config = config.current_config.small_monster_UI.ailments; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + --sort parts here local displayed_ailments = {}; for REpart, ailment in pairs(monster.ailments) do - if config.current_config.small_monster_UI.ailments.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 ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then goto continue; end - if config.current_config.small_monster_UI.ailments.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 not ailment.is_active then goto continue; end - if config.current_config.small_monster_UI.ailments.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; end - if config.current_config.small_monster_UI.ailments.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; end - if config.current_config.small_monster_UI.ailments.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; end - if config.current_config.small_monster_UI.ailments.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > config.current_config.small_monster_UI.ailments.settings.time_limit and not ailment.is_active then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then goto continue; end @@ -693,39 +716,39 @@ function ailments.draw_small(monster, ailments_position_on_screen, opacity_scale end - if config.current_config.small_monster_UI.ailments.sorting.type == "Normal" then - if config.current_config.small_monster_UI.ailments.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return false; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return false; end return left.id > right.id; end); else table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return true; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return true; end return left.id < right.id; end); end - elseif config.current_config.small_monster_UI.ailments.sorting.type == "Buildup" then - if config.current_config.small_monster_UI.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return false; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return false; end return left.total_buildup > right.total_buildup; end); else table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return true; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return true; end return left.total_buildup < right.total_buildup; end); end - elseif config.current_config.small_monster_UI.ailments.sorting.type == "Buildup Percentage" then - if config.current_config.small_monster_UI.ailments.sorting.reversed_order then + elseif cached_config.sorting.type == "Buildup Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return false; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return false; end return left.buildup_percentage > right.buildup_percentage; end); else table.sort(displayed_ailments, function(left, right) - if config.current_config.small_monster_UI.ailments.settings.prioritize_active_ailments and left.is_active then return true; end + if cached_config.settings.prioritize_active_ailments and left.is_active then return true; end return left.buildup_percentage < right.buildup_percentage; end); end @@ -733,8 +756,8 @@ function ailments.draw_small(monster, ailments_position_on_screen, opacity_scale for j, ailment in ipairs(displayed_ailments) do local ailment_position_on_screen = { - x = ailments_position_on_screen.x + config.current_config.small_monster_UI.ailments.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = ailments_position_on_screen.y + config.current_config.small_monster_UI.ailments.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = ailments_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = ailments_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } diff --git a/reframework/autorun/MHR_Overlay/Monsters/body_part.lua b/reframework/autorun/MHR_Overlay/Monsters/body_part.lua index a53b258..2fe705b 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/body_part.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/body_part.lua @@ -46,93 +46,105 @@ end function body_part.init_dynamic_UI(part) + local cached_config = config.current_config.large_monster_UI.dynamic.body_parts; + part.body_part_dynamic_UI = body_part_UI_entity.new( - config.current_config.large_monster_UI.dynamic.body_parts.visibility, - config.current_config.large_monster_UI.dynamic.body_parts.part_name_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_health.visibility, - config.current_config.large_monster_UI.dynamic.body_parts.part_health.bar, - config.current_config.large_monster_UI.dynamic.body_parts.part_health.text_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_health.value_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_health.percentage_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_break.visibility, - config.current_config.large_monster_UI.dynamic.body_parts.part_break.bar, - config.current_config.large_monster_UI.dynamic.body_parts.part_break.text_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_break.value_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_break.percentage_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_loss.visibility, - config.current_config.large_monster_UI.dynamic.body_parts.part_loss.bar, - config.current_config.large_monster_UI.dynamic.body_parts.part_loss.text_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_loss.value_label, - config.current_config.large_monster_UI.dynamic.body_parts.part_loss.percentage_label + cached_config.visibility, + cached_config.part_name_label, + cached_config.part_health.visibility, + cached_config.part_health.bar, + cached_config.part_health.text_label, + cached_config.part_health.value_label, + cached_config.part_health.percentage_label, + cached_config.part_break.visibility, + cached_config.part_break.bar, + cached_config.part_break.text_label, + cached_config.part_break.value_label, + cached_config.part_break.percentage_label, + cached_config.part_loss.visibility, + cached_config.part_loss.bar, + cached_config.part_loss.text_label, + cached_config.part_loss.value_label, + cached_config.part_loss.percentage_label ); end function body_part.init_static_UI(part) + local cached_config = config.current_config.large_monster_UI.static.body_parts; + part.body_part_static_UI = body_part_UI_entity.new( - config.current_config.large_monster_UI.static.body_parts.visibility, - config.current_config.large_monster_UI.static.body_parts.part_name_label, - config.current_config.large_monster_UI.static.body_parts.part_health.visibility, - config.current_config.large_monster_UI.static.body_parts.part_health.bar, - config.current_config.large_monster_UI.static.body_parts.part_health.text_label, - config.current_config.large_monster_UI.static.body_parts.part_health.value_label, - config.current_config.large_monster_UI.static.body_parts.part_health.percentage_label, - config.current_config.large_monster_UI.static.body_parts.part_break.visibility, - config.current_config.large_monster_UI.static.body_parts.part_break.bar, - config.current_config.large_monster_UI.static.body_parts.part_break.text_label, - config.current_config.large_monster_UI.static.body_parts.part_break.value_label, - config.current_config.large_monster_UI.static.body_parts.part_break.percentage_label, - config.current_config.large_monster_UI.static.body_parts.part_loss.visibility, - config.current_config.large_monster_UI.static.body_parts.part_loss.bar, - config.current_config.large_monster_UI.static.body_parts.part_loss.text_label, - config.current_config.large_monster_UI.static.body_parts.part_loss.value_label, - config.current_config.large_monster_UI.static.body_parts.part_loss.percentage_label + cached_config.visibility, + cached_config.part_name_label, + cached_config.part_health.visibility, + cached_config.part_health.bar, + cached_config.part_health.text_label, + cached_config.part_health.value_label, + cached_config.part_health.percentage_label, + cached_config.part_break.visibility, + cached_config.part_break.bar, + cached_config.part_break.text_label, + cached_config.part_break.value_label, + cached_config.part_break.percentage_label, + cached_config.part_loss.visibility, + cached_config.part_loss.bar, + cached_config.part_loss.text_label, + cached_config.part_loss.value_label, + cached_config.part_loss.percentage_label ); end function body_part.init_highlighted_UI(part) + local cached_config = config.current_config.large_monster_UI.highlighted.body_parts; + part.body_part_highlighted_UI = body_part_UI_entity.new( - config.current_config.large_monster_UI.highlighted.body_parts.visibility, - config.current_config.large_monster_UI.highlighted.body_parts.part_name_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_health.visibility, - config.current_config.large_monster_UI.highlighted.body_parts.part_health.bar, - config.current_config.large_monster_UI.highlighted.body_parts.part_health.text_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_health.value_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_health.percentage_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_break.visibility, - config.current_config.large_monster_UI.highlighted.body_parts.part_break.bar, - config.current_config.large_monster_UI.highlighted.body_parts.part_break.text_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_break.value_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_break.percentage_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_loss.visibility, - config.current_config.large_monster_UI.highlighted.body_parts.part_loss.bar, - config.current_config.large_monster_UI.highlighted.body_parts.part_loss.text_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_loss.value_label, - config.current_config.large_monster_UI.highlighted.body_parts.part_loss.percentage_label + cached_config.visibility, + cached_config.part_name_label, + cached_config.part_health.visibility, + cached_config.part_health.bar, + cached_config.part_health.text_label, + cached_config.part_health.value_label, + cached_config.part_health.percentage_label, + cached_config.part_break.visibility, + cached_config.part_break.bar, + cached_config.part_break.text_label, + cached_config.part_break.value_label, + cached_config.part_break.percentage_label, + cached_config.part_loss.visibility, + cached_config.part_loss.bar, + cached_config.part_loss.text_label, + cached_config.part_loss.value_label, + cached_config.part_loss.percentage_label ); end -function body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed) - if part == nil then - return; - end - +function body_part.update_flinch(part, part_current, part_max) if part_current > part.health then part.flinch_count = part.flinch_count + 1; end - if part_break_current > part.break_health then - part.break_count = part.break_count + 1; - end - if part.health ~= part_current then part.last_change_time = time.total_elapsed_seconds; end + if part.max_health ~= part_max then + part.last_change_time = time.total_elapsed_seconds; + end + + part.health = part_current; + part.max_health = part_max; + + if part.max_health ~= 0 then + part.health_percentage = part.health / part.max_health; + end +end + +function body_part.update_break(part, part_break_current, part_break_max, part_break_count, part_break_max_count) + if part.break_health ~= part_break_current then part.last_change_time = time.total_elapsed_seconds; end - if part.loss_health ~= part_loss_current then + if part.break_max_health ~= part_break_max then part.last_change_time = time.total_elapsed_seconds; end @@ -143,31 +155,35 @@ function body_part.update(part, part_current, part_max, part_break_current, part if part.break_max_count ~= part_break_max_count then part.last_change_time = time.total_elapsed_seconds; end - - if part.is_severed ~= is_severed then - part.last_change_time = time.total_elapsed_seconds; - end - part.health = part_current; - part.max_health = part_max; - part.break_health = part_break_current; part.break_max_health = part_break_max; - part.loss_health = part_loss_current; - part.loss_max_health = part_loss_max; - part.break_count = part_break_count; part.break_max_count = part_break_max_count; - part.is_severed = is_severed; - - if part.max_health ~= 0 then - part.health_percentage = part.health / part.max_health; - end if part.break_max_health ~= 0 then part.break_health_percentage = part.break_health / part.break_max_health; end +end + +function body_part.update_loss(part, part_loss_current, part_loss_max, is_severed) + if part.loss_health ~= part_loss_current then + part.last_change_time = time.total_elapsed_seconds; + end + + if part.loss_max_health ~= part_loss_max then + part.last_change_time = time.total_elapsed_seconds; + end + + if part.is_severed ~= is_severed then + part.last_change_time = time.total_elapsed_seconds; + end + + part.loss_health = part_loss_current; + part.loss_max_health = part_loss_max; + + part.is_severed = is_severed; if part.loss_max_health ~= 0 then part.loss_health_percentage = part.loss_health / part.loss_max_health; @@ -176,22 +192,25 @@ function body_part.update(part, part_current, part_max, part_break_current, part end function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.dynamic.body_parts; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local displayed_parts = {}; for REpart, part in pairs(monster.parts) do - if config.current_config.large_monster_UI.dynamic.body_parts.settings.hide_undamaged_parts - and part.health == part.max_health and part.flinch_count == 0 + if cached_config.settings.hide_undamaged_parts + and ((part.health == part.max_health and part.flinch_count == 0) or part.max_health < 0) and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0) and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then goto continue; end - if (not part.body_part_dynamic_UI.flinch_visibility) + if (not part.body_part_dynamic_UI.flinch_visibility or part.max_health < 0) and (not part.body_part_dynamic_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count) and (not part.body_part_dynamic_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then goto continue; end - if config.current_config.large_monster_UI.dynamic.body_parts.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > config.current_config.large_monster_UI.dynamic.body_parts.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -199,8 +218,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale ::continue:: end - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Normal" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.id > right.id; end); @@ -209,8 +228,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Health" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health > right.health; end); @@ -219,8 +238,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.health < right.health; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Health Percentage" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health_percentage > right.health_percentage; end); @@ -229,8 +248,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.health_percentage < right.health_percentage; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Flinch Count" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Flinch Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.flinch_count > right.flinch_count; end); @@ -239,8 +258,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.flinch_count < right.flinch_count; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Break Health" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health > right.break_health; end); @@ -249,8 +268,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.break_health < right.break_health; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Break Health Percentage" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health_percentage > right.break_health_percentage; end); @@ -259,8 +278,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.break_health_percentage < right.break_health_percentage; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Break Count" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_count > right.break_count; end); @@ -269,8 +288,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.break_count < right.break_count; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Sever Health" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health > right.loss_health; end); @@ -279,8 +298,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale return left.loss_health < right.loss_health; end); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.sorting.type == "Sever Health Percentage" then - if config.current_config.large_monster_UI.dynamic.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health_percentage > right.loss_health_percentage; end); @@ -295,8 +314,8 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale for j, part in ipairs(displayed_parts) do local part_position_on_screen = { - x = parts_position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = parts_position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = parts_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = parts_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } body_part_UI_entity.draw_dynamic(part, part_position_on_screen, opacity_scale); @@ -307,23 +326,25 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale end function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.static.body_parts; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local displayed_parts = {}; for REpart, part in pairs(monster.parts) do - if config.current_config.large_monster_UI.static.body_parts.settings.hide_undamaged_parts - and part.health == part.max_health and part.flinch_count == 0 + if cached_config.settings.hide_undamaged_parts + and ((part.health == part.max_health and part.flinch_count == 0) or part.max_health < 0) and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0) and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then goto continue; end - if (not part.body_part_static_UI.flinch_visibility) + if (not part.body_part_static_UI.flinch_visibility or part.max_health < 0) and (not part.body_part_static_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count) and (not part.body_part_static_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then goto continue; end - if config.current_config.large_monster_UI.static.body_parts.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > config.current_config.large_monster_UI.static.body_parts.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -331,8 +352,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) ::continue:: end - if config.current_config.large_monster_UI.static.body_parts.sorting.type == "Normal" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.id > right.id; end); @@ -341,8 +362,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Health" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health > right.health; end); @@ -351,8 +372,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.health < right.health; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Health Percentage" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health_percentage > right.health_percentage; end); @@ -361,8 +382,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.health_percentage < right.health_percentage; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Flinch Count" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Flinch Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.flinch_count > right.flinch_count; end); @@ -371,8 +392,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.flinch_count < right.flinch_count; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Break Health" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health > right.break_health; end); @@ -381,8 +402,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.break_health < right.break_health; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Break Health Percentage" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health_percentage > right.break_health_percentage; end); @@ -391,8 +412,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.break_health_percentage < right.break_health_percentage; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Break Count" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_count > right.break_count; end); @@ -401,8 +422,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.break_count < right.break_count; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Sever Health" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health > right.loss_health; end); @@ -411,8 +432,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) return left.loss_health < right.loss_health; end); end - elseif config.current_config.large_monster_UI.static.body_parts.sorting.type == "Sever Health Percentage" then - if config.current_config.large_monster_UI.static.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health_percentage > right.loss_health_percentage; end); @@ -427,8 +448,8 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) for j, part in ipairs(displayed_parts) do local part_position_on_screen = { - x = parts_position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = parts_position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = parts_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = parts_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; } body_part_UI_entity.draw_static(part, part_position_on_screen, opacity_scale); @@ -439,22 +460,25 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale) end function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.highlighted.body_parts; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local displayed_parts = {}; for REpart, part in pairs(monster.parts) do - if config.current_config.large_monster_UI.highlighted.body_parts.settings.hide_undamaged_parts - and part.health == part.max_health and part.flinch_count == 0 + if cached_config.settings.hide_undamaged_parts + and ((part.health == part.max_health and part.flinch_count == 0) or part.max_health < 0) and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0) and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then goto continue; end - if (not part.body_part_highlighted_UI.flinch_visibility) + if (not part.body_part_highlighted_UI.flinch_visibility or part.max_health < 0) and (not part.body_part_highlighted_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count) and (not part.body_part_highlighted_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then goto continue; end - if config.current_config.large_monster_UI.highlighted.body_parts.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > config.current_config.large_monster_UI.highlighted.body_parts.settings.time_limit then + if cached_config.settings.time_limit ~= 0 and time.total_elapsed_seconds - part.last_change_time > cached_config.settings.time_limit then goto continue; end @@ -462,8 +486,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s ::continue:: end - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Normal" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + if cached_config.sorting.type == "Normal" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.id > right.id; end); @@ -472,8 +496,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.id < right.id; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Health" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health > right.health; end); @@ -482,8 +506,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.health < right.health; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Health Percentage" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.health_percentage > right.health_percentage; end); @@ -492,8 +516,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.health_percentage < right.health_percentage; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Flinch Count" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Flinch Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.flinch_count > right.flinch_count; end); @@ -502,8 +526,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.flinch_count < right.flinch_count; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Break Health" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health > right.break_health; end); @@ -512,8 +536,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.break_health < right.break_health; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Break Health Percentage" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_health_percentage > right.break_health_percentage; end); @@ -522,8 +546,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.break_health_percentage < right.break_health_percentage; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Break Count" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Break Count" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.break_count > right.break_count; end); @@ -532,8 +556,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.break_count < right.break_count; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Sever Health" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health > right.loss_health; end); @@ -542,8 +566,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s return left.loss_health < right.loss_health; end); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.sorting.type == "Sever Health Percentage" then - if config.current_config.large_monster_UI.highlighted.body_parts.sorting.reversed_order then + elseif cached_config.sorting.type == "Sever Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_parts, function(left, right) return left.loss_health_percentage > right.loss_health_percentage; end); @@ -558,8 +582,8 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s for j, part in ipairs(displayed_parts) do local part_position_on_screen = { - x = parts_position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier, - y = parts_position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier; + x = parts_position_on_screen.x + cached_config.spacing.x * (j - 1) * global_scale_modifier, + y = parts_position_on_screen.y + cached_config.spacing.y * (j - 1) * global_scale_modifier; }; body_part_UI_entity.draw_highlighted(part, part_position_on_screen, opacity_scale); diff --git a/reframework/autorun/MHR_Overlay/Monsters/large_monster.lua b/reframework/autorun/MHR_Overlay/Monsters/large_monster.lua index 5d00b29..60d915f 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/large_monster.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/large_monster.lua @@ -170,38 +170,41 @@ function large_monster.init(monster, enemy) end function large_monster.init_dynamic_UI(monster) - monster.dynamic_name_label = table_helpers.deep_copy(config.current_config.large_monster_UI.dynamic.monster_name_label); + local cached_config = config.current_config.large_monster_UI.dynamic; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + monster.dynamic_name_label = table_helpers.deep_copy(cached_config.monster_name_label); monster.health_dynamic_UI = health_UI_entity.new( - config.current_config.large_monster_UI.dynamic.health.visibility, - config.current_config.large_monster_UI.dynamic.health.bar, - config.current_config.large_monster_UI.dynamic.health.text_label, - config.current_config.large_monster_UI.dynamic.health.value_label, - config.current_config.large_monster_UI.dynamic.health.percentage_label + cached_config.health.visibility, + cached_config.health.bar, + cached_config.health.text_label, + cached_config.health.value_label, + cached_config.health.percentage_label ); - monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + 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.y = monster.health_dynamic_UI.bar.capture_line.offset.y * 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 = config.current_config.large_monster_UI.dynamic.health.bar.normal_colors; + monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors; monster.stamina_dynamic_UI = stamina_UI_entity.new( - config.current_config.large_monster_UI.dynamic.stamina.visibility, - config.current_config.large_monster_UI.dynamic.stamina.bar, - config.current_config.large_monster_UI.dynamic.stamina.text_label, - config.current_config.large_monster_UI.dynamic.stamina.value_label, - config.current_config.large_monster_UI.dynamic.stamina.percentage_label + cached_config.stamina.visibility, + cached_config.stamina.bar, + cached_config.stamina.text_label, + cached_config.stamina.value_label, + cached_config.stamina.percentage_label ); monster.rage_dynamic_UI = rage_UI_entity.new( - config.current_config.large_monster_UI.dynamic.rage.visibility, - config.current_config.large_monster_UI.dynamic.rage.bar, - config.current_config.large_monster_UI.dynamic.rage.text_label, - config.current_config.large_monster_UI.dynamic.rage.value_label, - config.current_config.large_monster_UI.dynamic.rage.percentage_label, - config.current_config.large_monster_UI.dynamic.rage.timer_label + cached_config.rage.visibility, + cached_config.rage.bar, + cached_config.rage.text_label, + cached_config.rage.value_label, + cached_config.rage.percentage_label, + cached_config.rage.timer_label ); for REpart, part in pairs(monster.parts) do @@ -209,54 +212,57 @@ function large_monster.init_dynamic_UI(monster) end monster.ailment_dynamic_UI = ailment_UI_entity.new( - config.current_config.large_monster_UI.dynamic.ailments.visibility, - config.current_config.large_monster_UI.dynamic.ailments.bar, - config.current_config.large_monster_UI.dynamic.ailments.ailment_name_label, - config.current_config.large_monster_UI.dynamic.ailments.text_label, - config.current_config.large_monster_UI.dynamic.ailments.value_label, - config.current_config.large_monster_UI.dynamic.ailments.percentage_label, - config.current_config.large_monster_UI.dynamic.ailments.timer_label + cached_config.ailments.visibility, + cached_config.ailments.bar, + cached_config.ailments.ailment_name_label, + cached_config.ailments.text_label, + cached_config.ailments.value_label, + cached_config.ailments.percentage_label, + cached_config.ailments.timer_label ); ailments.init_ailment_buildup_dynamic_UI(monster.ailments); end function large_monster.init_static_UI(monster) - monster.static_name_label = table_helpers.deep_copy(config.current_config.large_monster_UI.static.monster_name_label); + local cached_config = config.current_config.large_monster_UI.static; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + monster.static_name_label = table_helpers.deep_copy(cached_config.monster_name_label); - monster.static_name_label.offset.x = monster.static_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.static_name_label.offset.y = monster.static_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + monster.static_name_label.offset.x = monster.static_name_label.offset.x * global_scale_modifier; + monster.static_name_label.offset.y = monster.static_name_label.offset.y * global_scale_modifier; monster.health_static_UI = health_UI_entity.new( - config.current_config.large_monster_UI.static.health.visibility, - config.current_config.large_monster_UI.static.health.bar, - config.current_config.large_monster_UI.static.health.text_label, - config.current_config.large_monster_UI.static.health.value_label, - config.current_config.large_monster_UI.static.health.percentage_label + cached_config.health.visibility, + cached_config.health.bar, + cached_config.health.text_label, + cached_config.health.value_label, + cached_config.health.percentage_label ); - monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + 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.y = monster.health_static_UI.bar.capture_line.offset.y * 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 = config.current_config.large_monster_UI.static.health.bar.normal_colors; + monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors; monster.stamina_static_UI = stamina_UI_entity.new( - config.current_config.large_monster_UI.static.stamina.visibility, - config.current_config.large_monster_UI.static.stamina.bar, - config.current_config.large_monster_UI.static.stamina.text_label, - config.current_config.large_monster_UI.static.stamina.value_label, - config.current_config.large_monster_UI.static.stamina.percentage_label + cached_config.stamina.visibility, + cached_config.stamina.bar, + cached_config.stamina.text_label, + cached_config.stamina.value_label, + cached_config.stamina.percentage_label ); monster.rage_static_UI = rage_UI_entity.new( - config.current_config.large_monster_UI.static.rage.visibility, - config.current_config.large_monster_UI.static.rage.bar, - config.current_config.large_monster_UI.static.rage.text_label, - config.current_config.large_monster_UI.static.rage.value_label, - config.current_config.large_monster_UI.static.rage.percentage_label, - config.current_config.large_monster_UI.static.rage.timer_label + cached_config.rage.visibility, + cached_config.rage.bar, + cached_config.rage.text_label, + cached_config.rage.value_label, + cached_config.rage.percentage_label, + cached_config.rage.timer_label ); for REpart, part in pairs(monster.parts) do @@ -264,51 +270,54 @@ function large_monster.init_static_UI(monster) end monster.ailment_static_UI = ailment_UI_entity.new( - config.current_config.large_monster_UI.static.ailments.visibility, - config.current_config.large_monster_UI.static.ailments.bar, - config.current_config.large_monster_UI.static.ailments.ailment_name_label, - config.current_config.large_monster_UI.static.ailments.text_label, - config.current_config.large_monster_UI.static.ailments.value_label, - config.current_config.large_monster_UI.static.ailments.percentage_label, - config.current_config.large_monster_UI.static.ailments.timer_label + cached_config.ailments.visibility, + cached_config.ailments.bar, + cached_config.ailments.ailment_name_label, + cached_config.ailments.text_label, + cached_config.ailments.value_label, + cached_config.ailments.percentage_label, + cached_config.ailments.timer_label ); ailments.init_ailment_buildup_static_UI(monster.ailments); end function large_monster.init_highlighted_UI(monster) - monster.highlighted_name_label = table_helpers.deep_copy(config.current_config.large_monster_UI.highlighted.monster_name_label); + local cached_config = config.current_config.large_monster_UI.highlighted; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + monster.highlighted_name_label = table_helpers.deep_copy(cached_config.monster_name_label); monster.health_highlighted_UI = health_UI_entity.new( - config.current_config.large_monster_UI.highlighted.health.visibility, - config.current_config.large_monster_UI.highlighted.health.bar, - config.current_config.large_monster_UI.highlighted.health.text_label, - config.current_config.large_monster_UI.highlighted.health.value_label, - config.current_config.large_monster_UI.highlighted.health.percentage_label + cached_config.health.visibility, + cached_config.health.bar, + cached_config.health.text_label, + cached_config.health.value_label, + cached_config.health.percentage_label ); - monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + 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.y = monster.health_highlighted_UI.bar.capture_line.offset.y * 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 = config.current_config.large_monster_UI.highlighted.health.bar.normal_colors; + monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors; monster.stamina_highlighted_UI = stamina_UI_entity.new( - config.current_config.large_monster_UI.highlighted.stamina.visibility, - config.current_config.large_monster_UI.highlighted.stamina.bar, - config.current_config.large_monster_UI.highlighted.stamina.text_label, - config.current_config.large_monster_UI.highlighted.stamina.value_label, - config.current_config.large_monster_UI.highlighted.stamina.percentage_label + cached_config.stamina.visibility, + cached_config.stamina.bar, + cached_config.stamina.text_label, + cached_config.stamina.value_label, + cached_config.stamina.percentage_label ); monster.rage_highlighted_UI = rage_UI_entity.new( - config.current_config.large_monster_UI.highlighted.rage.visibility, - config.current_config.large_monster_UI.highlighted.rage.bar, - config.current_config.large_monster_UI.highlighted.rage.text_label, - config.current_config.large_monster_UI.highlighted.rage.value_label, - config.current_config.large_monster_UI.highlighted.rage.percentage_label, - config.current_config.large_monster_UI.highlighted.rage.timer_label + cached_config.rage.visibility, + cached_config.rage.bar, + cached_config.rage.text_label, + cached_config.rage.value_label, + cached_config.rage.percentage_label, + cached_config.rage.timer_label ); for REpart, part in pairs(monster.parts) do @@ -316,13 +325,13 @@ function large_monster.init_highlighted_UI(monster) end monster.ailment_highlighted_UI = ailment_UI_entity.new( - config.current_config.large_monster_UI.highlighted.ailments.visibility, - config.current_config.large_monster_UI.highlighted.ailments.bar, - config.current_config.large_monster_UI.highlighted.ailments.ailment_name_label, - config.current_config.large_monster_UI.highlighted.ailments.text_label, - config.current_config.large_monster_UI.highlighted.ailments.value_label, - config.current_config.large_monster_UI.highlighted.ailments.percentage_label, - config.current_config.large_monster_UI.highlighted.ailments.timer_label + cached_config.ailments.visibility, + cached_config.ailments.bar, + cached_config.ailments.ailment_name_label, + cached_config.ailments.text_label, + cached_config.ailments.value_label, + cached_config.ailments.percentage_label, + cached_config.ailments.timer_label ); ailments.init_ailment_buildup_highlighted_UI(monster.ailments); @@ -339,7 +348,6 @@ local is_disp_icon_mini_map_method = enemy_character_base_type_def:get_method("i local physical_param_type = physical_param_field:get_type(); local get_vital_method = physical_param_type:get_method("getVital"); local get_capture_hp_vital_method = physical_param_type:get_method("get_CaptureHpVital"); -local vital_list_field = physical_param_type:get_field("_VitalList"); local vital_param_type = get_vital_method:get_return_type(); local get_current_method = vital_param_type:get_method("get_Current"); @@ -365,56 +373,18 @@ 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_game_object_method = sdk.find_type_definition("via.Component"):get_method("get_GameObject"); ---local get_transform_method = sdk.find_type_definition("via.GameObject"):get_method("get_Transform"); ---local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position"); - function large_monster.update_position(enemy) - if not config.current_config.large_monster_UI.dynamic.enabled then return; end local monster = large_monster.get_monster(enemy); - if not monster then + if monster == nil then return; end - local position = get_pos_field:call(enemy); - if position ~= nil then - monster.position = position; - end - - --[[ - -- cac - -- cache off the game object and transform - -- as these are pretty much guaranteed to stay constant - -- as long as the enemy is alive - if monster.game_object == nil then - monster.game_object = get_game_object_method:call(enemy); - if monster.game_object == nil then - customization_menu.status = "No enemy game object"; - return; - end - end - - if monster.transform == nil then - monster.transform = get_transform_method:call(monster.game_object); - if monster.transform == nil then - customization_menu.status = "No enemy transform"; - return; - end - end - - local position = get_position_method:call(monster.transform); - if not position then - customization_menu.status = "No enemy position"; - return; - end - - if position ~= nil then - monster.position = position; - end--]] + local position = get_pos_field:call(enemy) or monster.position; + monster.position = position; end -- Code by coavins @@ -436,9 +406,11 @@ function large_monster.update_all_riders() end function large_monster.update(enemy) - if not config.current_config.large_monster_UI.dynamic.enabled - and not config.current_config.large_monster_UI.static.enabled - and not config.current_config.large_monster_UI.highlighted.enabled then + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.enabled + and not cached_config.static.enabled + and not cached_config.highlighted.enabled then return; end @@ -448,29 +420,62 @@ function large_monster.update(enemy) local monster = large_monster.get_monster(enemy); + local dead_or_captured = check_die_method:call(enemy); + monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured; + local is_disp_icon_mini_map = is_disp_icon_mini_map_method:call(enemy) + monster.is_disp_icon_mini_map = (is_disp_icon_mini_map == nil and false) or is_disp_icon_mini_map; + + local physical_param = large_monster.update_health(enemy, monster); + + large_monster.update_stamina(enemy, monster); + large_monster.update_rage(enemy, monster); + large_monster.update_parts(enemy, monster, physical_param); + + ailments.update_ailments(enemy, monster); +end + +function large_monster.update_health(enemy, monster) + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.health.visibility + and not cached_config.static.health.visibility + and not cached_config.highlighted.health.visibility then + return nil; + end + local physical_param = physical_param_field:get_data(enemy) if physical_param == nil then customization_menu.status = "No physical param"; - return; + return nil; end local vital_param = get_vital_method:call(physical_param, 0, 0); if vital_param == nil then customization_menu.status = "No vital param"; - return; + return nil; end - local damage_param = damage_param_field:get_data(enemy); - if damage_param == nil then - customization_menu.status = "No damage param"; - return; + monster.health = get_current_method:call(vital_param) or monster.health; + monster.max_health = get_max_method:call(vital_param) or monster.max_health; + monster.capture_health = get_capture_hp_vital_method:call(physical_param) or monster.capture_health; + + monster.missing_health = monster.max_health - monster.health; + if monster.max_health ~= 0 then + monster.health_percentage = monster.health / monster.max_health; + monster.capture_percentage = monster.capture_health / monster.max_health; end - local health = get_current_method:call(vital_param); - local max_health = get_max_method:call(vital_param); - local capture_health = get_capture_hp_vital_method:call(physical_param); - local dead_or_captured = check_die_method:call(enemy); - local is_disp_icon_mini_map = is_disp_icon_mini_map_method:call(enemy); + return physical_param; +end + +function large_monster.update_stamina(enemy, monster) + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.stamina.visibility + and not cached_config.static.stamina.visibility + and not cached_config.highlighted.stamina.visibility then + return; + end local stamina_param = stamina_param_field:get_data(enemy) if stamina_param == nil then @@ -478,8 +483,24 @@ function large_monster.update(enemy) return; end - local stamina = get_stamina_method:call(stamina_param); - local max_stamina = get_max_stamina_method:call(stamina_param); + 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.missing_stamina = monster.max_stamina - monster.stamina; + if monster.max_stamina ~= 0 then + monster.stamina_percentage = monster.stamina / monster.max_stamina; + end +end + +function large_monster.update_rage(enemy, monster) + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.rage.visibility + and not cached_config.static.rage.visibility + and not cached_config.highlighted.rage.visibility then + return; + end local anger_param = anger_param_field:get_data(enemy); if anger_param == nil then @@ -488,54 +509,90 @@ function large_monster.update(enemy) end local is_in_rage = is_anger_method:call(anger_param); - local rage_point = get_anger_point_method:call(anger_param); - local rage_limit = get_limit_anger_method:call(anger_param); - local rage_timer = anger_param_get_timer_method:call(anger_param); - local rage_duration = get_timer_anger_method:call(anger_param); - local rage_count = get_count_anger_method:call(anger_param); + monster.is_in_rage = (is_in_rage == nil and false) or is_in_rage; - local vital_list = vital_list_field:get_data(physical_param); - if vital_list == nil then - customization_menu.status = "No vital list"; + 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_timer = anger_param_get_timer_method:call(anger_param) or monster.rage_timer; + monster.rage_duration = get_timer_anger_method:call(anger_param) or monster.rage_duration; + monster.rage_count = get_count_anger_method:call(anger_param) or monster.rage_count; + + if monster.rage_limit ~= 0 then + monster.rage_percentage = monster.rage_point / monster.rage_limit; + end + + if monster.is_in_rage then + monster.rage_total_seconds_left = monster.rage_duration - monster.rage_timer; + if monster.rage_total_seconds_left < 0 then + monster.rage_total_seconds_left = 0; + end + + monster.rage_minutes_left = math.floor(monster.rage_total_seconds_left / 60); + monster.rage_seconds_left = monster.rage_total_seconds_left - 60 * monster.rage_minutes_left; + + if monster.rage_duration ~= 0 then + monster.rage_timer_percentage = monster.rage_total_seconds_left / monster.rage_duration; + end + end +end + +function large_monster.update_parts(enemy, monster, physical_param) + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.body_parts.visibility + and not cached_config.static.body_parts.visibility + and not cached_config.highlighted.body_parts.visibility then return; end - local vital_list_count = vital_list:call("get_Count"); - if vital_list_count == nil or vital_list_count < 2 then - customization_menu.status = "No vital list count"; + 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_loss.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_loss.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_loss.visibility then return; end - local part_list = vital_list:call("get_Item", 1); - if part_list == nil then - customization_menu.status = "No part list"; - return; + if physical_param == nil then + physical_param = physical_param_field:get_data(enemy) + if physical_param == nil then + customization_menu.status = "No physical param"; + return nil; + end end - local part_list_count = part_list:call("get_Count"); - if part_list_count == nil then - customization_menu.status = "No part list count"; + local damage_param = damage_param_field:get_data(enemy); + if damage_param == nil then + customization_menu.status = "No damage param"; return; end local enemy_parts_damage_info = damage_param:get_field("_EnemyPartsDamageInfo"); - local enemy_parts_info_array; - if enemy_parts_damage_info ~= nil then - enemy_parts_info_array = enemy_parts_damage_info:call("get_PartsInfo"); + if enemy_parts_damage_info == nil then + customization_menu.status = "No parts damage info"; + return; end + local enemy_parts_info_array = enemy_parts_damage_info:call("get_PartsInfo"); + if enemy_parts_info_array == nil then + customization_menu.status = "No parts damage info array"; + return; + end + + local enemy_parts_info_array_size = enemy_parts_info_array:get_size(); + local part_id = 1; - for i = 0, part_list_count - 1 do - local enemy_parts_info; - if enemy_parts_info_array ~= nil then - enemy_parts_info = enemy_parts_info_array[i]; - end + for i = 0, enemy_parts_info_array_size - 1 do + local enemy_parts_info = enemy_parts_info_array[i]; local part = monster.parts[part_id]; if part == nil then local part_name = part_names.get_part_name(monster.id, part_id); - - if part_name == "" then + if part_name == nil then goto continue; else part = body_part.new(part_id, part_name); @@ -543,197 +600,122 @@ function large_monster.update(enemy) end end - local part_vital = physical_param:call("getVital", 1, i); - local part_current = -1; - local part_max = -1; + if cached_config.dynamic.body_parts.part_health.visibility + or cached_config.static.body_parts.part_health.visibility + or cached_config.highlighted.body_parts.part_health.visibility then + local part_vital = physical_param:call("getVital", 1, i); + if part_vital ~= nil then + local part_current = part_vital:call("get_Current") or -1; + local part_max = part_vital:call("get_Max") or -1; - if part_vital ~= nil then - part_current = part_vital:call("get_Current") or -1; - part_max = part_vital:call("get_Max") or -1; + body_part.update_flinch(part, part_current, part_max); + + end end - local part_break_vital = physical_param:call("getVital", 2, i); - local part_break_current = -1; - local part_break_max = -1; + if cached_config.dynamic.body_parts.part_break.visibility + or cached_config.static.body_parts.part_break.visibility + or cached_config.highlighted.body_parts.part_break.visibility then + local part_break_vital = physical_param:call("getVital", 2, i); + if part_break_vital ~= nil then + local part_break_current = part_break_vital:call("get_Current") or -1; + local part_break_max = part_break_vital:call("get_Max") or -1; + local part_break_count = -1; + local part_break_max_count = -1; - if part_break_vital ~= nil then - part_break_current = part_break_vital:call("get_Current") or -1; - part_break_max = part_break_vital:call("get_Max") or -1; + if enemy_parts_info ~= nil then + part_break_count = enemy_parts_info:call("get_PartsBreakDamageLevel") or part_break_count; + part_break_max_count = enemy_parts_info:call("get_PartsBreakDamageMaxLevel") or part_break_max_count; + end + + body_part.update_break(part, part_break_current, part_break_max, part_break_count, part_break_max_count) + end + end + if cached_config.dynamic.body_parts.part_loss.visibility + or cached_config.static.body_parts.part_loss.visibility + or cached_config.highlighted.body_parts.part_loss.visibility then + local part_loss_vital = physical_param:call("getVital", 3, i); + if part_loss_vital ~= nil then + local part_loss_current = part_loss_vital:call("get_Current") or -1; + local part_loss_max = part_loss_vital:call("get_Max") or -1; + local is_severed = false; + + if enemy_parts_info ~= nil then + local _is_severed = enemy_parts_info:call("get_PartsLossState"); + is_severed = (_is_severed == nil and false) or is_severed; + end + + body_part.update_loss(part, part_loss_current, part_loss_max, is_severed) + end end - - local part_loss_vital = physical_param:call("getVital", 3, i); - local part_loss_current = -1; - local part_loss_max = -1; - - if part_loss_vital ~= nil then - part_loss_current = part_loss_vital:call("get_Current") or -1; - part_loss_max = part_loss_vital:call("get_Max") or -1; - end - - local part_break_count = -1; - local part_break_max_count = -1; - local is_severed = false; - - if enemy_parts_info ~= nil then - part_break_count = enemy_parts_info:call("get_PartsBreakDamageLevel") or -1; - part_break_max_count = enemy_parts_info:call("get_PartsBreakDamageMaxLevel") or -1; - is_severed = enemy_parts_info:call("get_PartsLossState") or false; - end - - body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed); part_id = part_id + 1; ::continue:: end - - - if health ~= nil then - monster.health = health; - end - if max_health ~= nil then - monster.max_health = max_health; - end - - if capture_health ~= nil then - monster.capture_health = capture_health; - end - - if max_health ~= nil and health ~= nil then - monster.missing_health = max_health - health; - if max_health ~= 0 then - monster.health_percentage = health / max_health; - end - end - - if max_health ~= nil and capture_health ~= nil then - if max_health ~= 0 then - monster.capture_percentage = capture_health / max_health; - end - end - - if dead_or_captured ~= nil then - monster.dead_or_captured = dead_or_captured; - end - if is_disp_icon_mini_map ~= nil then - monster.is_disp_icon_mini_map = is_disp_icon_mini_map; - end - - if stamina ~= nil then - monster.stamina = stamina; - end - - if max_stamina ~= nil then - monster.max_stamina = max_stamina; - end - - if max_stamina ~= nil and stamina ~= nil then - monster.missing_stamina = max_stamina - stamina; - if max_stamina ~= 0 then - monster.stamina_percentage = stamina / max_stamina; - end - end - - if is_in_rage ~= nil then - monster.is_in_rage = is_in_rage; - end - - if rage_point ~= nil then - monster.rage_point = rage_point; - end - - if rage_limit ~= nil then - monster.rage_limit = rage_limit; - end - - if rage_point ~= nil and rage_limit ~= nil then - if rage_limit ~= 0 then - monster.rage_percentage = rage_point / rage_limit; - end - end - - if rage_timer ~= nil then - monster.rage_timer = rage_timer; - end - - if rage_duration ~= nil then - monster.rage_duration = rage_duration; - end - - if rage_timer ~= nil and rage_duration ~= nil and monster.is_in_rage then - monster.rage_total_seconds_left = rage_duration - rage_timer; - if monster.rage_total_seconds_left < 0 then - monster.rage_total_seconds_left = 0; - end - - monster.rage_minutes_left = math.floor(monster.rage_total_seconds_left / 60); - monster.rage_seconds_left = monster.rage_total_seconds_left - 60 * monster.rage_minutes_left; - if rage_duration ~= 0 then - monster.rage_timer_percentage = monster.rage_total_seconds_left / rage_duration; - end - end - - if rage_count ~= nil then - monster.rage_count = rage_count; - end - - ailments.update_ailments(enemy, monster); end function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.dynamic; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local monster_name_text = ""; - if config.current_config.large_monster_UI.dynamic.monster_name_label.include.monster_name then + if cached_config.monster_name_label.include.monster_name then monster_name_text = string.format("%s ", monster.name); end - if config.current_config.large_monster_UI.dynamic.monster_name_label.include.crown and monster.crown ~= "" then + if cached_config.monster_name_label.include.monster_id then + monster_name_text = monster_name_text .. tostring(monster.id) .. " "; + end + + if cached_config.monster_name_label.include.crown and monster.crown ~= "" then monster_name_text = monster_name_text .. string.format("%s ", monster.crown); end - if config.current_config.large_monster_UI.dynamic.monster_name_label.include.size then + if cached_config.monster_name_label.include.size then monster_name_text = monster_name_text .. string.format("#%.0f ", 100 * monster.size); end - if config.current_config.large_monster_UI.dynamic.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, 100 * monster.big_border, 100 * monster.king_border); end if monster.health < monster.capture_health then - monster.health_dynamic_UI.bar.colors = config.current_config.large_monster_UI.dynamic.health.bar.capture_colors; + monster.health_dynamic_UI.bar.colors = cached_config.health.bar.capture_colors; else - monster.health_dynamic_UI.bar.colors = config.current_config.large_monster_UI.dynamic.health.bar.normal_colors; + monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors; end drawing.draw_label(monster.dynamic_name_label, position_on_screen, opacity_scale, monster_name_text); local health_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.health.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier }; local stamina_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.stamina.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.stamina.offset.y * global_scale_modifier }; local rage_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.rage.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.rage.offset.y * global_scale_modifier }; local parts_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.body_parts.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.body_parts.offset.y * global_scale_modifier }; local ailments_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailments.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.ailments.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier }; local ailment_buildups_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier }; health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale); @@ -744,11 +726,11 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale) local last_part_position_on_screen = body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale); - if config.current_config.large_monster_UI.dynamic.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 ailments_position_on_screen = { - x = last_part_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = last_part_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = last_part_position_on_screen.x + 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 @@ -758,60 +740,66 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale) end function large_monster.draw_static(monster, position_on_screen, opacity_scale) - + local cached_config = config.current_config.large_monster_UI.static; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local monster_name_text = ""; - if config.current_config.large_monster_UI.static.monster_name_label.include.monster_name then + if cached_config.monster_name_label.include.monster_name then monster_name_text = string.format("%s ", monster.name); end - if config.current_config.large_monster_UI.static.monster_name_label.include.crown and monster.crown ~= "" then + if cached_config.monster_name_label.include.monster_id then + monster_name_text = monster_name_text .. tostring(monster.id) .. " "; + end + + if cached_config.monster_name_label.include.crown and monster.crown ~= "" then monster_name_text = monster_name_text .. string.format("%s ", monster.crown); end - if config.current_config.large_monster_UI.static.monster_name_label.include.size then + if cached_config.monster_name_label.include.size then monster_name_text = monster_name_text .. string.format("#%.0f ", 100 * monster.size); end - if config.current_config.large_monster_UI.static.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, 100 * monster.big_border, 100 * monster.king_border); end if monster.health < monster.capture_health then - monster.health_static_UI.bar.colors = config.current_config.large_monster_UI.static.health.bar.capture_colors; + monster.health_static_UI.bar.colors = cached_config.health.bar.capture_colors; else - monster.health_static_UI.bar.colors = config.current_config.large_monster_UI.static.health.bar.normal_colors; + monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors; end drawing.draw_label(monster.static_name_label, position_on_screen, opacity_scale, monster_name_text); local health_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.health.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier }; local stamina_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.stamina.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.stamina.offset.y * global_scale_modifier }; local rage_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.rage.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.rage.offset.y * global_scale_modifier }; local parts_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.body_parts.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.body_parts.offset.y * global_scale_modifier }; local ailments_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.ailments.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.ailments.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier }; local ailment_buildups_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.ailment_buildups.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.static.ailment_buildups.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier }; health_UI_entity.draw(monster, monster.health_static_UI, health_position_on_screen, opacity_scale); @@ -822,11 +810,11 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale) local last_part_position_on_screen = body_part.draw_static(monster, parts_position_on_screen, opacity_scale); - if config.current_config.large_monster_UI.static.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 ailments_position_on_screen = { - x = last_part_position_on_screen.x + config.current_config.large_monster_UI.static.ailments.relative_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = last_part_position_on_screen.y + config.current_config.large_monster_UI.static.ailments.relative_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = last_part_position_on_screen.x + cached_config.ailments.relative_offset.x * global_scale_modifier, + y = last_part_position_on_screen.y + cached_config.ailments.relative_offset.y * global_scale_modifier }; end end @@ -836,60 +824,66 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale) end function large_monster.draw_highlighted(monster, position_on_screen, opacity_scale) - + local cached_config = config.current_config.large_monster_UI.highlighted; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local monster_name_text = ""; - if config.current_config.large_monster_UI.highlighted.monster_name_label.include.monster_name then + if cached_config.monster_name_label.include.monster_name then monster_name_text = string.format("%s ", monster.name); end - if config.current_config.large_monster_UI.highlighted.monster_name_label.include.crown and monster.crown ~= "" then + if cached_config.monster_name_label.include.monster_id then + monster_name_text = monster_name_text .. tostring(monster.id) .. " "; + end + + if cached_config.monster_name_label.include.crown and monster.crown ~= "" then monster_name_text = monster_name_text .. string.format("%s ", monster.crown); end - if config.current_config.large_monster_UI.highlighted.monster_name_label.include.size then + if cached_config.monster_name_label.include.size then monster_name_text = monster_name_text .. string.format("#%.0f ", 100 * monster.size); end - if config.current_config.large_monster_UI.highlighted.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, 100 * monster.big_border, 100 * monster.king_border); end if monster.health < monster.capture_health then - monster.health_highlighted_UI.bar.colors = config.current_config.large_monster_UI.highlighted.health.bar.capture_colors; + monster.health_highlighted_UI.bar.colors = cached_config.health.bar.capture_colors; else - monster.health_highlighted_UI.bar.colors = config.current_config.large_monster_UI.highlighted.health.bar.normal_colors; + monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors; end drawing.draw_label(monster.highlighted_name_label, position_on_screen, opacity_scale, monster_name_text); local health_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.health.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier }; local stamina_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.stamina.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.stamina.offset.y * global_scale_modifier }; local rage_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.rage.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.rage.offset.y * global_scale_modifier }; local parts_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.body_parts.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.body_parts.offset.y * global_scale_modifier }; local ailments_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier }; local ailment_buildups_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier }; health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale); @@ -900,11 +894,11 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca local last_part_position_on_screen = body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale); - if config.current_config.large_monster_UI.highlighted.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 ailments_position_on_screen = { - x = last_part_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = last_part_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = last_part_position_on_screen.x + cached_config.ailments.relative_offset.x * global_scale_modifier, + y = last_part_position_on_screen.y + cached_config.ailments.relative_offset.y * global_scale_modifier }; end end diff --git a/reframework/autorun/MHR_Overlay/Monsters/monster_hook.lua b/reframework/autorun/MHR_Overlay/Monsters/monster_hook.lua index 6a5fc3d..b61871d 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/monster_hook.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/monster_hook.lua @@ -9,12 +9,6 @@ local enemy_character_base_update_method = enemy_character_base_type_def:get_met local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy"); -sdk.hook(enemy_character_base_update_method, function(args) - pcall(monster_hook.update_monster, sdk.to_managed_object(args[2])); -end, function(retval) - return retval; -end); - local tick_count = 0; local last_update_tick = 0; local recorded_monsters = {}; @@ -53,8 +47,8 @@ function monster_hook.update_monster(enemy) end if not recorded_monsters[enemy] then - num_known_monsters = num_known_monsters + 1 - recorded_monsters[enemy] = true + num_known_monsters = num_known_monsters + 1; + recorded_monsters[enemy] = true; end -- saves on a method call. @@ -76,9 +70,11 @@ function monster_hook.update_monster(enemy) end function monster_hook.update_large_monster(enemy) - if not config.current_config.large_monster_UI.dynamic.enabled and - not config.current_config.large_monster_UI.static.enabled and - not config.current_config.large_monster_UI.highlighted.enabled then + local cached_config = config.current_config.large_monster_UI; + + if not cached_config.dynamic.enabled and + not cached_config.static.enabled and + not cached_config.highlighted.enabled then return; end @@ -144,6 +140,12 @@ function monster_hook.init_module() large_monster = require("MHR_Overlay.Monsters.large_monster"); config = require("MHR_Overlay.Misc.config"); ailments = require("MHR_Overlay.Monsters.ailments"); + + sdk.hook(enemy_character_base_update_method, function(args) + pcall(monster_hook.update_monster, sdk.to_managed_object(args[2])); + end, function(retval) + return retval; + end); end return monster_hook; \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Monsters/small_monster.lua b/reframework/autorun/MHR_Overlay/Monsters/small_monster.lua index 9951025..ec69996 100644 --- a/reframework/autorun/MHR_Overlay/Monsters/small_monster.lua +++ b/reframework/autorun/MHR_Overlay/Monsters/small_monster.lua @@ -77,52 +77,53 @@ function small_monster.init(monster, enemy) end function small_monster.init_UI(monster) - monster.name_label = table_helpers.deep_copy(config.current_config.small_monster_UI.monster_name_label); + local cached_config = config.current_config.small_monster_UI; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; - monster.name_label.offset.x = monster.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - monster.name_label.offset.y = monster.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + monster.name_label = table_helpers.deep_copy(cached_config.monster_name_label); + + monster.name_label.offset.x = monster.name_label.offset.x * global_scale_modifier; + monster.name_label.offset.y = monster.name_label.offset.y * global_scale_modifier; monster.health_UI = health_UI_entity.new( - config.current_config.small_monster_UI.health.visibility, - config.current_config.small_monster_UI.health.bar, - config.current_config.small_monster_UI.health.text_label, - config.current_config.small_monster_UI.health.value_label, - config.current_config.small_monster_UI.health.percentage_label + cached_config.health.visibility, + cached_config.health.bar, + cached_config.health.text_label, + cached_config.health.value_label, + cached_config.health.percentage_label ); monster.stamina_UI = stamina_UI_entity.new( - config.current_config.small_monster_UI.stamina.visibility, - config.current_config.small_monster_UI.stamina.bar, - config.current_config.small_monster_UI.stamina.text_label, - config.current_config.small_monster_UI.stamina.value_label, - config.current_config.small_monster_UI.stamina.percentage_label + cached_config.stamina.visibility, + cached_config.stamina.bar, + cached_config.stamina.text_label, + cached_config.stamina.value_label, + cached_config.stamina.percentage_label ); monster.ailment_UI = ailment_UI_entity.new( - config.current_config.small_monster_UI.ailments.visibility, - config.current_config.small_monster_UI.ailments.bar, - config.current_config.small_monster_UI.ailments.ailment_name_label, - config.current_config.small_monster_UI.ailments.text_label, - config.current_config.small_monster_UI.ailments.value_label, - config.current_config.small_monster_UI.ailments.percentage_label, - config.current_config.small_monster_UI.ailments.timer_label + cached_config.ailments.visibility, + cached_config.ailments.bar, + cached_config.ailments.ailment_name_label, + cached_config.ailments.text_label, + cached_config.ailments.value_label, + cached_config.ailments.percentage_label, + cached_config.ailments.timer_label ); ailments.init_ailment_buildup_small_UI(monster.ailments); end -local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase"); local physical_param_field = enemy_character_base_type_def:get_field("k__BackingField"); -local status_param_field = enemy_character_base_type_def:get_field("k__BackingField"); local stamina_param_field = enemy_character_base_type_def:get_field("k__BackingField"); local check_die_method = enemy_character_base_type_def:get_method("checkDie"); local physical_param_type = physical_param_field:get_type(); local get_vital_method = physical_param_type:get_method("getVital"); -local get_capture_hp_vital_method = physical_param_type:get_method("get_CaptureHpVital"); -local get_hp_vital_method = enemy_character_base_type_def:get_method("getHpVital"); -local get_hp_max_vital_method = enemy_character_base_type_def:get_method("getHpMaxVital"); +local vital_param_type = get_vital_method:get_return_type(); +local get_current_method = vital_param_type:get_method("get_Current"); +local get_max_method = vital_param_type:get_method("get_Max"); local stamina_param_type = stamina_param_field:get_type(); @@ -131,61 +132,42 @@ local get_max_stamina_method = stamina_param_type:get_method("getMaxStamina"); local get_pos_field = enemy_character_base_type_def:get_method("get_Pos"); ---local get_gameobject_method = sdk.find_type_definition("via.Component"):get_method("get_GameObject"); ---local get_transform_method = sdk.find_type_definition("via.GameObject"):get_method("get_Transform"); ---local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position"); - function small_monster.update_position(enemy) - if not config.current_config.small_monster_UI.enabled or not config.current_config.small_monster_UI.dynamic_positioning.enabled then + local cached_config = config.current_config.small_monster_UI; + if not cached_config.enabled or not cached_config.dynamic_positioning.enabled then return; end local monster = small_monster.get_monster(enemy); - if not monster then return end - - local position = get_pos_field:call(enemy); - if position ~= nil then - monster.position = position; - end - - --[[ - -- cache off the game object and transform - -- as these are pretty much guaranteed to stay constant - -- as long as the enemy is alive - if monster.game_object == nil then - monster.game_object = get_gameobject_method:call(enemy) - if monster.game_object == nil then - customization_menu.status = "No enemy game object"; - return; - end - end - - if monster.transform == nil then - monster.transform = get_transform_method:call(monster.game_object) - if monster.transform == nil then - customization_menu.status = "No enemy transform"; - return; - end - end - - local position = get_position_method:call(monster.transform) - if not position then - customization_menu.status = "No enemy position"; + if monster == nil then return; end - if position ~= nil then - monster.position = position; - end - --]] + local position = get_pos_field:call(enemy) or monster.position; + monster.position = position; end function small_monster.update(enemy) + if not config.current_config.small_monster_UI.enabled then + return; + end + if enemy == nil then return; end - if not config.current_config.small_monster_UI.enabled then + local monster = small_monster.get_monster(enemy); + + local dead_or_captured = check_die_method:call(enemy); + monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured; + + small_monster.update_health(enemy, monster); + small_monster.update_stamina(enemy, monster); + ailments.update_ailments(enemy, monster); +end + +function small_monster.update_health(enemy, monster) + if not config.current_config.small_monster_UI.health.visibility then return; end @@ -195,9 +177,24 @@ function small_monster.update(enemy) return; end - local status_param = status_param_field:get_data(enemy) - if status_param == nil then - customization_menu.status = "No status param"; + local vital_param = get_vital_method:call(physical_param, 0, 0); + if vital_param == nil then + customization_menu.status = "No vital param"; + return; + end + + monster.health = get_current_method:call(vital_param) or monster.health; + monster.max_health = get_max_method:call(vital_param) or monster.max_health; + + monster.missing_health = monster.max_health - monster.health; + if monster.max_health ~= 0 then + monster.health_percentage = monster.health / monster.max_health; + monster.capture_percentage = monster.capture_health / monster.max_health; + end +end + +function small_monster.update_stamina(enemy, monster) + if not config.current_config.small_monster_UI.stamina.visibility then return; end @@ -207,88 +204,40 @@ function small_monster.update(enemy) return; end - local vital_param = get_vital_method:call(physical_param, 0, 0); - if vital_param == nil then - customization_menu.status = "No vital param"; - return; + 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.missing_stamina = monster.max_stamina - monster.stamina; + if monster.max_stamina ~= 0 then + monster.stamina_percentage = monster.stamina / monster.max_stamina; end - - local health = get_hp_vital_method:call(enemy); - local max_health = get_hp_max_vital_method:call(enemy); - local capture_health = get_capture_hp_vital_method:call(physical_param); - - local stamina = get_stamina_method:call(stamina_param); - local max_stamina = get_max_stamina_method:call(stamina_param); - - local dead_or_captured = check_die_method:call(enemy); - if dead_or_captured == nil then - return; - end - - local monster = small_monster.get_monster(enemy); - - if health ~= nil then - monster.health = health; - end - - if max_health ~= nil then - monster.max_health = max_health; - end - - if capture_health ~= nil then - monster.capture_health = capture_health; - end - - if max_health ~= nil and health ~= nil then - monster.missing_health = max_health - health; - if max_health ~= 0 then - monster.health_percentage = health / max_health; - end - end - - if dead_or_captured ~= nil then - monster.dead_or_captured = dead_or_captured; - end - - if stamina ~= nil then - monster.stamina = stamina; - end - - if max_stamina ~= nil then - monster.max_stamina = max_stamina; - end - - if max_stamina ~= nil and stamina ~= nil then - monster.missing_stamina = max_stamina - stamina; - if max_stamina ~= 0 then - monster.stamina_percentage = stamina / max_stamina; - end - end - - ailments.update_ailments(enemy, monster); end function small_monster.draw(monster, position_on_screen, opacity_scale) + local cached_config = config.current_config.small_monster_UI; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + drawing.draw_label(monster.name_label, position_on_screen, opacity_scale, monster.name); local health_position_on_screen = { - x = position_on_screen.x + config.current_config.small_monster_UI.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.small_monster_UI.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.health.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier }; local stamina_position_on_screen = { - x = position_on_screen.x + config.current_config.small_monster_UI.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.small_monster_UI.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.stamina.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.stamina.offset.y * global_scale_modifier }; local ailments_position_on_screen = { - x = position_on_screen.x + config.current_config.small_monster_UI.ailments.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.small_monster_UI.ailments.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier }; local ailment_buildups_position_on_screen = { - x = position_on_screen.x + config.current_config.small_monster_UI.ailment_buildups.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier, - y = position_on_screen.y + config.current_config.small_monster_UI.ailment_buildups.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier + x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier, + y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier }; health_UI_entity.draw(monster, monster.health_UI, health_position_on_screen, opacity_scale); diff --git a/reframework/autorun/MHR_Overlay/UI/Modules/damage_meter_UI.lua b/reframework/autorun/MHR_Overlay/UI/Modules/damage_meter_UI.lua index 0d7d081..3ac9d9e 100644 --- a/reframework/autorun/MHR_Overlay/UI/Modules/damage_meter_UI.lua +++ b/reframework/autorun/MHR_Overlay/UI/Modules/damage_meter_UI.lua @@ -23,6 +23,8 @@ local hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterI local member_index_field = hunter_info_type_def:get_field("_memberIndex"); function damage_meter_UI.get_players(player_info_list) + local cached_config = config.current_config.damage_meter_UI; + -- other players if player_info_list == nil then customization_menu.status = "No player info list"; @@ -52,7 +54,7 @@ function damage_meter_UI.get_players(player_info_list) local _player = player.get_player(player_id); if _player ~= nil then - if player_id == player.myself.id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then + if player_id == player.myself.id and cached_config.settings.my_damage_bar_location ~= "Normal" then goto continue; end table.insert(quest_players, _player); @@ -65,11 +67,15 @@ function damage_meter_UI.get_players(player_info_list) end function damage_meter_UI.draw() + local cached_config = config.current_config.damage_meter_UI; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; - if player.total.display.total_damage == 0 and config.current_config.damage_meter_UI.settings.hide_module_if_total_damage_is_zero then + if player.total.display.total_damage == 0 and cached_config.settings.hide_module_if_total_damage_is_zero then return; end + + local quest_players = {}; if damage_meter_UI.freeze_displayed_players and damage_meter_UI.last_displayed_players ~= {} then quest_players = damage_meter_UI.last_displayed_players; @@ -84,15 +90,15 @@ function damage_meter_UI.draw() if not damage_meter_UI.freeze_displayed_players then if #quest_players ~= 0 then -- sort here - if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then + if cached_config.sorting.type == "Normal" and cached_config.sorting.reversed_order then local reversed_quest_players = {}; for i = #quest_players, 1, -1 do table.insert(reversed_quest_players, quest_players[i]); end quest_players = reversed_quest_players; - elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then - if config.current_config.damage_meter_UI.sorting.reversed_order then + elseif cached_config.sorting.type == "DPS" then + if cached_config.sorting.reversed_order then table.sort(quest_players, function(left, right) return left.dps < right.dps; end); @@ -102,7 +108,7 @@ function damage_meter_UI.draw() end); end else - if config.current_config.damage_meter_UI.sorting.reversed_order then + if cached_config.sorting.reversed_order then table.sort(quest_players, function(left, right) return left.display.total_damage < right.display.total_damage; end); @@ -114,9 +120,9 @@ function damage_meter_UI.draw() end end - if config.current_config.damage_meter_UI.settings.my_damage_bar_location == "First" then + if cached_config.settings.my_damage_bar_location == "First" then table.insert(quest_players, 1, player.myself); - elseif config.current_config.damage_meter_UI.settings.my_damage_bar_location == "Last" then + elseif cached_config.settings.my_damage_bar_location == "Last" then table.insert(quest_players, #quest_players + 1, player.myself); elseif #player.list == 0 then table.insert(quest_players, player.myself); @@ -137,19 +143,19 @@ function damage_meter_UI.draw() end -- draw - local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position); + local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); for _, _player in ipairs(quest_players) do - if _player.display.total_damage == 0 and config.current_config.damage_meter_UI.settings.hide_player_if_player_damage_is_zero then + if _player.display.total_damage == 0 and cached_config.settings.hide_player_if_player_damage_is_zero then goto continue1 end player.draw(_player, position_on_screen, 1, top_damage, top_dps); - if config.current_config.damage_meter_UI.settings.orientation == "Horizontal" then - position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier; + if cached_config.settings.orientation == "Horizontal" then + position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier; else - position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier; + position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier; end ::continue1:: @@ -157,12 +163,12 @@ function damage_meter_UI.draw() end -- draw total damage - if config.current_config.damage_meter_UI.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then + if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then return; end - if not config.current_config.damage_meter_UI.settings.total_damage_offset_is_relative then - position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position); + if not cached_config.settings.total_damage_offset_is_relative then + position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); end player.draw_total(position_on_screen, 1); diff --git a/reframework/autorun/MHR_Overlay/UI/Modules/env_creature_UI.lua b/reframework/autorun/MHR_Overlay/UI/Modules/env_creature_UI.lua index 0aebad9..4c25d30 100644 --- a/reframework/autorun/MHR_Overlay/UI/Modules/env_creature_UI.lua +++ b/reframework/autorun/MHR_Overlay/UI/Modules/env_creature_UI.lua @@ -21,19 +21,22 @@ function env_creature_UI.draw() return; end + local cached_config = config.current_config.endemic_life_UI; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + for _, creature in pairs(env_creature.list) do - if config.current_config.endemic_life_UI.settings.max_distance == 0 then + if cached_config.settings.max_distance == 0 then break; end - if config.current_config.endemic_life_UI.settings.hide_inactive_creatures and creature.is_inactive then + if cached_config.settings.hide_inactive_creatures and creature.is_inactive then goto continue; end local position_on_screen = {}; - local world_offset = Vector3f.new(config.current_config.endemic_life_UI.world_offset.x, config.current_config.endemic_life_UI.world_offset.y, config.current_config.endemic_life_UI.world_offset.z); + local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.world_offset.z); position_on_screen = draw.world_to_screen(creature.position + world_offset); @@ -41,19 +44,19 @@ function env_creature_UI.draw() goto continue; end - position_on_screen.x = position_on_screen.x + config.current_config.endemic_life_UI.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - position_on_screen.y = position_on_screen.y + config.current_config.endemic_life_UI.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier; + position_on_screen.y = position_on_screen.y + cached_config.viewport_offset.y * global_scale_modifier; creature.distance = (player.myself_position - creature.position):length(); local opacity_scale = 1; - if creature.distance > config.current_config.endemic_life_UI.settings.max_distance then + if creature.distance > cached_config.settings.max_distance then goto continue; end - if config.current_config.endemic_life_UI.settings.opacity_falloff then - opacity_scale = 1 - (creature.distance / config.current_config.endemic_life_UI.settings.max_distance); + if cached_config.settings.opacity_falloff then + opacity_scale = 1 - (creature.distance / cached_config.settings.max_distance); end diff --git a/reframework/autorun/MHR_Overlay/UI/Modules/large_monster_UI.lua b/reframework/autorun/MHR_Overlay/UI/Modules/large_monster_UI.lua index 430b67e..303da8b 100644 --- a/reframework/autorun/MHR_Overlay/UI/Modules/large_monster_UI.lua +++ b/reframework/autorun/MHR_Overlay/UI/Modules/large_monster_UI.lua @@ -93,58 +93,64 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab end function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster) + local cached_config = config.current_config.large_monster_UI.dynamic; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local i = 0; - for _, monster in ipairs(displayed_monsters) do - if config.current_config.large_monster_UI.dynamic.settings.max_distance == 0 then - break; - end - - if monster.dead_or_captured and config.current_config.large_monster_UI.dynamic.settings.hide_dead_or_captured then - goto continue; - end - - if monster == highlighted_monster then - if not config.current_config.large_monster_UI.dynamic.settings.render_highlighted_monster then - goto continue; - end - else - if not config.current_config.large_monster_UI.dynamic.settings.render_not_highlighted_monsters then - goto continue; - end - end - - local position_on_screen = {}; - - local world_offset = Vector3f.new(config.current_config.large_monster_UI.dynamic.world_offset.x, config.current_config.large_monster_UI.dynamic.world_offset.y, config.current_config.large_monster_UI.dynamic.world_offset.z); - - position_on_screen = draw.world_to_screen(monster.position + world_offset); - - if position_on_screen == nil then - goto continue; - end - - position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - - local opacity_scale = 1; - if monster.distance > config.current_config.large_monster_UI.dynamic.settings.max_distance then - goto continue; - end - - if config.current_config.large_monster_UI.dynamic.settings.opacity_falloff then - opacity_scale = 1 - (monster.distance / config.current_config.large_monster_UI.dynamic.settings.max_distance); - end - - large_monster.draw_dynamic(monster, position_on_screen, opacity_scale); - - i = i + 1; - ::continue:: + for _, monster in ipairs(displayed_monsters) do + if cached_config.settings.max_distance == 0 then + break; end + + if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then + goto continue; + end + + if monster == highlighted_monster then + if not cached_config.settings.render_highlighted_monster then + goto continue; + end + else + if not cached_config.settings.render_not_highlighted_monsters then + goto continue; + end + end + + local position_on_screen = {}; + + local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.world_offset.z); + + position_on_screen = draw.world_to_screen(monster.position + world_offset); + + if position_on_screen == nil then + goto continue; + end + + position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier; + position_on_screen.y = position_on_screen.y + cached_config.viewport_offset.y * global_scale_modifier; + + local opacity_scale = 1; + if monster.distance > cached_config.settings.max_distance then + goto continue; + end + + if cached_config.settings.opacity_falloff then + opacity_scale = 1 - (monster.distance / cached_config.settings.max_distance); + end + + large_monster.draw_dynamic(monster, position_on_screen, opacity_scale); + + i = i + 1; + ::continue:: + end end function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) + local cached_config = config.current_config.large_monster_UI.static; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + -- sort here - if config.current_config.large_monster_UI.static.sorting.type == "Normal" and config.current_config.large_monster_UI.static.sorting.reversed_order then + if cached_config.sorting.type == "Normal" and cached_config.sorting.reversed_order then local reversed_monsters = {}; for i = #displayed_monsters, 1, -1 do table.insert(reversed_monsters, displayed_monsters[i]); @@ -152,8 +158,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) displayed_monsters = reversed_monsters; - elseif config.current_config.large_monster_UI.static.sorting.type == "Health" then - if config.current_config.large_monster_UI.static.sorting.reversed_order then + elseif cached_config.sorting.type == "Health" then + if cached_config.sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.health > right.health; end); @@ -162,8 +168,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) return left.health < right.health; end); end - elseif config.current_config.large_monster_UI.static.sorting.type == "Health Percentage" then - if config.current_config.large_monster_UI.static.sorting.reversed_order then + elseif cached_config.sorting.type == "Health Percentage" then + if cached_config.sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.health_percentage > right.health_percentage; end); @@ -172,8 +178,8 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) return left.health_percentage < right.health_percentage; end); end - elseif config.current_config.large_monster_UI.static.sorting.type == "Distance" then - if config.current_config.large_monster_UI.static.sorting.reversed_order then + elseif cached_config.sorting.type == "Distance" then + if cached_config.sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.distance > right.distance; end); @@ -184,20 +190,20 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) end end - local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.large_monster_UI.static.position); + local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); local i = 0; for _, monster in ipairs(displayed_monsters) do - if monster.dead_or_captured and config.current_config.large_monster_UI.static.settings.hide_dead_or_captured then + if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then goto continue; end if monster == highlighted_monster then - if not config.current_config.large_monster_UI.static.settings.render_highlighted_monster then + if not cached_config.settings.render_highlighted_monster then goto continue; end else - if not config.current_config.large_monster_UI.static.settings.render_not_highlighted_monsters then + if not cached_config.settings.render_not_highlighted_monsters then goto continue; end end @@ -207,10 +213,10 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) y = position_on_screen.y } - if config.current_config.large_monster_UI.static.settings.orientation == "Horizontal" then - monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i * config.current_config.global_settings.modifiers.global_scale_modifier; + if cached_config.settings.orientation == "Horizontal" then + monster_position_on_screen.x = monster_position_on_screen.x + cached_config.spacing.x * i * global_scale_modifier; else - monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i * config.current_config.global_settings.modifiers.global_scale_modifier; + monster_position_on_screen.y = monster_position_on_screen.y + cached_config.spacing.y * i * global_scale_modifier; end large_monster.draw_static(monster, monster_position_on_screen, 1); @@ -221,13 +227,15 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster) end function large_monster_UI.draw_highlighted(monster) + local cached_config = config.current_config.large_monster_UI.highlighted; + if monster == nil then return; end - local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.large_monster_UI.highlighted.position); + local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); - if monster.dead_or_captured and config.current_config.large_monster_UI.highlighted.settings.hide_dead_or_captured then + if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then return; end diff --git a/reframework/autorun/MHR_Overlay/UI/Modules/small_monster_UI.lua b/reframework/autorun/MHR_Overlay/UI/Modules/small_monster_UI.lua index 3725878..920d125 100644 --- a/reframework/autorun/MHR_Overlay/UI/Modules/small_monster_UI.lua +++ b/reframework/autorun/MHR_Overlay/UI/Modules/small_monster_UI.lua @@ -19,6 +19,8 @@ function small_monster_UI.draw() return; end + local cached_config = config.current_config.small_monster_UI; + local displayed_monsters = {}; local enemy_count = get_zako_enemy_count_method:call(singletons.enemy_manager); @@ -40,7 +42,7 @@ function small_monster_UI.draw() goto continue; end - if monster.dead_or_captured and config.current_config.small_monster_UI.settings.hide_dead_or_captured then + if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then goto continue; end @@ -48,24 +50,24 @@ function small_monster_UI.draw() ::continue:: end - if config.current_config.small_monster_UI.dynamic_positioning.enabled - or (not config.current_config.small_monster_UI.dynamic_positioning.enabled and config.current_config.small_monster_UI.static_sorting.type == "Distance") then + if cached_config.dynamic_positioning.enabled + or (not cached_config.dynamic_positioning.enabled and cached_config.static_sorting.type == "Distance") then for _, monster in ipairs(displayed_monsters) do monster.distance = (player.myself_position - monster.position):length(); end end - if not config.current_config.small_monster_UI.dynamic_positioning.enabled then + if not cached_config.dynamic_positioning.enabled then -- sort here - if config.current_config.small_monster_UI.static_sorting.type == "Normal" and config.current_config.small_monster_UI.static_sorting.reversed_order then + if cached_config.static_sorting.type == "Normal" and cached_config.static_sorting.reversed_order then local reversed_monsters = {}; for i = #displayed_monsters, 1, -1 do table.insert(reversed_monsters, displayed_monsters[i]); end displayed_monsters = reversed_monsters; - elseif config.current_config.small_monster_UI.static_sorting.type == "Health" then - if config.current_config.small_monster_UI.static_sorting.reversed_order then + elseif cached_config.static_sorting.type == "Health" then + if cached_config.static_sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.health > right.health; end); @@ -75,8 +77,8 @@ function small_monster_UI.draw() end); end - elseif config.current_config.small_monster_UI.static_sorting.type == "Health Percentage" then - if config.current_config.small_monster_UI.static_sorting.reversed_order then + elseif cached_config.static_sorting.type == "Health Percentage" then + if cached_config.static_sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.health_percentage > right.health_percentage; end); @@ -85,8 +87,8 @@ function small_monster_UI.draw() return left.health_percentage < right.health_percentage; end); end - elseif config.current_config.small_monster_UI.static_sorting.type == "Distance" then - if config.current_config.small_monster_UI.static_sorting.reversed_order then + elseif cached_config.static_sorting.type == "Distance" then + if cached_config.static_sorting.reversed_order then table.sort(displayed_monsters, function(left, right) return left.distance > right.distance; end); @@ -102,8 +104,8 @@ function small_monster_UI.draw() for _, monster in ipairs(displayed_monsters) do local position_on_screen; - if config.current_config.small_monster_UI.dynamic_positioning.enabled then - local world_offset = Vector3f.new(config.current_config.small_monster_UI.dynamic_positioning.world_offset.x, config.current_config.small_monster_UI.dynamic_positioning.world_offset.y, config.current_config.small_monster_UI.dynamic_positioning.world_offset.z); + if cached_config.dynamic_positioning.enabled then + local world_offset = Vector3f.new(cached_config.dynamic_positioning.world_offset.x, cached_config.dynamic_positioning.world_offset.y, cached_config.dynamic_positioning.world_offset.z); position_on_screen = draw.world_to_screen(monster.position + world_offset); @@ -111,31 +113,31 @@ function small_monster_UI.draw() goto continue end - position_on_screen.x = position_on_screen.x + config.current_config.small_monster_UI.dynamic_positioning.viewport_offset.x; - position_on_screen.y = position_on_screen.y + config.current_config.small_monster_UI.dynamic_positioning.viewport_offset.y; + position_on_screen.x = position_on_screen.x + cached_config.dynamic_positioning.viewport_offset.x; + position_on_screen.y = position_on_screen.y + cached_config.dynamic_positioning.viewport_offset.y; else - position_on_screen = screen.calculate_absolute_coordinates(config.current_config.small_monster_UI.static_position); - if config.current_config.small_monster_UI.settings.orientation == "Horizontal" then - position_on_screen.x = position_on_screen.x + config.current_config.small_monster_UI.static_spacing.x * i; + position_on_screen = screen.calculate_absolute_coordinates(cached_config.static_position); + if cached_config.settings.orientation == "Horizontal" then + position_on_screen.x = position_on_screen.x + cached_config.static_spacing.x * i; else - position_on_screen.y = position_on_screen.y + config.current_config.small_monster_UI.static_spacing.y * i; + position_on_screen.y = position_on_screen.y + cached_config.static_spacing.y * i; end end local opacity_scale = 1; - if config.current_config.small_monster_UI.dynamic_positioning.enabled then - if config.current_config.small_monster_UI.dynamic_positioning.max_distance == 0 then + if cached_config.dynamic_positioning.enabled then + if cached_config.dynamic_positioning.max_distance == 0 then return; end - if monster.distance > config.current_config.small_monster_UI.dynamic_positioning.max_distance then + if monster.distance > cached_config.dynamic_positioning.max_distance then goto continue; end - if config.current_config.small_monster_UI.dynamic_positioning.opacity_falloff then - opacity_scale = 1 - (monster.distance / config.current_config.small_monster_UI.dynamic_positioning.max_distance); + if cached_config.dynamic_positioning.opacity_falloff then + opacity_scale = 1 - (monster.distance / cached_config.dynamic_positioning.max_distance); end end diff --git a/reframework/autorun/MHR_Overlay/UI/Modules/time_UI.lua b/reframework/autorun/MHR_Overlay/UI/Modules/time_UI.lua index 6b7b198..3175849 100644 --- a/reframework/autorun/MHR_Overlay/UI/Modules/time_UI.lua +++ b/reframework/autorun/MHR_Overlay/UI/Modules/time_UI.lua @@ -23,8 +23,10 @@ end function time_UI.init_UI() time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label); - time_UI.label.offset.x = time_UI.label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - time_UI.label.offset.y = time_UI.label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + + time_UI.label.offset.x = time_UI.label.offset.x * global_scale_modifier; + time_UI.label.offset.y = time_UI.label.offset.y * global_scale_modifier; end function time_UI.init_module() diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua index 8e6ed78..d073083 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua @@ -7,6 +7,8 @@ local language; function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + entity.visibility = visibility; entity.bar = table_helpers.deep_copy(bar); entity.name_label = table_helpers.deep_copy(name_label); @@ -15,25 +17,25 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la entity.percentage_label = table_helpers.deep_copy(percentage_label); entity.timer_label = table_helpers.deep_copy(timer_label); - entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; + entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; + entity.bar.size.width = entity.bar.size.width * global_scale_modifier; + entity.bar.size.height = entity.bar.size.height * global_scale_modifier; - entity.name_label.offset.x = entity.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.name_label.offset.y = entity.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.name_label.offset.x = entity.name_label.offset.x * global_scale_modifier; + entity.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier; - entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier; + entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier; - entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier; + entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier; - entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; + entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; - entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier; + entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier; return entity; end @@ -43,11 +45,13 @@ function ailment_UI_entity.draw_dynamic(ailment, ailment_UI, position_on_screen, return; end + local cached_config = config.current_config.large_monster_UI.dynamic.ailments; + local ailment_name = ""; - if config.current_config.large_monster_UI.dynamic.ailments.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.dynamic.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -72,11 +76,13 @@ function ailment_UI_entity.draw_static(ailment, ailment_UI, position_on_screen, return; end + local cached_config = config.current_config.large_monster_UI.static.ailments; + local ailment_name = ""; - if config.current_config.large_monster_UI.static.ailments.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.static.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -101,11 +107,13 @@ function ailment_UI_entity.draw_highlighted(ailment, ailment_UI, position_on_scr return; end + local cached_config = config.current_config.large_monster_UI.highlighted.ailments; + local ailment_name = ""; - if config.current_config.large_monster_UI.highlighted.ailments.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.large_monster_UI.highlighted.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end @@ -130,11 +138,13 @@ function ailment_UI_entity.draw_small(ailment, ailment_UI, position_on_screen, o return; end + local cached_config = config.current_config.small_monster_UI.ailments; + local ailment_name = ""; - if config.current_config.small_monster_UI.ailments.ailment_name_label.include.ailment_name then + if cached_config.ailment_name_label.include.ailment_name then ailment_name = ailment.name .. " "; end - if config.current_config.small_monster_UI.ailments.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then + if cached_config.ailment_name_label.include.activation_count and ailment.activate_count ~= 0 then ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_buildup_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_buildup_UI_entity.lua index cea3254..e910a9d 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_buildup_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_buildup_UI_entity.lua @@ -8,6 +8,7 @@ local language; function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label, buildup_value_label, buildup_percentage_label, total_buildup_label, total_buildup_value_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; --entity.visibility = visibility; entity.buildup_bar = table_helpers.deep_copy(buildup_bar); @@ -19,38 +20,39 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail entity.total_buildup_label = table_helpers.deep_copy(total_buildup_label); entity.total_buildup_value_label = table_helpers.deep_copy(total_buildup_value_label); - entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.buildup_bar.size.width = entity.buildup_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.buildup_bar.size.height = entity.buildup_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * global_scale_modifier; + entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier; + entity.buildup_bar.size.width = entity.buildup_bar.size.width * global_scale_modifier; + entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier; - entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * global_scale_modifier; + entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * global_scale_modifier; + entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * global_scale_modifier; + entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * global_scale_modifier; - entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier; + entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier; - entity.buildup_value_label.offset.x = entity.buildup_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.buildup_value_label.offset.y = entity.buildup_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.buildup_value_label.offset.x = entity.buildup_value_label.offset.x * global_scale_modifier; + entity.buildup_value_label.offset.y = entity.buildup_value_label.offset.y * global_scale_modifier; - entity.buildup_percentage_label.offset.x = entity.buildup_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.buildup_percentage_label.offset.y = entity.buildup_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.buildup_percentage_label.offset.x = entity.buildup_percentage_label.offset.x * global_scale_modifier + entity.buildup_percentage_label.offset.y = entity.buildup_percentage_label.offset.y * global_scale_modifier; - entity.total_buildup_label.offset.x = entity.total_buildup_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.total_buildup_label.offset.y = entity.total_buildup_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.total_buildup_label.offset.x = entity.total_buildup_label.offset.x * global_scale_modifier; + entity.total_buildup_label.offset.y = entity.total_buildup_label.offset.y * global_scale_modifier; - entity.total_buildup_value_label.offset.x = entity.total_buildup_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.total_buildup_value_label.offset.y = entity.total_buildup_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.total_buildup_value_label.offset.x = entity.total_buildup_value_label.offset.x * global_scale_modifier; + entity.total_buildup_value_label.offset.y = entity.total_buildup_value_label.offset.y * global_scale_modifier; return entity; end function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) - + local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups; + local player_buildup_bar_percentage = 0; - if config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then + if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then player_buildup_bar_percentage = _player.buildup_share; else if top_buildup ~= 0 then @@ -58,9 +60,9 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos end end - if _player.id == player.myself.id and config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.highlighted_bar == "Me" then + if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); - elseif config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then + elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); else drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); @@ -72,9 +74,10 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos end function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) + local cached_config = config.current_config.large_monster_UI.static.ailment_buildups; local player_buildup_bar_percentage = 0; - if config.current_config.large_monster_UI.static.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then + if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then player_buildup_bar_percentage = _player.buildup_share; else if top_buildup ~= 0 then @@ -82,9 +85,9 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi end end - if _player.id == player.myself.id and config.current_config.large_monster_UI.static.ailment_buildups.settings.highlighted_bar == "Me" then + if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); - elseif config.current_config.large_monster_UI.static.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then + elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); else drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); @@ -96,9 +99,10 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi end function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) - + local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups; + local player_buildup_bar_percentage = 0; - if config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then + if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then player_buildup_bar_percentage = _player.buildup_share; else if top_buildup ~= 0 then @@ -106,9 +110,9 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, end end - if _player.id == player.myself.id and config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.highlighted_bar == "Me" then + if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); - elseif config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then + elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); else drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); @@ -120,9 +124,10 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, end function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) + local cached_config = config.current_config.small_monster_UI.ailment_buildups; local player_buildup_bar_percentage = 0; - if config.current_config.small_monster_UI.ailment_buildups.settings.buildup_bar_relative_to == "Total Buildup" then + if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then player_buildup_bar_percentage = _player.buildup_share; else if top_buildup ~= 0 then @@ -130,9 +135,9 @@ function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, posit end end - if _player.id == player.myself.id and config.current_config.small_monster_UI.ailment_buildups.settings.highlighted_bar == "Me" then + if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); - elseif config.current_config.small_monster_UI.ailment_buildups.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then + elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); else drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua index f5a323e..f00daab 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua @@ -7,6 +7,9 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label, flinch_percentage_label, break_visibility, break_bar, break_text_label, break_value_label, break_percentage_label, loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label) + + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + local entity = {}; entity.part_visibility = part_visibility; @@ -16,91 +19,93 @@ function body_part_UI_entity.new(part_visibility, part_name_label, entity.part_name_label = table_helpers.deep_copy(part_name_label); - entity.part_name_label.offset.x = entity.part_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.part_name_label.offset.y = entity.part_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.part_name_label.offset.x = entity.part_name_label.offset.x * global_scale_modifier; + entity.part_name_label.offset.y = entity.part_name_label.offset.y * global_scale_modifier; entity.flinch_bar = table_helpers.deep_copy(flinch_bar); entity.flinch_text_label = table_helpers.deep_copy(flinch_text_label); entity.flinch_value_label = table_helpers.deep_copy(flinch_value_label); entity.flinch_percentage_label = table_helpers.deep_copy(flinch_percentage_label); - entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_bar.size.width = entity.flinch_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_bar.size.height = entity.flinch_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * global_scale_modifier; + entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * global_scale_modifier; + entity.flinch_bar.size.width = entity.flinch_bar.size.width * global_scale_modifier; + entity.flinch_bar.size.height = entity.flinch_bar.size.height * global_scale_modifier; - entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_text_label.offset.y = entity.flinch_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * global_scale_modifier; + entity.flinch_text_label.offset.y = entity.flinch_text_label.offset.y * global_scale_modifier; - entity.flinch_value_label.offset.x = entity.flinch_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_value_label.offset.y = entity.flinch_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.flinch_value_label.offset.x = entity.flinch_value_label.offset.x * global_scale_modifier; + entity.flinch_value_label.offset.y = entity.flinch_value_label.offset.y * global_scale_modifier; - entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * global_scale_modifier; + entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * global_scale_modifier; entity.break_bar = table_helpers.deep_copy(break_bar); entity.break_text_label = table_helpers.deep_copy(break_text_label); entity.break_value_label = table_helpers.deep_copy(break_value_label); entity.break_percentage_label = table_helpers.deep_copy(break_percentage_label); - entity.break_bar.offset.x = entity.break_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_bar.offset.y = entity.break_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_bar.size.width = entity.break_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_bar.size.height = entity.break_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.break_bar.offset.x = entity.break_bar.offset.x * global_scale_modifier; + entity.break_bar.offset.y = entity.break_bar.offset.y * global_scale_modifier; + entity.break_bar.size.width = entity.break_bar.size.width * global_scale_modifier; + entity.break_bar.size.height = entity.break_bar.size.height * global_scale_modifier; - entity.break_text_label.offset.x = entity.break_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_text_label.offset.y = entity.break_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.break_text_label.offset.x = entity.break_text_label.offset.x * global_scale_modifier; + entity.break_text_label.offset.y = entity.break_text_label.offset.y * global_scale_modifier; - entity.break_value_label.offset.x = entity.break_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_value_label.offset.y = entity.break_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.break_value_label.offset.x = entity.break_value_label.offset.x * global_scale_modifier; + entity.break_value_label.offset.y = entity.break_value_label.offset.y * global_scale_modifier; - entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * global_scale_modifier; + entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * global_scale_modifier; entity.loss_bar = table_helpers.deep_copy(loss_bar); entity.loss_text_label = table_helpers.deep_copy(loss_text_label); entity.loss_value_label = table_helpers.deep_copy(loss_value_label); entity.loss_health_percentage_label = table_helpers.deep_copy(loss_health_percentage_label); - entity.loss_bar.offset.x = entity.loss_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_bar.offset.y = entity.loss_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_bar.size.width = entity.loss_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_bar.size.height = entity.loss_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.loss_bar.offset.x = entity.loss_bar.offset.x * global_scale_modifier; + entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier; + entity.loss_bar.size.width = entity.loss_bar.size.width * global_scale_modifier; + entity.loss_bar.size.height = entity.loss_bar.size.height * global_scale_modifier; - entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_text_label.offset.y = entity.loss_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * global_scale_modifier; + entity.loss_text_label.offset.y = entity.loss_text_label.offset.y * global_scale_modifier; - entity.loss_value_label.offset.x = entity.loss_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_value_label.offset.y = entity.loss_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.loss_value_label.offset.x = entity.loss_value_label.offset.x * global_scale_modifier; + entity.loss_value_label.offset.y = entity.loss_value_label.offset.y * global_scale_modifier; - entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * global_scale_modifier; + entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * global_scale_modifier; return entity; end function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.dynamic.body_parts; + if not part.body_part_dynamic_UI.part_visibility then return; end local part_name = ""; - if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.part_name then + if cached_config.part_name_label.include.part_name then part_name = part.name .. " "; end - if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then + if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.flinch_count) .. " "; end if part.break_max_count ~= 0 then - if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_count then - if config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_max_count then + if cached_config.part_name_label.include.break_count then + if cached_config.part_name_label.include.break_max_count then part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count); elseif part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.break_count); end - elseif config.current_config.large_monster_UI.dynamic.body_parts.part_name_label.include.break_max_count then + elseif cached_config.part_name_label.include.break_max_count then part_name = part_name .. "/" .. tostring(part.break_max_count); end end @@ -110,20 +115,20 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local flinch_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_health.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_health.offset.y, + x = position_on_screen.x + cached_config.part_health.offset.x, + y = position_on_screen.y + cached_config.part_health.offset.y, visibility = part.body_part_dynamic_UI.flinch_visibility }; local break_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_break.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_break.offset.y, + x = position_on_screen.x + cached_config.part_break.offset.x, + y = position_on_screen.y + cached_config.part_break.offset.y, visibility = part.body_part_dynamic_UI.flinch_visibility }; local loss_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.body_parts.part_loss.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.body_parts.part_loss.offset.y, + x = position_on_screen.x + cached_config.part_loss.offset.x, + y = position_on_screen.y + cached_config.part_loss.offset.y, }; @@ -162,27 +167,29 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal end function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.static.body_parts; + if not part.body_part_static_UI.part_visibility then return; end local part_name = ""; - if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.part_name then + if cached_config.part_name_label.include.part_name then part_name = part.name .. " "; end - if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then + if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.flinch_count) .. " "; end if part.break_max_count ~= 0 then - if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_count then - if config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_max_count then + if cached_config.part_name_label.include.break_count then + if cached_config.part_name_label.include.break_max_count then part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count); elseif part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.break_count); end - elseif config.current_config.large_monster_UI.static.body_parts.part_name_label.include.break_max_count then + elseif cached_config.part_name_label.include.break_max_count then part_name = part_name .. "/" .. tostring(part.break_max_count); end end @@ -192,20 +199,20 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local flinch_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_health.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_health.offset.y, + x = position_on_screen.x + cached_config.part_health.offset.x, + y = position_on_screen.y + cached_config.part_health.offset.y, visibility = part.body_part_static_UI.flinch_visibility }; local break_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_break.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_break.offset.y, + x = position_on_screen.x + cached_config.part_break.offset.x, + y = position_on_screen.y + cached_config.part_break.offset.y, visibility = part.body_part_static_UI.flinch_visibility }; local loss_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.static.body_parts.part_loss.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.static.body_parts.part_loss.offset.y, + x = position_on_screen.x + cached_config.part_loss.offset.x, + y = position_on_screen.y + cached_config.part_loss.offset.y, }; @@ -244,27 +251,29 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale end function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_scale) + local cached_config = config.current_config.large_monster_UI.highlighted.body_parts; + if not part.body_part_highlighted_UI.part_visibility then return; end local part_name = ""; - if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.part_name then + if cached_config.part_name_label.include.part_name then part_name = part.name .. " "; end - if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then + if cached_config.part_name_label.include.flinch_count and part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.flinch_count) .. " "; end if part.break_max_count ~= 0 then - if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_count then - if config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_max_count then + if cached_config.part_name_label.include.break_count then + if cached_config.part_name_label.include.break_max_count then part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count); elseif part.flinch_count ~= 0 then part_name = part_name .. "x" .. tostring(part.break_count); end - elseif config.current_config.large_monster_UI.highlighted.body_parts.part_name_label.include.break_max_count then + elseif cached_config.part_name_label.include.break_max_count then part_name = part_name .. "/" .. tostring(part.break_max_count); end end @@ -274,51 +283,55 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_ local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); local flinch_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_health.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_health.offset.y, + x = position_on_screen.x + cached_config.part_health.offset.x, + y = position_on_screen.y + cached_config.part_health.offset.y, visibility = part.body_part_highlighted_UI.flinch_visibility }; local break_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_break.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_break.offset.y, + x = position_on_screen.x + cached_config.part_break.offset.x, + y = position_on_screen.y + cached_config.part_break.offset.y, visibility = part.body_part_highlighted_UI.flinch_visibility }; local loss_position_on_screen = { - x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.body_parts.part_loss.offset.x, - y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.body_parts.part_loss.offset.y, + x = position_on_screen.x + cached_config.part_loss.offset.x, + y = position_on_screen.y + cached_config.part_loss.offset.y, }; - if part.body_part_highlighted_UI.flinch_visibility then + local draw_health = part.body_part_highlighted_UI.flinch_visibility and part.max_health > 0; + local draw_break = part.body_part_highlighted_UI.break_visibility and part.break_max_health > 0 and part.break_count < part.break_max_count; + local draw_loss = part.body_part_highlighted_UI.loss_visibility and part.loss_max_health > 0 and not part.is_severed; + + if draw_health then drawing.draw_bar(part.body_part_highlighted_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage); end - if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then + if draw_break then drawing.draw_bar(part.body_part_highlighted_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage); end - if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then + if draw_loss then drawing.draw_bar(part.body_part_highlighted_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage); end drawing.draw_label(part.body_part_highlighted_UI.part_name_label, position_on_screen, opacity_scale, part_name); - if part.body_part_highlighted_UI.flinch_visibility then + if draw_health then drawing.draw_label(part.body_part_highlighted_UI.flinch_text_label, flinch_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_highlighted_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string); drawing.draw_label(part.body_part_highlighted_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage); end - if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then + if draw_break then drawing.draw_label(part.body_part_highlighted_UI.break_text_label, break_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_highlighted_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string); drawing.draw_label(part.body_part_highlighted_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage); end - if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then + if draw_loss then drawing.draw_label(part.body_part_highlighted_UI.loss_text_label, loss_position_on_screen, opacity_scale); drawing.draw_label(part.body_part_highlighted_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string); drawing.draw_label(part.body_part_highlighted_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage); diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/damage_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/damage_UI_entity.lua index 1933c04..3036acf 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/damage_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/damage_UI_entity.lua @@ -8,6 +8,8 @@ local language; function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label, percentage_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + --entity.visibility = visibility; entity.bar = table_helpers.deep_copy(bar); entity.highlighted_bar = table_helpers.deep_copy(highlighted_bar); @@ -17,39 +19,40 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label entity.value_label = table_helpers.deep_copy(value_label); entity.percentage_label = table_helpers.deep_copy(percentage_label); - entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; + entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; + entity.bar.size.width = entity.bar.size.width * global_scale_modifier; + entity.bar.size.height = entity.bar.size.height * global_scale_modifier; - entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * global_scale_modifier; + entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * global_scale_modifier; + entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * global_scale_modifier; + entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier; - entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier; + entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier; - entity.dps_label.offset.x = entity.dps_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.dps_label.offset.y = entity.dps_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.dps_label.offset.x = entity.dps_label.offset.x * global_scale_modifier; + entity.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier; - entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * global_scale_modifier; + entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * global_scale_modifier; - entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier; + entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier; - entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; + entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; return entity; end function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps) + local cached_config = config.current_config.damage_meter_UI; - local player_include = config.current_config.damage_meter_UI.player_name_label.include.others; + local player_include = cached_config.player_name_label.include.others; if _player.id == player.myself.id then - player_include = config.current_config.damage_meter_UI.player_name_label.include.myself; + player_include = cached_config.player_name_label.include.myself; end local player_name_text = ""; @@ -76,7 +79,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d end local player_damage_bar_percentage = 0; - if config.current_config.damage_meter_UI.settings.damage_bar_relative_to == "Total Damage" then + if cached_config.settings.damage_bar_relative_to == "Total Damage" then if player.total.display.total_damage ~= 0 then player_damage_bar_percentage = _player.display.total_damage / player.total.display.total_damage; end @@ -86,11 +89,11 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d end end - if _player.id == player.myself.id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then + if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage); - elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then + elseif cached_config.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage); - elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps then + elseif cached_config.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps then drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage); else drawing.draw_bar(_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage); diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua index 2dec0d4..2eebf25 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua @@ -7,25 +7,27 @@ local config; function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + entity.visibility = visibility; entity.bar = table_helpers.deep_copy(bar); entity.text_label = table_helpers.deep_copy(text_label); entity.value_label = table_helpers.deep_copy(value_label); entity.percentage_label = table_helpers.deep_copy(percentage_label); - entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; + entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; + entity.bar.size.width = entity.bar.size.width * global_scale_modifier; + entity.bar.size.height = entity.bar.size.height * global_scale_modifier; - entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier; + entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier; - entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier; + entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier; - entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; + entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; return entity; end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua index 1b7eb68..5278c8a 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua @@ -7,6 +7,8 @@ local config; function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + entity.visibility = visibility; entity.bar = table_helpers.deep_copy(bar); entity.text_label = table_helpers.deep_copy(text_label); @@ -14,22 +16,22 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage entity.percentage_label = table_helpers.deep_copy(percentage_label); entity.timer_label = table_helpers.deep_copy(timer_label); - entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; + entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; + entity.bar.size.width = entity.bar.size.width * global_scale_modifier; + entity.bar.size.height = entity.bar.size.height * global_scale_modifier; - entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier; + entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier; - entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier; + entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier; - entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; + entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; - entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier; + entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier; return entity; end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua index 0d015ab..73c2bb6 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua @@ -7,25 +7,27 @@ local config; function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label) local entity = {}; + local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; + entity.visibility = visibility; entity.bar = table_helpers.deep_copy(bar); entity.text_label = table_helpers.deep_copy(text_label); entity.value_label = table_helpers.deep_copy(value_label); entity.percentage_label = table_helpers.deep_copy(percentage_label); - entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; + entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; + entity.bar.size.width = entity.bar.size.width * global_scale_modifier; + entity.bar.size.height = entity.bar.size.height * global_scale_modifier; - entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.text_label.offset.x = entity.text_label.offset.x * global_scale_modifier; + entity.text_label.offset.y = entity.text_label.offset.y * global_scale_modifier; - entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier; + entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier; - entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier; - entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier; + entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; + entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; return entity; end diff --git a/reframework/autorun/MHR_Overlay/UI/customization_menu.lua b/reframework/autorun/MHR_Overlay/UI/customization_menu.lua index 903ed5b..142491b 100644 --- a/reframework/autorun/MHR_Overlay/UI/customization_menu.lua +++ b/reframework/autorun/MHR_Overlay/UI/customization_menu.lua @@ -3156,6 +3156,12 @@ function customization_menu.draw() config_changed = config_changed or changed; large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; + changed, config.current_config.large_monster_UI.dynamic.monster_name_label.include.monster_id = imgui.checkbox( + language.current_language.customization_menu.monster_id, + config.current_config.large_monster_UI.dynamic.monster_name_label.include.monster_id); + config_changed = config_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; + changed, config.current_config.large_monster_UI.dynamic.monster_name_label.include.crown = imgui.checkbox(language.current_language .customization_menu.crown, config.current_config.large_monster_UI.dynamic.monster_name_label.include.crown); @@ -6206,21 +6212,21 @@ function customization_menu.draw() .customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.x = imgui.drag_float(language.current_language .customization_menu.x, config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.y = imgui.drag_float(language.current_language .customization_menu.y, config.current_config.large_monster_UI.dynamic.ailment_buildups.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6231,14 +6237,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.x, 0.1, -screen.width, screen.width , "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_spacing.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6249,14 +6255,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_spacing.x, 0.1, -screen.width, screen.width , "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_spacing.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6265,7 +6271,7 @@ function customization_menu.draw() .customization_menu.highlighted_bar, customization_menu.large_monster_dynamic_UI_highlighted_buildup_bar_index, customization_menu.displayed_highlighted_buildup_bar_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if changed then config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.highlighted_bar = customization_menu.highlighted_buildup_bar_types [customization_menu.large_monster_dynamic_UI_highlighted_buildup_bar_index]; @@ -6276,7 +6282,7 @@ function customization_menu.draw() customization_menu.large_monster_dynamic_UI_buildup_bar_relative_index, customization_menu.displayed_buildup_bar_relative_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if changed then config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.buildup_bar_relative_to = customization_menu @@ -6287,7 +6293,7 @@ function customization_menu.draw() .current_language.customization_menu.time_limit, config.current_config.large_monster_UI.dynamic.ailment_buildups.settings.time_limit, 0.1, 0, 99999, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6306,7 +6312,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.filter.blast); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6317,7 +6323,7 @@ function customization_menu.draw() customization_menu.large_monster_dynamic_UI_ailment_buildups_sorting_type_index, customization_menu.displayed_ailment_buildups_sorting_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if changed then config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.type = customization_menu.ailment_buildups_sorting_types @@ -6328,7 +6334,7 @@ function customization_menu.draw() language.current_language.customization_menu.reversed_order, config.current_config.large_monster_UI.dynamic.ailment_buildups.sorting.reversed_order); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6338,7 +6344,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.include) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.ailment_name = imgui @@ -6346,7 +6352,7 @@ function customization_menu.draw() language.current_language.customization_menu.ailment_name, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.ailment_name); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.activation_count = imgui @@ -6354,7 +6360,7 @@ function customization_menu.draw() language.current_language.customization_menu.activation_count, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.include.activation_count); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6366,7 +6372,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -6374,7 +6380,7 @@ function customization_menu.draw() screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6384,7 +6390,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6395,7 +6401,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.shadow.offset.x = imgui @@ -6405,7 +6411,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.shadow.offset.y = imgui .drag_float( @@ -6414,7 +6420,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6424,7 +6430,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.ailment_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6440,7 +6446,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.offset.x = imgui.drag_float(language @@ -6449,7 +6455,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -6457,7 +6463,7 @@ function customization_menu.draw() screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6467,7 +6473,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6478,7 +6484,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.shadow.offset.x = imgui @@ -6488,7 +6494,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.shadow.offset.y = imgui .drag_float( @@ -6497,7 +6503,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6507,7 +6513,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.player_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6523,7 +6529,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; -- add text format @@ -6534,7 +6540,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -6542,7 +6548,7 @@ function customization_menu.draw() , screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6552,7 +6558,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6563,7 +6569,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.shadow.offset.x = imgui @@ -6572,7 +6578,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.shadow.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -6580,7 +6586,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6591,7 +6597,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_value_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6608,7 +6614,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; -- add text format @@ -6619,7 +6625,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -6627,7 +6633,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6637,7 +6643,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6648,7 +6654,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.shadow.offset.x = imgui @@ -6658,7 +6664,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.shadow.offset.y = imgui .drag_float( @@ -6667,7 +6673,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6678,7 +6684,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_percentage_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6694,7 +6700,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; -- add text format @@ -6705,7 +6711,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -6713,7 +6719,7 @@ function customization_menu.draw() , screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6723,7 +6729,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6734,7 +6740,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.shadow.offset.x = imgui @@ -6744,7 +6750,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.shadow.offset.y = imgui .drag_float( @@ -6753,7 +6759,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6764,7 +6770,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6781,7 +6787,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; -- add text format @@ -6792,7 +6798,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -6800,7 +6806,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6810,7 +6816,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6822,7 +6828,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.shadow.offset.x = imgui @@ -6832,7 +6838,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_value_label.shadow.offset.y = imgui .drag_float( @@ -6841,7 +6847,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6852,7 +6858,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6868,7 +6874,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.offset.x = imgui.drag_float(language @@ -6876,14 +6882,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6894,14 +6900,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.size.height = imgui.drag_float(language .current_language.customization_menu.height, config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.size.height, 0.1, 0, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6912,7 +6918,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6922,7 +6928,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.dynamic.ailment_buildups.buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6938,7 +6944,7 @@ function customization_menu.draw() .checkbox(language.current_language.customization_menu.visible, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.offset.x = imgui.drag_float(language @@ -6946,14 +6952,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6964,14 +6970,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; changed, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.size.height = imgui .drag_float(language.current_language.customization_menu.height, config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.size.height, 0.1, 0, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6983,7 +6989,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -6994,7 +7000,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.dynamic.ailment_buildups.highlighted_buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed; imgui.tree_pop(); end @@ -7131,6 +7137,12 @@ function customization_menu.draw() config_changed = config_changed or changed; large_monster_static_UI_changed = large_monster_static_UI_changed or changed; + changed, config.current_config.large_monster_UI.static.monster_name_label.include.monster_id = imgui.checkbox( + language.current_language.customization_menu.monster_id, + config.current_config.large_monster_UI.static.monster_name_label.include.monster_id); + config_changed = config_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; + changed, config.current_config.large_monster_UI.static.monster_name_label.include.crown = imgui.checkbox(language.current_language .customization_menu.crown, config.current_config.large_monster_UI.static.monster_name_label.include.crown); @@ -10148,20 +10160,20 @@ function customization_menu.draw() .customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.offset.x = imgui.drag_float(language.current_language .customization_menu.x, config.current_config.large_monster_UI.static.ailment_buildups.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.offset.y = imgui.drag_float(language.current_language .customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10172,14 +10184,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.player_spacing.y, 0.1, -screen.height, screen.height , "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10190,14 +10202,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.ailment_spacing.x, 0.1, -screen.width, screen.width , "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.ailment_spacing.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10207,7 +10219,7 @@ function customization_menu.draw() .customization_menu.highlighted_bar, customization_menu.large_monster_static_UI_highlighted_buildup_bar_index, customization_menu.displayed_highlighted_buildup_bar_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if changed then config.current_config.large_monster_UI.static.ailment_buildups.settings.highlighted_bar = customization_menu.highlighted_buildup_bar_types [customization_menu.large_monster_static_UI_highlighted_buildup_bar_index]; @@ -10218,7 +10230,7 @@ function customization_menu.draw() customization_menu.large_monster_static_UI_buildup_bar_relative_index, customization_menu.displayed_buildup_bar_relative_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if changed then config.current_config.large_monster_UI.static.ailment_buildups.settings.buildup_bar_relative_to = customization_menu @@ -10229,7 +10241,7 @@ function customization_menu.draw() .current_language.customization_menu.time_limit, config.current_config.large_monster_UI.static.ailment_buildups.settings.time_limit, 0.1, 0, 99999, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10248,7 +10260,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.filter.blast); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10259,7 +10271,7 @@ function customization_menu.draw() customization_menu.large_monster_static_UI_ailment_buildups_sorting_type_index, customization_menu.displayed_ailment_buildups_sorting_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if changed then config.current_config.large_monster_UI.static.ailment_buildups.sorting.type = customization_menu.ailment_buildups_sorting_types @@ -10270,7 +10282,7 @@ function customization_menu.draw() language.current_language.customization_menu.reversed_order, config.current_config.large_monster_UI.static.ailment_buildups.sorting.reversed_order); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10280,7 +10292,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.include) then changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.ailment_name = imgui @@ -10288,14 +10300,14 @@ function customization_menu.draw() language.current_language.customization_menu.ailment_name, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.ailment_name); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.activation_count = imgui .checkbox( language.current_language.customization_menu.activation_count, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.include.activation_count); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10307,7 +10319,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -10315,7 +10327,7 @@ function customization_menu.draw() screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10325,7 +10337,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10336,7 +10348,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.shadow.offset.x = imgui @@ -10346,7 +10358,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.shadow.offset.y = imgui .drag_float( @@ -10355,7 +10367,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10365,7 +10377,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.ailment_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10381,7 +10393,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.offset.x = imgui.drag_float(language @@ -10390,7 +10402,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -10398,7 +10410,7 @@ function customization_menu.draw() screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10408,7 +10420,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10419,7 +10431,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.shadow.offset.x = imgui @@ -10429,7 +10441,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.shadow.offset.y = imgui .drag_float( @@ -10438,7 +10450,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10448,7 +10460,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.player_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10464,7 +10476,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; -- add text format @@ -10475,7 +10487,7 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -10483,7 +10495,7 @@ function customization_menu.draw() screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10493,7 +10505,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10504,7 +10516,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.shadow.offset.x = imgui @@ -10513,7 +10525,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.shadow.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -10521,7 +10533,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10531,7 +10543,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.buildup_value_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10548,7 +10560,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; -- add text format @@ -10559,7 +10571,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -10567,7 +10579,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10577,7 +10589,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10588,7 +10600,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.shadow.offset.x = imgui @@ -10598,7 +10610,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.shadow.offset.y = imgui .drag_float( @@ -10607,7 +10619,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10618,7 +10630,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.buildup_percentage_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10634,7 +10646,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; -- add text format @@ -10645,14 +10657,14 @@ function customization_menu.draw() screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10662,7 +10674,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10673,7 +10685,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.shadow.offset.x = imgui @@ -10683,7 +10695,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.shadow.offset.y = imgui .drag_float( @@ -10692,7 +10704,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10702,7 +10714,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10719,7 +10731,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; -- add text format @@ -10730,7 +10742,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -10738,7 +10750,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10748,7 +10760,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10759,7 +10771,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.shadow.offset.x = imgui @@ -10769,7 +10781,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_value_label.shadow.offset.y = imgui .drag_float( @@ -10778,7 +10790,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10789,7 +10801,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10805,7 +10817,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.offset.x = imgui.drag_float(language @@ -10813,14 +10825,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10831,14 +10843,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.size.height = imgui.drag_float(language .current_language.customization_menu.height, config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.size.height, 0.1, 0, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10849,7 +10861,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10859,7 +10871,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.static.ailment_buildups.buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10875,7 +10887,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.offset.x = imgui.drag_float(language @@ -10883,14 +10895,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10901,14 +10913,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; changed, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.size.height = imgui .drag_float(language.current_language.customization_menu.height, config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.size.height, 0.1, 0, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10920,7 +10932,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10931,7 +10943,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.static.ailment_buildups.highlighted_buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_static_UI_changed = large_monster_static_UI_changed or changed; imgui.tree_pop(); end @@ -10991,6 +11003,13 @@ function customization_menu.draw() config_changed = config_changed or changed; large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; + changed, config.current_config.large_monster_UI.highlighted.monster_name_label.include.monster_id = imgui.checkbox( + language.current_language.customization_menu.monster_id, + config.current_config.large_monster_UI.highlighted.monster_name_label.include.monster_id); + config_changed = config_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; + + changed, config.current_config.large_monster_UI.highlighted.monster_name_label.include.crown = imgui.checkbox(language .current_language.customization_menu.crown, config.current_config.large_monster_UI.highlighted.monster_name_label.include.crown); @@ -14074,7 +14093,7 @@ function customization_menu.draw() .customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.x = imgui.drag_float(language.current_language @@ -14082,14 +14101,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.y = imgui.drag_float(language.current_language .customization_menu.y, config.current_config.large_monster_UI.highlighted.ailment_buildups.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14100,14 +14119,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_spacing.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14118,14 +14137,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_spacing.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_spacing.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_spacing.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14136,7 +14155,7 @@ function customization_menu.draw() , customization_menu.displayed_highlighted_buildup_bar_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if changed then config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.highlighted_bar = customization_menu.highlighted_buildup_bar_types [customization_menu.large_monster_highlighted_UI_highlighted_buildup_bar_index]; @@ -14147,7 +14166,7 @@ function customization_menu.draw() customization_menu.large_monster_highlighted_UI_buildup_bar_relative_index, customization_menu.displayed_buildup_bar_relative_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if changed then config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.buildup_bar_relative_to = customization_menu @@ -14158,7 +14177,7 @@ function customization_menu.draw() .current_language.customization_menu.time_limit, config.current_config.large_monster_UI.highlighted.ailment_buildups.settings.time_limit, 0.1, 0, 99999, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14177,7 +14196,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.filter.blast); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14188,7 +14207,7 @@ function customization_menu.draw() customization_menu.large_monster_highlighted_UI_ailment_buildups_sorting_type_index, customization_menu.displayed_ailment_buildups_sorting_types); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if changed then config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.type = customization_menu.ailment_buildups_sorting_types @@ -14199,7 +14218,7 @@ function customization_menu.draw() language.current_language.customization_menu.reversed_order, config.current_config.large_monster_UI.highlighted.ailment_buildups.sorting.reversed_order); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14209,7 +14228,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.include) then changed, @@ -14218,7 +14237,7 @@ function customization_menu.draw() language.current_language.customization_menu.ailment_name, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.include.ailment_name); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.include.activation_count = imgui @@ -14226,7 +14245,7 @@ function customization_menu.draw() language.current_language.customization_menu.activation_count, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.include.activation_count); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14238,7 +14257,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -14246,7 +14265,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14256,7 +14275,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14267,7 +14286,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.shadow.offset.x = imgui @@ -14277,7 +14296,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.shadow.offset.y = imgui .drag_float( @@ -14286,7 +14305,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14297,7 +14316,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.ailment_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14313,7 +14332,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.offset.x = imgui.drag_float(language @@ -14322,7 +14341,7 @@ function customization_menu.draw() screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -14330,7 +14349,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14340,7 +14359,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14351,7 +14370,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.shadow.offset.x = imgui @@ -14361,7 +14380,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.shadow.offset.y = imgui .drag_float( @@ -14370,7 +14389,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14381,7 +14400,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.player_name_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14397,7 +14416,7 @@ function customization_menu.draw() .checkbox(language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; -- add text format @@ -14408,7 +14427,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -14416,7 +14435,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14426,7 +14445,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14437,7 +14456,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.shadow.offset.x = imgui @@ -14446,7 +14465,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.shadow.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -14454,7 +14473,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14465,7 +14484,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_value_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14482,7 +14501,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; -- add text format @@ -14493,7 +14512,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -14501,7 +14520,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14512,7 +14531,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14524,7 +14543,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, @@ -14535,7 +14554,7 @@ function customization_menu.draw() 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.shadow.offset.y = imgui @@ -14545,7 +14564,7 @@ function customization_menu.draw() 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14556,7 +14575,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_percentage_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14573,7 +14592,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; -- add text format @@ -14584,7 +14603,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.offset.y = imgui.drag_float(language .current_language.customization_menu.y, @@ -14592,7 +14611,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14602,7 +14621,7 @@ function customization_menu.draw() , config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14613,7 +14632,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.shadow.offset.x = imgui @@ -14623,7 +14642,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.shadow.offset.y = imgui .drag_float( @@ -14632,7 +14651,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14643,7 +14662,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14660,7 +14679,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; -- add text format @@ -14671,7 +14690,7 @@ function customization_menu.draw() -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label.offset.y = imgui .drag_float(language.current_language.customization_menu.y, @@ -14679,7 +14698,7 @@ function customization_menu.draw() -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14690,7 +14709,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14702,7 +14721,7 @@ function customization_menu.draw() language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label.shadow.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, @@ -14713,7 +14732,7 @@ function customization_menu.draw() 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_value_label.shadow.offset.y = imgui @@ -14723,7 +14742,7 @@ function customization_menu.draw() 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14735,7 +14754,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.total_buildup_label.shadow.color, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14751,7 +14770,7 @@ function customization_menu.draw() .current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.offset.x = imgui.drag_float(language @@ -14759,14 +14778,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.offset.y = imgui.drag_float(language .current_language.customization_menu.y, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14777,14 +14796,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.size.height = imgui.drag_float(language .current_language.customization_menu.height, config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.size.height, 0.1, 0, screen.height , "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14796,7 +14815,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14807,7 +14826,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14823,7 +14842,7 @@ function customization_menu.draw() .checkbox(language.current_language.customization_menu.visible, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.visibility); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; if imgui.tree_node(language.current_language.customization_menu.offset) then changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.offset.x = imgui @@ -14831,14 +14850,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.offset.x, 0.1, -screen.width, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.offset.y = imgui .drag_float(language.current_language.customization_menu.y, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.offset.y, 0.1, -screen.height, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14849,14 +14868,14 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.size.width, 0.1, 0, screen.width, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; changed, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.size.height = imgui .drag_float(language.current_language.customization_menu.height, config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.size.height, 0.1, 0, screen.height, "%.1f"); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14869,7 +14888,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.colors.foreground, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end @@ -14881,7 +14900,7 @@ function customization_menu.draw() config.current_config.large_monster_UI.highlighted.ailment_buildups.highlighted_buildup_bar.colors.background, customization_menu.color_picker_flags); config_changed = config_changed or changed; - large_monster_UI_changed = large_monster_UI_changed or changed; + large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed; imgui.tree_pop(); end diff --git a/reframework/autorun/MHR_Overlay/UI/drawing.lua b/reframework/autorun/MHR_Overlay/UI/drawing.lua index edf21d1..3ad87b9 100644 --- a/reframework/autorun/MHR_Overlay/UI/drawing.lua +++ b/reframework/autorun/MHR_Overlay/UI/drawing.lua @@ -4,7 +4,8 @@ local config; drawing.font = nil; function drawing.init_font() - drawing.font = d2d.Font.new(config.current_config.global_settings.UI_font.family, config.current_config.global_settings.UI_font.size, config.current_config.global_settings.UI_font.bold, config.current_config.global_settings.UI_font.italic); + local cached_config = config.current_config.global_settings.UI_font; + drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold, cached_config.italic); end function drawing.argb_color_to_abgr_color(argb_color)