Damage Meter UI customization refactoring

This commit is contained in:
GreenComfyTea
2023-01-05 18:15:18 +02:00
parent a8ec321dae
commit 9a3cb399e2
10 changed files with 466 additions and 772 deletions

View File

@@ -204,7 +204,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
--" Condition Type: (" .. tostring(attacker_type) .. --" Condition Type: (" .. tostring(attacker_type) ..
--") " .. tostring(condition_type); --") " .. tostring(condition_type);
if is_otomo_attack then --if is_otomo_attack then
--xy = xy .. "\nOtomo Master: " .. tostring(attacking_player.id) .. --xy = xy .. "\nOtomo Master: " .. tostring(attacking_player.id) ..
--" " .. tostring(attacking_player.name) .. --" " .. tostring(attacking_player.name) ..
--" Damage: " .. tostring(damage_object.total_damage); --" Damage: " .. tostring(damage_object.total_damage);
@@ -212,11 +212,11 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
--xy = xy .. "\nOtomo: " .. tostring(attacking_otomo.id) .. --xy = xy .. "\nOtomo: " .. tostring(attacking_otomo.id) ..
--" " .. tostring(attacking_otomo.name) .. --" " .. tostring(attacking_otomo.name) ..
--" Damage: " .. tostring(damage_object.total_damage); --" Damage: " .. tostring(damage_object.total_damage);
end --end
if string.len(xy) > 2700 then --if string.len(xy) > 2700 then
--xy = ""; -- xy = "";
end --end
end end
--function damage_hook.on_mystery_core_break(enemy) --function damage_hook.on_mystery_core_break(enemy)
@@ -226,12 +226,12 @@ end
function damage_hook.cart(dead_player_id, flag_cat_skill_insurance) function damage_hook.cart(dead_player_id, flag_cat_skill_insurance)
-- flag_cat_skill_insurance = 0 -- flag_cat_skill_insurance = 0
-- flag_cat_skill_insurance = 1 -- flag_cat_skill_insurance = 1
local player_ = players.list[dead_player_id]; local player = players.list[dead_player_id];
if player_ == nil then if player == nil then
return; return;
end end
player_.cart_count = player_.cart_count + 1; player.cart_count = player.cart_count + 1;
quest_status.get_cart_count(); quest_status.get_cart_count();
end end

View File

@@ -295,33 +295,40 @@ function non_players.update_otomos(otomo_info_field_)
local level = otomo_info_level_field:get_data(otomo_info) or 0; local level = otomo_info_level_field:get_data(otomo_info) or 0;
local otomo_in_list = non_players.otomo_list[id]; local otomo = non_players.otomo_list[id];
if otomo_in_list == nil or (otomo_in_list.name ~= name and otomo_in_list.level) then if otomo == nil or (otomo.name ~= name and level ~= otomo.level) or
(otomo.type == players.types.my_otomo and otomo.id ~= players.myself.id) or
(otomo.type ~= players.types.my_otomo and otomo.id == players.myself.id) then
if id == players.myself.id then if id == players.myself.id then
local otomo = non_players.new(id, name, level, players.types.my_otomo); otomo = non_players.new(id, name, level, players.types.my_otomo);
non_players.otomo_list[id] = otomo; non_players.otomo_list[id] = otomo;
if cached_config.settings.show_my_otomos_separately then
table.insert(players.display_list, otomo);
end
elseif id >= 4 then elseif id >= 4 then
local otomo = non_players.new(id, name, level, players.types.servant_otomo); otomo = non_players.new(id, name, level, players.types.servant_otomo);
non_players.otomo_list[id] = otomo; non_players.otomo_list[id] = otomo;
if cached_config.settings.show_servant_otomos_separately then
table.insert(players.display_list, non_players);
end
else else
local otomo = non_players.new(id, name, level, players.types.my_otomo); otomo = non_players.new(id, name, level, players.types.other_player_otomo);
non_players.otomo_list[id] = otomo; non_players.otomo_list[id] = otomo;
if cached_config.settings.show_other_player_otomos_separately then
table.insert(players.display_list, non_players);
end
end end
end end
if id == players.myself.id then
if cached_config.settings.show_my_otomos_separately then
table.insert(players.display_list, otomo);
end
elseif id >= 4 then
if cached_config.settings.show_servant_otomos_separately then
table.insert(players.display_list, otomo);
end
else
if cached_config.settings.show_other_player_otomos_separately then
table.insert(players.display_list, otomo);
end
end
::continue:: ::continue::
end end
end end

View File

