Refactoring

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

View File

@@ -44,6 +44,9 @@ local ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity"
local ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity"); local ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
local customization_menu = require("MHR_Overlay.UI.customization_menu"); local customization_menu = require("MHR_Overlay.UI.customization_menu");
local label_customization = require("MHR_Overlay.UI.Customizations.label_customization");
local bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
local line_customization = require("MHR_Overlay.UI.Customizations.line_customization");
local drawing = require("MHR_Overlay.UI.drawing"); local drawing = require("MHR_Overlay.UI.drawing");
------------------------INIT MODULES------------------------- ------------------------INIT MODULES-------------------------
@@ -82,9 +85,12 @@ ailment_hook.init_module();
ailment_buildup.init_module(); ailment_buildup.init_module();
customization_menu.init_module(); customization_menu.init_module();
label_customization.init_module();
bar_customization.init_module();
line_customization.init_module();
drawing.init_module();
damage_meter_UI.init_module(); damage_meter_UI.init_module();
drawing.init_module();
large_monster_UI.init_module(); large_monster_UI.init_module();
small_monster_UI.init_module(); small_monster_UI.init_module();
time_UI.init_module(); time_UI.init_module();
@@ -115,9 +121,12 @@ local function main_loop()
quest_status.update_is_training_area(); quest_status.update_is_training_area();
if quest_status.is_training_area then if quest_status.is_training_area then
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI; local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI; config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI; local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled); local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
@@ -126,14 +135,16 @@ local function main_loop()
end end
end end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then if config.current_config.damage_meter_UI.enabled and
config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then
local success = pcall(damage_meter_UI.draw); local success = pcall(damage_meter_UI.draw);
if not success then if not success then
customization_menu.status = "Damage meter drawing function threw an exception"; customization_menu.status = "Damage meter drawing function threw an exception";
end end
end end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then if config.current_config.endemic_life_UI.enabled and
config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then
local success = pcall(env_creature_UI.draw); local success = pcall(env_creature_UI.draw);
if not success then if not success then
customization_menu.status = "Endemic life drawing function threw an exception"; customization_menu.status = "Endemic life drawing function threw an exception";
@@ -141,16 +152,20 @@ local function main_loop()
end end
end end
elseif quest_status.is_result_screen then elseif quest_status.is_result_screen then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then if config.current_config.small_monster_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
local success = pcall(small_monster_UI.draw); local success = pcall(small_monster_UI.draw);
if not success then if not success then
customization_menu.status = "Small monster drawing function threw an exception"; customization_menu.status = "Small monster drawing function threw an exception";
end end
end end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI; local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI; config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI; local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled); local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
@@ -159,21 +174,24 @@ local function main_loop()
end end
end end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then if config.current_config.time_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then
local success = pcall(time_UI.draw); local success = pcall(time_UI.draw);
if not success then if not success then
customization_menu.status = "Time drawing function threw an exception"; customization_menu.status = "Time drawing function threw an exception";
end end
end end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then if config.current_config.damage_meter_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
local success = pcall(damage_meter_UI.draw); local success = pcall(damage_meter_UI.draw);
if not success then if not success then
customization_menu.status = "Damage meter drawing function threw an exception"; customization_menu.status = "Damage meter drawing function threw an exception";
end end
end end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then if config.current_config.endemic_life_UI.enabled and
config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then
local success = pcall(env_creature_UI.draw); local success = pcall(env_creature_UI.draw);
if not success then if not success then
customization_menu.status = "Endemic life drawing function threw an exception"; customization_menu.status = "Endemic life drawing function threw an exception";
@@ -181,16 +199,20 @@ local function main_loop()
end end
elseif quest_status.index == 2 then elseif quest_status.index == 2 then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then if config.current_config.small_monster_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
local success = pcall(small_monster_UI.draw); local success = pcall(small_monster_UI.draw);
if not success then if not success then
customization_menu.status = "Small monster drawing function threw an exception"; customization_menu.status = "Small monster drawing function threw an exception";
end end
end end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI; local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI; config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI; local static_enabled = config.current_config.large_monster_UI.static.enabled and
config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and
config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI;
@@ -201,21 +223,24 @@ local function main_loop()
end end
end end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.time_UI then if config.current_config.time_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.time_UI then
local success = pcall(time_UI.draw); local success = pcall(time_UI.draw);
if not success then if not success then
customization_menu.status = "Time drawing function threw an exception"; customization_menu.status = "Time drawing function threw an exception";
end end
end end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then if config.current_config.damage_meter_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then
local success = pcall(damage_meter_UI.draw); local success = pcall(damage_meter_UI.draw);
if not success then if not success then
customization_menu.status = "Damage meter drawing function threw an exception"; customization_menu.status = "Damage meter drawing function threw an exception";
end end
end end
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then if config.current_config.endemic_life_UI.enabled and
config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then
local success = pcall(env_creature_UI.draw); local success = pcall(env_creature_UI.draw);
if not success then if not success then
customization_menu.status = "Endemic life drawing function threw an exception"; customization_menu.status = "Endemic life drawing function threw an exception";
@@ -438,6 +463,7 @@ local function main_loop()
xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer); xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer);
--]] --]]
end end
-- #endregion -- #endregion
----------------------------LOOP----------------------------- ----------------------------LOOP-----------------------------

