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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user