Merge table_helpers and unicode_helpers into utils

This commit is contained in:
GreenComfyTea
2023-04-21 10:08:07 +03:00
parent 3dcb55e086
commit f627a0b19b
52 changed files with 677 additions and 585 deletions

View File

@@ -1,6 +1,6 @@
local ailment_buildups_customization = {};
local table_helpers;
local utils;
local config;
local screen;
local players;
@@ -43,6 +43,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function ailment_buildups_customization.draw(cached_config)
local changed = false;
@@ -100,7 +103,7 @@ function ailment_buildups_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.settings) then
changed, index = imgui.combo(
language.current_language.customization_menu.highlighted_bar,
table_helpers.find_index(customization_menu.highlighted_buildup_bar_types, cached_config.settings.highlighted_bar),
utils.table.find_index(customization_menu.highlighted_buildup_bar_types, cached_config.settings.highlighted_bar),
customization_menu.displayed_highlighted_buildup_bar_types);
config_changed = config_changed or changed;
@@ -111,7 +114,7 @@ function ailment_buildups_customization.draw(cached_config)
changed, index = imgui.combo(
language.current_language.customization_menu.buildup_bars_are_relative_to,
table_helpers.find_index(customization_menu.displayed_buildup_bar_relative_types, cached_config.settings.buildup_bar_relative_to),
utils.table.find_index(customization_menu.displayed_buildup_bar_relative_types, cached_config.settings.buildup_bar_relative_to),
customization_menu.displayed_buildup_bar_relative_types);
config_changed = config_changed or changed;
@@ -131,7 +134,7 @@ function ailment_buildups_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.ailment_buildups_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.ailment_buildups_sorting_types, cached_config.sorting.type),
customization_menu.displayed_ailment_buildups_sorting_types);
config_changed = config_changed or changed;
@@ -198,7 +201,7 @@ function ailment_buildups_customization.draw(cached_config)
end
function ailment_buildups_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,6 @@
local ailments_customization = {};
local table_helpers;
local utils;
local config;
local screen;
local players;
@@ -43,6 +43,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function ailments_customization.draw(cached_config)
local changed = false;
@@ -140,7 +143,7 @@ function ailments_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.ailments_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.ailments_sorting_types, cached_config.sorting.type),
customization_menu.displayed_ailments_sorting_types);
config_changed = config_changed or changed;
@@ -363,7 +366,7 @@ function ailments_customization.draw(cached_config)
end
function ailments_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,6 @@
local bar_customization = {};
local table_helpers;
local utils;
local config;
local screen;
local players;
@@ -42,6 +42,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function bar_customization.draw(bar_name, bar)
if bar == nil then
@@ -96,7 +99,7 @@ function bar_customization.draw(bar_name, bar)
changed, index = imgui.combo(language.current_language.customization_menu.style,
table_helpers.find_index(customization_menu.outline_styles,
utils.table.find_index(customization_menu.outline_styles,
bar.outline.style),
customization_menu.displayed_outline_styles);
bar_changed = bar_changed or changed;
@@ -189,7 +192,7 @@ function bar_customization.draw(bar_name, bar)
end
function bar_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,6 @@
local body_parts_customization = {};
local table_helpers;
local utils;
local config;
local screen;
local players;
@@ -43,6 +43,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function body_parts_customization.draw(cached_config)
local changed = false;
@@ -88,7 +91,7 @@ function body_parts_customization.draw(cached_config)
config_changed = config_changed or changed;
changed, index = imgui.combo(language.current_language.customization_menu.filter_mode,
table_helpers.find_index(customization_menu.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
utils.table.find_index(customization_menu.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
customization_menu.displayed_large_monster_UI_parts_filter_types);
config_changed = config_changed or changed;
@@ -108,7 +111,7 @@ function body_parts_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
customization_menu.displayed_large_monster_UI_parts_sorting_types);
config_changed = config_changed or changed;
@@ -366,7 +369,7 @@ function body_parts_customization.draw(cached_config)
end
function body_parts_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local large_monster_UI_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -43,6 +42,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function large_monster_UI_customization.draw(cached_config)
local changed = false;
@@ -87,7 +89,6 @@ function large_monster_UI_customization.draw(cached_config)
end
function large_monster_UI_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local label_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -41,6 +40,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function label_customization.draw(label_name, label)
local label_changed = false;
@@ -114,7 +116,6 @@ function label_customization.draw(label_name, label)
end
function label_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local large_monster_UI_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -50,6 +49,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function large_monster_UI_customization.draw(cached_config)
local changed = false;
@@ -80,7 +82,6 @@ function large_monster_UI_customization.draw(cached_config)
end
function large_monster_UI_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local line_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -41,6 +40,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function line_customization.draw(line_name, line)
if line == nil then
@@ -94,7 +96,6 @@ function line_customization.draw(line_name, line)
end
function line_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local module_visibility_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -43,6 +42,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function module_visibility_customization.draw(cached_config)
local changed = false;
@@ -100,7 +102,6 @@ function module_visibility_customization.draw(cached_config)
end
function module_visibility_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local rage_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -43,6 +42,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function rage_customization.draw(cached_config)
local changed = false;
@@ -90,7 +92,6 @@ function rage_customization.draw(cached_config)
end
function rage_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,6 +1,5 @@
local stamina_customization = {};
local table_helpers;
local config;
local screen;
local players;
@@ -43,6 +42,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function stamina_customization.draw(cached_config)
local changed = false;
@@ -90,7 +92,6 @@ function stamina_customization.draw(cached_config)
end
function stamina_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -4,7 +4,6 @@ local buff_UI_entity;
local config;
local buffs;
local screen;
local table_helpers;
local sdk = sdk;
local tostring = tostring;
@@ -34,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function buff_UI.draw()
local cached_config = config.current_config.buff_UI;
@@ -113,7 +115,6 @@ function buff_UI.init_module()
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
buffs = require("MHR_Overlay.Buffs.buffs");
--singletons = require("MHR_Overlay.Game_Handler.singletons");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
config = require("MHR_Overlay.Misc.config");
--customization_menu = require("MHR_Overlay.UI.customization_menu");
--players = require("MHR_Overlay.Damage_Meter.players");

View File

@@ -9,7 +9,7 @@ local quest_status;
local screen;
local drawing;
local language;
local table_helpers;
local utils;
local sdk = sdk;
local tostring = tostring;
@@ -39,6 +39,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
damage_meter_UI.last_displayed_players = {};
damage_meter_UI.freeze_displayed_players = false;
@@ -64,7 +67,7 @@ function damage_meter_UI.draw()
local quest_players = {};
if damage_meter_UI.freeze_displayed_players and not table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
if damage_meter_UI.freeze_displayed_players and not utils.table.is_empty(damage_meter_UI.last_displayed_players) then
quest_players = damage_meter_UI.last_displayed_players;
else
quest_players = players.display_list;
@@ -182,7 +185,7 @@ function damage_meter_UI.init_module()
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");
utils = require("MHR_Overlay.Misc.utils");
end
return damage_meter_UI;

View File

@@ -7,7 +7,6 @@ local large_monster;
local screen;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
@@ -41,6 +40,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
local enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
@@ -100,7 +102,6 @@ function env_creature_UI.init_module()
screen = require("MHR_Overlay.Game_Handler.screen");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");

View File

@@ -7,7 +7,6 @@ local large_monster;
local screen;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
@@ -40,6 +39,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
local enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
local get_boss_enemy_count_method = enemy_manager_type_def:get_method("getBossEnemyCount");
@@ -333,7 +335,6 @@ function large_monster_UI.init_module()
screen = require("MHR_Overlay.Game_Handler.screen");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");

View File

@@ -7,7 +7,6 @@ local customization_menu;
local screen;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
@@ -39,6 +38,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
local enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
local get_zako_enemy_count_method = enemy_manager_type_def:get_method("getZakoEnemyCount");
@@ -192,7 +194,6 @@ function small_monster_UI.init_module()
screen = require("MHR_Overlay.Game_Handler.screen");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
end

View File

@@ -4,7 +4,7 @@ local time;
local screen;
local config;
local drawing;
local table_helpers;
local utils;
local sdk = sdk;
local tostring = tostring;
@@ -34,6 +34,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
time_UI.label = nil;
@@ -51,7 +54,7 @@ function time_UI.draw()
end
function time_UI.init_UI()
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
time_UI.label = utils.table.deep_copy(config.current_config.time_UI.time_label);
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -64,7 +67,7 @@ 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");
utils = require("MHR_Overlay.Misc.utils");
time_UI.init_UI()
end

View File

@@ -1,7 +1,7 @@
local ailment_UI_entity = {};
local config;
local table_helpers;
local utils;
local drawing;
local language;
@@ -33,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label)
local entity = {};
@@ -40,12 +43,12 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.name_label = table_helpers.deep_copy(name_label);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.name_label = utils.table.deep_copy(name_label);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -116,7 +119,7 @@ function ailment_UI_entity.draw(ailment, ailment_UI, cached_config, position_on_
end
function ailment_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
language = require("MHR_Overlay.Misc.language");

View File

@@ -1,6 +1,6 @@
local ailment_buildup_UI_entity = {};
local table_helpers;
local utils;
local drawing;
local config;
local players;
@@ -34,6 +34,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label,
buildup_value_label, buildup_percentage_label, total_buildup_label,
@@ -43,14 +46,14 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.buildup_bar = table_helpers.deep_copy(buildup_bar);
entity.highlighted_buildup_bar = table_helpers.deep_copy(highlighted_buildup_bar);
entity.ailment_name_label = table_helpers.deep_copy(ailment_name_label);
entity.player_name_label = table_helpers.deep_copy(player_name_label);
entity.buildup_value_label = table_helpers.deep_copy(buildup_value_label);
entity.buildup_percentage_label = table_helpers.deep_copy(buildup_percentage_label);
entity.total_buildup_label = table_helpers.deep_copy(total_buildup_label);
entity.total_buildup_value_label = table_helpers.deep_copy(total_buildup_value_label);
entity.buildup_bar = utils.table.deep_copy(buildup_bar);
entity.highlighted_buildup_bar = utils.table.deep_copy(highlighted_buildup_bar);
entity.ailment_name_label = utils.table.deep_copy(ailment_name_label);
entity.player_name_label = utils.table.deep_copy(player_name_label);
entity.buildup_value_label = utils.table.deep_copy(buildup_value_label);
entity.buildup_percentage_label = utils.table.deep_copy(buildup_percentage_label);
entity.total_buildup_label = utils.table.deep_copy(total_buildup_label);
entity.total_buildup_value_label = utils.table.deep_copy(total_buildup_value_label);
entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * global_scale_modifier;
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
@@ -115,7 +118,7 @@ function ailment_buildup_UI_entity.draw(player, player_buildup, ailment_buildup_
end
function ailment_buildup_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
players = require("MHR_Overlay.Damage_Meter.players");

View File

@@ -1,7 +1,7 @@
local body_part_UI_entity = {};
local config;
local table_helpers;
local utils;
local drawing;
local sdk = sdk;
@@ -32,6 +32,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibility, flinch_bar, flinch_text_label,
flinch_value_label, flinch_percentage_label, break_visibility, break_bar, break_text_label, break_value_label,
@@ -46,15 +49,15 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.break_visibility = break_visibility;
entity.loss_visibility = loss_visibility;
entity.part_name_label = table_helpers.deep_copy(part_name_label);
entity.part_name_label = utils.table.deep_copy(part_name_label);
entity.part_name_label.offset.x = entity.part_name_label.offset.x * global_scale_modifier;
entity.part_name_label.offset.y = entity.part_name_label.offset.y * global_scale_modifier;
entity.flinch_bar = table_helpers.deep_copy(flinch_bar);
entity.flinch_text_label = table_helpers.deep_copy(flinch_text_label);
entity.flinch_value_label = table_helpers.deep_copy(flinch_value_label);
entity.flinch_percentage_label = table_helpers.deep_copy(flinch_percentage_label);
entity.flinch_bar = utils.table.deep_copy(flinch_bar);
entity.flinch_text_label = utils.table.deep_copy(flinch_text_label);
entity.flinch_value_label = utils.table.deep_copy(flinch_value_label);
entity.flinch_percentage_label = utils.table.deep_copy(flinch_percentage_label);
entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * global_scale_modifier;
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * global_scale_modifier;
@@ -72,10 +75,10 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * global_scale_modifier;
entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * global_scale_modifier;
entity.break_bar = table_helpers.deep_copy(break_bar);
entity.break_text_label = table_helpers.deep_copy(break_text_label);
entity.break_value_label = table_helpers.deep_copy(break_value_label);
entity.break_percentage_label = table_helpers.deep_copy(break_percentage_label);
entity.break_bar = utils.table.deep_copy(break_bar);
entity.break_text_label = utils.table.deep_copy(break_text_label);
entity.break_value_label = utils.table.deep_copy(break_value_label);
entity.break_percentage_label = utils.table.deep_copy(break_percentage_label);
entity.break_bar.offset.x = entity.break_bar.offset.x * global_scale_modifier;
entity.break_bar.offset.y = entity.break_bar.offset.y * global_scale_modifier;
@@ -93,10 +96,10 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * global_scale_modifier;
entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * global_scale_modifier;
entity.loss_bar = table_helpers.deep_copy(loss_bar);
entity.loss_text_label = table_helpers.deep_copy(loss_text_label);
entity.loss_value_label = table_helpers.deep_copy(loss_value_label);
entity.loss_health_percentage_label = table_helpers.deep_copy(loss_health_percentage_label);
entity.loss_bar = utils.table.deep_copy(loss_bar);
entity.loss_text_label = utils.table.deep_copy(loss_text_label);
entity.loss_value_label = utils.table.deep_copy(loss_value_label);
entity.loss_health_percentage_label = utils.table.deep_copy(loss_health_percentage_label);
entity.loss_bar.offset.x = entity.loss_bar.offset.x * global_scale_modifier;
entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier;
@@ -248,7 +251,7 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre
end
function body_part_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
end

View File

@@ -1,7 +1,7 @@
local buff_UI_entity = {};
local config;
local table_helpers;
local utils;
local drawing;
local language;
@@ -33,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function buff_UI_entity.new(bar, name_label, timer_label)
local entity = {};
@@ -40,9 +43,9 @@ function buff_UI_entity.new(bar, name_label, timer_label)
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.name_label = table_helpers.deep_copy(name_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.name_label = utils.table.deep_copy(name_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -79,7 +82,7 @@ function buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale)
end
function buff_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
language = require("MHR_Overlay.Misc.language");

View File

@@ -1,6 +1,6 @@
local damage_UI_entity = {};
local table_helpers;
local utils;
local drawing;
local config;
local players;
@@ -36,19 +36,22 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function damage_UI_entity.new(damage_meter_UI_elements, type)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar = table_helpers.deep_copy(damage_meter_UI_elements.damage_bar);
entity.name_label = table_helpers.deep_copy(damage_meter_UI_elements.name_label);
entity.hunter_rank_label = table_helpers.deep_copy(damage_meter_UI_elements.hunter_rank_label);
entity.cart_count_label = table_helpers.deep_copy(damage_meter_UI_elements.cart_count_label);
entity.dps_label = table_helpers.deep_copy(damage_meter_UI_elements.dps_label);
entity.value_label = table_helpers.deep_copy(damage_meter_UI_elements.damage_value_label);
entity.percentage_label = table_helpers.deep_copy(damage_meter_UI_elements.damage_percentage_label);
entity.bar = utils.table.deep_copy(damage_meter_UI_elements.damage_bar);
entity.name_label = utils.table.deep_copy(damage_meter_UI_elements.name_label);
entity.hunter_rank_label = utils.table.deep_copy(damage_meter_UI_elements.hunter_rank_label);
entity.cart_count_label = utils.table.deep_copy(damage_meter_UI_elements.cart_count_label);
entity.dps_label = utils.table.deep_copy(damage_meter_UI_elements.dps_label);
entity.value_label = utils.table.deep_copy(damage_meter_UI_elements.damage_value_label);
entity.percentage_label = utils.table.deep_copy(damage_meter_UI_elements.damage_percentage_label);
entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit;
@@ -231,7 +234,7 @@ function damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_da
end
function damage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
players = require("MHR_Overlay.Damage_Meter.players");

View File

@@ -1,6 +1,6 @@
local health_UI_entity = {};
local table_helpers;
local utils;
local drawing;
local language;
local config;
@@ -33,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
local entity = {};
@@ -40,10 +43,10 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.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;
@@ -89,7 +92,7 @@ function health_UI_entity.draw(monster, health_UI, position_on_screen, opacity_s
end
function health_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");

View File

@@ -1,6 +1,6 @@
local rage_UI_entity = {};
local table_helpers;
local utils;
local drawing;
local language;
local config;
@@ -33,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {};
@@ -40,11 +43,11 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -103,7 +106,7 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale
end
function rage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");

View File

@@ -1,6 +1,6 @@
local stamina_UI_entity = {};
local table_helpers;
local utils;
local drawing;
local language;
local config;
@@ -33,6 +33,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {};
@@ -40,11 +43,11 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -100,7 +103,7 @@ function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity
end
function stamina_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");

View File

@@ -1,6 +1,6 @@
local customization_menu = {};
local table_helpers;
local utils;
local config;
local screen;
local players;
@@ -57,6 +57,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
customization_menu.font = nil;
customization_menu.font_range = {0x1, 0xFFFF, 0};
@@ -450,14 +453,14 @@ function customization_menu.draw_config()
if imgui.tree_node(language.current_language.customization_menu.config) then
changed, index = imgui.combo(language.current_language.customization_menu.config,
table_helpers.find_index(config.config_names, config.current_config_name), config.config_names);
utils.table.find_index(config.config_names, config.current_config_name), config.config_names);
config_changed = config_changed or changed;
if changed then
config.current_config_name = config.config_names[index];
config.update(index);
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));
language.update(utils.table.find_index(language.language_names, config.current_config.global_settings.language, false));
customization_menu.init();
@@ -473,7 +476,7 @@ function customization_menu.draw_config()
config.new(customization_menu.config_name_input);
config_changed = config_changed or changed;
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));
language.update(utils.table.find_index(language.language_names, config.current_config.global_settings.language, false));
customization_menu.init();
@@ -491,7 +494,7 @@ function customization_menu.draw_config()
config.duplicate(customization_menu.config_name_input);
config_changed = config_changed or changed;
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));
language.update(utils.table.find_index(language.language_names, config.current_config.global_settings.language, false));
customization_menu.init();
@@ -508,7 +511,7 @@ function customization_menu.draw_config()
if changed then
config.reset();
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));
language.update(utils.table.find_index(language.language_names, config.current_config.global_settings.language, false));
customization_menu.init();
@@ -814,7 +817,7 @@ function customization_menu.draw_global_settings(apply_font_requested, language_
imgui.text(language.current_language.customization_menu.menu_font_change_disclaimer);
changed, index = imgui.combo(language.current_language.customization_menu.language .. "*",
table_helpers.find_index(language.language_names, cached_config.language), language.language_names);
utils.table.find_index(language.language_names, cached_config.language), language.language_names);
config_changed = config_changed or changed;
if changed then
@@ -891,7 +894,7 @@ function customization_menu.draw_global_settings(apply_font_requested, language_
imgui.text(language.current_language.customization_menu.UI_font_notice);
changed, index = imgui.combo(language.current_language.customization_menu.family,
table_helpers.find_index(customization_menu.fonts, cached_config.UI_font.family), customization_menu.fonts);
utils.table.find_index(customization_menu.fonts, cached_config.UI_font.family), customization_menu.fonts);
config_changed = config_changed or changed;
if changed then
@@ -1089,7 +1092,7 @@ function customization_menu.draw_small_monster_UI()
config_changed = config_changed or changed;
changed, index = imgui.combo(language.current_language.customization_menu.static_orientation,
table_helpers.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
utils.table.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
customization_menu.displayed_orientation_types);
config_changed = config_changed or changed;
@@ -1171,7 +1174,7 @@ function customization_menu.draw_small_monster_UI()
config_changed = config_changed or changed;
changed, index = imgui.combo(language.current_language.customization_menu.anchor, table_helpers.find_index(
changed, index = imgui.combo(language.current_language.customization_menu.anchor, utils.table.find_index(
customization_menu.anchor_types, cached_config.static_position.anchor), customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -1198,7 +1201,7 @@ function customization_menu.draw_small_monster_UI()
end
if imgui.tree_node(language.current_language.customization_menu.static_sorting) then
changed, index = imgui.combo(language.current_language.customization_menu.type, table_helpers.find_index(
changed, index = imgui.combo(language.current_language.customization_menu.type, utils.table.find_index(
customization_menu.monster_UI_sorting_types, cached_config.static_sorting.type),
customization_menu.displayed_monster_UI_sorting_types);
@@ -1352,7 +1355,7 @@ function customization_menu.draw_large_monster_static_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.highlighted_monster_location,
table_helpers.find_index(customization_menu.damage_meter_UI_my_damage_bar_location_types, cached_config.settings.highlighted_monster_location),
utils.table.find_index(customization_menu.damage_meter_UI_my_damage_bar_location_types, cached_config.settings.highlighted_monster_location),
customization_menu.displayed_damage_meter_UI_my_damage_bar_location_types);
config_changed = config_changed or changed;
@@ -1363,7 +1366,7 @@ function customization_menu.draw_large_monster_static_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.orientation,
table_helpers.find_index( customization_menu.orientation_types, cached_config.settings.orientation),
utils.table.find_index( customization_menu.orientation_types, cached_config.settings.orientation),
customization_menu.displayed_orientation_types);
config_changed = config_changed or changed;
@@ -1388,7 +1391,7 @@ function customization_menu.draw_large_monster_static_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.anchor,
table_helpers.find_index(customization_menu.anchor_types, cached_config.position.anchor),
utils.table.find_index(customization_menu.anchor_types, cached_config.position.anchor),
customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -1417,7 +1420,7 @@ function customization_menu.draw_large_monster_static_UI()
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.monster_UI_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.monster_UI_sorting_types, cached_config.sorting.type),
customization_menu.displayed_monster_UI_sorting_types);
config_changed = config_changed or changed;
@@ -1469,7 +1472,7 @@ function customization_menu.draw_large_monster_highlighted_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.anchor,
table_helpers.find_index(customization_menu.anchor_types, cached_config.position.anchor),
utils.table.find_index(customization_menu.anchor_types, cached_config.position.anchor),
customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -1489,7 +1492,7 @@ function customization_menu.draw_large_monster_highlighted_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.mode,
table_helpers.find_index(customization_menu.auto_highlight_modes, cached_config.auto_highlight.mode),
utils.table.find_index(customization_menu.auto_highlight_modes, cached_config.auto_highlight.mode),
customization_menu.displayed_auto_highlight_modes);
config_changed = config_changed or changed;
@@ -1536,7 +1539,7 @@ function customization_menu.draw_time_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.anchor,
table_helpers.find_index(customization_menu.anchor_types, cached_config.position.anchor),
utils.table.find_index(customization_menu.anchor_types, cached_config.position.anchor),
customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -1637,7 +1640,7 @@ function customization_menu.draw_damage_meter_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.orientation,
table_helpers.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
utils.table.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
customization_menu.displayed_orientation_types);
config_changed = config_changed or changed;
@@ -1648,7 +1651,7 @@ function customization_menu.draw_damage_meter_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.highlighted,
table_helpers.find_index(customization_menu.damage_meter_UI_highlighted_entity_types, cached_config.settings.highlighted_bar),
utils.table.find_index(customization_menu.damage_meter_UI_highlighted_entity_types, cached_config.settings.highlighted_bar),
customization_menu.displayed_damage_meter_UI_highlighted_entity_types);
config_changed = config_changed or changed;
@@ -1659,7 +1662,7 @@ function customization_menu.draw_damage_meter_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.damage_bars_are_relative_to,
table_helpers.find_index(customization_menu.damage_meter_UI_damage_bar_relative_types, cached_config.settings.damage_bar_relative_to),
utils.table.find_index(customization_menu.damage_meter_UI_damage_bar_relative_types, cached_config.settings.damage_bar_relative_to),
customization_menu.displayed_damage_meter_UI_damage_bar_relative_types);
config_changed = config_changed or changed;
@@ -1670,7 +1673,7 @@ function customization_menu.draw_damage_meter_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.my_damage_bar_location,
table_helpers.find_index(customization_menu.damage_meter_UI_my_damage_bar_location_types, cached_config.settings.my_damage_bar_location),
utils.table.find_index(customization_menu.damage_meter_UI_my_damage_bar_location_types, cached_config.settings.my_damage_bar_location),
customization_menu.displayed_damage_meter_UI_my_damage_bar_location_types);
config_changed = config_changed or changed;
@@ -1681,7 +1684,7 @@ function customization_menu.draw_damage_meter_UI()
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),
utils.table.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;
@@ -1691,7 +1694,7 @@ function customization_menu.draw_damage_meter_UI()
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),
utils.table.find_index(customization_menu.damage_meter_UI_dps_modes, cached_config.settings.dps_mode),
customization_menu.displayed_damage_meter_UI_dps_modes);
config_changed = config_changed or changed;
@@ -1818,7 +1821,7 @@ function customization_menu.draw_damage_meter_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.anchor,
table_helpers.find_index(customization_menu.anchor_types, cached_config.position.anchor),
utils.table.find_index(customization_menu.anchor_types, cached_config.position.anchor),
customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -1833,7 +1836,7 @@ function customization_menu.draw_damage_meter_UI()
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.damage_meter_UI_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.damage_meter_UI_sorting_types, cached_config.sorting.type),
customization_menu.displayed_damage_meter_UI_sorting_types);
config_changed = config_changed or changed;
@@ -2160,7 +2163,7 @@ function customization_menu.draw_buff_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.orientation,
table_helpers.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
utils.table.find_index(customization_menu.orientation_types, cached_config.settings.orientation),
customization_menu.displayed_orientation_types);
config_changed = config_changed or changed;
@@ -2199,7 +2202,7 @@ function customization_menu.draw_buff_UI()
changed, index = imgui.combo(
language.current_language.customization_menu.anchor,
table_helpers.find_index(customization_menu.anchor_types, cached_config.position.anchor),
utils.table.find_index(customization_menu.anchor_types, cached_config.position.anchor),
customization_menu.displayed_anchor_types);
config_changed = config_changed or changed;
@@ -2214,7 +2217,7 @@ function customization_menu.draw_buff_UI()
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.buff_UI_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.buff_UI_sorting_types, cached_config.sorting.type),
customization_menu.displayed_buff_UI_sorting_types);
config_changed = config_changed or changed;
@@ -2247,7 +2250,7 @@ function customization_menu.draw_buff_UI()
end
function customization_menu.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");

View File

@@ -1,8 +1,7 @@
local drawing = {};
local config;
local table_helpers;
local unicode_helpers;
local utils;
local sdk = sdk;
local tostring = tostring;
@@ -32,6 +31,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
drawing.font = nil;
@@ -77,7 +79,7 @@ function drawing.limit_text_size(text, size_limit)
break
else
local old_limited_text = limited_text;
limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "...";
limited_text = utils.unicode.sub(limited_text, 1, -5) .. "...";
if limited_text == old_limited_text then
break
@@ -332,8 +334,7 @@ end
function drawing.init_module()
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
unicode_helpers = require("MHR_Overlay.Misc.unicode_helpers");
utils = require("MHR_Overlay.Misc.utils");
end
return drawing;