View File

@@ -43,7 +43,8 @@ local is_from_host_field = packet_quest_forfeit_type_def:get_field("_IsFromQuest
function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette_attack) function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette_attack)
if is_marionette_attack then if is_marionette_attack then
return "wyvern riding"; return "wyvern riding";
elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or damage_source_type_id == 13 then elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or
damage_source_type_id == 13 then
return "player"; return "player";
elseif damage_source_type_id == 1 or damage_source_type_id == 8 then elseif damage_source_type_id == 1 or damage_source_type_id == 8 then
return "bomb"; return "bomb";
@@ -93,7 +94,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
for enemy, monster in pairs(large_monster.list) do for enemy, monster in pairs(large_monster.list) do
if monster.unique_id == attacker_id then if monster.unique_id == attacker_id then
attacker_id = monster.rider_id; attacker_id = monster.rider_id;
break; break
end end
end end
end end
@@ -161,7 +162,8 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
-- xy = ""; -- xy = "";
--end --end
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack); local damage_source_type = damage_hook.get_damage_source_type(attacker_type,
is_marionette_attack);
local attacking_player = player.get_player(attacker_id); local attacking_player = player.get_player(attacker_id);

View File

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

View File

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

View File

@@ -503,7 +503,8 @@ function keyboard.check_hotkeys(hard_keyboard)
if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_dynamic_UI.key)) then if get_release_method:call(hard_keyboard,
math.tointeger(cached_config.large_monster_dynamic_UI.key)) then
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled; config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
end end
end end
@@ -511,7 +512,8 @@ function keyboard.check_hotkeys(hard_keyboard)
if not (cached_config.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_static_UI.key)) then if get_release_method:call(hard_keyboard,
math.tointeger(cached_config.large_monster_static_UI.key)) then
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled; config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
end end
end end
@@ -519,8 +521,10 @@ function keyboard.check_hotkeys(hard_keyboard)
if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl) if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift) and not (cached_config.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then and not (cached_config.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_highlighted_UI.key)) then if get_release_method:call(hard_keyboard,
config.current_config.large_monster_UI.highlighted.enabled = not config.current_config.large_monster_UI.highlighted.enabled; math.tointeger(cached_config.large_monster_highlighted_UI.key)) then
config.current_config.large_monster_UI.highlighted.enabled = not
config.current_config.large_monster_UI.highlighted.enabled;
end end
end end

View File

@@ -1,4 +1,3 @@
local quest_status = {}; local quest_status = {};
local singletons; local singletons;
local customization_menu; local customization_menu;

View File

@@ -35,7 +35,9 @@ local height_field = size_type:get_field("h");
function screen.get_game_window_size() function screen.get_game_window_size()
if scene_view == nil then if scene_view == nil then
scene_view = sdk.call_native_func(singletons.scene_manager, sdk.find_type_definition("via.SceneManager"), "get_MainView"); scene_view = sdk.call_native_func(singletons.scene_manager,
sdk.find_type_definition("via.SceneManager")
, "get_MainView");
if scene_view == nil then if scene_view == nil then
--log.error("[MHR_Overlay.lua] No scene view"); --log.error("[MHR_Overlay.lua] No scene view");

View File