@@ -15,7 +15,9 @@ players.myself = nil;
players.myself_position = Vector3f.new(0, 0, 0); players.myself_position = Vector3f.new(0, 0, 0);
players.total = nil; players.total = nil;
players.display_list = {} players.display_list = {};
players.highlighted_damage_UI = nil;
players.types = { players.types = {
["myself"] = 0, ["myself"] = 0,
@@ -24,36 +26,38 @@ players.types = {
["my_otomo"] = 4, ["my_otomo"] = 4,
["other_player_otomo"] = 8, ["other_player_otomo"] = 8,
["servant_otomo"] = 16, ["servant_otomo"] = 16,
["total"] = 32 ["total"] = 32,
["highlight"] = 64
} }
function players.new(id, name, master_rank, hunter_rank, type) function players.new(id, name, master_rank, hunter_rank, type)
local new_player = {}; local player = {};
new_player.id = id; player.id = id;
new_player.name = name; player.name = name;
new_player.hunter_rank = hunter_rank; player.hunter_rank = hunter_rank;
new_player.master_rank = master_rank; player.master_rank = master_rank;
new_player.type = type; player.type = type;
new_player.cart_count = 0; player.cart_count = 0;
new_player.join_time = -1; player.join_time = -1;
new_player.first_hit_time = -1; player.first_hit_time = -1;
new_player.dps = 0; player.dps = 0;
new_player.small_monsters = players.init_damage_sources() player.small_monsters = players.init_damage_sources()
new_player.large_monsters = players.init_damage_sources(); player.large_monsters = players.init_damage_sources();
new_player.display = {}; player.display = {};
new_player.display.total_damage = 0; player.display.total_damage = 0;
new_player.display.physical_damage = 0; player.display.physical_damage = 0;
new_player.display.elemental_damage = 0; player.display.elemental_damage = 0;
new_player.display.ailment_damage = 0; player.display.ailment_damage = 0;
players.init_UI(new_player); players.init_UI(player);
return new_player; return player;
end end
function players.init_damage_sources() function players.init_damage_sources()
@@ -100,12 +104,25 @@ function players.init_damage_sources()
monster_type.poison.elemental_damage = 0; monster_type.poison.elemental_damage = 0;
monster_type.poison.ailment_damage = 0; monster_type.poison.ailment_damage = 0;
monster_type.otomo_poison = {};
monster_type.otomo_poison.total_damage = 0;
monster_type.otomo_poison.physical_damage = 0;
monster_type.otomo_poison.elemental_damage = 0;
monster_type.otomo_poison.ailment_damage = 0;
monster_type.blast = {}; monster_type.blast = {};
monster_type.blast.total_damage = 0; monster_type.blast.total_damage = 0;
monster_type.blast.physical_damage = 0; monster_type.blast.physical_damage = 0;
monster_type.blast.elemental_damage = 0; monster_type.blast.elemental_damage = 0;
monster_type.blast.ailment_damage = 0; monster_type.blast.ailment_damage = 0;
monster_type.otomo_blast = {};
monster_type.otomo_blast.total_damage = 0;
monster_type.otomo_blast.physical_damage = 0;
monster_type.otomo_blast.elemental_damage = 0;
monster_type.otomo_blast.ailment_damage = 0;
monster_type.endemic_life = {}; monster_type.endemic_life = {};
monster_type.endemic_life.total_damage = 0; monster_type.endemic_life.total_damage = 0;
monster_type.endemic_life.physical_damage = 0; monster_type.endemic_life.physical_damage = 0;
@@ -125,18 +142,18 @@ function players.get_player(player_id)
return players.list[player_id]; return players.list[player_id];
end end
function players.update_damage(_player, damage_source_type, is_large_monster, damage_object) function players.update_damage(player, damage_source_type, is_large_monster, damage_object)
if _player == nil then if player == nil then
return; return;
end end
if _player.first_hit_time == -1 then if player.first_hit_time == -1 then
_player.first_hit_time = time.total_elapsed_script_seconds; player.first_hit_time = time.total_elapsed_script_seconds;
end end
local player_monster_type = _player.small_monsters; local player_monster_type = player.small_monsters;
if is_large_monster then if is_large_monster then
player_monster_type = _player.large_monsters; player_monster_type = player.large_monsters;
end end
if damage_source_type == "player" then if damage_source_type == "player" then
@@ -163,172 +180,162 @@ function players.update_damage(_player, damage_source_type, is_large_monster, da
players.merge_damage(player_monster_type, damage_object); players.merge_damage(player_monster_type, damage_object);
end end
players.update_display(_player); players.update_display(player);
end end
function players.update_display(_player) function players.update_display(player)
if _player == nil then if player == nil then
return; return;
end end
_player.display.total_damage = 0; player.display.total_damage = 0;
_player.display.physical_damage = 0; player.display.physical_damage = 0;
_player.display.elemental_damage = 0; player.display.elemental_damage = 0;
_player.display.ailment_damage = 0; player.display.ailment_damage = 0;
local cached_config = config.current_config.damage_meter_UI; local cached_config = config.current_config.damage_meter_UI;
if cached_config.tracked_monster_types.small_monsters then if cached_config.tracked_monster_types.small_monsters then
if cached_config.tracked_damage_types.player_damage then if cached_config.tracked_damage_types.player_damage then
players.merge_damage(_player.display, _player.small_monsters); players.merge_damage(player.display, player.small_monsters);
end end
if cached_config.tracked_damage_types.bomb_damage then if cached_config.tracked_damage_types.bomb_damage then
players.merge_damage(_player.display, _player.small_monsters.bombs); players.merge_damage(player.display, player.small_monsters.bombs);
end end
if cached_config.tracked_damage_types.kunai_damage then if cached_config.tracked_damage_types.kunai_damage then
players.merge_damage(_player.display, _player.small_monsters.kunai); players.merge_damage(player.display, player.small_monsters.kunai);
end end
if cached_config.tracked_damage_types.installation_damage then if cached_config.tracked_damage_types.installation_damage then
players.merge_damage(_player.display, _player.small_monsters.installations); players.merge_damage(player.display, player.small_monsters.installations);
end end
if cached_config.tracked_damage_types.otomo_damage then if cached_config.tracked_damage_types.otomo_damage then
if _player.is_otomo then if player.type == players.types.myself then
if _player.id == players.myself.id or _player.id == non_players.my_second_otomo_id then
if cached_config.settings.show_my_otomos_separately then if not cached_config.settings.show_my_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo); players.merge_damage(player.display, player.small_monsters.otomo);
end
elseif _player.is_servant then
if cached_config.settings.show_servant_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo);
end
else
if cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo);
end
end end
else elseif player.type == players.types.other_players then
if _player == players.myself then
if not cached_config.settings.show_my_otomos_separately then if not cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo); players.merge_damage(player.display, player.small_monsters.otomo);
end
elseif _player.is_servant then
if not cached_config.settings.show_servant_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo);
end
else
if not cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.small_monsters.otomo);
end
end end
elseif player.type == players.types.servants then
if not cached_config.settings.show_servant_otomos_separately then
players.merge_damage(player.display, player.small_monsters.otomo);
end
elseif player.type == players.types.my_otomo then
if cached_config.settings.show_my_otomos_separately then
players.merge_damage(player.display, player.small_monsters.otomo);
end
elseif player.type == players.types.other_player_otomo then
if cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(player.display, player.small_monsters.otomo);
end
elseif player.type == players.types.servant_otomo then
if cached_config.settings.show_servant_otomos_separately then
players.merge_damage(player.display, player.small_monsters.otomo);
end
end end
end end
if cached_config.tracked_damage_types.wyvern_riding_damage then if cached_config.tracked_damage_types.wyvern_riding_damage then
players.merge_damage(_player.display, _player.small_monsters.wyvern_riding); players.merge_damage(player.display, player.small_monsters.wyvern_riding);
end end
if cached_config.tracked_damage_types.poison_damage then if cached_config.tracked_damage_types.poison_damage then
players.merge_damage(_player.display, _player.small_monsters.poison); players.merge_damage(player.display, player.small_monsters.poison);
end end
if cached_config.tracked_damage_types.blast_damage then if cached_config.tracked_damage_types.blast_damage then
players.merge_damage(_player.display, _player.small_monsters.blast); players.merge_damage(player.display, player.small_monsters.blast);
end end
if cached_config.tracked_damage_types.endemic_life_damage then if cached_config.tracked_damage_types.endemic_life_damage then
players.merge_damage(_player.display, _player.small_monsters.endemic_life); players.merge_damage(player.display, player.small_monsters.endemic_life);
end end
if cached_config.tracked_damage_types.other_damage then if cached_config.tracked_damage_types.other_damage then
players.merge_damage(_player.display, _player.small_monsters.other); players.merge_damage(player.display, player.small_monsters.other);
end end
end end
if cached_config.tracked_monster_types.large_monsters then if cached_config.tracked_monster_types.large_monsters then
if cached_config.tracked_damage_types.player_damage then if cached_config.tracked_damage_types.player_damage then
players.merge_damage(_player.display, _player.large_monsters); players.merge_damage(player.display, player.large_monsters);
end end
if cached_config.tracked_damage_types.bomb_damage then if cached_config.tracked_damage_types.bomb_damage then
players.merge_damage(_player.display, _player.large_monsters.bombs); players.merge_damage(player.display, player.large_monsters.bombs);
end end
if cached_config.tracked_damage_types.kunai_damage then if cached_config.tracked_damage_types.kunai_damage then
players.merge_damage(_player.display, _player.large_monsters.kunai); players.merge_damage(player.display, player.large_monsters.kunai);
end end
if cached_config.tracked_damage_types.installation_damage then if cached_config.tracked_damage_types.installation_damage then
players.merge_damage(_player.display, _player.large_monsters.installations); players.merge_damage(player.display, player.large_monsters.installations);
end end
if cached_config.tracked_damage_types.otomo_damage then if cached_config.tracked_damage_types.otomo_damage then
if _player.is_otomo then if player.type == players.types.myself then
if _player.id == players.myself.id or _player.id == non_players.my_second_otomo_id then
if cached_config.settings.show_my_otomos_separately then if not cached_config.settings.show_my_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo); players.merge_damage(player.display, player.large_monsters.otomo);
end
elseif _player.is_servant then
if cached_config.settings.show_servant_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo);
end
else
if cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo);
end
end end
else elseif player.type == players.types.other_players then
if _player == players.myself then
if not cached_config.settings.show_my_otomos_separately then if not cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo); players.merge_damage(player.display, player.large_monsters.otomo);
end
elseif _player.is_servant then
if not cached_config.settings.show_servant_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo);
end
else
if not cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(_player.display, _player.large_monsters.otomo);
end
end end
elseif player.type == players.types.servants then
if not cached_config.settings.show_servant_otomos_separately then
players.merge_damage(player.display, player.large_monsters.otomo);
end
elseif player.type == players.types.my_otomo then
if cached_config.settings.show_my_otomos_separately then
players.merge_damage(player.display, player.large_monsters.otomo);
end
elseif player.type == players.types.other_player_otomo then
if cached_config.settings.show_other_player_otomos_separately then
players.merge_damage(player.display, player.large_monsters.otomo);
end
elseif player.type == players.types.servant_otomo then
if cached_config.settings.show_servant_otomos_separately then
players.merge_damage(player.display, player.large_monsters.otomo);
end
end end
end end
if cached_config.tracked_damage_types.wyvern_riding_damage then if cached_config.tracked_damage_types.wyvern_riding_damage then
players.merge_damage(_player.display, _player.large_monsters.wyvern_riding); players.merge_damage(player.display, player.large_monsters.wyvern_riding);
end end
if cached_config.tracked_damage_types.poison_damage then if cached_config.tracked_damage_types.poison_damage then
players.merge_damage(_player.display, _player.large_monsters.poison); players.merge_damage(player.display, player.large_monsters.poison);
end end
if cached_config.tracked_damage_types.blast_damage then if cached_config.tracked_damage_types.blast_damage then
players.merge_damage(_player.display, _player.large_monsters.blast); players.merge_damage(player.display, player.large_monsters.blast);
end end
if cached_config.tracked_damage_types.endemic_life_damage then if cached_config.tracked_damage_types.endemic_life_damage then
players.merge_damage(_player.display, _player.large_monsters.endemic_life); players.merge_damage(player.display, player.large_monsters.endemic_life);
end end
if cached_config.tracked_damage_types.other_damage then if cached_config.tracked_damage_types.other_damage then
players.merge_damage(_player.display, _player.large_monsters.other); players.merge_damage(player.display, player.large_monsters.other);
end end
end end
end end
@@ -350,8 +357,8 @@ function players.update_dps(bypass_freeze)
end end
players.total.dps = 0; players.total.dps = 0;
for _, _player in pairs(players.list) do for _, player in pairs(players.list) do
players.update_player_dps(_player); players.update_player_dps(player);
end end
for _, servant in pairs(non_players.servant_list) do for _, servant in pairs(non_players.servant_list) do
@@ -363,28 +370,28 @@ function players.update_dps(bypass_freeze)
end end
end end
function players.update_player_dps(_player) function players.update_player_dps(player)
local cached_config = config.current_config.damage_meter_UI.settings; local cached_config = config.current_config.damage_meter_UI.settings;
if _player.join_time == -1 then if player.join_time == -1 then
_player.join_time = time.total_elapsed_script_seconds; player.join_time = time.total_elapsed_script_seconds;
end end
if cached_config.dps_mode == "Quest Time" then if cached_config.dps_mode == "Quest Time" then
if time.total_elapsed_seconds > 0 then if time.total_elapsed_seconds > 0 then
_player.dps = _player.display.total_damage / time.total_elapsed_seconds; player.dps = player.display.total_damage / time.total_elapsed_seconds;
end end
elseif cached_config.dps_mode == "Join Time" then elseif cached_config.dps_mode == "Join Time" then
if time.total_elapsed_script_seconds - _player.join_time > 0 then if time.total_elapsed_script_seconds - player.join_time > 0 then
_player.dps = _player.display.total_damage / (time.total_elapsed_script_seconds - _player.join_time); player.dps = player.display.total_damage / (time.total_elapsed_script_seconds - player.join_time);
end end
elseif cached_config.dps_mode == "First Hit" then elseif cached_config.dps_mode == "First Hit" then
if time.total_elapsed_script_seconds - _player.first_hit_time > 0 then if time.total_elapsed_script_seconds - player.first_hit_time > 0 then
_player.dps = _player.display.total_damage / (time.total_elapsed_script_seconds - _player.first_hit_time); player.dps = player.display.total_damage / (time.total_elapsed_script_seconds - player.first_hit_time);
end end
end end
players.total.dps = players.total.dps + _player.dps; players.total.dps = players.total.dps + player.dps;
end end
function players.sort_players() function players.sort_players()
@@ -555,6 +562,8 @@ function players.update_player_list_(hunter_info_field_)
end end
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
@@ -574,39 +583,49 @@ function players.update_player_list_(hunter_info_field_)
goto continue goto continue
end end
local player_in_list = players.list[id]; local player = players.list[id];
if player_in_list == nil or (player_in_list.name ~= name and player_in_list.hunter_rank ~= hunter_rank and player_in_list.master_rank ~= master_rank) then if player == nil or (player.name ~= name and player.hunter_rank ~= hunter_rank and player.master_rank ~= master_rank) then
if player_in_list.name == players.myself.name then if player ~= nil then
players.myself = players.new(id, name, master_rank, hunter_rank, players.types.myself); if player.name == players.myself.name then
players.list[id] = players.myself; player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
players.myself = player;
players.list[id] = player;
end
else else
players.list[id] = players.new(id, name, master_rank, hunter_rank, players.types.other_player); player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
players.list[id] = player;
end end
end end
if player_in_list ~= players.myself then if player ~= players.myself then
table.insert(players.display_list, player_in_list); table.insert(players.display_list, player);
end end
::continue:: ::continue::
end end
end end
function players.init_UI(_player) function players.init_UI(player)
local cached_config = config.current_config.damage_meter_UI; local cached_config = config.current_config.damage_meter_UI;
if _player.type == players.types.myself then if player.type == players.types.myself then
_player.damage_UI = damage_UI_entity.new(cached_config.myself, _player.type); player.damage_UI = damage_UI_entity.new(cached_config.myself, player.type);
elseif _player.type == players.types.other_player then elseif player.type == players.types.other_player then
_player.damage_UI = damage_UI_entity.new(cached_config.other_players, _player.type); player.damage_UI = damage_UI_entity.new(cached_config.other_players, player.type);
elseif _player.type == players.types.total then elseif player.type == players.types.total then
_player.damage_UI = damage_UI_entity.new(cached_config.total, _player.type); player.damage_UI = damage_UI_entity.new(cached_config.total, player.type);
end end
end end
function players.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps) function players.init_highlighted_UI()
damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps); local cached_config = config.current_config.damage_meter_UI;
players.highlighted_damage_UI = damage_UI_entity.new(cached_config.highlighted, players.types.highlight);
end
function players.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_damage, top_dps);
end end
function players.init_module() function players.init_module()

