Update Large Monster Health when Host on Player Join?

This commit is contained in:
GreenComfyTea
2023-08-17 12:18:55 +03:00
parent 6456e3bfaf
commit 1c9eff6b06
3 changed files with 15 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ local language;
local non_players;
local utils;
local error_handler;
local large_monster;
local sdk = sdk;
local tostring = tostring;
@@ -108,6 +109,8 @@ function this.new(id, name, master_rank, hunter_rank, type)
this.init_highlighted_UI();
end
large_monster.request_health_update();
return player;
end
@@ -458,6 +461,7 @@ function this.update_players()
non_players.update_otomo_list(is_on_quest, quest_status.is_online);
this.update_dps(false);
quest_status.update_cart_count();
end
function this.update_player_list(hunter_info_field_)
@@ -473,8 +477,6 @@ function this.update_player_list(hunter_info_field_)
return;
end
local update_cart_count = false;
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
@@ -502,7 +504,6 @@ function this.update_player_list(hunter_info_field_)
this.list[this.myself.id] = nil;
this.myself = this.new(myself_id, myself_player_name, myself_master_rank, myself_hunter_rank, this.types.myself);
this.list[myself_id] = this.myself;
update_cart_count = true;
end
-- other players
@@ -558,20 +559,14 @@ function this.update_player_list(hunter_info_field_)
player = this.new(id, name, master_rank, hunter_rank, this.types.myself);
this.myself = player;
this.list[id] = player;
update_cart_count = true;
else
player = this.new(id, name, master_rank, hunter_rank, this.types.other_player);
this.list[id] = player;
update_cart_count = true;
end
end
::continue::
end
if update_cart_count then
quest_status.update_cart_count();
end
end
function this.init_UI(player)
@@ -608,6 +603,7 @@ function this.init_dependencies()
non_players = require("MHR_Overlay.Damage_Meter.non_players");
utils = require("MHR_Overlay.Misc.utils");
error_handler = require("MHR_Overlay.Misc.error_handler");
large_monster = require("MHR_Overlay.Monsters.large_monster");
end
function this.init_module()