@@ -268,11 +268,21 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB974A652, foreground = 0xB974A652,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF,
capture_health = 0xB9CCCC33 capture_health = 0xB9CCCC33
} }
} }
}, },
@@ -442,9 +452,17 @@ function config.init()
height = 4 height = 4
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7ff80ce,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -617,9 +635,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -635,9 +661,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -773,14 +807,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -898,9 +941,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1003,9 +1054,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1033,8 +1092,7 @@ function config.init()
reversed_order = false reversed_order = false
}, },
filter = filter = {
{
health_break_severe = true, health_break_severe = true,
health_break = true, health_break = true,
health_severe = true, health_severe = true,
@@ -1150,9 +1208,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1236,9 +1302,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999bfff,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1321,9 +1395,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9e57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1502,9 +1584,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7ff80ce,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1677,9 +1767,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -1695,9 +1793,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -1837,14 +1943,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -1962,9 +2077,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2067,9 +2190,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2214,9 +2345,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2300,9 +2439,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999BFFF,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2385,9 +2532,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9E57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2567,9 +2722,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7FF80CE,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2742,9 +2905,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -2760,9 +2931,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -2883,14 +3062,23 @@ function config.init()
height = 20 height = 20
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
normal_colors = { normal_colors = {
foreground = 0xB974A653, foreground = 0xB974A653,
background = 0xB9000000, background = 0xB9000000,
outline = 0xC0FFFFFF
}, },
capture_colors = { capture_colors = {
foreground = 0xB9CCCC33, foreground = 0xB9CCCC33,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
}, },
capture_line = { capture_line = {
@@ -3008,9 +3196,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB966CCC5, foreground = 0xB966CCC5,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3113,9 +3309,17 @@ function config.init()
height = 7 height = 7
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9CC6666, foreground = 0xB9CC6666,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3259,9 +3463,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9ca85cc, foreground = 0xB9CA85CC,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3345,9 +3557,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB999bfff, foreground = 0xB999BFFF,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3430,9 +3650,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xB9e57386, foreground = 0xB9E57386,
background = 0x88000000 background = 0x88000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3611,9 +3839,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7ff80ce, foreground = 0xA7FF80CE,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -3786,9 +4022,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA796cfe5, foreground = 0xA796CFE5,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -3804,9 +4048,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -4125,9 +4377,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA7CCA3F4,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
}, },
@@ -4143,9 +4403,17 @@ function config.init()
height = 5 height = 5
}, },
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = { colors = {
foreground = 0xA7F4D5A3, foreground = 0xA7F4D5A3,
background = 0xA7000000 background = 0xA7000000,
outline = 0xC0FFFFFF
} }
} }
}, },
@@ -4222,7 +4490,8 @@ function config.init_module()
config.load(); config.load();
config.current_config.version = "v2.1.2"; config.current_config.version = "v2.1.2";
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false)); language.update(table_helpers.find_index(language.language_names,
config.current_config.global_settings.language, false));
end end

View File

@@ -392,7 +392,14 @@ language.default_language = {
health_filter = "Health", health_filter = "Health",
break_severe_filter = "Break + Severe", break_severe_filter = "Break + Severe",
break_filter = "Break", break_filter = "Break",
severe_filter = "Severe" severe_filter = "Severe",
outline = "Outline",
thickness = "Thickness",
style = "Style",
inside = "Inside",
outside = "Outside",
center = "Center"
} }
}; };
@@ -409,7 +416,9 @@ function language.load()
end end
for i, language_file_name in ipairs(language_files) do for i, language_file_name in ipairs(language_files) do
local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json", ""); local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json"
,
"");
local loaded_language = json.load_file(language_file_name); local loaded_language = json.load_file(language_file_name);
if loaded_language ~= nil then if loaded_language ~= nil then
@@ -436,11 +445,10 @@ function language.save(file_name, language_table)
end end
end end
function language.save_default(); function language.save_default()
language.save(language.language_folder .. "en-us.json", language.default_language) language.save(language.language_folder .. "en-us.json", language.default_language)
end end
function language.update(index) function language.update(index)
language.current_language = table_helpers.deep_copy(language.languages[index]); language.current_language = table_helpers.deep_copy(language.languages[index]);
end end

View File

@@ -11,9 +11,13 @@ function table_helpers.deep_copy(original, copies)
copy = {}; copy = {};
copies[original] = copy; copies[original] = copy;
for original_key, original_value in next, original, nil do for original_key, original_value in next, original, nil do
copy[table_helpers.deep_copy(original_key, copies)] = table_helpers.deep_copy(original_value, copies); copy[table_helpers.deep_copy(original_key, copies)] = table_helpers.deep_copy(original_value
,
copies);
end end
setmetatable(copy, table_helpers.deep_copy(getmetatable(original), copies)); setmetatable(copy,
table_helpers.deep_copy(getmetatable(original)
, copies));
end end
else -- number, string, boolean, etc else -- number, string, boolean, etc
copy = original; copy = original;

View File

@@ -19,7 +19,7 @@ local unicode_helpers = {};
-- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535) -- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535)
-- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111) -- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111)
local pattern = '[%z\1-\127\194-\244][\128-\191]*'; local pattern = "[%z\1-\127\194-\244][\128-\191]*";
-- helper function -- helper function
function unicode_helpers.relative_position(position, length) function unicode_helpers.relative_position(position, length)
@@ -36,13 +36,13 @@ function unicode_helpers.map(s, f, no_subs)
local i = 0; local i = 0;
if no_subs then if no_subs then
for b, e in s:gmatch('()' .. pattern .. '()') do for b, e in s:gmatch("()" .. pattern .. "()") do
i = i + 1; i = i + 1;
local c = e - b; local c = e - b;
f(i, c, b) f(i, c, b)
end end
else else
for b, c in s:gmatch('()(' .. pattern .. ')') do for b, c in s:gmatch("()(" .. pattern .. ")") do
i = i + 1; i = i + 1;
f(i, c, b); f(i, c, b);
end end
@@ -75,7 +75,7 @@ function unicode_helpers.sub(string, i, j)
end end
if i > j then if i > j then
return ''; return "";
end end
local diff = j - i; local diff = j - i;
@@ -105,7 +105,6 @@ function unicode_helpers.sub(string, i, j)
return string.sub(string, i, b + c - 1); return string.sub(string, i, b + c - 1);
end end
function unicode_helpers.init_module() function unicode_helpers.init_module()
end end