View File

@@ -4264,7 +4264,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4289,7 +4289,7 @@ function config.init()
x = -65, x = -65,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4309,7 +4309,7 @@ function config.init()
x = 315, x = 315,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4329,7 +4329,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4348,7 +4348,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4367,7 +4367,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4399,7 +4399,7 @@ function config.init()
}, },
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA7F49AC1,
background = 0xA7000000, background = 0xA7000000,
outline = 0xC0000000 outline = 0xC0000000
} }
@@ -4424,7 +4424,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4449,7 +4449,7 @@ function config.init()
x = -65, x = -65,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4469,7 +4469,7 @@ function config.init()
x = 315, x = 315,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4489,7 +4489,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4508,7 +4508,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4527,7 +4527,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4559,7 +4559,7 @@ function config.init()
}, },
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA799E2FF,
background = 0xA7000000, background = 0xA7000000,
outline = 0xC0000000 outline = 0xC0000000
} }
@@ -4581,7 +4581,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4601,7 +4601,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4620,7 +4620,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4639,7 +4639,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4694,7 +4694,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4714,7 +4714,7 @@ function config.init()
x = -30, x = -30,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4734,7 +4734,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4753,7 +4753,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4772,7 +4772,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFF59FC4,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4804,7 +4804,7 @@ function config.init()
}, },
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA7B20E42,
background = 0xA7000000, background = 0xA7000000,
outline = 0xC0000000 outline = 0xC0000000
} }
@@ -4827,7 +4827,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4847,7 +4847,7 @@ function config.init()
x = -30, x = -30,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4867,7 +4867,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4886,7 +4886,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4905,7 +4905,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFF99E2FF,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4937,7 +4937,7 @@ function config.init()
}, },
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA71288B2,
background = 0xA7000000, background = 0xA7000000,
outline = 0xC0000000 outline = 0xC0000000
} }
@@ -4960,7 +4960,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -4980,7 +4980,7 @@ function config.init()
x = -30, x = -30,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5000,7 +5000,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5019,7 +5019,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5038,7 +5038,7 @@ function config.init()
x = 262, x = 262,
y = 0 y = 0
}, },
color = 0xFFCCF4E1, color = 0xFFCDAAF2,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5070,7 +5070,7 @@ function config.init()
}, },
colors = { colors = {
foreground = 0xA7CCA3F4, foreground = 0xA7662D91,
background = 0xA7000000, background = 0xA7000000,
outline = 0xC0000000 outline = 0xC0000000
} }
@@ -5086,7 +5086,7 @@ function config.init()
x = 5, x = 5,
y = 0 y = 0
}, },
color = 0xFFFF9393, color = 0xFFF27979,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5106,7 +5106,7 @@ function config.init()
x = 315, x = 315,
y = 0 y = 0
}, },
color = 0xFFFF9393, color = 0xFFF27979,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5126,7 +5126,7 @@ function config.init()
x = 155, x = 155,
y = 0 y = 0
}, },
color = 0xFFFF9393, color = 0xFFF27979,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5145,7 +5145,7 @@ function config.init()
x = 205, x = 205,
y = 0 y = 0
}, },
color = 0xFFFF9393, color = 0xFFF27979,
shadow = { shadow = {
visibility = true, visibility = true,
@@ -5158,29 +5158,149 @@ function config.init()
}, },
}, },
highlighted_bar = { highlighted = {
visibility = true, name_label = {
offset = {
x = 0,
y = 17
},
size = {
width = 310,
height = 5
},
outline = {
visibility = true, visibility = true,
thickness = 1,
offset = 0, text = "%s",
style = "Center" offset = {
x = 5,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
hunter_rank_label = {
visibility = false,
text = "[%s]",
offset = {
x = -65,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
cart_count_label = {
visibility = false,
text = "%d",
offset = {
x = 315,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
dps_label = {
visibility = true,
text = "%.1f",
offset = {
x = 155,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
damage_value_label = {
visibility = true,
text = "%.0f",
offset = {
x = 205,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
damage_percentage_label = {
visibility = true,
text = "%5.1f%%",
offset = {
x = 262,
y = 0
},
color = 0xFFF7BEAD,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
}, },
colors = { damage_bar = {
foreground = 0xA7F4D5A3, visibility = true,
background = 0xA7000000, offset = {
outline = 0xC0000000 x = 0,
y = 17
},
size = {
width = 310,
height = 5
},
outline = {
visibility = true,
thickness = 1,
offset = 0,
style = "Center"
},
colors = {
foreground = 0xA7FDC689,
background = 0xA7000000,
outline = 0xC0000000
}
} }
} }
}, },

View File

@@ -109,13 +109,13 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
drawing.draw_label(ailment_buildup_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_buildup_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
local ailment_buildup_position_on_screen = { local ailment_buildup_position_on_screen = {
x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (j - 1) * global_scale_modifier, x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (j - 1) * global_scale_modifier,
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier; y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
}; };
ailment_buildup_UI_entity.draw(_player, ailment_buildup_UI, cached_config, ailment_buildup_position_on_screen, opacity_scale, top_buildup); ailment_buildup_UI_entity.draw(player, ailment_buildup_UI, cached_config, ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j; last_j = j;
end end

View File

@@ -26,100 +26,8 @@ function large_monster_UI_customization.draw(cached_config)
local changed = false; local changed = false;
local config_changed = false; local config_changed = false;
if imgui.tree_node(language.current_language.customization_menu.monster_name_label) then changed = label_customization.draw(language.current_language.customization_menu.monster_name_label, cached_config.monster_name_label);
changed, cached_config.monster_name_label.visibility = imgui.checkbox( config_changed = config_changed or changed;
language.current_language.customization_menu.visible, cached_config.monster_name_label.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.include) then
changed, cached_config.monster_name_label.include.monster_name = imgui.checkbox(
language.current_language.customization_menu.monster_name, cached_config.monster_name_label.include.monster_name);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.monster_id = imgui.checkbox(
language.current_language.customization_menu.monster_id, cached_config.monster_name_label.include.monster_id);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.crown = imgui.checkbox(
language.current_language.customization_menu.crown, cached_config.monster_name_label.include.crown);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.size = imgui.checkbox(
language.current_language.customization_menu.size, cached_config.monster_name_label.include.size);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.scrown_thresholds = imgui.checkbox(
language.current_language.customization_menu.crown_thresholds, cached_config.monster_name_label.include.scrown_thresholds);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.monster_name_label.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.monster_name_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.monster_name_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.monster_name_label.color = imgui.color_picker_argb(
"", cached_config.monster_name_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, cached_config.monster_name_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.monster_name_label.shadow.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.monster_name_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.monster_name_label.shadow.offset.x,
0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.monster_name_label.shadow.offset.y,
0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.monster_name_label.shadow.color = imgui.color_picker_argb(
"", cached_config.monster_name_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
changed = health_customization.draw(cached_config.health); changed = health_customization.draw(cached_config.health);
config_changed = config_changed or changed; config_changed = config_changed or changed;

View File

@@ -34,8 +34,6 @@ function damage_meter_UI.draw()
local quest_players = {}; local quest_players = {};
--damage_meter_UI.freeze_displayed_players = true;
if damage_meter_UI.freeze_displayed_players and not table_helpers.is_empty(damage_meter_UI.last_displayed_players) then if damage_meter_UI.freeze_displayed_players and not table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
quest_players = damage_meter_UI.last_displayed_players; quest_players = damage_meter_UI.last_displayed_players;
else else
@@ -46,13 +44,13 @@ function damage_meter_UI.draw()
local top_damage = 0; local top_damage = 0;
local top_dps = 0; local top_dps = 0;
for _, _player in ipairs(quest_players) do for _, player in ipairs(quest_players) do
if _player.display.total_damage > top_damage then if player.display.total_damage > top_damage then
top_damage = _player.display.total_damage; top_damage = player.display.total_damage;
end end
if _player.dps > top_dps then if player.dps > top_dps then
top_dps = _player.dps; top_dps = player.dps;
end end
end end
@@ -82,26 +80,28 @@ function damage_meter_UI.draw()
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position); position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
end end
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 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
goto continue goto continue
end end
if _player.type == players.types.myself then if player.type == players.types.myself then
if cached_config.settings.hide_myself then if cached_config.settings.hide_myself then
goto continue goto continue
end end
elseif _player.type == players.types.servant then elseif player.type == players.types.servant then
if cached_config.settings.hide_servants then if cached_config.settings.hide_servants then
goto continue goto continue
end end
elseif _player.type == players.types.other_player then elseif player.type == players.types.other_player then
if cached_config.settings.hide_other_players then if cached_config.settings.hide_other_players then
goto continue goto continue
end end
end end
players.draw(_player, position_on_screen, 1, top_damage, top_dps); players.draw(player, position_on_screen, 1, top_damage, top_dps);
if cached_config.settings.orientation == "Horizontal" then if cached_config.settings.orientation == "Horizontal" then
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier; position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;

View File

@@ -74,10 +74,10 @@ function ailment_buildup_UI_entity.draw(_player_buildup, ailment_buildup_UI, cac
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
local _player = players.get_player(_player_buildup.id); local player = players.get_player(_player_buildup.id);
local player_name = "Player " .. tostring(_player_buildup.id); local player_name = "Player " .. tostring(_player_buildup.id);
if _player ~= nil then if player ~= nil then
player_name = _player.name; player_name = player.name;
end end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player_name); drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player_name);

View File

@@ -14,9 +14,7 @@ function damage_UI_entity.new(damage_meter_UI_elements, type)
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;
--entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(damage_meter_UI_elements.damage_bar); entity.bar = table_helpers.deep_copy(damage_meter_UI_elements.damage_bar);
entity.highlighted_bar = table_helpers.deep_copy(cached_config.highlighted_bar);
entity.name_label = table_helpers.deep_copy(damage_meter_UI_elements.name_label); entity.name_label = table_helpers.deep_copy(damage_meter_UI_elements.name_label);
entity.hunter_rank_label = table_helpers.deep_copy(damage_meter_UI_elements.hunter_rank_label); entity.hunter_rank_label = table_helpers.deep_copy(damage_meter_UI_elements.hunter_rank_label);
entity.cart_count_label = table_helpers.deep_copy(damage_meter_UI_elements.cart_count_label); entity.cart_count_label = table_helpers.deep_copy(damage_meter_UI_elements.cart_count_label);
@@ -45,15 +43,6 @@ function damage_UI_entity.new(damage_meter_UI_elements, type)
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier; entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
end end
if entity.highlighted_bar ~= nil then
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * global_scale_modifier;
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * global_scale_modifier;
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * global_scale_modifier;
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier;
entity.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;
end
if entity.name_label ~= nil then if entity.name_label ~= nil then
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;
@@ -91,110 +80,121 @@ function damage_UI_entity.new(damage_meter_UI_elements, type)
return entity; return entity;
end end
function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps) function damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
local cached_config = config.current_config.damage_meter_UI; local cached_config = config.current_config.damage_meter_UI;
local name_include = nil; local name_include = nil;
if _player.damage_UI.name_label ~= nil then if player.damage_UI.name_label ~= nil then
name_include = _player.damage_UI.name_label.include; name_include = player.damage_UI.name_label.include;
end end
local hunter_rank_include = nil; local hunter_rank_include = nil;
if _player.damage_UI.hunter_rank_label ~= nil then if player.damage_UI.hunter_rank_label ~= nil then
hunter_rank_include = _player.damage_UI.hunter_rank_label.include; hunter_rank_include = player.damage_UI.hunter_rank_label.include;
end end
local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA; local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA;
local player_damage_percentage = 0; local player_damage_percentage = 0;
if players.total.display.total_damage ~= 0 then if players.total.display.total_damage ~= 0 then
player_damage_percentage = _player.display.total_damage / players.total.display.total_damage; player_damage_percentage = player.display.total_damage / players.total.display.total_damage;
end end
local player_damage_bar_percentage = 0; local player_damage_bar_percentage = 0;
if _player.type ~= players.types.total then if player.type ~= players.types.total then
if cached_config.settings.damage_bar_relative_to == "Total Damage" then if cached_config.settings.damage_bar_relative_to == "Total Damage" then
if players.total.display.total_damage ~= 0 then if players.total.display.total_damage ~= 0 then
player_damage_bar_percentage = _player.display.total_damage / players.total.display.total_damage; player_damage_bar_percentage = player.display.total_damage / players.total.display.total_damage;
end end
else else
if top_damage ~= 0 then if top_damage ~= 0 then
player_damage_bar_percentage = _player.display.total_damage / top_damage; player_damage_bar_percentage = player.display.total_damage / top_damage;
end end
end end
end end
local name_text = ""; local name_text = "";
if _player.type == players.types.total then if player.type == players.types.total then
name_text = _player.damage_UI.total_name; name_text = player.damage_UI.total_name;
elseif name_include ~= nil then elseif name_include ~= nil then
if name_include.master_rank and name_include.hunter_rank then if name_include.master_rank and name_include.hunter_rank then
name_text = string.format("[%d:%d] ", _player.master_rank, _player.hunter_rank); name_text = string.format("[%d:%d] ", player.master_rank, player.hunter_rank);
elseif name_include.master_rank then elseif name_include.master_rank then
name_text = string.format("[%d] ", _player.master_rank); name_text = string.format("[%d] ", player.master_rank);
elseif name_include.hunter_rank then elseif name_include.hunter_rank then
name_text = string.format("[%d] ", _player.hunter_rank); name_text = string.format("[%d] ", player.hunter_rank);
elseif name_include.level then elseif name_include.level then
name_text = string.format("[%d] ", _player.level); name_text = string.format("[%d] ", player.level);
end end
if name_include.cart_count and is_on_quest then if name_include.cart_count and is_on_quest then
name_text = name_text .. string.format("x%d ", _player.cart_count); name_text = name_text .. string.format("x%d ", player.cart_count);
end end
if name_include.type then if name_include.type then
name_text = name_text .. _player.damage_UI.type_name .. " "; name_text = name_text .. player.damage_UI.type_name .. " ";
end end
if name_include.id then if name_include.id then
name_text = name_text .. string.format("%d ", _player.id); name_text = name_text .. string.format("%d ", player.id);
end end
if name_include.name then if name_include.name then
name_text = name_text .. _player.name; name_text = name_text .. player.name;
end end
end end
local hunter_rank_string = ""; local hunter_rank_string = "";
if _player.damage_UI.hunter_rank_label ~= nil then if player.damage_UI.hunter_rank_label ~= nil then
if hunter_rank_include == nil then if hunter_rank_include == nil then
hunter_rank_string = string.format("%d", _player.level); hunter_rank_string = string.format("%d", player.level);
elseif hunter_rank_include.master_rank and hunter_rank_include.hunter_rank then elseif hunter_rank_include.master_rank and hunter_rank_include.hunter_rank then
hunter_rank_string = string.format("%d:%d", _player.master_rank, _player.hunter_rank); hunter_rank_string = string.format("%d:%d", player.master_rank, player.hunter_rank);
elseif hunter_rank_include.master_rank then elseif hunter_rank_include.master_rank then
hunter_rank_string = string.format("%d", _player.master_rank); hunter_rank_string = string.format("%d", player.master_rank);
elseif hunter_rank_include.hunter_rank then elseif hunter_rank_include.hunter_rank then
hunter_rank_string = string.format("%d", _player.hunter_rank); hunter_rank_string = string.format("%d", player.hunter_rank);
end end
end end
xy = 1 local bar = player.damage_UI.bar;
local name_label = player.damage_UI.name_label;
local hunter_rank_label = player.damage_UI.hunter_rank_label;
local value_label = player.damage_UI.value_label;
local percentage_label = player.damage_UI.percentage_label;
local dps_label = player.damage_UI.dps_label;
local bar = _player.damage_UI.bar; if player.type ~= players.types.total then
if (cached_config.settings.highlighted_bar == "Top Damage" and player.display.total_damage == top_damage) or
if (cached_config.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage) or (cached_config.settings.highlighted_bar == "Top DPS" and player.dps == top_dps) then
(cached_config.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps) then bar = players.highlighted_damage_UI.bar;
bar = _player.damage_UI.highlighted_bar; name_label = players.highlighted_damage_UI.name_label;
hunter_rank_label = players.highlighted_damage_UI.hunter_rank_label;
value_label = players.highlighted_damage_UI.value_label;
percentage_label = players.highlighted_damage_UI.percentage_label;
dps_label = players.highlighted_damage_UI.dps_label;
end
end end
drawing.draw_bar(bar, position_on_screen, opacity_scale, player_damage_bar_percentage); drawing.draw_bar(bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
name_text = drawing.limit_text_size(name_text, _player.damage_UI.player_name_size_limit); name_text = drawing.limit_text_size(name_text, player.damage_UI.player_name_size_limit);
drawing.draw_label(_player.damage_UI.name_label, position_on_screen, opacity_scale, name_text); drawing.draw_label(name_label, position_on_screen, opacity_scale, name_text);
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, hunter_rank_string); drawing.draw_label(hunter_rank_label, position_on_screen, opacity_scale, hunter_rank_string);
drawing.draw_label(_player.damage_UI.value_label, position_on_screen, opacity_scale, _player.display.total_damage); drawing.draw_label(value_label, position_on_screen, opacity_scale, player.display.total_damage);
drawing.draw_label(_player.damage_UI.percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage); drawing.draw_label(percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage);
drawing.draw_label(_player.damage_UI.dps_label, position_on_screen, opacity_scale, _player.dps); drawing.draw_label(dps_label, position_on_screen, opacity_scale, player.dps);
if is_on_quest then if is_on_quest then
drawing.draw_label(_player.damage_UI.cart_count_label, position_on_screen, opacity_scale, _player.cart_count); drawing.draw_label(player.damage_UI.cart_count_label, position_on_screen, opacity_scale, player.cart_count);
end end
end end

View File

@@ -556,8 +556,8 @@ function customization_menu.draw()
end end
if damage_meter_UI_changed or modifiers_changed then if damage_meter_UI_changed or modifiers_changed then
for _, _player in pairs(players.list) do for _, player in pairs(players.list) do
players.init_UI(_player); players.init_UI(player);
end end
@@ -569,7 +569,8 @@ function customization_menu.draw()
non_players.init_UI(otomo); non_players.init_UI(otomo);
end end
players.init_total_UI(players.total); players.init_UI(players.total);
players.init_highlighted_UI();
end end
if endemic_life_UI_changed or modifiers_changed then if endemic_life_UI_changed or modifiers_changed then
@@ -658,16 +659,21 @@ function customization_menu.draw_global_settings()
small_monster.init_list(); small_monster.init_list();
large_monster.init_list(); large_monster.init_list();
env_creature.init_list(); env_creature.init_list();
players.init_UI(players.myself);
players.init_UI(players.total);
for _, _player in pairs(players.list) do for _, player in pairs(players.list) do
players.init_UI(_player); players.init_UI(player);
end end
for _, servant in pairs(non_players.servant_list) do for _, servant in pairs(non_players.servant_list) do
non_players.init_UI(servant); non_players.init_UI(servant);
end end
for _, otomo in pairs(non_players.otomo_list) do
non_players.init_UI(otomo);
end
players.init_UI(players.total);
players.init_highlighted_UI();
end end
if imgui.tree_node(language.current_language.customization_menu.menu_font) then if imgui.tree_node(language.current_language.customization_menu.menu_font) then
@@ -1684,361 +1690,6 @@ function customization_menu.draw_damage_meter_UI()
imgui.tree_pop(); imgui.tree_pop();
end end
--[[
if imgui.tree_node(language.current_language.customization_menu.player_name_label) then
changed, cached_config.player_name_label.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.player_name_label.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.include) then
if imgui.tree_node(language.current_language.customization_menu.me) then
changed, cached_config.player_name_label.include.myself.master_rank = imgui.checkbox(
language.current_language.customization_menu.master_rank, cached_config.player_name_label.include.myself.master_rank);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.myself.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, cached_config.player_name_label.include.myself.hunter_rank);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.myself.cart_count =imgui.checkbox(
language.current_language.customization_menu.cart_count, cached_config.player_name_label.include.myself.cart_count);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.myself.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.myself.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.myself.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.myself.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.myself.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.myself.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.other_players) then
changed, cached_config.player_name_label.include.others.master_rank = imgui.checkbox(
language.current_language.customization_menu.master_rank, cached_config.player_name_label.include.others.master_rank);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.others.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, cached_config.player_name_label.include.others.hunter_rank);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.others.cart_count = imgui.checkbox(
language.current_language.customization_menu.cart_count, cached_config.player_name_label.include.others.cart_count);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.others.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.others.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.others.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.others.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.others.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.others.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.servants) then
changed, cached_config.player_name_label.include.servants.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.servants.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.servants.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.servants.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.servants.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.servants.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.my_otomos) then
changed, cached_config.player_name_label.include.my_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.player_name_label.include.my_otomos.level);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.my_otomos.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.my_otomos.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.my_otomos.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.my_otomos.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.my_otomos.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.my_otomos.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.other_player_otomos) then
changed, cached_config.player_name_label.include.other_player_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.player_name_label.include.other_player_otomos.level);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.other_player_otomos.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.other_player_otomos.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.other_player_otomos.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.other_player_otomos.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.other_player_otomos.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.other_player_otomos.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.servant_otomos) then
changed, cached_config.player_name_label.include.servant_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.player_name_label.include.servant_otomos.level);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.servant_otomos.type = imgui.checkbox(
language.current_language.customization_menu.type, cached_config.player_name_label.include.servant_otomos.type);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.servant_otomos.id = imgui.checkbox(
language.current_language.customization_menu.id, cached_config.player_name_label.include.servant_otomos.id);
config_changed = config_changed or changed;
changed, cached_config.player_name_label.include.servant_otomos.name = imgui.checkbox(
language.current_language.customization_menu.name, cached_config.player_name_label.include.servant_otomos.name);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.player_name_label.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.player_name_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.player_name_label.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.player_name_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.player_name_label.color = imgui.color_picker_argb(
"", cached_config.player_name_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, cached_config.player_name_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.player_name_label.shadow.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.player_name_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.player_name_label.shadow.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.player_name_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.player_name_label.shadow.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.player_name_label.shadow.color = imgui.color_picker_argb(
"", cached_config.player_name_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.hunter_rank_label) then
changed, cached_config.master_hunter_rank_label.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.master_hunter_rank_label.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.include) then
if imgui.tree_node(language.current_language.customization_menu.me) then
changed, cached_config.master_hunter_rank_label.include.myself.master_rank = imgui.checkbox(
language.current_language.customization_menu.master_rank, cached_config.master_hunter_rank_label.include.myself.master_rank);
config_changed = config_changed or changed;
changed, cached_config.master_hunter_rank_label.include.myself.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, cached_config.master_hunter_rank_label.include.myself.hunter_rank);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.other_players) then
changed, cached_config.master_hunter_rank_label.include.others.master_rank = imgui.checkbox(
language.current_language.customization_menu.master_rank, cached_config.master_hunter_rank_label.include.others.master_rank);
config_changed = config_changed or changed;
changed, cached_config.master_hunter_rank_label.include.others.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, cached_config.master_hunter_rank_label.include.others.hunter_rank);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.my_otomos) then
changed, cached_config.master_hunter_rank_label.include.my_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.master_hunter_rank_label.include.my_otomos.level);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.other_player_otomos) then
changed, cached_config.master_hunter_rank_label.include.other_player_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.master_hunter_rank_label.include.other_player_otomos.level);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.servant_otomos) then
changed, cached_config.master_hunter_rank_label.include.servant_otomos.level = imgui.checkbox(
language.current_language.customization_menu.level, cached_config.master_hunter_rank_label.include.servant_otomos.level);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.master_hunter_rank_label.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.master_hunter_rank_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.master_hunter_rank_label.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.master_hunter_rank_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.master_hunter_rank_label.color = imgui.color_picker_argb(
"", cached_config.master_hunter_rank_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, cached_config.master_hunter_rank_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.master_hunter_rank_label.shadow.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.master_hunter_rank_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.master_hunter_rank_label.shadow.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.master_hunter_rank_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.master_hunter_rank_label.shadow.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.master_hunter_rank_label.shadow.color = imgui.color_picker_argb(
"", cached_config.master_hunter_rank_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
]]
if imgui.tree_node(language.current_language.customization_menu.myself) then if imgui.tree_node(language.current_language.customization_menu.myself) then
changed = label_customization.draw(language.current_language.customization_menu.name_label, cached_config.myself.name_label); changed = label_customization.draw(language.current_language.customization_menu.name_label, cached_config.myself.name_label);
@@ -2191,38 +1842,27 @@ function customization_menu.draw_damage_meter_UI()
imgui.tree_pop(); imgui.tree_pop();
end end
--[[ if imgui.tree_node(language.current_language.customization_menu.highlighted) then
changed = label_customization.draw(language.current_language.customization_menu.cart_count_label, cached_config.cart_count_label); changed = label_customization.draw(language.current_language.customization_menu.name_label, cached_config.highlighted.name_label);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.dps_label, cached_config.dps_label); changed = label_customization.draw(language.current_language.customization_menu.hunter_rank_label, cached_config.highlighted.hunter_rank_label);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.damage_value_label, cached_config.damage_value_label); changed = label_customization.draw(language.current_language.customization_menu.dps_label, cached_config.highlighted.dps_label);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.damage_percentage_label, cached_config.damage_percentage_label); changed = label_customization.draw(language.current_language.customization_menu.damage_value_label, cached_config.highlighted.damage_value_label);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.total_damage_label, cached_config.total_damage_label);
config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.total_dps_label, cached_config.total_dps_label); changed = label_customization.draw(language.current_language.customization_menu.damage_percentage_label, cached_config.highlighted.damage_percentage_label);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.total_damage_value_label, cached_config.total_damage_value_label); changed = bar_customization.draw(language.current_language.customization_menu.damage_bar, cached_config.highlighted.damage_bar);
config_changed = config_changed or changed; config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.total_cart_count_label, cached_config.total_cart_count_label); imgui.tree_pop();
config_changed = config_changed or changed; end
changed = bar_customization.draw(language.current_language.customization_menu.damage_bar, cached_config.damage_bar);
config_changed = config_changed or changed;
changed = bar_customization.draw(language.current_language.customization_menu.highlighted_damage_bar, cached_config.highlighted_damage_bar);
config_changed = config_changed or changed;
--]]
if config_changed then if config_changed then
local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA; local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA;
@@ -2234,8 +1874,8 @@ function customization_menu.draw_damage_meter_UI()
end end
if damage_display_changed then if damage_display_changed then
for _, _player in pairs(players.list) do for _, player in pairs(players.list) do
players.update_display(_player); players.update_display(player);
end end
for _, servant in pairs(non_players.servant_list) do for _, servant in pairs(non_players.servant_list) do