mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Compare commits
2 Commits
add4cca6f1
...
a84c698a4b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84c698a4b | ||
|
|
f0eb9673b0 |
@@ -188,7 +188,7 @@ local function main_loop()
|
||||
|
||||
player.update_player_list(quest_status.index >= 2);
|
||||
non_players.update_servant_list();
|
||||
|
||||
|
||||
if quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
|
||||
|
||||
local large_monster_UI_config = config.current_config.large_monster_UI;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
local table_helpers = {};
|
||||
|
||||
local next = next;
|
||||
|
||||
function table_helpers.deep_copy(original, copies)
|
||||
copies = copies or {};
|
||||
local original_type = type(original);
|
||||
@@ -25,9 +27,9 @@ function table_helpers.deep_copy(original, copies)
|
||||
return copy;
|
||||
end
|
||||
|
||||
function table_helpers.find_index(table, value, nullable)
|
||||
for i = 1, #table do
|
||||
if table[i] == value then
|
||||
function table_helpers.find_index(table_, value, nullable)
|
||||
for i = 1, #table_ do
|
||||
if table_[i] == value then
|
||||
return i;
|
||||
end
|
||||
end
|
||||
@@ -43,8 +45,8 @@ function table_helpers.merge(...)
|
||||
local tables_to_merge = { ... };
|
||||
assert(#tables_to_merge > 1, "There should be at least two tables to merge them");
|
||||
|
||||
for key, table in ipairs(tables_to_merge) do
|
||||
assert(type(table) == "table", string.format("Expected a table as function parameter %d", key));
|
||||
for key, table_ in ipairs(tables_to_merge) do
|
||||
assert(type(table_) == "table", string.format("Expected a table as function parameter %d", key));
|
||||
end
|
||||
|
||||
local result = table_helpers.deep_copy(tables_to_merge[1]);
|
||||
@@ -65,10 +67,10 @@ function table_helpers.merge(...)
|
||||
return result;
|
||||
end
|
||||
|
||||
function table_helpers.tostring(table)
|
||||
if type(table) == "table" then
|
||||
function table_helpers.tostring(table_)
|
||||
if type(table_) == "table" then
|
||||
local s = "{ \n";
|
||||
for k, v in pairs(table) do
|
||||
for k, v in pairs(table_) do
|
||||
if type(k) ~= "number" then
|
||||
k = "\"" .. k .. "\"";
|
||||
end
|
||||
@@ -76,11 +78,16 @@ function table_helpers.tostring(table)
|
||||
end
|
||||
return s .. "} \n";
|
||||
else
|
||||
return tostring(table);
|
||||
return tostring(table_);
|
||||
end
|
||||
end
|
||||
|
||||
function table_helpers.is_empty(table_)
|
||||
return next(table_) == nil;
|
||||
end
|
||||
|
||||
function table_helpers.init_module()
|
||||
|
||||
end
|
||||
|
||||
return table_helpers;
|
||||
|
||||
@@ -83,7 +83,8 @@ function damage_meter_UI.draw()
|
||||
end
|
||||
|
||||
local quest_players = {};
|
||||
if damage_meter_UI.freeze_displayed_players and 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;
|
||||
elseif quest_status.flow_state == quest_status.flow_states.IN_LOBBY or quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
|
||||
local player_info_list = hunter_info_field:get_data(singletons.lobby_manager);
|
||||
@@ -93,7 +94,7 @@ function damage_meter_UI.draw()
|
||||
quest_players = damage_meter_UI.get_players(player_info_list);
|
||||
end
|
||||
|
||||
if not damage_meter_UI.freeze_displayed_players then
|
||||
if not damage_meter_UI.freeze_displayed_players or table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
|
||||
if #quest_players ~= 0 then
|
||||
-- sort here
|
||||
if cached_config.sorting.type == "Normal" then
|
||||
|
||||
Reference in New Issue
Block a user