View File

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

View File

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

View File

@@ -285,7 +285,7 @@ function ailments.update_ailments(enemy, monster)
for index, ailment_param in ipairs(condition_param_table) do for index, ailment_param in ipairs(condition_param_table) do
local id = index - 1; local id = index - 1;
if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then
goto continue; goto continue
end end
ailments.update_ailment(monster, ailment_param, id); ailments.update_ailment(monster, ailment_param, id);
@@ -438,110 +438,115 @@ function ailments.draw_dynamic(monster, ailments_position_on_screen, opacity_sca
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -601,110 +606,115 @@ function ailments.draw_static(monster, ailments_position_on_screen, opacity_scal
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -763,110 +773,115 @@ function ailments.draw_highlighted(monster, ailments_position_on_screen, opacity
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -924,110 +939,115 @@ function ailments.draw_small(monster, ailments_position_on_screen, opacity_scale
for id, ailment in pairs(monster.ailments) do for id, ailment in pairs(monster.ailments) do
if id == ailments.paralyze_id then if id == ailments.paralyze_id then
if not cached_config.filter.paralysis then if not cached_config.filter.paralysis then
goto continue; goto continue
end end
elseif id == ailments.sleep_id then elseif id == ailments.sleep_id then
if not cached_config.filter.sleep then if not cached_config.filter.sleep then
goto continue; goto continue
end end
elseif id == ailments.stun_id then elseif id == ailments.stun_id then
if not cached_config.filter.stun then if not cached_config.filter.stun then
goto continue; goto continue
end end
elseif id == ailments.flash_id then elseif id == ailments.flash_id then
if not cached_config.filter.flash then if not cached_config.filter.flash then
goto continue; goto continue
end end
elseif id == ailments.poison_id then elseif id == ailments.poison_id then
if not cached_config.filter.poison then if not cached_config.filter.poison then
goto continue; goto continue
end end
elseif id == ailments.blast_id then elseif id == ailments.blast_id then
if not cached_config.filter.blast then if not cached_config.filter.blast then
goto continue; goto continue
end end
elseif id == ailments.exhaust_id then elseif id == ailments.exhaust_id then
if not cached_config.filter.exhaust then if not cached_config.filter.exhaust then
goto continue; goto continue
end end
elseif id == ailments.ride_id then elseif id == ailments.ride_id then
if not cached_config.filter.ride then if not cached_config.filter.ride then
goto continue; goto continue
end end
elseif id == ailments.water_id then elseif id == ailments.water_id then
if not cached_config.filter.waterblight then if not cached_config.filter.waterblight then
goto continue; goto continue
end end
elseif id == ailments.fire_id then elseif id == ailments.fire_id then
if not cached_config.filter.fireblight then if not cached_config.filter.fireblight then
goto continue; goto continue
end end
elseif id == ailments.ice_id then elseif id == ailments.ice_id then
if not cached_config.filter.iceblight then if not cached_config.filter.iceblight then
goto continue; goto continue
end end
elseif id == ailments.thunder_id then elseif id == ailments.thunder_id then
if not cached_config.filter.thunderblight then if not cached_config.filter.thunderblight then
goto continue; goto continue
end end
elseif id == ailments.fall_trap_id then elseif id == ailments.fall_trap_id then
if not cached_config.filter.fall_trap then if not cached_config.filter.fall_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_trap_id then elseif id == ailments.shock_trap_id then
if not cached_config.filter.shock_trap then if not cached_config.filter.shock_trap then
goto continue; goto continue
end end
elseif id == ailments.capture_id then elseif id == ailments.capture_id then
if not cached_config.filter.tranq_bomb then if not cached_config.filter.tranq_bomb then
goto continue; goto continue
end end
elseif id == ailments.koyashi_id then elseif id == ailments.koyashi_id then
if not cached_config.filter.dung_bomb then if not cached_config.filter.dung_bomb then
goto continue; goto continue
end end
elseif id == ailments.steel_fang_id then elseif id == ailments.steel_fang_id then
if not cached_config.filter.steel_fang then if not cached_config.filter.steel_fang then
goto continue; goto continue
end end
elseif id == ailments.fall_quick_sand_id then elseif id == ailments.fall_quick_sand_id then
if not cached_config.filter.quick_sand then if not cached_config.filter.quick_sand then
goto continue; goto continue
end end
elseif id == ailments.fall_otomo_trap_id then elseif id == ailments.fall_otomo_trap_id then
if not cached_config.filter.fall_otomo_trap then if not cached_config.filter.fall_otomo_trap then
goto continue; goto continue
end end
elseif id == ailments.shock_otomo_trap_id then elseif id == ailments.shock_otomo_trap_id then
if not cached_config.filter.shock_otomo_trap then if not cached_config.filter.shock_otomo_trap then
goto continue; goto continue
end end
else else
goto continue; goto continue
end end
if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and ailment.buildup_limit ~= 0 and ailment.activate_count == 0 and not ailment.is_active then if cached_config.settings.hide_ailments_with_zero_buildup and ailment.total_buildup == 0 and
goto continue; ailment.buildup_limit ~= 0
and ailment.activate_count == 0 and not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and not ailment.is_active then if cached_config.settings.hide_inactive_ailments_with_no_buildup_support and ailment.buildup_limit == 0 and
goto continue; not ailment.is_active then
goto continue
end end
if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then if cached_config.settings.hide_all_inactive_ailments and not ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_all_active_ailments and ailment.is_active then if cached_config.settings.hide_all_active_ailments and ailment.is_active then
goto continue; goto continue
end end
if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then if cached_config.settings.hide_disabled_ailments and not ailment.is_enable then
goto continue; goto continue
end end
if cached_config.settings.time_limit ~= 0 and time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and not ailment.is_active then if cached_config.settings.time_limit ~= 0 and
goto continue; time.total_elapsed_script_seconds - ailment.last_change_time > cached_config.settings.time_limit and
not ailment.is_active then
goto continue
end end
table.insert(displayed_ailments, ailment); table.insert(displayed_ailments, ailment);
@@ -1087,7 +1107,8 @@ end
function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailment_buildup) function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailment_buildup)
if monster == nil or player == nil or (ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id) then if monster == nil or player == nil or
(ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id) then
return; return;
end end
@@ -1097,7 +1118,8 @@ function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailm
end end
-- accumulate this buildup for this attacker -- accumulate this buildup for this attacker
monster.ailments[ailment_type].buildup[attacker_id] = (monster.ailments[ailment_type].buildup[attacker_id] or 0) + ailment_buildup; monster.ailments[ailment_type].buildup[attacker_id] = (monster.ailments[ailment_type].buildup[attacker_id] or 0) +
ailment_buildup;
ailments.calculate_ailment_contribution(monster, ailment_type); ailments.calculate_ailment_contribution(monster, ailment_type);
end end

View File

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

View File

@@ -204,10 +204,14 @@ function large_monster.init_dynamic_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x *
monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y *
monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height *
global_scale_modifier;
monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_dynamic_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -263,10 +267,14 @@ function large_monster.init_static_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x *
monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y *
monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height *
global_scale_modifier;
monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_static_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -319,10 +327,14 @@ function large_monster.init_highlighted_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x * global_scale_modifier; monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x *
monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y * global_scale_modifier; global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width * global_scale_modifier; monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y *
monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height * global_scale_modifier; global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width *
global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height
* global_scale_modifier;
monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors; monster.health_highlighted_UI.bar.colors = cached_config.health.bar.normal_colors;
@@ -402,7 +414,8 @@ local get_mario_player_index_method = mario_param_type:get_method("get_MarioPlay
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos"); local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
function large_monster.update_position(enemy, monster) function large_monster.update_position(enemy, monster)
if not config.current_config.large_monster_UI.dynamic.enabled and config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then if not config.current_config.large_monster_UI.dynamic.enabled and
config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then
return; return;
end end
@@ -713,7 +726,7 @@ function large_monster.update_parts(enemy, monster, physical_param)
if part == nil then if part == nil then
local part_name = part_names.get_part_name(monster.id, part_id); local part_name = part_names.get_part_name(monster.id, part_id);
if part_name == nil then if part_name == nil then
goto continue; goto continue
else else
part = body_part.new(part_id, part_name); part = body_part.new(part_id, part_name);
monster.parts[part_id] = part; monster.parts[part_id] = part;
@@ -842,18 +855,23 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale); health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale);
drawing.draw_capture_line(monster.health_dynamic_UI, health_position_on_screen, opacity_scale, monster.capture_percentage); drawing.draw_capture_line(monster.health_dynamic_UI, health_position_on_screen, opacity_scale,
monster.capture_percentage);
stamina_UI_entity.draw(monster, monster.stamina_dynamic_UI, stamina_position_on_screen, opacity_scale); stamina_UI_entity.draw(monster, monster.stamina_dynamic_UI, stamina_position_on_screen, opacity_scale);
rage_UI_entity.draw(monster, monster.rage_dynamic_UI, rage_position_on_screen, opacity_scale); rage_UI_entity.draw(monster, monster.rage_dynamic_UI, rage_position_on_screen, opacity_scale);
local last_part_position_on_screen = body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_dynamic(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then
ailments_position_on_screen = { ailments_position_on_screen = {
x = last_part_position_on_screen.x + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * global_scale_modifier, x = last_part_position_on_screen.x +
y = last_part_position_on_screen.y + config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * global_scale_modifier config.current_config.large_monster_UI.highlighted.ailments.relative_offset.x * global_scale_modifier,
y = last_part_position_on_screen.y +
config.current_config.large_monster_UI.highlighted.ailments.relative_offset.y * global_scale_modifier
}; };
end end
end end
@@ -932,7 +950,9 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
stamina_UI_entity.draw(monster, monster.stamina_static_UI, stamina_position_on_screen, opacity_scale); stamina_UI_entity.draw(monster, monster.stamina_static_UI, stamina_position_on_screen, opacity_scale);
rage_UI_entity.draw(monster, monster.rage_static_UI, rage_position_on_screen, opacity_scale); rage_UI_entity.draw(monster, monster.rage_static_UI, rage_position_on_screen, opacity_scale);
local last_part_position_on_screen = body_part.draw_static(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_static(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then
@@ -1011,12 +1031,15 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
}; };
health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale); health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale);
drawing.draw_capture_line(monster.health_highlighted_UI, health_position_on_screen, opacity_scale, monster.capture_percentage); drawing.draw_capture_line(monster.health_highlighted_UI, health_position_on_screen, opacity_scale,
monster.capture_percentage);
stamina_UI_entity.draw(monster, monster.stamina_highlighted_UI, stamina_position_on_screen, opacity_scale); stamina_UI_entity.draw(monster, monster.stamina_highlighted_UI, stamina_position_on_screen, opacity_scale);
rage_UI_entity.draw(monster, monster.rage_highlighted_UI, rage_position_on_screen, opacity_scale); rage_UI_entity.draw(monster, monster.rage_highlighted_UI, rage_position_on_screen, opacity_scale);
local last_part_position_on_screen = body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale); local last_part_position_on_screen = body_part.draw_highlighted(monster,
parts_position_on_screen
, opacity_scale);
if cached_config.ailments.settings.offset_is_relative_to_parts then if cached_config.ailments.settings.offset_is_relative_to_parts then
if last_part_position_on_screen ~= nil then if last_part_position_on_screen ~= nil then

