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

@@ -8,7 +8,6 @@ local ailment_buildup_UI_entity;
local time;
local small_monster;
local large_monster;
local table_helpers;
local drawing;
local sdk = sdk;
@@ -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;
function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailment_buildups_position_on_screen, opacity_scale)
@@ -238,7 +240,6 @@ function ailment_buildup.init_module()
time = require("MHR_Overlay.Game_Handler.time");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
end

View File

@@ -4,7 +4,6 @@ local small_monster;
local large_monster;
local config;
local ailments;
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;
local enemy_poison_damage_param_type_def = sdk.find_type_definition("snow.enemy.EnemyPoisonDamageParam");
local on_poison_activate_proc_method = enemy_poison_damage_param_type_def:get_method("onActivateProc");
@@ -147,7 +149,6 @@ function ailment_hook.init_module()
large_monster = require("MHR_Overlay.Monsters.large_monster");
config = require("MHR_Overlay.Misc.config");
ailments = require("MHR_Overlay.Monsters.ailments");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
sdk.hook(stock_damage_method, function(args)
pcall(ailment_hook.stock_damage, sdk.to_managed_object(args[2]));

View File

@@ -8,7 +8,6 @@ local ailment_buildup_UI_entity;
local time;
local small_monster;
local large_monster;
local table_helpers;
local non_players;
local sdk = sdk;
@@ -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;
--0 Paralyze
--1 Sleep
@@ -821,7 +823,6 @@ function ailments.init_module()
time = require("MHR_Overlay.Game_Handler.time");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
end
return ailments;

View File

@@ -3,7 +3,6 @@ local body_part = {};
local singletons;
local customization_menu;
local config;
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;
body_part.list = {};
@@ -342,7 +344,6 @@ function body_part.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
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

@@ -4,7 +4,7 @@ local singletons;
local customization_menu;
local config;
local language;
local table_helpers;
local utils;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
@@ -48,6 +48,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
large_monster.list = {};
@@ -257,7 +260,7 @@ end
function large_monster.init_UI(monster, monster_UI, cached_config)
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
monster_UI.monster_name_label = table_helpers.deep_copy(cached_config.monster_name_label);
monster_UI.monster_name_label = utils.table.deep_copy(cached_config.monster_name_label);
monster_UI.health_UI = health_UI_entity.new(
cached_config.health.visibility,
@@ -910,7 +913,7 @@ function large_monster.init_module()
customization_menu = require("MHR_Overlay.UI.customization_menu");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
body_part = require("MHR_Overlay.Monsters.body_part");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");

View File

@@ -35,6 +35,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
local enemy_character_base_update_method = enemy_character_base_type_def:get_method("update");

View File

@@ -3,7 +3,7 @@ local small_monster = {};
local singletons;
local customization_menu;
local config;
local table_helpers;
local utils;
local health_UI_entity;
local stamina_UI_entity;
local screen;
@@ -41,6 +41,9 @@ local imgui = imgui;
local draw = draw;
local Vector2f = Vector2f;
local reframework = reframework;
local os = os;
local ValueType = ValueType;
local package = package;
small_monster.list = {};
@@ -113,7 +116,7 @@ function small_monster.init_UI(monster)
local monster_UI = monster.UI;
monster_UI.name_label = table_helpers.deep_copy(cached_config.monster_name_label);
monster_UI.name_label = utils.table.deep_copy(cached_config.monster_name_label);
monster_UI.name_label.offset.x = monster_UI.name_label.offset.x * global_scale_modifier;
monster_UI.name_label.offset.y = monster_UI.name_label.offset.y * global_scale_modifier;
@@ -250,7 +253,7 @@ function small_monster.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
screen = require("MHR_Overlay.Game_Handler.screen");