mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Added hotkeys, separated player initialization and drawing.
This commit is contained in:
@@ -12,14 +12,8 @@ damage_meter_UI.last_displayed_players = {};
|
||||
damage_meter_UI.freeze_displayed_players = false;
|
||||
|
||||
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
||||
local my_hunter_info_field = lobby_manager_type_def:get_field("_myHunterInfo");
|
||||
local myself_index_field = lobby_manager_type_def:get_field("_myselfIndex");
|
||||
local myself_quest_index_field = lobby_manager_type_def:get_field("_myselfQuestIndex");
|
||||
|
||||
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
|
||||
|
||||
local my_hunter_info_type_def = my_hunter_info_field:get_type();
|
||||
local name_field = my_hunter_info_type_def:get_field("_name");
|
||||
local hunter_info_field = lobby_manager_type_def:get_field("_hunterInfo");
|
||||
|
||||
local quest_hunter_info_type_def = quest_hunter_info_field:get_type();
|
||||
local get_count_method = quest_hunter_info_type_def:get_method("get_Count");
|
||||
@@ -27,10 +21,48 @@ local get_item_method = quest_hunter_info_type_def:get_method("get_Item");
|
||||
|
||||
local hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterInfo");
|
||||
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
|
||||
local hunter_rank_field = hunter_info_type_def:get_field("_hunterRank");
|
||||
|
||||
local progress_manager_type_def = sdk.find_type_definition("snow.progress.ProgressManager");
|
||||
local get_hunter_rank_method = progress_manager_type_def:get_method("get_HunterRank");
|
||||
function damage_meter_UI.get_players(player_info_list)
|
||||
-- other players
|
||||
if player_info_list == nil then
|
||||
customization_menu.status = "No player info list";
|
||||
return {};
|
||||
end
|
||||
|
||||
local quest_players = {};
|
||||
|
||||
local count = get_count_method:call(player_info_list);
|
||||
|
||||
if count == nil then
|
||||
customization_menu.status = "No player info list count";
|
||||
return {};
|
||||
end
|
||||
|
||||
for i = 0, count - 1 do
|
||||
local player_info = get_item_method:call(player_info_list, i);
|
||||
|
||||
if player_info == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
local player_id = member_index_field:get_data(player_info);
|
||||
if player_id == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
local _player = player.get_player(player_id);
|
||||
if _player ~= nil then
|
||||
if player_id == player.myself.id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then
|
||||
goto continue;
|
||||
end
|
||||
table.insert(quest_players, _player);
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
return quest_players;
|
||||
end
|
||||
|
||||
function damage_meter_UI.draw()
|
||||
|
||||
@@ -38,150 +70,60 @@ function damage_meter_UI.draw()
|
||||
return;
|
||||
end
|
||||
|
||||
if singletons.lobby_manager == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
if singletons.progress_manager == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
-- myself player
|
||||
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
|
||||
if myself_player_info == nil then
|
||||
customization_menu.status = "No myself player info list";
|
||||
return;
|
||||
end
|
||||
|
||||
local myself_player_name = name_field:get_data(myself_player_info);
|
||||
if myself_player_name == nil then
|
||||
customization_menu.status = "No myself player name";
|
||||
return;
|
||||
end
|
||||
|
||||
if quest_status.is_online then
|
||||
player.myself_id = myself_quest_index_field:get_data(singletons.lobby_manager);
|
||||
if player.myself_id == nil then
|
||||
customization_menu.status = "No myself player id";
|
||||
return;
|
||||
end
|
||||
else
|
||||
player.myself_id = myself_index_field:get_data(singletons.lobby_manager);
|
||||
if player.myself_id == nil then
|
||||
customization_menu.status = "No myself player id";
|
||||
return;
|
||||
end
|
||||
end
|
||||
|
||||
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager);
|
||||
if myself_hunter_rank == nil then
|
||||
customization_menu.status = "No myself hunter rank";
|
||||
myself_hunter_rank = 0;
|
||||
end
|
||||
|
||||
if player.list[player.myself_id] == nil then
|
||||
player.list[player.myself_id] = player.new(player.myself_id, myself_player_name, myself_hunter_rank);
|
||||
player.myself = player.list[player.myself_id];
|
||||
else
|
||||
|
||||
end
|
||||
|
||||
local quest_players = {};
|
||||
|
||||
if damage_meter_UI.freeze_displayed_players then
|
||||
if damage_meter_UI.freeze_displayed_players and damage_meter_UI.last_displayed_players ~= {} then
|
||||
quest_players = damage_meter_UI.last_displayed_players;
|
||||
elseif quest_status.index < 2 then
|
||||
local player_info_list = hunter_info_field:get_data(singletons.lobby_manager);
|
||||
quest_players = damage_meter_UI.get_players(player_info_list);
|
||||
else
|
||||
-- other players
|
||||
local player_info_list = quest_hunter_info_field:get_data(singletons.lobby_manager);
|
||||
if player_info_list == nil then
|
||||
customization_menu.status = "No player info list";
|
||||
end
|
||||
quest_players = damage_meter_UI.get_players(player_info_list);
|
||||
end
|
||||
|
||||
local count = get_count_method:call(player_info_list);
|
||||
if count == nil then
|
||||
customization_menu.status = "No player info list count";
|
||||
return;
|
||||
end
|
||||
|
||||
for i = 0, count - 1 do
|
||||
|
||||
local player_info = get_item_method:call(player_info_list, i);
|
||||
if player_info == nil then
|
||||
goto continue
|
||||
end
|
||||
|
||||
local player_id = member_index_field:get_data(player_info)
|
||||
if player_id == nil then
|
||||
goto continue
|
||||
end
|
||||
|
||||
local player_hunter_rank = hunter_rank_field:get_data(player_info);
|
||||
if player_hunter_rank == nil then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if player_id == player.myself_id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then
|
||||
player.list[player.myself_id].hunter_rank = player_hunter_rank;
|
||||
goto continue
|
||||
end
|
||||
|
||||
local player_name = name_field:get_data(player_info);
|
||||
if player_name == nil then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if player.list[player_id] == nil then
|
||||
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
|
||||
elseif player.list[player_id].name ~= player_name then
|
||||
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
|
||||
end
|
||||
|
||||
table.insert(quest_players, player.list[player_id]);
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
-- sort here
|
||||
if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
|
||||
local reversed_quest_players = {};
|
||||
for i = #quest_players, 1, -1 do
|
||||
table.insert(reversed_quest_players, quest_players[i]);
|
||||
end
|
||||
quest_players = reversed_quest_players;
|
||||
elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.dps < right.dps;
|
||||
end);
|
||||
if not damage_meter_UI.freeze_displayed_players then
|
||||
if #quest_players ~= 0 then
|
||||
-- sort here
|
||||
if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
|
||||
local reversed_quest_players = {};
|
||||
for i = #quest_players, 1, -1 do
|
||||
table.insert(reversed_quest_players, quest_players[i]);
|
||||
end
|
||||
quest_players = reversed_quest_players;
|
||||
elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.dps < right.dps;
|
||||
end);
|
||||
else
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.dps > right.dps;
|
||||
end);
|
||||
end
|
||||
else
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.dps > right.dps;
|
||||
end);
|
||||
end
|
||||
else
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.display.total_damage < right.display.total_damage;
|
||||
end);
|
||||
else
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.display.total_damage > right.display.total_damage;
|
||||
end);
|
||||
if config.current_config.damage_meter_UI.sorting.reversed_order then
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.display.total_damage < right.display.total_damage;
|
||||
end);
|
||||
else
|
||||
table.sort(quest_players, function(left, right)
|
||||
return left.display.total_damage > right.display.total_damage;
|
||||
end);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if config.current_config.damage_meter_UI.settings.my_damage_bar_location == "First" then
|
||||
table.insert(quest_players, 1, player.list[player.myself_id]);
|
||||
table.insert(quest_players, 1, player.myself);
|
||||
elseif config.current_config.damage_meter_UI.settings.my_damage_bar_location == "Last" then
|
||||
table.insert(quest_players, #quest_players + 1, player.list[player.myself_id]);
|
||||
elseif #quest_players == 0 then
|
||||
table.insert(quest_players, 1, player.list[player.myself_id]);
|
||||
table.insert(quest_players, #quest_players + 1, player.myself);
|
||||
elseif #player.list == 0 then
|
||||
table.insert(quest_players, player.myself);
|
||||
end
|
||||
|
||||
damage_meter_UI.last_displayed_players = quest_players;
|
||||
end
|
||||
|
||||
|
||||
local top_damage = 0;
|
||||
local top_dps = 0;
|
||||
for _, _player in ipairs(quest_players) do
|
||||
@@ -193,7 +135,7 @@ function damage_meter_UI.draw()
|
||||
top_dps = _player.dps;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- draw
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position);
|
||||
for _, _player in ipairs(quest_players) do
|
||||
@@ -205,9 +147,9 @@ function damage_meter_UI.draw()
|
||||
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
|
||||
|
||||
if config.current_config.damage_meter_UI.settings.orientation == "Horizontal" then
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x;
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
else
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
end
|
||||
|
||||
::continue1::
|
||||
@@ -223,9 +165,7 @@ function damage_meter_UI.draw()
|
||||
position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position);
|
||||
end
|
||||
|
||||
drawing.draw_label(config.current_config.damage_meter_UI.total_damage_label, position_on_screen, 1, language.current_language.UI.total_damage);
|
||||
drawing.draw_label(config.current_config.damage_meter_UI.total_damage_value_label, position_on_screen, 1, player.total.display.total_damage);
|
||||
drawing.draw_label(config.current_config.damage_meter_UI.total_dps_label, position_on_screen, 1, player.total.dps);
|
||||
player.draw_total(position_on_screen, 1);
|
||||
end
|
||||
|
||||
function damage_meter_UI.init_module()
|
||||
|
||||
@@ -23,6 +23,7 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
|
||||
local displayed_monsters = {};
|
||||
|
||||
local highlighted_id = -1;
|
||||
local monster_id_shift = 0;
|
||||
local highlighted_monster = nil;
|
||||
|
||||
if singletons.gui_manager ~= nil then
|
||||
@@ -36,7 +37,6 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local enemy_count = get_boss_enemy_count_method:call(singletons.enemy_manager);
|
||||
if enemy_count == nil then
|
||||
return;
|
||||
@@ -55,7 +55,9 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if i == highlighted_id then
|
||||
if monster.dead_or_captured then
|
||||
monster_id_shift = monster_id_shift + 1;
|
||||
elseif i == highlighted_id + monster_id_shift then
|
||||
highlighted_monster = monster;
|
||||
end
|
||||
|
||||
@@ -114,8 +116,8 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster)
|
||||
goto continue;
|
||||
end
|
||||
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y;
|
||||
position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
local opacity_scale = 1;
|
||||
if monster.distance > config.current_config.large_monster_UI.dynamic.settings.max_distance then
|
||||
@@ -199,9 +201,9 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
|
||||
}
|
||||
|
||||
if config.current_config.large_monster_UI.static.settings.orientation == "Horizontal" then
|
||||
monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i;
|
||||
monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
else
|
||||
monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i;
|
||||
monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
end
|
||||
|
||||
large_monster.draw_static(monster, monster_position_on_screen, 1);
|
||||
|
||||
@@ -3,6 +3,9 @@ local time;
|
||||
local screen;
|
||||
local config;
|
||||
local drawing;
|
||||
local table_helpers;
|
||||
|
||||
time_UI.label = nil;
|
||||
|
||||
function time_UI.draw()
|
||||
local elapsed_minutes = time.elapsed_minutes;
|
||||
@@ -14,7 +17,14 @@ function time_UI.draw()
|
||||
|
||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position);
|
||||
|
||||
drawing.draw_label(config.current_config.time_UI.time_label, position_on_screen, 1, elapsed_minutes, elapsed_seconds);
|
||||
drawing.draw_label(time_UI.label , position_on_screen, 1, elapsed_minutes, elapsed_seconds);
|
||||
end
|
||||
|
||||
function time_UI.init_UI()
|
||||
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
|
||||
|
||||
time_UI.label.offset.x = time_UI.label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
time_UI.label.offset.y = time_UI.label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
end
|
||||
|
||||
function time_UI.init_module()
|
||||
@@ -22,6 +32,9 @@ function time_UI.init_module()
|
||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
|
||||
time_UI.init_UI()
|
||||
end
|
||||
|
||||
return time_UI;
|
||||
@@ -13,6 +13,23 @@ function body_part_UI_entity.new(visibility, bar, name_label, text_label, value_
|
||||
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 * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.name_label.offset.x = entity.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.name_label.offset.y = entity.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -25,8 +42,8 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count and part.break_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_dynamic_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
@@ -46,8 +63,8 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count and part.break_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_static_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
@@ -67,8 +84,8 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.part_name then
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count and part.break_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
|
||||
@@ -17,20 +17,49 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, 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 * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.dps_label.offset.x = entity.dps_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.dps_label.offset.y = entity.dps_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
|
||||
local player_include = config.current_config.damage_meter_UI.player_name_label.include.others;
|
||||
if _player.id == _player.myself_id then
|
||||
if _player.id == player.myself.id then
|
||||
player_include = config.current_config.damage_meter_UI.player_name_label.include.myself;
|
||||
end
|
||||
|
||||
local player_name_text = "";
|
||||
|
||||
if player_include.hunter_rank then
|
||||
player_name_text = string.format("[%d] ", _player.hunter_rank);
|
||||
end
|
||||
|
||||
if player_include.word_player then
|
||||
player_name_text = language.current_language.UI.player .. " ";
|
||||
player_name_text = player_name_text .. language.current_language.UI.player .. " ";
|
||||
end
|
||||
|
||||
if player_include.player_id then
|
||||
@@ -57,9 +86,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
end
|
||||
end
|
||||
|
||||
x = string.format("%s / %s", tostring(_player.dps), tostring(top_dps));
|
||||
|
||||
if _player.id == player.myself_id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then
|
||||
if _player.id == player.myself.id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then
|
||||
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then
|
||||
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
@@ -69,7 +96,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
|
||||
drawing.draw_bar(_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
|
||||
end
|
||||
|
||||
if _player.id == player.myself_id then
|
||||
if _player.id == player.myself.id then
|
||||
if _player.damage_UI.hunter_rank_label.enable_for.me then
|
||||
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, _player.hunter_rank);
|
||||
end
|
||||
|
||||
@@ -2,6 +2,7 @@ local health_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
local language;
|
||||
local config;
|
||||
|
||||
function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
@@ -12,6 +13,20 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
|
||||
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 * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -31,6 +46,7 @@ function health_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
end
|
||||
|
||||
return health_UI_entity;
|
||||
@@ -2,6 +2,7 @@ local rage_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
local language;
|
||||
local config;
|
||||
|
||||
function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
|
||||
local entity = {};
|
||||
@@ -13,6 +14,23 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
|
||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -39,6 +57,7 @@ function rage_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
end
|
||||
|
||||
return rage_UI_entity;
|
||||
@@ -2,6 +2,7 @@ local stamina_UI_entity = {};
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
local language;
|
||||
local config;
|
||||
|
||||
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
|
||||
local entity = {};
|
||||
@@ -12,6 +13,20 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
|
||||
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 * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -31,6 +46,7 @@ function stamina_UI_entity.init_module()
|
||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
language = require("MHR_Overlay.Misc.language");
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
end
|
||||
|
||||
return stamina_UI_entity;
|
||||
@@ -8,6 +8,8 @@ local large_monster;
|
||||
local small_monster;
|
||||
local language;
|
||||
local part_names;
|
||||
local time_UI;
|
||||
local keyboard;
|
||||
|
||||
customization_menu.font = nil;
|
||||
customization_menu.font_range = { 0x1, 0xFFFF, 0 };
|
||||
@@ -84,6 +86,20 @@ customization_menu.damage_meter_UI_anchor_index = 1;
|
||||
|
||||
customization_menu.selected_UI_font_index = 9;
|
||||
|
||||
|
||||
|
||||
customization_menu.all_UI_waiting_for_key = false;
|
||||
|
||||
customization_menu.small_monster_UI_waiting_for_key = false;
|
||||
|
||||
customization_menu.large_monster_UI_waiting_for_key = false;
|
||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
||||
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
||||
|
||||
customization_menu.time_UI_waiting_for_key = false;
|
||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||
|
||||
function customization_menu.reload_font(pop_push)
|
||||
local success, new_font = pcall(imgui.load_font, language.current_language.font_name, config.current_config.global_settings.menu_font.size, customization_menu.font_range);
|
||||
if success then
|
||||
@@ -218,6 +234,15 @@ function customization_menu.draw()
|
||||
local config_changed = false;
|
||||
local changed = false;
|
||||
|
||||
local modifiers_changed = false;
|
||||
local small_monster_UI_changed = false;
|
||||
local large_monster_dynamic_UI_changed = false;
|
||||
local large_monster_static_UI_changed = false;
|
||||
local large_monster_highlighted_UI_changed = false;
|
||||
local time_UI_changed = false;
|
||||
|
||||
local damage_meter_UI_changed = false;
|
||||
|
||||
local status_string = tostring(customization_menu.status);
|
||||
imgui.text(language.current_language.customization_menu.status .. ": " .. status_string);
|
||||
|
||||
@@ -229,19 +254,22 @@ function customization_menu.draw()
|
||||
changed, config.current_config.large_monster_UI.dynamic.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_dynamic_UI, config.current_config.large_monster_UI.dynamic.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
imgui.same_line();
|
||||
|
||||
|
||||
|
||||
changed, config.current_config.large_monster_UI.static.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_static_UI, config.current_config.large_monster_UI.static.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
changed, config.current_config.large_monster_UI.highlighted.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_highlighted_UI, config.current_config.large_monster_UI.highlighted.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
|
||||
changed, config.current_config.time_UI.enabled = imgui.checkbox(language.current_language.customization_menu.time_UI, config.current_config.time_UI.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
imgui.same_line();
|
||||
|
||||
changed, config.current_config.damage_meter_UI.enabled = imgui.checkbox(language.current_language.customization_menu.damage_meter_UI,
|
||||
config.current_config.damage_meter_UI.enabled);
|
||||
@@ -250,6 +278,207 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.hotkeys) then
|
||||
if customization_menu.all_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.all_UI = 0;
|
||||
customization_menu.all_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.all_UI) then
|
||||
local is_any_other_waiting = customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.all_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.all_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.small_monster_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.small_monster_UI = 0;
|
||||
customization_menu.small_monster_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.small_monster_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.small_monster_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.small_monster_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_UI = 0;
|
||||
customization_menu.large_monster_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.large_monster_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_dynamic_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_dynamic_UI = 0;
|
||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_dynamic_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_dynamic_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_static_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_static_UI = 0;
|
||||
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_static_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.large_monster_static_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_static_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_highlighted_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_highlighted_UI = 0;
|
||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_highlighted_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_highlighted_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.time_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.time_UI = 0;
|
||||
customization_menu.time_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.time_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.damage_meter_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.time_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.time_UI]);
|
||||
|
||||
|
||||
|
||||
if customization_menu.damage_meter_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.damage_meter_UI = 0;
|
||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.damage_meter_UI) then
|
||||
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
|
||||
or customization_menu.small_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_UI_waiting_for_key
|
||||
or customization_menu.large_monster_dynamic_UI_waiting_for_key
|
||||
or customization_menu.large_monster_static_UI_waiting_for_key
|
||||
or customization_menu.large_monster_highlighted_UI_waiting_for_key
|
||||
or customization_menu.time_UI_waiting_for_key;
|
||||
|
||||
if not is_any_other_waiting then
|
||||
customization_menu.damage_meter_UI_waiting_for_key = true;
|
||||
end
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.damage_meter_UI]);
|
||||
|
||||
|
||||
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.global_settings) then
|
||||
changed, customization_menu.selected_language_index = imgui.combo(language.current_language.customization_menu.language, customization_menu.selected_language_index, language.language_names);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -338,7 +567,21 @@ function customization_menu.draw()
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.modifiers) then
|
||||
changed, config.current_config.global_settings.modifiers.global_position_modifier =
|
||||
imgui.drag_float(language.current_language.customization_menu.global_position_modifier, config.current_config.global_settings.modifiers.global_position_modifier, 0.01, 0.01, 10, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
modifiers_changed = modifiers_changed or changed;
|
||||
|
||||
changed, config.current_config.global_settings.modifiers.global_scale_modifier =
|
||||
imgui.drag_float(language.current_language.customization_menu.global_scale_modifier, config.current_config.global_settings.modifiers.global_scale_modifier, 0.01, 0.01, 10, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
modifiers_changed = modifiers_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.performance) then
|
||||
changed, config.current_config.global_settings.performance.max_monster_updates_per_tick =
|
||||
imgui.slider_int(language.current_language.customization_menu.max_monster_updates_per_tick, config.current_config.global_settings.performance.max_monster_updates_per_tick, 1, 150);
|
||||
@@ -350,6 +593,7 @@ function customization_menu.draw()
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.module_visibility_on_different_screens) then
|
||||
|
||||
@@ -386,36 +630,36 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.quest_summary_screen) then
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.small_monster_UI =
|
||||
if imgui.tree_node(language.current_language.customization_menu.quest_result_screen) then
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI =
|
||||
imgui.checkbox(language.current_language.customization_menu.small_monster_UI,
|
||||
config.current_config.global_settings.module_visibility.quest_summary_screen.small_monster_UI);
|
||||
config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_dynamic_UI =
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_dynamic_UI, config.current_config.global_settings.module_visibility
|
||||
.quest_summary_screen.large_monster_dynamic_UI);
|
||||
.quest_result_screen.large_monster_dynamic_UI);
|
||||
config_changed = config_changed or changed;
|
||||
imgui.same_line();
|
||||
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_static_UI =
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_static_UI, config.current_config.global_settings.module_visibility
|
||||
.quest_summary_screen.large_monster_static_UI);
|
||||
.quest_result_screen.large_monster_static_UI);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_highlighted_UI =
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI =
|
||||
imgui.checkbox(language.current_language.customization_menu.large_monster_highlighted_UI, config.current_config.global_settings.module_visibility
|
||||
.quest_summary_screen.large_monster_highlighted_UI);
|
||||
.quest_result_screen.large_monster_highlighted_UI);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.time_UI = imgui.checkbox(
|
||||
language.current_language.customization_menu.time_UI, config.current_config.global_settings.module_visibility.quest_summary_screen.time_UI);
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.time_UI = imgui.checkbox(
|
||||
language.current_language.customization_menu.time_UI, config.current_config.global_settings.module_visibility.quest_result_screen.time_UI);
|
||||
config_changed = config_changed or changed;
|
||||
imgui.same_line();
|
||||
|
||||
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.damage_meter_UI =
|
||||
changed, config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI =
|
||||
imgui.checkbox(language.current_language.customization_menu.damage_meter_UI,
|
||||
config.current_config.global_settings.module_visibility.quest_summary_screen.damage_meter_UI);
|
||||
config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
@@ -447,7 +691,6 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.small_monster_UI) then
|
||||
local small_monster_UI_changed = false;
|
||||
changed, config.current_config.small_monster_UI.enabled = imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config
|
||||
.small_monster_UI.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -1175,8 +1418,6 @@ function customization_menu.draw()
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.large_monster_UI) then
|
||||
if imgui.tree_node(language.current_language.customization_menu.dynamically_positioned) then
|
||||
local large_monster_dynamic_UI_changed = false;
|
||||
|
||||
changed, config.current_config.large_monster_UI.dynamic.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.dynamic.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -2398,9 +2639,9 @@ function customization_menu.draw()
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count =
|
||||
imgui.checkbox(language.current_language.customization_menu.break_count,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count);
|
||||
changed, config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count =
|
||||
imgui.checkbox(language.current_language.customization_menu.flinch_count,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count);
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
|
||||
|
||||
@@ -2731,18 +2972,10 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if large_monster_dynamic_UI_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_dynamic_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.statically_positioned) then
|
||||
local large_monster_static_UI_changed = false;
|
||||
|
||||
changed, config.current_config.large_monster_UI.static.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.static.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -3996,8 +4229,8 @@ function customization_menu.draw()
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_count, config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count);
|
||||
changed, config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.flinch_count, config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count);
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
|
||||
|
||||
@@ -4327,31 +4560,15 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if large_monster_static_UI_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_static_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.highlighted) then
|
||||
local large_monster_highlighted_UI_changed = false;
|
||||
|
||||
changed, config.current_config.large_monster_UI.highlighted.enabled =
|
||||
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.highlighted.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.settings) then
|
||||
changed, config.current_config.large_monster_UI.highlighted.settings.hide_dead_or_captured = imgui.checkbox(language.current_language.customization_menu.hide_dead_or_captured, config.current_config.
|
||||
large_monster_UI.highlighted.settings.hide_dead_or_captured);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.position) then
|
||||
changed, config.current_config.large_monster_UI.highlighted.position.x =
|
||||
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.large_monster_UI.highlighted.position.x, 0.1, 0, screen.width, "%.1f");
|
||||
@@ -5528,8 +5745,8 @@ function customization_menu.draw()
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_count, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count);
|
||||
changed, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.flinch_count, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count);
|
||||
config_changed = config_changed or changed;
|
||||
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
|
||||
|
||||
@@ -5859,12 +6076,6 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if large_monster_highlighted_UI_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_highlighted_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
@@ -5899,6 +6110,7 @@ function customization_menu.draw()
|
||||
changed, config.current_config.time_UI.time_label.visibility =
|
||||
imgui.checkbox(language.current_language.customization_menu.visible, config.current_config.time_UI.time_label.visibility);
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
-- add text format
|
||||
|
||||
@@ -5906,10 +6118,12 @@ function customization_menu.draw()
|
||||
changed, config.current_config.time_UI.time_label.offset.x =
|
||||
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.time_UI.time_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.time_UI.time_label.offset.y =
|
||||
imgui.drag_float(language.current_language.customization_menu.y, config.current_config.time_UI.time_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
@@ -5917,6 +6131,7 @@ function customization_menu.draw()
|
||||
if imgui.tree_node(language.current_language.customization_menu.color) then
|
||||
changed, config.current_config.time_UI.time_label.color = imgui.color_picker_argb("", config.current_config.time_UI.time_label.color, customization_menu.color_picker_flags);
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
@@ -5925,17 +6140,20 @@ function customization_menu.draw()
|
||||
changed, config.current_config.time_UI.time_label.shadow.visibility =
|
||||
imgui.checkbox(language.current_language.customization_menu.visible, config.current_config.time_UI.time_label.shadow.visibility);
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
changed, config.current_config.time_UI.time_label.shadow.offset.x =
|
||||
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.time_UI.time_label.shadow.offset.x, 0.1, -screen.width, screen.width,
|
||||
"%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.time_UI.time_label.shadow.offset.y =
|
||||
imgui.drag_float(language.current_language.customization_menu.y, config.current_config.time_UI.time_label.shadow.offset.y, 0.1, -screen.height,
|
||||
screen.height, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
@@ -5943,6 +6161,7 @@ function customization_menu.draw()
|
||||
if imgui.tree_node(language.current_language.customization_menu.color) then
|
||||
changed, config.current_config.time_UI.time_label.shadow.color = imgui.color_picker_argb("", config.current_config.time_UI.time_label.shadow.color, customization_menu.color_picker_flags);
|
||||
config_changed = config_changed or changed;
|
||||
time_UI_changed = time_UI_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
@@ -5956,8 +6175,6 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.damage_meter_UI) then
|
||||
local damage_meter_UI_changed = false;
|
||||
|
||||
changed, config.current_config.damage_meter_UI.enabled = imgui.checkbox(language.current_language.customization_menu.enabled,
|
||||
config.current_config.damage_meter_UI.enabled);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -6173,6 +6390,11 @@ function customization_menu.draw()
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.include) then
|
||||
if imgui.tree_node(language.current_language.customization_menu.me) then
|
||||
changed, config.current_config.damage_meter_UI.player_name_label.include.myself.hunter_rank = imgui.checkbox(
|
||||
language.current_language.customization_menu.hunter_rank, config.current_config.damage_meter_UI.player_name_label.include.myself.hunter_rank);
|
||||
config_changed = config_changed or changed;
|
||||
damage_meter_UI_changed = damage_meter_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.damage_meter_UI.player_name_label.include.myself.word_player = imgui.checkbox(
|
||||
language.current_language.customization_menu.word_player, config.current_config.damage_meter_UI.player_name_label.include.myself.word_player);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -6192,6 +6414,11 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.other_players) then
|
||||
changed, config.current_config.damage_meter_UI.player_name_label.include.others.hunter_rank = imgui.checkbox(
|
||||
language.current_language.customization_menu.hunter_rank, config.current_config.damage_meter_UI.player_name_label.include.others.hunter_rank);
|
||||
config_changed = config_changed or changed;
|
||||
damage_meter_UI_changed = damage_meter_UI_changed or changed;
|
||||
|
||||
changed, config.current_config.damage_meter_UI.player_name_label.include.others.word_player = imgui.checkbox(
|
||||
language.current_language.customization_menu.word_player, config.current_config.damage_meter_UI.player_name_label.include.others.word_player);
|
||||
config_changed = config_changed or changed;
|
||||
@@ -6858,18 +7085,41 @@ function customization_menu.draw()
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if damage_meter_UI_changed then
|
||||
for _, _player in pairs(player.list) do
|
||||
player.init_UI(_player);
|
||||
end
|
||||
end
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
imgui.end_window();
|
||||
imgui.pop_font(customization_menu.font);
|
||||
|
||||
if large_monster_dynamic_UI_changed or modifiers_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_dynamic_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
if large_monster_static_UI_changed or modifiers_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_static_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
if large_monster_highlighted_UI_changed or modifiers_changed then
|
||||
for _, monster in pairs(large_monster.list) do
|
||||
large_monster.init_highlighted_UI(monster);
|
||||
end
|
||||
end
|
||||
|
||||
if time_UI_changed or modifiers_changed then
|
||||
time_UI.init_UI();
|
||||
end
|
||||
|
||||
if damage_meter_UI_changed or modifiers_changed then
|
||||
for _, _player in pairs(player.list) do
|
||||
player.init_UI(_player);
|
||||
player.init_total_UI(player.total);
|
||||
end
|
||||
end
|
||||
|
||||
if config_changed then
|
||||
config.save();
|
||||
end
|
||||
@@ -6884,6 +7134,8 @@ function customization_menu.init_module()
|
||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||
part_names = require("MHR_Overlay.Misc.part_names");
|
||||
time_UI = require("MHR_Overlay.UI.Modules.time_UI");
|
||||
keyboard = require("MHR_Overlay.Game_Handler.keyboard");
|
||||
|
||||
customization_menu.init();
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user