View File

@@ -101,7 +101,8 @@ function monster_hook.update_large_monster(enemy)
-- is it old tick? -- is it old tick?
-- is update limit reached? -- is update limit reached?
if tick_count == last_update_tick and updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then if tick_count == last_update_tick and
updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then
return; return;
end end
@@ -142,7 +143,8 @@ function monster_hook.update_small_monster(enemy)
-- is it old tick? -- is it old tick?
-- is update limit reached? -- is update limit reached?
if tick_count == last_update_tick and updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then if tick_count == last_update_tick and
updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then
return; return;
end end
@@ -244,7 +246,8 @@ function monster_hook.init_module()
end); end);
sdk.hook(anger_add_method, function(args) sdk.hook(anger_add_method, function(args)
pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]), sdk.to_managed_object(args[4])); pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]),
sdk.to_managed_object(args[4]));
end, function(retval) end, function(retval)
return retval; return retval;
end); end);

View File

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

View File

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

View File

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

View File

@@ -33,17 +33,17 @@ function small_monster_UI.draw()
local enemy = get_zako_enemy_method:call(singletons.enemy_manager, i); local enemy = get_zako_enemy_method:call(singletons.enemy_manager, i);
if enemy == nil then if enemy == nil then
customization_menu.status = "No enemy"; customization_menu.status = "No enemy";
goto continue; goto continue
end end
local monster = small_monster.list[enemy]; local monster = small_monster.list[enemy];
if monster == nil then if monster == nil then
customization_menu.status = "No monster hp entry"; customization_menu.status = "No monster hp entry";
goto continue; goto continue
end end
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
goto continue; goto continue
end end
table.insert(displayed_monsters, monster); table.insert(displayed_monsters, monster);
@@ -105,7 +105,9 @@ function small_monster_UI.draw()
local position_on_screen; local position_on_screen;
if cached_config.dynamic_positioning.enabled then if cached_config.dynamic_positioning.enabled then
local world_offset = Vector3f.new(cached_config.dynamic_positioning.world_offset.x, cached_config.dynamic_positioning.world_offset.y, cached_config.dynamic_positioning.world_offset.z); local world_offset = Vector3f.new(cached_config.dynamic_positioning.world_offset.x,
cached_config.dynamic_positioning.world_offset.y,
cached_config.dynamic_positioning.world_offset.z);
position_on_screen = draw.world_to_screen(monster.position + world_offset); position_on_screen = draw.world_to_screen(monster.position + world_offset);
@@ -135,7 +137,7 @@ function small_monster_UI.draw()
end end
if monster.distance > cached_config.dynamic_positioning.max_distance then if monster.distance > cached_config.dynamic_positioning.max_distance then
goto continue; goto continue
end end
if cached_config.dynamic_positioning.opacity_falloff then if cached_config.dynamic_positioning.opacity_falloff then

