mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Add Followers to Damage Meter UI
This commit is contained in:
@@ -6,6 +6,7 @@ local large_monster;
|
||||
local ailments;
|
||||
local table_helpers;
|
||||
local singletons;
|
||||
local non_players;
|
||||
|
||||
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
|
||||
local enemy_character_base_after_calc_damage_damage_side_method = enemy_character_base_type_def:get_method("afterCalcDamage_DamageSide");
|
||||
@@ -87,14 +88,14 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
||||
|
||||
-- 4 is virtual player in singleplayer that "owns" 2nd otomo
|
||||
if not quest_status.is_online and attacker_id == 4 then
|
||||
attacker_id = player.myself.id;
|
||||
--attacker_id = player.myself.id;
|
||||
end
|
||||
|
||||
if is_marionette_attack then
|
||||
large_monster.update_all_riders();
|
||||
for enemy, monster in pairs(large_monster.list) do
|
||||
if monster.unique_id == attacker_id then
|
||||
attacker_id = monster.rider_id;
|
||||
--attacker_id = monster.rider_id;
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -151,22 +152,25 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
||||
-- 31 - EcSwampLeech
|
||||
-- 32 - EcPenetrateFish
|
||||
|
||||
--xy = "\nPlayer: " .. tostring(attacker_id) ..
|
||||
--" Damage: " .. tostring(damage_object.total_damage) ..
|
||||
--" Type: (" .. tostring(attacker_type) ..
|
||||
--") " ..
|
||||
--" Condition Damage: " .. tostring(condition_damage) ..
|
||||
--" Condition Type: (" .. tostring(attacker_type) ..
|
||||
--") " .. tostring(condition_type);
|
||||
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack);
|
||||
|
||||
--if string.len(xy) > 2300 then
|
||||
-- xy = "";
|
||||
--end
|
||||
local attacking_player = non_players.get_servant(attacker_id);
|
||||
if attacking_player == nil then
|
||||
attacking_player = player.get_player(attacker_id);
|
||||
end
|
||||
|
||||
local damage_source_type = damage_hook.get_damage_source_type(attacker_type,
|
||||
is_marionette_attack);
|
||||
xy = xy .. "\nPlayer: " .. tostring(attacker_id) ..
|
||||
" " .. tostring(attacking_player.name) ..
|
||||
" Damage: " .. tostring(damage_object.total_damage) ..
|
||||
" Type: (" .. tostring(attacker_type) ..
|
||||
") " ..
|
||||
" Condition Damage: " .. tostring(condition_damage) ..
|
||||
" Condition Type: (" .. tostring(attacker_type) ..
|
||||
") " .. tostring(condition_type);
|
||||
|
||||
local attacking_player = player.get_player(attacker_id);
|
||||
if string.len(xy) > 2300 then
|
||||
xy = "";
|
||||
end
|
||||
|
||||
local monster;
|
||||
if is_large_monster then
|
||||
@@ -222,6 +226,7 @@ function damage_hook.init_module()
|
||||
ailments = require("MHR_Overlay.Monsters.ailments");
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||
|
||||
--sdk.hook(get_finish_shoot_wall_hit_damage_rate_method, function(args)
|
||||
-- pcall(damage_hook.on_get_finish_shoot_wall_hit_damage_rate, sdk.to_managed_object(args[2]), sdk.to_float(args[3]), sdk.to_int64(args--[4]));
|
||||
|
||||
154
reframework/autorun/MHR_Overlay/Damage_Meter/non_players.lua
Normal file
154
reframework/autorun/MHR_Overlay/Damage_Meter/non_players.lua
Normal file
@@ -0,0 +1,154 @@
|
||||
local non_players = {};
|
||||
local config;
|
||||
local table_helpers;
|
||||
local singletons;
|
||||
local customization_menu;
|
||||
local non_player_damage_UI_entity;
|
||||
local time;
|
||||
local quest_status;
|
||||
local drawing;
|
||||
local language;
|
||||
local player;
|
||||
|
||||
non_players.servant_list = {};
|
||||
non_players.otomo_list = {};
|
||||
|
||||
function non_players.new(id, name, is_otomo)
|
||||
local non_player = {};
|
||||
non_player.id = id;
|
||||
non_player.name = name;
|
||||
|
||||
non_player.is_player = false;
|
||||
non_player.is_otomo = is_otomo;
|
||||
|
||||
non_player.join_time = -1;
|
||||
non_player.first_hit_time = -1;
|
||||
non_player.dps = 0;
|
||||
|
||||
non_player.small_monsters = player.init_damage_sources()
|
||||
non_player.large_monsters = player.init_damage_sources();
|
||||
|
||||
non_player.display = {};
|
||||
non_player.display.total_damage = 0;
|
||||
non_player.display.physical_damage = 0;
|
||||
non_player.display.elemental_damage = 0;
|
||||
non_player.display.ailment_damage = 0;
|
||||
|
||||
non_players.init_UI(non_player);
|
||||
|
||||
return non_player;
|
||||
end
|
||||
|
||||
function non_players.get_servant(servant_id)
|
||||
return non_players.servant_list[servant_id];
|
||||
end
|
||||
|
||||
function non_players.get_otomo(otomo_id)
|
||||
return non_players.otomo_list[otomo_id];
|
||||
end
|
||||
|
||||
function non_players.init()
|
||||
non_players.servant_list = {};
|
||||
non_players.otomo_list = {};
|
||||
end
|
||||
|
||||
local servant_manager_type_def = sdk.find_type_definition("snow.ai.ServantManager");
|
||||
local get_quest_servant_id_list_method = servant_manager_type_def:get_method("getQuestServantIdList");
|
||||
local get_ai_control_by_servant_id_method = servant_manager_type_def:get_method("getAIControlByServantID");
|
||||
|
||||
local list_type_def = get_quest_servant_id_list_method:get_return_type();
|
||||
local get_count_method = list_type_def:get_method("get_Count");
|
||||
local get_item_method = list_type_def:get_method("get_Item");
|
||||
|
||||
local ai_control_type_def = get_ai_control_by_servant_id_method:get_return_type();
|
||||
local get_servant_info_method = ai_control_type_def:get_method("get_ServantInfo");
|
||||
|
||||
local servant_info_type_def = get_servant_info_method:get_return_type();
|
||||
local get_servant_name_method = servant_info_type_def:get_method("get_ServantName");
|
||||
local get_servant_player_index_method = servant_info_type_def:get_method("get_ServantPlayerIndex");
|
||||
|
||||
function non_players.update_servant_list()
|
||||
if singletons.servant_manager == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
local quest_servant_id_list = get_quest_servant_id_list_method:call(singletons.servant_manager);
|
||||
if quest_servant_id_list == nil then
|
||||
customization_menu.status = "No quest servant id list";
|
||||
return;
|
||||
end
|
||||
|
||||
local servant_count = get_count_method:call(quest_servant_id_list);
|
||||
if servant_count == nil then
|
||||
customization_menu.status = "No quest servant id list count";
|
||||
return;
|
||||
end
|
||||
|
||||
for i = 0, servant_count - 1 do
|
||||
local servant_id = get_item_method:call(quest_servant_id_list, i);
|
||||
if servant_id == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
|
||||
local servant_name = "Follower";
|
||||
local player_id = -1;
|
||||
local ai_control = get_ai_control_by_servant_id_method:call(singletons.servant_manager, servant_id);
|
||||
|
||||
if ai_control ~= nil then
|
||||
local servant_info = get_servant_info_method:call(ai_control);
|
||||
if servant_info ~= nil then
|
||||
local name = get_servant_name_method:call(servant_info);
|
||||
|
||||
if name ~= nil then
|
||||
servant_name = name;
|
||||
end
|
||||
|
||||
local id = get_servant_player_index_method:call(servant_info);
|
||||
|
||||
if id == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
player_id = id;
|
||||
end
|
||||
end
|
||||
|
||||
if non_players.servant_list[player_id] == nil then
|
||||
local servant = non_players.new(player_id, servant_name, false);
|
||||
non_players.servant_list[player_id] = servant;
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
function non_players.init_UI(non_player)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
non_player.damage_UI = non_player_damage_UI_entity.new(cached_config.damage_bar,
|
||||
cached_config.highlighted_damage_bar, cached_config.player_name_label, cached_config.dps_label,
|
||||
cached_config.damage_value_label, cached_config.damage_percentage_label);
|
||||
|
||||
end
|
||||
|
||||
function non_players.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
non_player_damage_UI_entity.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps);
|
||||
end
|
||||
|
||||
function non_players.init_module()
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||
non_player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.non_player_damage_UI_entity");
|
||||
time = require("MHR_Overlay.Game_Handler.time");
|
||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
player = require("MHR_Overlay.Damage_Meter.player");
|
||||
|
||||
non_players.init();
|
||||
end
|
||||
|
||||
return non_players;
|
||||
@@ -3,7 +3,7 @@ local config;
|
||||
local table_helpers;
|
||||
local singletons;
|
||||
local customization_menu;
|
||||
local damage_UI_entity;
|
||||
local player_damage_UI_entity;
|
||||
local time;
|
||||
local quest_status;
|
||||
local drawing;
|
||||
@@ -22,134 +22,17 @@ function player.new(id, guid, name, master_rank, hunter_rank)
|
||||
new_player.hunter_rank = hunter_rank;
|
||||
new_player.master_rank = master_rank;
|
||||
|
||||
new_player.is_player = true;
|
||||
|
||||
new_player.cart_count = 0;
|
||||
|
||||
new_player.join_time = -1;
|
||||
new_player.first_hit_time = -1;
|
||||
new_player.dps = 0;
|
||||
|
||||
new_player.small_monsters = {};
|
||||
|
||||
new_player.small_monsters.total_damage = 0;
|
||||
new_player.small_monsters.physical_damage = 0;
|
||||
new_player.small_monsters.elemental_damage = 0;
|
||||
new_player.small_monsters.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.bombs = {};
|
||||
new_player.small_monsters.bombs.total_damage = 0;
|
||||
new_player.small_monsters.bombs.physical_damage = 0;
|
||||
new_player.small_monsters.bombs.elemental_damage = 0;
|
||||
new_player.small_monsters.bombs.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.kunai = {};
|
||||
new_player.small_monsters.kunai.total_damage = 0;
|
||||
new_player.small_monsters.kunai.physical_damage = 0;
|
||||
new_player.small_monsters.kunai.elemental_damage = 0;
|
||||
new_player.small_monsters.kunai.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.installations = {};
|
||||
new_player.small_monsters.installations.total_damage = 0;
|
||||
new_player.small_monsters.installations.physical_damage = 0;
|
||||
new_player.small_monsters.installations.elemental_damage = 0;
|
||||
new_player.small_monsters.installations.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.otomo = {};
|
||||
new_player.small_monsters.otomo.total_damage = 0;
|
||||
new_player.small_monsters.otomo.physical_damage = 0;
|
||||
new_player.small_monsters.otomo.elemental_damage = 0;
|
||||
new_player.small_monsters.otomo.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.wyvern_riding = {};
|
||||
new_player.small_monsters.wyvern_riding.total_damage = 0;
|
||||
new_player.small_monsters.wyvern_riding.physical_damage = 0;
|
||||
new_player.small_monsters.wyvern_riding.elemental_damage = 0;
|
||||
new_player.small_monsters.wyvern_riding.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.poison = {};
|
||||
new_player.small_monsters.poison.total_damage = 0;
|
||||
new_player.small_monsters.poison.physical_damage = 0;
|
||||
new_player.small_monsters.poison.elemental_damage = 0;
|
||||
new_player.small_monsters.poison.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.blast = {};
|
||||
new_player.small_monsters.blast.total_damage = 0;
|
||||
new_player.small_monsters.blast.physical_damage = 0;
|
||||
new_player.small_monsters.blast.elemental_damage = 0;
|
||||
new_player.small_monsters.blast.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.endemic_life = {};
|
||||
new_player.small_monsters.endemic_life.total_damage = 0;
|
||||
new_player.small_monsters.endemic_life.physical_damage = 0;
|
||||
new_player.small_monsters.endemic_life.elemental_damage = 0;
|
||||
new_player.small_monsters.endemic_life.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters.other = {};
|
||||
new_player.small_monsters.other.total_damage = 0;
|
||||
new_player.small_monsters.other.physical_damage = 0;
|
||||
new_player.small_monsters.other.elemental_damage = 0;
|
||||
new_player.small_monsters.other.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters = {};
|
||||
|
||||
new_player.large_monsters.total_damage = 0;
|
||||
new_player.large_monsters.physical_damage = 0;
|
||||
new_player.large_monsters.elemental_damage = 0;
|
||||
new_player.large_monsters.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.bombs = {};
|
||||
new_player.large_monsters.bombs.total_damage = 0;
|
||||
new_player.large_monsters.bombs.physical_damage = 0;
|
||||
new_player.large_monsters.bombs.elemental_damage = 0;
|
||||
new_player.large_monsters.bombs.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.kunai = {};
|
||||
new_player.large_monsters.kunai.total_damage = 0;
|
||||
new_player.large_monsters.kunai.physical_damage = 0;
|
||||
new_player.large_monsters.kunai.elemental_damage = 0;
|
||||
new_player.large_monsters.kunai.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.installations = {};
|
||||
new_player.large_monsters.installations.total_damage = 0;
|
||||
new_player.large_monsters.installations.physical_damage = 0;
|
||||
new_player.large_monsters.installations.elemental_damage = 0;
|
||||
new_player.large_monsters.installations.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.otomo = {};
|
||||
new_player.large_monsters.otomo.total_damage = 0;
|
||||
new_player.large_monsters.otomo.physical_damage = 0;
|
||||
new_player.large_monsters.otomo.elemental_damage = 0;
|
||||
new_player.large_monsters.otomo.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.wyvern_riding = {};
|
||||
new_player.large_monsters.wyvern_riding.total_damage = 0;
|
||||
new_player.large_monsters.wyvern_riding.physical_damage = 0;
|
||||
new_player.large_monsters.wyvern_riding.elemental_damage = 0;
|
||||
new_player.large_monsters.wyvern_riding.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.poison = {};
|
||||
new_player.large_monsters.poison.total_damage = 0;
|
||||
new_player.large_monsters.poison.physical_damage = 0;
|
||||
new_player.large_monsters.poison.elemental_damage = 0;
|
||||
new_player.large_monsters.poison.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.blast = {};
|
||||
new_player.large_monsters.blast.total_damage = 0;
|
||||
new_player.large_monsters.blast.physical_damage = 0;
|
||||
new_player.large_monsters.blast.elemental_damage = 0;
|
||||
new_player.large_monsters.blast.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.endemic_life = {};
|
||||
new_player.large_monsters.endemic_life.total_damage = 0;
|
||||
new_player.large_monsters.endemic_life.physical_damage = 0;
|
||||
new_player.large_monsters.endemic_life.elemental_damage = 0;
|
||||
new_player.large_monsters.endemic_life.ailment_damage = 0;
|
||||
|
||||
new_player.large_monsters.other = {};
|
||||
new_player.large_monsters.other.total_damage = 0;
|
||||
new_player.large_monsters.other.physical_damage = 0;
|
||||
new_player.large_monsters.other.elemental_damage = 0;
|
||||
new_player.large_monsters.other.ailment_damage = 0;
|
||||
|
||||
new_player.small_monsters = player.init_damage_sources()
|
||||
new_player.large_monsters = player.init_damage_sources();
|
||||
|
||||
new_player.display = {};
|
||||
new_player.display.total_damage = 0;
|
||||
new_player.display.physical_damage = 0;
|
||||
@@ -165,6 +48,71 @@ function player.new(id, guid, name, master_rank, hunter_rank)
|
||||
return new_player;
|
||||
end
|
||||
|
||||
function player.init_damage_sources()
|
||||
local monster_type = {};
|
||||
|
||||
monster_type.total_damage = 0;
|
||||
monster_type.physical_damage = 0;
|
||||
monster_type.elemental_damage = 0;
|
||||
monster_type.ailment_damage = 0;
|
||||
|
||||
monster_type.bombs = {};
|
||||
monster_type.bombs.total_damage = 0;
|
||||
monster_type.bombs.physical_damage = 0;
|
||||
monster_type.bombs.elemental_damage = 0;
|
||||
monster_type.bombs.ailment_damage = 0;
|
||||
|
||||
monster_type.kunai = {};
|
||||
monster_type.kunai.total_damage = 0;
|
||||
monster_type.kunai.physical_damage = 0;
|
||||
monster_type.kunai.elemental_damage = 0;
|
||||
monster_type.kunai.ailment_damage = 0;
|
||||
|
||||
monster_type.installations = {};
|
||||
monster_type.installations.total_damage = 0;
|
||||
monster_type.installations.physical_damage = 0;
|
||||
monster_type.installations.elemental_damage = 0;
|
||||
monster_type.installations.ailment_damage = 0;
|
||||
|
||||
monster_type.otomo = {};
|
||||
monster_type.otomo.total_damage = 0;
|
||||
monster_type.otomo.physical_damage = 0;
|
||||
monster_type.otomo.elemental_damage = 0;
|
||||
monster_type.otomo.ailment_damage = 0;
|
||||
|
||||
monster_type.wyvern_riding = {};
|
||||
monster_type.wyvern_riding.total_damage = 0;
|
||||
monster_type.wyvern_riding.physical_damage = 0;
|
||||
monster_type.wyvern_riding.elemental_damage = 0;
|
||||
monster_type.wyvern_riding.ailment_damage = 0;
|
||||
|
||||
monster_type.poison = {};
|
||||
monster_type.poison.total_damage = 0;
|
||||
monster_type.poison.physical_damage = 0;
|
||||
monster_type.poison.elemental_damage = 0;
|
||||
monster_type.poison.ailment_damage = 0;
|
||||
|
||||
monster_type.blast = {};
|
||||
monster_type.blast.total_damage = 0;
|
||||
monster_type.blast.physical_damage = 0;
|
||||
monster_type.blast.elemental_damage = 0;
|
||||
monster_type.blast.ailment_damage = 0;
|
||||
|
||||
monster_type.endemic_life = {};
|
||||
monster_type.endemic_life.total_damage = 0;
|
||||
monster_type.endemic_life.physical_damage = 0;
|
||||
monster_type.endemic_life.elemental_damage = 0;
|
||||
monster_type.endemic_life.ailment_damage = 0;
|
||||
|
||||
monster_type.other = {};
|
||||
monster_type.other.total_damage = 0;
|
||||
monster_type.other.physical_damage = 0;
|
||||
monster_type.other.elemental_damage = 0;
|
||||
monster_type.other.ailment_damage = 0;
|
||||
|
||||
return monster_type;
|
||||
end
|
||||
|
||||
function player.get_player(player_id)
|
||||
return player.list[player_id];
|
||||
end
|
||||
@@ -499,7 +447,7 @@ end
|
||||
function player.init_UI(_player)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
_player.damage_UI = damage_UI_entity.new(cached_config.damage_bar, cached_config.highlighted_damage_bar,
|
||||
_player.damage_UI = player_damage_UI_entity.new(cached_config.damage_bar, cached_config.highlighted_damage_bar,
|
||||
cached_config.player_name_label, cached_config.dps_label, cached_config.master_hunter_rank_label,
|
||||
cached_config.damage_value_label, cached_config.damage_percentage_label, cached_config.cart_count_label);
|
||||
end
|
||||
@@ -531,14 +479,17 @@ function player.init_total_UI(_player)
|
||||
end
|
||||
|
||||
function player.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);
|
||||
player_damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps);
|
||||
end
|
||||
|
||||
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_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_cart_count_label, position_on_screen, opacity_scale, quest_status.cart_count, quest_status.max_cart_count);
|
||||
|
||||
if quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
|
||||
drawing.draw_label(player.total.damage_UI.total_cart_count_label, position_on_screen, opacity_scale, quest_status.cart_count, quest_status.max_cart_count);
|
||||
end
|
||||
end
|
||||
|
||||
function player.init_module()
|
||||
@@ -546,7 +497,7 @@ function player.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
|
||||
player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.player_damage_UI_entity");
|
||||
time = require("MHR_Overlay.Game_Handler.time");
|
||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
|
||||
@@ -8,6 +8,7 @@ local large_monster;
|
||||
local damage_meter_UI;
|
||||
local time;
|
||||
local env_creature;
|
||||
local non_players;
|
||||
|
||||
quest_status.flow_states = {
|
||||
NONE = 0,
|
||||
@@ -109,6 +110,7 @@ function quest_status.set_flow_state(new_flow_state)
|
||||
|
||||
if quest_status.flow_state == quest_status.flow_states.IN_LOBBY or quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
|
||||
player.init();
|
||||
non_players.init();
|
||||
small_monster.init_list();
|
||||
large_monster.init_list();
|
||||
env_creature.init_list();
|
||||
@@ -346,6 +348,7 @@ function quest_status.init_module()
|
||||
damage_meter_UI = require("MHR_Overlay.UI.Modules.damage_meter_UI");
|
||||
time = require("MHR_Overlay.Game_Handler.time");
|
||||
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||
|
||||
quest_status.init();
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ function singletons.init()
|
||||
singletons.init_game_keyboard();
|
||||
singletons.init_scene_manager();
|
||||
singletons.init_game_manager();
|
||||
singletons.init_servant_manager();
|
||||
end
|
||||
|
||||
function singletons.init_message_manager()
|
||||
@@ -171,6 +172,19 @@ function singletons.init_game_manager()
|
||||
return singletons.game_manager;
|
||||
end
|
||||
|
||||
function singletons.init_servant_manager()
|
||||
if singletons.servant_manager ~= nil then
|
||||
return;
|
||||
end
|
||||
|
||||
singletons.servant_manager = sdk.get_managed_singleton("snow.ai.ServantManager");
|
||||
if singletons.servant_manager == nil then
|
||||
--log.error("[MHR Overlay] No enemy manager");
|
||||
end
|
||||
|
||||
return singletons.servant_manager;
|
||||
end
|
||||
|
||||
function singletons.init_module()
|
||||
singletons.init();
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@ local singletons;
|
||||
local customization_menu;
|
||||
local quest_status;
|
||||
local player;
|
||||
local non_players;
|
||||
local config;
|
||||
local small_monster;
|
||||
|
||||
@@ -81,6 +82,28 @@ function time.update_players_dps()
|
||||
new_total_dps = new_total_dps + _player.dps;
|
||||
end
|
||||
|
||||
for _, servant in pairs(non_players.servant_list) do
|
||||
if servant.join_time == -1 then
|
||||
servant.join_time = time.total_elapsed_script_seconds;
|
||||
end
|
||||
|
||||
if cached_config.dps_mode == "Quest Time" then
|
||||
if time.total_elapsed_seconds > 0 then
|
||||
servant.dps = servant.display.total_damage / time.total_elapsed_seconds;
|
||||
end
|
||||
elseif cached_config.dps_mode == "Join Time" then
|
||||
if time.total_elapsed_script_seconds - servant.join_time > 0 then
|
||||
servant.dps = servant.display.total_damage / (time.total_elapsed_script_seconds - servant.join_time);
|
||||
end
|
||||
elseif cached_config.dps_mode == "First Hit" then
|
||||
if time.total_elapsed_script_seconds - servant.first_hit_time > 0 then
|
||||
servant.dps = servant.display.total_damage / (time.total_elapsed_script_seconds - servant.first_hit_time);
|
||||
end
|
||||
end
|
||||
|
||||
new_total_dps = new_total_dps + servant.dps;
|
||||
end
|
||||
|
||||
player.total.dps = new_total_dps;
|
||||
end
|
||||
|
||||
@@ -91,6 +114,7 @@ function time.init_module()
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||
end
|
||||
|
||||
return time;
|
||||
|
||||
@@ -4201,7 +4201,7 @@ function config.init()
|
||||
|
||||
spacing = {
|
||||
x = 300,
|
||||
y = 24
|
||||
y = -24
|
||||
},
|
||||
|
||||
settings = {
|
||||
@@ -4216,11 +4216,16 @@ function config.init()
|
||||
total_damage_offset_is_relative = true,
|
||||
|
||||
freeze_dps_on_quest_end = true,
|
||||
|
||||
show_my_otomos_separately = true,
|
||||
show_other_otomos_separately = true,
|
||||
show_followers_separately = true,
|
||||
|
||||
orientation = "Vertical", -- "Vertical" or "Horizontal"
|
||||
highlighted_bar = "Me",
|
||||
damage_bar_relative_to = "Top Damage", -- "total damage" or "top damage"
|
||||
my_damage_bar_location = "First", -- "normal" or "first" or "last"
|
||||
my_damage_bar_location = "Last", -- "normal" or "first" or "last"
|
||||
total_damage_location = "First",
|
||||
dps_mode = "First Hit",
|
||||
|
||||
player_name_size_limit = 150
|
||||
@@ -4228,12 +4233,12 @@ function config.init()
|
||||
|
||||
sorting = {
|
||||
type = "Damage", -- "normal" or "damage" or "dps"
|
||||
reversed_order = false
|
||||
reversed_order = true
|
||||
},
|
||||
|
||||
position = {
|
||||
x = 525,
|
||||
y = 225,
|
||||
y = 120,
|
||||
-- Possible values: "Top-Left", "Top-Right", "Bottom-Left", "Bottom-Right"
|
||||
anchor = "Bottom-Left"
|
||||
},
|
||||
|
||||
@@ -127,7 +127,10 @@ language.default_language = {
|
||||
buildup = "Buildup:",
|
||||
total_buildup = "Total Buildup",
|
||||
part_break = "Break",
|
||||
part_sever = "Sever"
|
||||
part_sever = "Sever",
|
||||
|
||||
otomo = "Buddy",
|
||||
servant = "Follower",
|
||||
},
|
||||
|
||||
customization_menu = {
|
||||
@@ -291,6 +294,7 @@ language.default_language = {
|
||||
total_damage = "Total Damage",
|
||||
|
||||
my_damage_bar_location = "My Damage Bar Location",
|
||||
total_damage_location = "Total Damage Bar Location",
|
||||
first = "First",
|
||||
last = "Last",
|
||||
|
||||
@@ -310,9 +314,12 @@ language.default_language = {
|
||||
|
||||
other_players = "Other Players",
|
||||
hunter_rank = "Hunter Rank",
|
||||
word_player = "Word \"Player\"";
|
||||
player_id = "Player ID",
|
||||
player_name = "Player Name",
|
||||
id = "ID",
|
||||
name = "Name",
|
||||
|
||||
show_my_otomos_separately = "Show my Buddies separately",
|
||||
show_other_otomos_separately = "Show other Buddies separately",
|
||||
show_followers_separately = "Show Followers separately",
|
||||
|
||||
dps_mode = "DPS Mode",
|
||||
dps = "DPS",
|
||||
|
||||
@@ -3,10 +3,12 @@ local singletons;
|
||||
local config;
|
||||
local customization_menu;
|
||||
local player;
|
||||
local non_players;
|
||||
local quest_status;
|
||||
local screen;
|
||||
local drawing;
|
||||
local language;
|
||||
local table_helpers;
|
||||
|
||||
damage_meter_UI.last_displayed_players = {};
|
||||
damage_meter_UI.freeze_displayed_players = false;
|
||||
@@ -63,6 +65,12 @@ function damage_meter_UI.get_players(player_info_list)
|
||||
::continue::
|
||||
end
|
||||
|
||||
if cached_config.settings.show_followers_separately then
|
||||
for id, non_player in pairs(non_players.servant_list) do
|
||||
table.insert(quest_players, non_player);
|
||||
end
|
||||
end
|
||||
|
||||
return quest_players;
|
||||
end
|
||||
|
||||
@@ -142,8 +150,32 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
end
|
||||
|
||||
-- draw
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
|
||||
-- draw total damage
|
||||
if cached_config.settings.total_damage_location == "First" then
|
||||
if cached_config.settings.hide_total_damage then
|
||||
return;
|
||||
end
|
||||
|
||||
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
|
||||
return;
|
||||
end
|
||||
|
||||
player.draw_total(position_on_screen, 1);
|
||||
|
||||
if cached_config.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
|
||||
else
|
||||
position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier;
|
||||
end
|
||||
end
|
||||
|
||||
-- draw
|
||||
if not cached_config.settings.total_damage_offset_is_relative then
|
||||
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
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
|
||||
goto continue
|
||||
@@ -157,7 +189,12 @@ function damage_meter_UI.draw()
|
||||
goto continue
|
||||
end
|
||||
|
||||
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
|
||||
if _player.is_player then
|
||||
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
|
||||
else
|
||||
non_players.draw(_player, position_on_screen, 1, top_damage, top_dps);
|
||||
end
|
||||
|
||||
|
||||
if cached_config.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
|
||||
@@ -170,19 +207,21 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
|
||||
-- draw total damage
|
||||
if cached_config.settings.hide_total_damage then
|
||||
return;
|
||||
end
|
||||
if cached_config.settings.total_damage_location == "Last" then
|
||||
if cached_config.settings.hide_total_damage then
|
||||
return;
|
||||
end
|
||||
|
||||
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
|
||||
return;
|
||||
end
|
||||
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
|
||||
return;
|
||||
end
|
||||
|
||||
if not cached_config.settings.total_damage_offset_is_relative then
|
||||
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
end
|
||||
if not cached_config.settings.total_damage_offset_is_relative then
|
||||
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||
end
|
||||
|
||||
player.draw_total(position_on_screen, 1);
|
||||
player.draw_total(position_on_screen, 1);
|
||||
end
|
||||
end
|
||||
|
||||
function damage_meter_UI.init_module()
|
||||
@@ -190,10 +229,12 @@ function damage_meter_UI.init_module()
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||
player = require("MHR_Overlay.Damage_Meter.player");
|
||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
end
|
||||
|
||||
return damage_meter_UI;
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
local non_player_damage_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
local config;
|
||||
local player;
|
||||
local language;
|
||||
|
||||
function non_player_damage_UI_entity.new(bar, highlighted_bar, name_label, dps_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
|
||||
--entity.visibility = visibility;
|
||||
entity.bar = table_helpers.deep_copy(bar);
|
||||
entity.highlighted_bar = table_helpers.deep_copy(highlighted_bar);
|
||||
entity.name_label = table_helpers.deep_copy(name_label);
|
||||
entity.dps_label = table_helpers.deep_copy(dps_label);
|
||||
entity.value_label = table_helpers.deep_copy(value_label);
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
|
||||
entity.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.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;
|
||||
|
||||
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_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.y = entity.dps_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function non_player_damage_UI_entity.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
local include = cached_config.player_name_label.include.others;
|
||||
|
||||
local name_text = "";
|
||||
|
||||
if include.type then
|
||||
if non_player.is_otomo then
|
||||
name_text = name_text .. language.current_language.UI.otomo .. " ";
|
||||
else
|
||||
name_text = name_text .. language.current_language.UI.servant .. " ";
|
||||
end
|
||||
end
|
||||
|
||||
if include.id then
|
||||
name_text = name_text .. string.format("%d ", non_player.id);
|
||||
end
|
||||
|
||||
if include.name then
|
||||
name_text = name_text .. non_player.name;
|
||||
end
|
||||
|
||||
local player_damage_percentage = 0;
|
||||
if player.total.display.total_damage ~= 0 then
|
||||
player_damage_percentage = non_player.display.total_damage / player.total.display.total_damage;
|
||||
end
|
||||
|
||||
local player_damage_bar_percentage = 0;
|
||||
if cached_config.settings.damage_bar_relative_to == "Total Damage" then
|
||||
if player.total.display.total_damage ~= 0 then
|
||||
player_damage_bar_percentage = non_player.display.total_damage / player.total.display.total_damage;
|
||||
end
|
||||
else
|
||||
if top_damage ~= 0 then
|
||||
player_damage_bar_percentage = non_player.display.total_damage / top_damage;
|
||||
end
|
||||
end
|
||||
|
||||
if cached_config.settings.highlighted_bar == "Top Damage" and non_player.display.total_damage == top_damage then
|
||||
drawing.draw_bar(non_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
elseif cached_config.settings.highlighted_bar == "Top DPS" and non_player.dps == top_dps then
|
||||
drawing.draw_bar(non_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
else
|
||||
drawing.draw_bar(non_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
end
|
||||
|
||||
name_text = drawing.limit_text_size(name_text, non_player.damage_UI.name_size_limit);
|
||||
|
||||
drawing.draw_label(non_player.damage_UI.name_label, position_on_screen, opacity_scale, name_text);
|
||||
drawing.draw_label(non_player.damage_UI.value_label, position_on_screen, opacity_scale, non_player.display.total_damage);
|
||||
drawing.draw_label(non_player.damage_UI.percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage);
|
||||
drawing.draw_label(non_player.damage_UI.dps_label, position_on_screen, opacity_scale, non_player.dps);
|
||||
end
|
||||
|
||||
function non_player_damage_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
player = require("MHR_Overlay.Damage_Meter.player");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
end
|
||||
|
||||
return non_player_damage_UI_entity;
|
||||
@@ -1,11 +1,12 @@
|
||||
local damage_UI_entity = {};
|
||||
local player_damage_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
local config;
|
||||
local player;
|
||||
local language;
|
||||
local quest_status;
|
||||
|
||||
function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label,
|
||||
function player_damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label,
|
||||
percentage_label, cart_count_label)
|
||||
local entity = {};
|
||||
|
||||
@@ -59,7 +60,7 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label
|
||||
return entity;
|
||||
end
|
||||
|
||||
function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
function player_damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
local cached_config = config.current_config.damage_meter_UI;
|
||||
|
||||
local player_include = cached_config.player_name_label.include.others;
|
||||
@@ -77,20 +78,19 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
player_name_text = string.format("[%d] ", _player.hunter_rank);
|
||||
end
|
||||
|
||||
if player_include.cart_count then
|
||||
if player_include.cart_count and quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
|
||||
player_name_text = player_name_text .. string.format("x%d ", _player.cart_count);
|
||||
end
|
||||
|
||||
|
||||
if player_include.word_player then
|
||||
if player_include.type then
|
||||
player_name_text = player_name_text .. language.current_language.UI.player .. " ";
|
||||
end
|
||||
|
||||
if player_include.player_id then
|
||||
if player_include.id then
|
||||
player_name_text = player_name_text .. string.format("%d ", _player.id);
|
||||
end
|
||||
|
||||
if player_include.player_name then
|
||||
if player_include.name then
|
||||
player_name_text = player_name_text .. _player.name;
|
||||
end
|
||||
|
||||
@@ -150,20 +150,23 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
|
||||
player_name_text = drawing.limit_text_size(player_name_text, _player.damage_UI.player_name_size_limit);
|
||||
|
||||
|
||||
drawing.draw_label(_player.damage_UI.player_name_label, position_on_screen, opacity_scale, player_name_text);
|
||||
drawing.draw_label(_player.damage_UI.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(_player.damage_UI.dps_label, position_on_screen, opacity_scale, _player.dps);
|
||||
drawing.draw_label(_player.damage_UI.cart_count_label, position_on_screen, opacity_scale, _player.cart_count);
|
||||
|
||||
if quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
|
||||
drawing.draw_label(_player.damage_UI.cart_count_label, position_on_screen, opacity_scale, _player.cart_count);
|
||||
end
|
||||
end
|
||||
|
||||
function damage_UI_entity.init_module()
|
||||
function player_damage_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
player = require("MHR_Overlay.Damage_Meter.player");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||
end
|
||||
|
||||
return damage_UI_entity;
|
||||
return player_damage_UI_entity;
|
||||
@@ -11,6 +11,8 @@ local language;
|
||||
local part_names;
|
||||
local time_UI;
|
||||
local keyboard;
|
||||
local non_players;
|
||||
|
||||
local label_customization;
|
||||
local bar_customization;
|
||||
local large_monster_UI_customization;
|
||||
@@ -51,6 +53,7 @@ customization_menu.displayed_buildup_bar_relative_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_highlighted_bar_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_damage_bar_relative_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_my_damage_bar_location_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_total_damage_location_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_sorting_types = {};
|
||||
customization_menu.displayed_damage_meter_UI_dps_modes = {};
|
||||
|
||||
@@ -69,6 +72,7 @@ customization_menu.buildup_bar_relative_types = {};
|
||||
customization_menu.damage_meter_UI_highlighted_bar_types = {};
|
||||
customization_menu.damage_meter_UI_damage_bar_relative_types = {};
|
||||
customization_menu.damage_meter_UI_my_damage_bar_location_types = {};
|
||||
customization_menu.damage_meter_UI_total_damage_location_types = {};
|
||||
customization_menu.damage_meter_UI_sorting_types = {};
|
||||
customization_menu.damage_meter_UI_dps_modes = {};
|
||||
|
||||
@@ -150,10 +154,16 @@ function customization_menu.init()
|
||||
|
||||
customization_menu.displayed_damage_meter_UI_damage_bar_relative_types =
|
||||
{language.current_language.customization_menu.total_damage, language.current_language.customization_menu.top_damage};
|
||||
customization_menu.displayed_damage_meter_UI_my_damage_bar_location_types = {language.current_language
|
||||
|
||||
customization_menu.displayed_damage_meter_UI_my_damage_bar_location_types = {language.current_language
|
||||
.customization_menu.normal, language.current_language.customization_menu.first,
|
||||
language.current_language
|
||||
.customization_menu.last};
|
||||
|
||||
customization_menu.displayed_damage_meter_UI_total_damage_location_types = {
|
||||
language.current_language.customization_menu.first,
|
||||
language.current_language.customization_menu.last};
|
||||
|
||||
customization_menu.displayed_damage_meter_UI_sorting_types =
|
||||
{language.current_language.customization_menu.normal, language.current_language.customization_menu.damage,
|
||||
language.current_language.customization_menu.dps};
|
||||
@@ -216,6 +226,11 @@ function customization_menu.init()
|
||||
customization_menu.damage_meter_UI_my_damage_bar_location_types =
|
||||
{language.default_language.customization_menu.normal, language.default_language.customization_menu.first,
|
||||
language.default_language.customization_menu.last};
|
||||
|
||||
customization_menu.damage_meter_UI_total_damage_location_types = {
|
||||
language.current_language.customization_menu.first,
|
||||
language.current_language.customization_menu.last};
|
||||
|
||||
customization_menu.damage_meter_UI_sorting_types = {language.default_language.customization_menu.normal,
|
||||
language.default_language.customization_menu.damage,
|
||||
language.default_language.customization_menu.dps};
|
||||
@@ -543,6 +558,11 @@ function customization_menu.draw()
|
||||
if damage_meter_UI_changed or modifiers_changed then
|
||||
for _, _player in pairs(player.list) do
|
||||
player.init_UI(_player);
|
||||
|
||||
end
|
||||
|
||||
for _, servant in pairs(non_players.servant_list) do
|
||||
non_players.init_UI(servant);
|
||||
end
|
||||
|
||||
player.init_total_UI(player.total);
|
||||
@@ -640,6 +660,10 @@ function customization_menu.draw_global_settings()
|
||||
for _, _player in pairs(player.list) do
|
||||
player.init_UI(_player);
|
||||
end
|
||||
|
||||
for _, servant in pairs(non_players.servant_list) do
|
||||
non_players.init_UI(servant);
|
||||
end
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.menu_font) then
|
||||
@@ -1418,6 +1442,21 @@ function customization_menu.draw_damage_meter_UI()
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.settings.show_my_otomos_separately = imgui.checkbox(
|
||||
language.current_language.customization_menu.show_my_otomos_separately, cached_config.settings.show_my_otomos_separately);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.settings.show_other_otomos_separately = imgui.checkbox(
|
||||
language.current_language.customization_menu.show_other_otomos_separately, cached_config.settings.show_other_otomos_separately);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.settings.show_followers_separately = imgui.checkbox(
|
||||
language.current_language.customization_menu.show_followers_separately, cached_config.settings.show_followers_separately);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, index = imgui.combo(
|
||||
language.current_language.customization_menu.orientation,
|
||||
table_helpers.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
|
||||
@@ -1462,6 +1501,17 @@ function customization_menu.draw_damage_meter_UI()
|
||||
cached_config.settings.my_damage_bar_location = customization_menu.damage_meter_UI_my_damage_bar_location_types[index];
|
||||
end
|
||||
|
||||
changed, index = imgui.combo(
|
||||
language.current_language.customization_menu.total_damage_location,
|
||||
table_helpers.find_index(customization_menu.damage_meter_UI_total_damage_location_types, cached_config.settings.total_damage_location),
|
||||
customization_menu.displayed_damage_meter_UI_total_damage_location_types);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if changed then
|
||||
cached_config.settings.total_damage_location = customization_menu.damage_meter_UI_total_damage_location_types[index];
|
||||
end
|
||||
|
||||
changed, index = imgui.combo(language.current_language.customization_menu.dps_mode,
|
||||
table_helpers.find_index(customization_menu.damage_meter_UI_dps_modes, cached_config.settings.dps_mode),
|
||||
customization_menu.displayed_damage_meter_UI_dps_modes);
|
||||
@@ -1570,10 +1620,14 @@ function customization_menu.draw_damage_meter_UI()
|
||||
tracked_damage_types_changed = tracked_damage_types_changed or changed;
|
||||
|
||||
if tracked_damage_types_changed then
|
||||
for player_id, _player in pairs(player.list) do
|
||||
for _, _player in pairs(player.list) do
|
||||
player.update_display(_player);
|
||||
end
|
||||
|
||||
for _, servant in pairs(non_players.servant_list) do
|
||||
player.update_display(servant);
|
||||
end
|
||||
|
||||
player.update_display(player.total);
|
||||
end
|
||||
|
||||
@@ -1662,18 +1716,18 @@ function customization_menu.draw_damage_meter_UI()
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.player_name_label.include.myself.word_player = imgui.checkbox(
|
||||
language.current_language.customization_menu.word_player, cached_config.player_name_label.include.myself.word_player);
|
||||
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.player_id = imgui.checkbox(
|
||||
language.current_language.customization_menu.player_id, cached_config.player_name_label.include.myself.player_id);
|
||||
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.player_name = imgui.checkbox(
|
||||
language.current_language.customization_menu.player_name, cached_config.player_name_label.include.myself.player_name);
|
||||
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;
|
||||
|
||||
@@ -1696,18 +1750,18 @@ function customization_menu.draw_damage_meter_UI()
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.player_name_label.include.others.word_player = imgui.checkbox(
|
||||
language.current_language.customization_menu.word_player, cached_config.player_name_label.include.others.word_player);
|
||||
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.player_id = imgui.checkbox(
|
||||
language.current_language.customization_menu.player_id, cached_config.player_name_label.include.others.player_id);
|
||||
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.player_name = imgui.checkbox(
|
||||
language.current_language.customization_menu.player_name, cached_config.player_name_label.include.others.player_name);
|
||||
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;
|
||||
|
||||
@@ -1996,6 +2050,8 @@ function customization_menu.init_module()
|
||||
part_names = require("MHR_Overlay.Misc.part_names");
|
||||
time_UI = require("MHR_Overlay.UI.Modules.time_UI");
|
||||
keyboard = require("MHR_Overlay.Game_Handler.keyboard");
|
||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||
|
||||
label_customization = require("MHR_Overlay.UI.Customizations.label_customization");
|
||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||
large_monster_UI_customization = require("MHR_Overlay.UI.Customizations.large_monster_UI_customization");
|
||||
|
||||
Reference in New Issue
Block a user