View File

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

View File

@@ -5,7 +5,9 @@ local config;
local player; local player;
local language; local language;
function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label, buildup_value_label, buildup_percentage_label, total_buildup_label, total_buildup_value_label) function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label,
buildup_value_label, buildup_percentage_label, total_buildup_label,
total_buildup_value_label)
local entity = {}; local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -24,11 +26,16 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier; entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
entity.buildup_bar.size.width = entity.buildup_bar.size.width * global_scale_modifier; entity.buildup_bar.size.width = entity.buildup_bar.size.width * global_scale_modifier;
entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier; entity.buildup_bar.size.height = entity.buildup_bar.size.height * global_scale_modifier;
entity.buildup_bar.outline.thickness = entity.buildup_bar.outline.thickness * global_scale_modifier;
entity.buildup_bar.outline.offset = entity.buildup_bar.outline.offset * global_scale_modifier;
entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * global_scale_modifier; entity.highlighted_buildup_bar.offset.x = entity.highlighted_buildup_bar.offset.x * global_scale_modifier;
entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * global_scale_modifier; entity.highlighted_buildup_bar.offset.y = entity.highlighted_buildup_bar.offset.y * global_scale_modifier;
entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * global_scale_modifier; entity.highlighted_buildup_bar.size.width = entity.highlighted_buildup_bar.size.width * global_scale_modifier;
entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * global_scale_modifier; entity.highlighted_buildup_bar.size.height = entity.highlighted_buildup_bar.size.height * global_scale_modifier;
entity.highlighted_buildup_bar.outline.thickness = entity.highlighted_buildup_bar.outline.thickness *
global_scale_modifier;
entity.highlighted_buildup_bar.outline.offset = entity.highlighted_buildup_bar.outline.offset * global_scale_modifier;
entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier; entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier;
entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier; entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
@@ -48,7 +55,8 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
return entity; return entity;
end end
function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, position_on_screen, opacity_scale,
top_buildup)
local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups; local cached_config = config.current_config.large_monster_UI.dynamic.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
@@ -61,19 +69,24 @@ function ailment_buildup_UI_entity.draw_dynamic(_player, ailment_buildup_UI, pos
end end
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, position_on_screen, opacity_scale,
top_buildup)
local cached_config = config.current_config.large_monster_UI.static.ailment_buildups; local cached_config = config.current_config.large_monster_UI.static.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
@@ -86,19 +99,24 @@ function ailment_buildup_UI_entity.draw_static(_player, ailment_buildup_UI, posi
end end
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI, position_on_screen, opacity_scale,
top_buildup)
local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups; local cached_config = config.current_config.large_monster_UI.highlighted.ailment_buildups;
local player_buildup_bar_percentage = 0; local player_buildup_bar_percentage = 0;
@@ -111,16 +129,20 @@ function ailment_buildup_UI_entity.draw_highlighted(_player, ailment_buildup_UI,
end end
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup) function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, position_on_screen, opacity_scale, top_buildup)
@@ -136,16 +158,20 @@ function ailment_buildup_UI_entity.draw_small(_player, ailment_buildup_UI, posit
end end
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player.buildup == top_buildup then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale,
player_buildup_bar_percentage);
else else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage); drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player.get_player(_player.id).name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale,
player.get_player(_player.id).name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup); drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * _player.buildup_share); drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale,
100 * _player.buildup_share);
end end
function ailment_buildup_UI_entity.init_module() function ailment_buildup_UI_entity.init_module()

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,8 @@ drawing.font = nil;
function drawing.init_font() function drawing.init_font()
local cached_config = config.current_config.global_settings.UI_font; local cached_config = config.current_config.global_settings.UI_font;
drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold, cached_config.italic); drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold,
cached_config.italic);
end end
function drawing.argb_color_to_abgr_color(argb_color) function drawing.argb_color_to_abgr_color(argb_color)
@@ -44,7 +45,7 @@ function drawing.limit_text_size(text, size_limit)
local text_width, text_height = drawing.font:measure(limited_text); local text_width, text_height = drawing.font:measure(limited_text);
if text_width < size_limit then if text_width < size_limit then
break; break
else else
limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "..."; limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "...";
end end
@@ -124,6 +125,7 @@ function drawing.draw_label(label, position, opacity_scale, ...)
end end
function drawing.draw_bar(bar, position, opacity_scale, percentage) function drawing.draw_bar(bar, position, opacity_scale, percentage)
if bar == nil if bar == nil
or not bar.visibility then or not bar.visibility then
return; return;
@@ -137,33 +139,127 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
percentage = 0; percentage = 0;
end end
local position_x = position.x + bar.offset.x; local outline_visibility = bar.outline.visibility;
local position_y = position.y + bar.offset.y; local style = bar.outline.style; -- Inside/Center/Outside
local foreground_width = bar.size.width * percentage;
local background_width = bar.size.width - foreground_width;
local new_foreground_color = bar.colors.foreground; local outline_thickness = bar.outline.thickness;
local new_background_color = bar.colors.background; if not outline_visibility then
outline_thickness = 0;
end
local half_outline_thickness = outline_thickness / 2;
local outline_offset = bar.outline.offset;
if outline_thickness == 0 then
outline_offset = 0;
end
local half_outline_offset = outline_offset / 2;
local outline_position_x = 0;
local outline_position_y = 0;
local outline_width = 0;
local outline_height = 0;
local position_x = 0;
local position_y = 0;
local foreground_width = 0;
local background_width = 0;
local height = 0;
if style == "Inside" then
outline_position_x = position.x + bar.offset.x + half_outline_thickness;
outline_position_y = position.y + bar.offset.y + half_outline_thickness;
outline_width = bar.size.width - outline_thickness;
outline_height = bar.size.height - outline_thickness;
position_x = outline_position_x + half_outline_thickness + outline_offset;
position_y = outline_position_y + half_outline_thickness + outline_offset;
local width = outline_width - outline_thickness - outline_offset - outline_offset;
foreground_width = width * percentage;
background_width = width - foreground_width;
height = outline_height - outline_thickness - outline_offset - outline_offset;
elseif style == "Center" then
outline_position_x = position.x + bar.offset.x - half_outline_offset;
outline_position_y = position.y + bar.offset.y - half_outline_offset;
outline_width = bar.size.width + outline_offset;
outline_height = bar.size.height + outline_offset;
position_x = outline_position_x + half_outline_thickness + outline_offset;
position_y = outline_position_y + half_outline_thickness + outline_offset;
local width = outline_width - outline_thickness - outline_offset - outline_offset;
foreground_width = width * percentage;
background_width = width - foreground_width;
height = outline_height - outline_thickness - outline_offset - outline_offset;
else
position_x = position.x + bar.offset.x;
position_y = position.y + bar.offset.y;
local width = bar.size.width;
height = bar.size.height;
foreground_width = width * percentage;
background_width = width - foreground_width;
outline_position_x = position_x - half_outline_thickness - outline_offset;
outline_position_y = position_y - half_outline_thickness - outline_offset;
outline_width = width + outline_thickness + outline_offset + outline_offset;
outline_height = height + outline_thickness + outline_offset + outline_offset;
end
local foreground_color = bar.colors.foreground;
local background_color = bar.colors.background;
local outline_color = bar.colors.outline;
if opacity_scale < 1 then if opacity_scale < 1 then
new_foreground_color = drawing.scale_color_opacity(new_foreground_color, opacity_scale); foreground_color = drawing.scale_color_opacity(foreground_color, opacity_scale);
new_background_color = drawing.scale_color_opacity(new_background_color, opacity_scale); background_color = drawing.scale_color_opacity(background_color, opacity_scale);
outline_color = drawing.scale_color_opacity(outline_color, opacity_scale);
end
local use_d2d = d2d ~= nil;
-- outline
if outline_thickness ~= 0 then
if use_d2d then
d2d.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_thickness,
outline_color);
else
outline_color = drawing.argb_color_to_abgr_color(outline_color);
draw.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_color);
end
end end
-- foreground -- foreground
if d2d ~= nil then if foreground_width ~= 0 then
d2d.fill_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color); if use_d2d then
d2d.fill_rect(position_x, position_y, foreground_width, height, foreground_color);
else else
new_foreground_color = drawing.argb_color_to_abgr_color(new_foreground_color); foreground_color = drawing.argb_color_to_abgr_color(foreground_color);
draw.filled_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color) draw.filled_rect(position_x, position_y, foreground_width, height, foreground_color)
end
end end
-- background -- background
if d2d ~= nil then if background_width ~= 0 then
d2d.fill_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color); if use_d2d then
d2d.fill_rect(position_x + foreground_width, position_y, background_width, height, background_color);
else else
new_background_color = drawing.argb_color_to_abgr_color(new_background_color); background_color = drawing.argb_color_to_abgr_color(background_color);
draw.filled_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color) draw.filled_rect(position_x + foreground_width, position_y, background_width, height, background_color)
end
end end
end end
@@ -180,7 +276,8 @@ function drawing.draw_capture_line(health_UI, position, opacity_scale, percentag
end end
local position_x = position.x + health_UI.bar.offset.x + health_UI.bar.capture_line.offset.x + health_UI.bar.size.width * percentage; local position_x = position.x + health_UI.bar.offset.x + health_UI.bar.capture_line.offset.x +
health_UI.bar.size.width * percentage;
local position_y = position.y + health_UI.bar.offset.y + health_UI.bar.capture_line.offset.y; local position_y = position.y + health_UI.bar.offset.y + health_UI.bar.capture_line.offset.y;
local color = health_UI.bar.capture_line.color; local color = health_UI.bar.capture_line.color;
@@ -190,10 +287,12 @@ function drawing.draw_capture_line(health_UI, position, opacity_scale, percentag
end end
if d2d ~= nil then if d2d ~= nil then
d2d.fill_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height, color); d2d.fill_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height,
color);
else else
color = drawing.argb_color_to_abgr_color(color); color = drawing.argb_color_to_abgr_color(color);
draw.filled_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height, color) draw.filled_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height
, color)
end end
end end

View File

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

View File

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

View File

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

View File

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

View File

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