mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-25 04:48:22 -08:00
Compare commits
16 Commits
c8cad67d15
...
v2.4.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40820f98a7 | ||
|
|
dd8a6bc2d7 | ||
|
|
5dbfcb89f4 | ||
|
|
75a7d8fa8c | ||
|
|
d4e97854c3 | ||
|
|
81a803cc7c | ||
|
|
9b1ff5b264 | ||
|
|
94e9e5d18b | ||
|
|
96afca0ade | ||
|
|
f627a0b19b | ||
|
|
ad2097b380 | ||
|
|
a08ecff5d7 | ||
|
|
3dcb55e086 | ||
|
|
23df95e30e | ||
|
|
ba3ec120b2 | ||
|
|
0a9c8488d6 |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 GreenComfyTea
|
Copyright (c) 2023 GreenComfyTea
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Exposes in-game data about monsters, creatures, players and damage. Draws a high
|
|||||||
* **[Troubleshooting](https://github.com/GreenComfyTea/MHR-Overlay/wiki/Troubleshooting)**
|
* **[Troubleshooting](https://github.com/GreenComfyTea/MHR-Overlay/wiki/Troubleshooting)**
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
1. [REFramework](https://www.nexusmods.com/monsterhunterrise/mods/26) (v1.3.7 or above);
|
1. [REFramework](https://www.nexusmods.com/monsterhunterrise/mods/26) (v1.3.8 or above);
|
||||||
2. [REFramework Direct2D](https://www.nexusmods.com/monsterhunterrise/mods/134) (v0.4.0 or above).
|
2. [REFramework Direct2D](https://www.nexusmods.com/monsterhunterrise/mods/134) (v0.4.0 or above).
|
||||||
|
|
||||||
# How to install:
|
# How to install:
|
||||||
@@ -35,7 +35,7 @@ Exposes in-game data about monsters, creatures, players and damage. Draws a high
|
|||||||
|
|
||||||
**neatnet** - Korean translation.
|
**neatnet** - Korean translation.
|
||||||
**s9000008, mcc1** - Traditional Chinese translation.
|
**s9000008, mcc1** - Traditional Chinese translation.
|
||||||
**etnAtker** - Simplified Chinese translation.
|
**etnAtker**, **sukiqwq** - Simplified Chinese translation.
|
||||||
**AKILAND0214** - Japanese translation.
|
**AKILAND0214** - Japanese translation.
|
||||||
***
|
***
|
||||||
# Support
|
# Support
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
xy = "";
|
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
local pairs = pairs;
|
local pairs = pairs;
|
||||||
@@ -28,6 +26,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
local debug = require("MHR_Overlay.Misc.debug");
|
local debug = require("MHR_Overlay.Misc.debug");
|
||||||
|
|
||||||
@@ -39,9 +40,8 @@ local time = require("MHR_Overlay.Game_Handler.time");
|
|||||||
|
|
||||||
local config = require("MHR_Overlay.Misc.config");
|
local config = require("MHR_Overlay.Misc.config");
|
||||||
local language = require("MHR_Overlay.Misc.language");
|
local language = require("MHR_Overlay.Misc.language");
|
||||||
local table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
local unicode_helpers = require("MHR_Overlay.Misc.unicode_helpers");
|
|
||||||
local part_names = require("MHR_Overlay.Misc.part_names");
|
local part_names = require("MHR_Overlay.Misc.part_names");
|
||||||
|
local utils = require("MHR_Overlay.Misc.utils");
|
||||||
|
|
||||||
--local buffs = require("MHR_Overlay.Buffs.buffs");
|
--local buffs = require("MHR_Overlay.Buffs.buffs");
|
||||||
|
|
||||||
@@ -93,12 +93,15 @@ local large_monster_UI_customization = require("MHR_Overlay.UI.Customizations.la
|
|||||||
|
|
||||||
local drawing = require("MHR_Overlay.UI.drawing");
|
local drawing = require("MHR_Overlay.UI.drawing");
|
||||||
|
|
||||||
|
if debug ~= nil and debug.enabled then
|
||||||
|
xy = "";
|
||||||
|
end
|
||||||
|
|
||||||
------------------------INIT MODULES-------------------------
|
------------------------INIT MODULES-------------------------
|
||||||
-- #region
|
-- #region
|
||||||
screen.init_module();
|
screen.init_module();
|
||||||
singletons.init_module();
|
singletons.init_module();
|
||||||
table_helpers.init_module();
|
utils.init_module();
|
||||||
unicode_helpers.init_module();
|
|
||||||
time.init_module();
|
time.init_module();
|
||||||
|
|
||||||
language.init_module();
|
language.init_module();
|
||||||
@@ -334,7 +337,7 @@ end);
|
|||||||
-- #endregion
|
-- #endregion
|
||||||
----------------------------D2D------------------------------
|
----------------------------D2D------------------------------
|
||||||
|
|
||||||
if debug.enabled then
|
if debug ~= nil and debug.enabled then
|
||||||
if d2d ~= nil then
|
if d2d ~= nil then
|
||||||
d2d.register(function()
|
d2d.register(function()
|
||||||
end, function()
|
end, function()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local buffs = {};
|
local this = {};
|
||||||
|
|
||||||
local buff_UI_entity;
|
local buff_UI_entity;
|
||||||
local config;
|
local config;
|
||||||
@@ -31,10 +31,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
buffs.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function buffs.new(name)
|
function this.new(name)
|
||||||
local buff = {};
|
local buff = {};
|
||||||
|
|
||||||
buff.name = name;
|
buff.name = name;
|
||||||
@@ -50,48 +53,48 @@ function buffs.new(name)
|
|||||||
|
|
||||||
buff.is_infinite = false;
|
buff.is_infinite = false;
|
||||||
|
|
||||||
buffs.init_UI(buff);
|
this.init_UI(buff);
|
||||||
|
|
||||||
return buff;
|
return buff;
|
||||||
end
|
end
|
||||||
|
|
||||||
function buffs.init_buffs()
|
function this.init_buffs()
|
||||||
buffs.list = {};
|
this.list = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
function buffs.init_UI(buff)
|
function this.init_UI(buff)
|
||||||
local cached_config = config.current_config.buff_UI;
|
local cached_config = config.current_config.buff_UI;
|
||||||
buff.buff_UI = buff_UI_entity.new(cached_config.bar, cached_config.name_label, cached_config.timer_label);
|
buff.buff_UI = buff_UI_entity.new(cached_config.bar, cached_config.name_label, cached_config.timer_label);
|
||||||
end
|
end
|
||||||
|
|
||||||
function buffs.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
||||||
buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale);
|
buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
function buffs.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
||||||
|
|
||||||
|
|
||||||
local buff = buffs.new("Enviroment Damage Negated");
|
local buff = this.new("Enviroment Damage Negated");
|
||||||
buff.duration = 90;
|
buff.duration = 90;
|
||||||
buff.timer = 65;
|
buff.timer = 65;
|
||||||
buff.timer_percentage = 0.66;
|
buff.timer_percentage = 0.66;
|
||||||
buff.minutes_left = 1;
|
buff.minutes_left = 1;
|
||||||
buff.seconds_left = 5
|
buff.seconds_left = 5
|
||||||
|
|
||||||
buffs.list["Enviroment Damage Negated"] = buff;
|
this.list["Enviroment Damage Negated"] = buff;
|
||||||
|
|
||||||
local buff = buffs.new("Sharpness Loss Reduced");
|
local buff = this.new("Sharpness Loss Reduced");
|
||||||
buff.duration = 120;
|
buff.duration = 120;
|
||||||
buff.timer = 70;
|
buff.timer = 70;
|
||||||
buff.timer_percentage = 0.583;
|
buff.timer_percentage = 0.583;
|
||||||
buff.minutes_left = 1;
|
buff.minutes_left = 1;
|
||||||
buff.seconds_left = 10
|
buff.seconds_left = 10
|
||||||
|
|
||||||
buffs.list["Sharpness Loss Reduced"] = buff;
|
this.list["Sharpness Loss Reduced"] = buff;
|
||||||
|
|
||||||
local buff = buffs.new("Sharpness Loss Reduced 2");
|
local buff = this.new("Sharpness Loss Reduced 2");
|
||||||
buff.duration = 120;
|
buff.duration = 120;
|
||||||
buff.timer = 70;
|
buff.timer = 70;
|
||||||
buff.timer_percentage = 0.583;
|
buff.timer_percentage = 0.583;
|
||||||
@@ -99,7 +102,7 @@ function buffs.init_module()
|
|||||||
buff.seconds_left = 10
|
buff.seconds_left = 10
|
||||||
buff.is_infinite = true;
|
buff.is_infinite = true;
|
||||||
|
|
||||||
buffs.list["Sharpness Loss Reduced 2"] = buff;
|
this.list["Sharpness Loss Reduced 2"] = buff;
|
||||||
end
|
end
|
||||||
|
|
||||||
return buffs;
|
return this;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
local damage_hook = {};
|
local this = {};
|
||||||
|
|
||||||
local quest_status;
|
local quest_status;
|
||||||
local players;
|
local players;
|
||||||
local small_monster;
|
local small_monster;
|
||||||
local large_monster;
|
local large_monster;
|
||||||
local ailments;
|
local ailments;
|
||||||
local table_helpers;
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local non_players;
|
local non_players;
|
||||||
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -37,6 +37,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
|
local wall_hit_damage_queue = {};
|
||||||
|
|
||||||
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
|
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
|
||||||
local enemy_character_base_after_calc_damage_damage_side_method = enemy_character_base_type_def:get_method("afterCalcDamage_DamageSide");
|
local enemy_character_base_after_calc_damage_damage_side_method = enemy_character_base_type_def:get_method("afterCalcDamage_DamageSide");
|
||||||
@@ -44,6 +49,8 @@ local enemy_character_base_after_calc_damage_damage_side_method = enemy_characte
|
|||||||
local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy");
|
local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy");
|
||||||
local check_die_method = enemy_character_base_type_def:get_method("checkDie");
|
local check_die_method = enemy_character_base_type_def:get_method("checkDie");
|
||||||
|
|
||||||
|
local stock_direct_marionette_finish_shoot_hit_parts_damage_method = enemy_character_base_type_def:get_method("stockDirectMarionetteFinishShootHitPartsDamage");
|
||||||
|
|
||||||
local enemy_calc_damage_info_type_def = sdk.find_type_definition("snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide");
|
local enemy_calc_damage_info_type_def = sdk.find_type_definition("snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide");
|
||||||
local get_attacker_id_method = enemy_calc_damage_info_type_def:get_method("get_AttackerID");
|
local get_attacker_id_method = enemy_calc_damage_info_type_def:get_method("get_AttackerID");
|
||||||
local get_damage_attacker_type_method = enemy_calc_damage_info_type_def:get_method("get_DamageAttackerType");
|
local get_damage_attacker_type_method = enemy_calc_damage_info_type_def:get_method("get_DamageAttackerType");
|
||||||
@@ -72,11 +79,10 @@ local packet_quest_forfeit_type_def = sdk.find_type_definition("snow.QuestManage
|
|||||||
local dead_player_id_field = packet_quest_forfeit_type_def:get_field("_DeadPlIndex");
|
local dead_player_id_field = packet_quest_forfeit_type_def:get_field("_DeadPlIndex");
|
||||||
local is_from_host_field = packet_quest_forfeit_type_def:get_field("_IsFromQuestHostPacket");
|
local is_from_host_field = packet_quest_forfeit_type_def:get_field("_IsFromQuestHostPacket");
|
||||||
|
|
||||||
function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette_attack)
|
function this.get_damage_source_type(damage_source_type_id, is_marionette_attack)
|
||||||
if is_marionette_attack then
|
if is_marionette_attack then
|
||||||
return "wyvern riding";
|
return "wyvern riding";
|
||||||
elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or
|
elseif damage_source_type_id == 0 or damage_source_type_id == 7 or damage_source_type_id == 11 or damage_source_type_id == 13 then
|
||||||
damage_source_type_id == 13 then
|
|
||||||
return "player";
|
return "player";
|
||||||
elseif damage_source_type_id == 1 or damage_source_type_id == 8 then
|
elseif damage_source_type_id == 1 or damage_source_type_id == 8 then
|
||||||
return "bomb";
|
return "bomb";
|
||||||
@@ -88,15 +94,13 @@ function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette
|
|||||||
return "otomo";
|
return "otomo";
|
||||||
elseif damage_source_type_id >= 25 and damage_source_type_id <= 32 then
|
elseif damage_source_type_id >= 25 and damage_source_type_id <= 32 then
|
||||||
return "endemic life";
|
return "endemic life";
|
||||||
elseif damage_source_type_id == 34 then
|
end
|
||||||
|
|
||||||
return "other";
|
return "other";
|
||||||
end
|
end
|
||||||
|
|
||||||
return tostring(damage_source_type_id);
|
|
||||||
end
|
|
||||||
|
|
||||||
-- snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide
|
-- snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide
|
||||||
function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
function this.update_damage(enemy, enemy_calc_damage_info)
|
||||||
local is_large_monster = is_boss_enemy_method:call(enemy);
|
local is_large_monster = is_boss_enemy_method:call(enemy);
|
||||||
|
|
||||||
if is_large_monster == nil then
|
if is_large_monster == nil then
|
||||||
@@ -124,7 +128,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
|||||||
for enemy, monster in pairs(large_monster.list) do
|
for enemy, monster in pairs(large_monster.list) do
|
||||||
if monster.unique_id == attacker_id then
|
if monster.unique_id == attacker_id then
|
||||||
attacker_id = monster.rider_id;
|
attacker_id = monster.rider_id;
|
||||||
break
|
break;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -180,7 +184,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
|||||||
-- 31 - EcSwampLeech
|
-- 31 - EcSwampLeech
|
||||||
-- 32 - EcPenetrateFish
|
-- 32 - EcPenetrateFish
|
||||||
|
|
||||||
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack);
|
local damage_source_type = this.get_damage_source_type(attacker_type, is_marionette_attack);
|
||||||
|
|
||||||
local monster;
|
local monster;
|
||||||
if is_large_monster then
|
if is_large_monster then
|
||||||
@@ -222,27 +226,13 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
|||||||
|
|
||||||
players.update_damage(players.total, damage_source_type, is_large_monster, damage_object);
|
players.update_damage(players.total, damage_source_type, is_large_monster, damage_object);
|
||||||
players.update_damage(player, damage_source_type, is_large_monster, damage_object);
|
players.update_damage(player, damage_source_type, is_large_monster, damage_object);
|
||||||
|
|
||||||
--xy = xy .. "\nPlayer: " .. tostring(player.id) ..
|
|
||||||
-- " " .. tostring(player.name) ..
|
|
||||||
-- " Damage: " .. tostring(damage_object.total_damage);
|
|
||||||
|
|
||||||
--if is_otomo_attack then
|
|
||||||
--xy = xy .. "\nOtomo: " .. tostring(otomo.id) ..
|
|
||||||
-- " " .. tostring(otomo.name) ..
|
|
||||||
-- " Damage: " .. tostring(damage_object.total_damage);
|
|
||||||
--end
|
|
||||||
|
|
||||||
--if string.len(xy) > 2000 then
|
|
||||||
-- xy = "";
|
|
||||||
--end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--function damage_hook.on_mystery_core_break(enemy)
|
--function damage_hook.on_mystery_core_break(enemy)
|
||||||
|
|
||||||
--end
|
--end
|
||||||
|
|
||||||
function damage_hook.cart(dead_player_id, flag_cat_skill_insurance)
|
function this.cart(dead_player_id, flag_cat_skill_insurance)
|
||||||
-- flag_cat_skill_insurance = 0
|
-- flag_cat_skill_insurance = 0
|
||||||
-- flag_cat_skill_insurance = 1
|
-- flag_cat_skill_insurance = 1
|
||||||
local player = players.list[dead_player_id];
|
local player = players.list[dead_player_id];
|
||||||
@@ -255,38 +245,101 @@ function damage_hook.cart(dead_player_id, flag_cat_skill_insurance)
|
|||||||
quest_status.get_cart_count();
|
quest_status.get_cart_count();
|
||||||
end
|
end
|
||||||
|
|
||||||
--function damage_hook.on_get_finish_shoot_wall_hit_damage_rate(enemy, rate, is_part_damage)
|
function this.on_stock_direct_marionette_finish_shoot_hit_parts_damage(enemy, damage_rate, is_endure, is_ignore_multi_rate, category, no)
|
||||||
|
local monster = large_monster.get_monster(enemy);
|
||||||
|
|
||||||
--xy = string.format("enemy: %s\nrate: %s\nis_part_damage: %s", tostring(enemy), tostring(rate), tostring(is_part_damage));
|
local damage = utils.math.round(monster.max_health * damage_rate);
|
||||||
--end
|
|
||||||
|
|
||||||
|
large_monster.update_all_riders();
|
||||||
|
local attacker_id = monster.rider_id;
|
||||||
|
|
||||||
local get_finish_shoot_wall_hit_damage_rate_method = enemy_character_base_type_def:get_method("stockFinishShootHitDamage");
|
table.insert(wall_hit_damage_queue,
|
||||||
|
{
|
||||||
|
damage = damage,
|
||||||
|
is_large = monster.is_large
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function damage_hook.init_module()
|
if attacker_id == -1 then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
local player = players.get_player(attacker_id);
|
||||||
|
if player == nil then
|
||||||
|
player = non_players.get_servant(attacker_id);
|
||||||
|
end
|
||||||
|
|
||||||
|
if player == nil then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
local damage_source_type = this.get_damage_source_type(0, true);
|
||||||
|
local is_large_monster = monster.is_large;
|
||||||
|
|
||||||
|
local large_monster_damage_object = {};
|
||||||
|
large_monster_damage_object.total_damage = 0;
|
||||||
|
large_monster_damage_object.physical_damage = 0;
|
||||||
|
large_monster_damage_object.elemental_damage = 0;
|
||||||
|
large_monster_damage_object.ailment_damage = 0;
|
||||||
|
|
||||||
|
local small_monster_damage_object = {};
|
||||||
|
small_monster_damage_object.total_damage = 0;
|
||||||
|
small_monster_damage_object.physical_damage = 0;
|
||||||
|
small_monster_damage_object.elemental_damage = 0;
|
||||||
|
small_monster_damage_object.ailment_damage = 0;
|
||||||
|
|
||||||
|
for _, damage_info in ipairs(wall_hit_damage_queue) do
|
||||||
|
if damage_info.is_large then
|
||||||
|
|
||||||
|
large_monster_damage_object.total_damage = large_monster_damage_object.total_damage + damage_info.damage;
|
||||||
|
large_monster_damage_object.physical_damage = large_monster_damage_object.physical_damage + damage_info.damage;
|
||||||
|
else
|
||||||
|
small_monster_damage_object.total_damage = small_monster_damage_object.total_damage + damage_info.damage;
|
||||||
|
small_monster_damage_object.physical_damage = small_monster_damage_object.physical_damage + damage_info.damage;
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
wall_hit_damage_queue = {};
|
||||||
|
|
||||||
|
players.update_damage(players.total, damage_source_type, false, small_monster_damage_object);
|
||||||
|
players.update_damage(player, damage_source_type, false, small_monster_damage_object);
|
||||||
|
|
||||||
|
players.update_damage(players.total, damage_source_type, true, large_monster_damage_object);
|
||||||
|
players.update_damage(player, damage_source_type, true, large_monster_damage_object);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.init_module()
|
||||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||||
ailments = require("MHR_Overlay.Monsters.ailments");
|
ailments = require("MHR_Overlay.Monsters.ailments");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
|
|
||||||
--sdk.hook(get_finish_shoot_wall_hit_damage_rate_method, function(args)
|
sdk.hook(stock_direct_marionette_finish_shoot_hit_parts_damage_method, function(args)
|
||||||
-- pcall(damage_hook.on_get_finish_shoot_wall_hit_damage_rate, sdk.to_managed_object(args[2]), sdk.to_float(args[3]), sdk.to_int64(args--[4]));
|
local enemy = sdk.to_managed_object(args[2]);
|
||||||
--end, function(retval)
|
local damage_rate = sdk.to_float(args[3]);
|
||||||
-- return retval;
|
local is_endure = (sdk.to_int64(args[4]) & 1) == 1;
|
||||||
--end);
|
local is_ignore_multi_rate = (sdk.to_int64(args[5]) & 1) == 1;
|
||||||
|
local category = sdk.to_int64(args[6]); --snow.enemy.EnemyDef.VitalCategory
|
||||||
|
local no = sdk.to_int64(args[7]);
|
||||||
|
|
||||||
|
this.on_stock_direct_marionette_finish_shoot_hit_parts_damage(enemy, damage_rate, is_endure, is_ignore_multi_rate, category, no);
|
||||||
|
end, function(retval)
|
||||||
|
return retval;
|
||||||
|
end);
|
||||||
|
|
||||||
sdk.hook(enemy_character_base_after_calc_damage_damage_side_method, function(args)
|
sdk.hook(enemy_character_base_after_calc_damage_damage_side_method, function(args)
|
||||||
pcall(damage_hook.update_damage, sdk.to_managed_object(args[2]), sdk.to_managed_object(args[3]));
|
pcall(this.update_damage, sdk.to_managed_object(args[2]), sdk.to_managed_object(args[3]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(quest_forfeit_method, function(args)
|
sdk.hook(quest_forfeit_method, function(args)
|
||||||
pcall(damage_hook.cart, sdk.to_int64(args[3]), (sdk.to_int64(args[4]) & 0xFFFFFFFF));
|
pcall(this.cart, sdk.to_int64(args[3]), (sdk.to_int64(args[4]) & 0xFFFFFFFF));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
@@ -298,4 +351,4 @@ function damage_hook.init_module()
|
|||||||
--end);
|
--end);
|
||||||
end
|
end
|
||||||
|
|
||||||
return damage_hook;
|
return this;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
local non_players = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local damage_UI_entity;
|
local damage_UI_entity;
|
||||||
@@ -9,7 +8,6 @@ local time;
|
|||||||
local quest_status;
|
local quest_status;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
local unicode_helpers;
|
|
||||||
local players;
|
local players;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
@@ -40,13 +38,16 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
non_players.servant_list = {};
|
this.servant_list = {};
|
||||||
non_players.otomo_list = {};
|
this.otomo_list = {};
|
||||||
|
|
||||||
non_players.my_second_otomo_id = -1;
|
this.my_second_otomo_id = -1;
|
||||||
|
|
||||||
function non_players.new(id, name, level, type)
|
function this.new(id, name, level, type)
|
||||||
local non_player = {};
|
local non_player = {};
|
||||||
non_player.id = id;
|
non_player.id = id;
|
||||||
non_player.name = name;
|
non_player.name = name;
|
||||||
@@ -67,22 +68,22 @@ function non_players.new(id, name, level, type)
|
|||||||
non_player.display.elemental_damage = 0;
|
non_player.display.elemental_damage = 0;
|
||||||
non_player.display.ailment_damage = 0;
|
non_player.display.ailment_damage = 0;
|
||||||
|
|
||||||
non_players.init_UI(non_player);
|
this.init_UI(non_player);
|
||||||
|
|
||||||
return non_player;
|
return non_player;
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.get_servant(servant_id)
|
function this.get_servant(servant_id)
|
||||||
return non_players.servant_list[servant_id];
|
return this.servant_list[servant_id];
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.get_otomo(otomo_id)
|
function this.get_otomo(otomo_id)
|
||||||
return non_players.otomo_list[otomo_id];
|
return this.otomo_list[otomo_id];
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.init()
|
function this.init()
|
||||||
non_players.servant_list = {};
|
this.servant_list = {};
|
||||||
non_players.otomo_list = {};
|
this.otomo_list = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
local servant_manager_type_def = sdk.find_type_definition("snow.ai.ServantManager");
|
local servant_manager_type_def = sdk.find_type_definition("snow.ai.ServantManager");
|
||||||
@@ -127,7 +128,7 @@ local otomo_info_name_field = otomo_info_type_def:get_field("_Name");
|
|||||||
local otomo_info_level_field = otomo_info_type_def:get_field("_Level");
|
local otomo_info_level_field = otomo_info_type_def:get_field("_Level");
|
||||||
local otomo_info_order_field = otomo_info_type_def:get_field("_Order");
|
local otomo_info_order_field = otomo_info_type_def:get_field("_Order");
|
||||||
|
|
||||||
function non_players.update_servant_list()
|
function this.update_servant_list()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if singletons.servant_manager == nil then
|
if singletons.servant_manager == nil then
|
||||||
@@ -175,40 +176,40 @@ function non_players.update_servant_list()
|
|||||||
goto continue;
|
goto continue;
|
||||||
end
|
end
|
||||||
|
|
||||||
if non_players.servant_list[id] == nil then
|
if this.servant_list[id] == nil then
|
||||||
non_players.servant_list[id] = non_players.new(id, name, 0, players.types.servant);
|
this.servant_list[id] = this.new(id, name, 0, players.types.servant);
|
||||||
end
|
end
|
||||||
|
|
||||||
if not cached_config.settings.hide_servants then
|
if not cached_config.settings.hide_servants then
|
||||||
table.insert(players.display_list, non_players.servant_list[id]);
|
table.insert(players.display_list, this.servant_list[id]);
|
||||||
end
|
end
|
||||||
|
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.update_otomo_list(is_on_quest, is_online)
|
function this.update_otomo_list(is_on_quest, is_online)
|
||||||
if is_online then
|
if is_online then
|
||||||
if is_on_quest then
|
if is_on_quest then
|
||||||
--non_players.update_my_otomos();
|
--non_players.update_my_otomos();
|
||||||
non_players.update_otomos(quest_otomo_info_field);
|
this.update_otomos(quest_otomo_info_field);
|
||||||
else
|
else
|
||||||
non_players.update_otomos(otomo_info_field);
|
this.update_otomos(otomo_info_field);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
if is_on_quest then
|
if is_on_quest then
|
||||||
non_players.update_my_otomos();
|
this.update_my_otomos();
|
||||||
non_players.update_servant_otomos();
|
this.update_servant_otomos();
|
||||||
else
|
else
|
||||||
non_players.update_my_otomos();
|
this.update_my_otomos();
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.update_my_otomos()
|
function this.update_my_otomos()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
local first_otomo = get_master_otomo_info_method:call(singletons.otomo_manager, 0);
|
local first_otomo = get_master_otomo_info_method:call(singletons.otomo_manager, 0);
|
||||||
@@ -218,12 +219,12 @@ function non_players.update_my_otomos()
|
|||||||
local level = otomo_create_data_level_field:get_data(first_otomo) or 0;
|
local level = otomo_create_data_level_field:get_data(first_otomo) or 0;
|
||||||
|
|
||||||
local myself_id = players.myself.id;
|
local myself_id = players.myself.id;
|
||||||
if non_players.otomo_list[myself_id] == nil then
|
if this.otomo_list[myself_id] == nil then
|
||||||
non_players.otomo_list[myself_id] = non_players.new(0, name, level, players.types.my_otomo);
|
this.otomo_list[myself_id] = this.new(0, name, level, players.types.my_otomo);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.settings.show_my_otomos_separately then
|
if cached_config.settings.show_my_otomos_separately then
|
||||||
table.insert(players.display_list, non_players.otomo_list[myself_id]);
|
table.insert(players.display_list, this.otomo_list[myself_id]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -235,18 +236,18 @@ function non_players.update_my_otomos()
|
|||||||
local level = otomo_create_data_level_field:get_data(second_otomo) or 0;
|
local level = otomo_create_data_level_field:get_data(second_otomo) or 0;
|
||||||
|
|
||||||
-- the secondary otomo is actually the 4th one!
|
-- the secondary otomo is actually the 4th one!
|
||||||
if non_players.otomo_list[non_players.my_second_otomo_id] == nil then
|
if this.otomo_list[this.my_second_otomo_id] == nil then
|
||||||
non_players.otomo_list[non_players.my_second_otomo_id] = non_players.new(non_players.my_second_otomo_id, name, level, players.types.my_otomo);
|
this.otomo_list[this.my_second_otomo_id] = this.new(this.my_second_otomo_id, name, level, players.types.my_otomo);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.settings.show_my_otomos_separately then
|
if cached_config.settings.show_my_otomos_separately then
|
||||||
table.insert(players.display_list, non_players.otomo_list[non_players.my_second_otomo_id]);
|
table.insert(players.display_list, this.otomo_list[this.my_second_otomo_id]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.update_servant_otomos()
|
function this.update_servant_otomos()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
local servant_otomo_list = get_servant_otomo_list_method:call(singletons.otomo_manager);
|
local servant_otomo_list = get_servant_otomo_list_method:call(singletons.otomo_manager);
|
||||||
@@ -277,14 +278,12 @@ function non_players.update_servant_otomos()
|
|||||||
goto continue;
|
goto continue;
|
||||||
end
|
end
|
||||||
|
|
||||||
--name = unicode_helpers.sub(name, 13);
|
if this.otomo_list[member_id] == nil then
|
||||||
|
this.otomo_list[member_id] = this.new(member_id, name, level, players.types.servant_otomo);
|
||||||
if non_players.otomo_list[member_id] == nil then
|
|
||||||
non_players.otomo_list[member_id] = non_players.new(member_id, name, level, players.types.servant_otomo);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.settings.show_servant_otomos_separately then
|
if cached_config.settings.show_servant_otomos_separately then
|
||||||
table.insert(players.display_list, non_players.otomo_list[member_id]);
|
table.insert(players.display_list, this.otomo_list[member_id]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -293,7 +292,7 @@ function non_players.update_servant_otomos()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.update_otomos(otomo_info_field_)
|
function this.update_otomos(otomo_info_field_)
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if singletons.lobby_manager == nil then
|
if singletons.lobby_manager == nil then
|
||||||
@@ -326,22 +325,22 @@ function non_players.update_otomos(otomo_info_field_)
|
|||||||
|
|
||||||
local level = otomo_info_level_field:get_data(otomo_info) or 0;
|
local level = otomo_info_level_field:get_data(otomo_info) or 0;
|
||||||
|
|
||||||
local otomo = non_players.otomo_list[id];
|
local otomo = this.otomo_list[id];
|
||||||
|
|
||||||
if otomo == nil or (otomo.name ~= name and level ~= otomo.level) or
|
if otomo == nil or (otomo.name ~= name and level ~= otomo.level) or
|
||||||
(otomo.type == players.types.my_otomo and otomo.id ~= players.myself.id) or
|
(otomo.type == players.types.my_otomo and otomo.id ~= players.myself.id) or
|
||||||
(otomo.type ~= players.types.my_otomo and otomo.id == players.myself.id) then
|
(otomo.type ~= players.types.my_otomo and otomo.id == players.myself.id) then
|
||||||
if id == players.myself.id then
|
if id == players.myself.id then
|
||||||
otomo = non_players.new(id, name, level, players.types.my_otomo);
|
otomo = this.new(id, name, level, players.types.my_otomo);
|
||||||
non_players.otomo_list[id] = otomo;
|
this.otomo_list[id] = otomo;
|
||||||
|
|
||||||
elseif id >= 4 then
|
elseif id >= 4 then
|
||||||
otomo = non_players.new(id, name, level, players.types.servant_otomo);
|
otomo = this.new(id, name, level, players.types.servant_otomo);
|
||||||
non_players.otomo_list[id] = otomo;
|
this.otomo_list[id] = otomo;
|
||||||
|
|
||||||
else
|
else
|
||||||
otomo = non_players.new(id, name, level, players.types.other_player_otomo);
|
otomo = this.new(id, name, level, players.types.other_player_otomo);
|
||||||
non_players.otomo_list[id] = otomo;
|
this.otomo_list[id] = otomo;
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -364,7 +363,7 @@ function non_players.update_otomos(otomo_info_field_)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.init_UI(non_player)
|
function this.init_UI(non_player)
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if non_player.type == players.types.servant then
|
if non_player.type == players.types.servant then
|
||||||
@@ -378,9 +377,8 @@ function non_players.init_UI(non_player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function non_players.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
|
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
|
||||||
@@ -389,9 +387,8 @@ function non_players.init_module()
|
|||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
unicode_helpers = require("MHR_Overlay.Misc.unicode_helpers");
|
|
||||||
|
|
||||||
non_players.init();
|
this.init();
|
||||||
end
|
end
|
||||||
|
|
||||||
return non_players;
|
return this;
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
local players = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local damage_UI_entity;
|
local damage_UI_entity;
|
||||||
@@ -39,17 +38,20 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
players.list = {};
|
this.list = {};
|
||||||
players.myself = nil;
|
this.myself = nil;
|
||||||
players.myself_position = Vector3f.new(0, 0, 0);
|
this.myself_position = Vector3f.new(0, 0, 0);
|
||||||
players.total = nil;
|
this.total = nil;
|
||||||
|
|
||||||
players.display_list = {};
|
this.display_list = {};
|
||||||
|
|
||||||
players.highlighted_damage_UI = nil;
|
this.highlighted_damage_UI = nil;
|
||||||
|
|
||||||
players.types = {
|
this.types = {
|
||||||
["myself"] = 0,
|
["myself"] = 0,
|
||||||
["other_player"] = 1,
|
["other_player"] = 1,
|
||||||
["servant"] = 2,
|
["servant"] = 2,
|
||||||
@@ -61,7 +63,7 @@ players.types = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function players.new(id, name, master_rank, hunter_rank, type)
|
function this.new(id, name, master_rank, hunter_rank, type)
|
||||||
local player = {};
|
local player = {};
|
||||||
player.id = id;
|
player.id = id;
|
||||||
player.name = name;
|
player.name = name;
|
||||||
@@ -76,8 +78,8 @@ function players.new(id, name, master_rank, hunter_rank, type)
|
|||||||
player.first_hit_time = -1;
|
player.first_hit_time = -1;
|
||||||
player.dps = 0;
|
player.dps = 0;
|
||||||
|
|
||||||
player.small_monsters = players.init_damage_sources()
|
player.small_monsters = this.init_damage_sources()
|
||||||
player.large_monsters = players.init_damage_sources();
|
player.large_monsters = this.init_damage_sources();
|
||||||
|
|
||||||
player.display = {};
|
player.display = {};
|
||||||
player.display.total_damage = 0;
|
player.display.total_damage = 0;
|
||||||
@@ -85,16 +87,16 @@ function players.new(id, name, master_rank, hunter_rank, type)
|
|||||||
player.display.elemental_damage = 0;
|
player.display.elemental_damage = 0;
|
||||||
player.display.ailment_damage = 0;
|
player.display.ailment_damage = 0;
|
||||||
|
|
||||||
players.init_UI(player);
|
this.init_UI(player);
|
||||||
|
|
||||||
if players.highlighted_damage_UI == nil then
|
if this.highlighted_damage_UI == nil then
|
||||||
players.init_highlighted_UI();
|
this.init_highlighted_UI();
|
||||||
end
|
end
|
||||||
|
|
||||||
return player;
|
return player;
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.init_damage_sources()
|
function this.init_damage_sources()
|
||||||
local monster_type = {};
|
local monster_type = {};
|
||||||
|
|
||||||
monster_type.total_damage = 0;
|
monster_type.total_damage = 0;
|
||||||
@@ -172,15 +174,15 @@ function players.init_damage_sources()
|
|||||||
return monster_type;
|
return monster_type;
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.get_player(player_id)
|
function this.get_player(player_id)
|
||||||
if player_id == non_players.my_second_otomo_id then
|
if player_id == non_players.my_second_otomo_id then
|
||||||
return players.myself;
|
return this.myself;
|
||||||
end
|
end
|
||||||
|
|
||||||
return players.list[player_id];
|
return this.list[player_id];
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.update_damage(player, damage_source_type, is_large_monster, damage_object)
|
function this.update_damage(player, damage_source_type, is_large_monster, damage_object)
|
||||||
if player == nil then
|
if player == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -195,37 +197,37 @@ function players.update_damage(player, damage_source_type, is_large_monster, dam
|
|||||||
end
|
end
|
||||||
|
|
||||||
if damage_source_type == "player" then
|
if damage_source_type == "player" then
|
||||||
players.merge_damage(player_monster_type, damage_object);
|
this.merge_damage(player_monster_type, damage_object);
|
||||||
elseif damage_source_type == "bomb" then
|
elseif damage_source_type == "bomb" then
|
||||||
players.merge_damage(player_monster_type.bombs, damage_object);
|
this.merge_damage(player_monster_type.bombs, damage_object);
|
||||||
elseif damage_source_type == "kunai" then
|
elseif damage_source_type == "kunai" then
|
||||||
players.merge_damage(player_monster_type.kunai, damage_object);
|
this.merge_damage(player_monster_type.kunai, damage_object);
|
||||||
elseif damage_source_type == "installation" then
|
elseif damage_source_type == "installation" then
|
||||||
players.merge_damage(player_monster_type.installations, damage_object);
|
this.merge_damage(player_monster_type.installations, damage_object);
|
||||||
elseif damage_source_type == "otomo" then
|
elseif damage_source_type == "otomo" then
|
||||||
players.merge_damage(player_monster_type.otomo, damage_object);
|
this.merge_damage(player_monster_type.otomo, damage_object);
|
||||||
elseif damage_source_type == "wyvern riding" then
|
elseif damage_source_type == "wyvern riding" then
|
||||||
players.merge_damage(player_monster_type.wyvern_riding, damage_object);
|
this.merge_damage(player_monster_type.wyvern_riding, damage_object);
|
||||||
elseif damage_source_type == "poison" then
|
elseif damage_source_type == "poison" then
|
||||||
players.merge_damage(player_monster_type.poison, damage_object);
|
this.merge_damage(player_monster_type.poison, damage_object);
|
||||||
elseif damage_source_type == "blast" then
|
elseif damage_source_type == "blast" then
|
||||||
players.merge_damage(player_monster_type.blast, damage_object);
|
this.merge_damage(player_monster_type.blast, damage_object);
|
||||||
elseif damage_source_type == "otomo poison" then
|
elseif damage_source_type == "otomo poison" then
|
||||||
players.merge_damage(player_monster_type.otomo_poison, damage_object);
|
this.merge_damage(player_monster_type.otomo_poison, damage_object);
|
||||||
elseif damage_source_type == "otomo blast" then
|
elseif damage_source_type == "otomo blast" then
|
||||||
players.merge_damage(player_monster_type.otomo_blast, damage_object);
|
this.merge_damage(player_monster_type.otomo_blast, damage_object);
|
||||||
elseif damage_source_type == "endemic life" then
|
elseif damage_source_type == "endemic life" then
|
||||||
players.merge_damage(player_monster_type.endemic_life, damage_object);
|
this.merge_damage(player_monster_type.endemic_life, damage_object);
|
||||||
elseif damage_source_type == "other" then
|
elseif damage_source_type == "other" then
|
||||||
players.merge_damage(player_monster_type.other, damage_object);
|
this.merge_damage(player_monster_type.other, damage_object);
|
||||||
else
|
else
|
||||||
players.merge_damage(player_monster_type, damage_object);
|
this.merge_damage(player_monster_type, damage_object);
|
||||||
end
|
end
|
||||||
|
|
||||||
players.update_display(player);
|
this.update_display(player);
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.update_display(player)
|
function this.update_display(player)
|
||||||
if player == nil then
|
if player == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -249,152 +251,152 @@ function players.update_display(player)
|
|||||||
|
|
||||||
for _, monster_type in ipairs(monster_types) do
|
for _, monster_type in ipairs(monster_types) do
|
||||||
if cached_config.tracked_damage_types.player_damage then
|
if cached_config.tracked_damage_types.player_damage then
|
||||||
players.merge_damage(player.display, monster_type);
|
this.merge_damage(player.display, monster_type);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.bomb_damage then
|
if cached_config.tracked_damage_types.bomb_damage then
|
||||||
players.merge_damage(player.display, monster_type.bombs);
|
this.merge_damage(player.display, monster_type.bombs);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.kunai_damage then
|
if cached_config.tracked_damage_types.kunai_damage then
|
||||||
players.merge_damage(player.display, monster_type.kunai);
|
this.merge_damage(player.display, monster_type.kunai);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.installation_damage then
|
if cached_config.tracked_damage_types.installation_damage then
|
||||||
players.merge_damage(player.display, monster_type.installations);
|
this.merge_damage(player.display, monster_type.installations);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.otomo_damage then
|
if cached_config.tracked_damage_types.otomo_damage then
|
||||||
if player.type == players.types.myself then
|
if player.type == this.types.myself then
|
||||||
|
|
||||||
if not cached_config.settings.show_my_otomos_separately then
|
if not cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player then
|
elseif player.type == this.types.other_player then
|
||||||
|
|
||||||
if not cached_config.settings.show_other_player_otomos_separately then
|
if not cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant then
|
elseif player.type == this.types.servant then
|
||||||
|
|
||||||
if not cached_config.settings.show_servant_otomos_separately then
|
if not cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.my_otomo then
|
elseif player.type == this.types.my_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_my_otomos_separately then
|
if cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player_otomo then
|
elseif player.type == this.types.other_player_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_other_player_otomos_separately then
|
if cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant_otomo then
|
elseif player.type == this.types.servant_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_servant_otomos_separately then
|
if cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.total then
|
elseif player.type == this.types.total then
|
||||||
|
|
||||||
players.merge_damage(player.display, monster_type.otomo);
|
this.merge_damage(player.display, monster_type.otomo);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.wyvern_riding_damage then
|
if cached_config.tracked_damage_types.wyvern_riding_damage then
|
||||||
players.merge_damage(player.display, monster_type.wyvern_riding);
|
this.merge_damage(player.display, monster_type.wyvern_riding);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.poison_damage then
|
if cached_config.tracked_damage_types.poison_damage then
|
||||||
players.merge_damage(player.display, monster_type.poison);
|
this.merge_damage(player.display, monster_type.poison);
|
||||||
|
|
||||||
if player.type == players.types.myself then
|
if player.type == this.types.myself then
|
||||||
|
|
||||||
if not cached_config.settings.show_my_otomos_separately then
|
if not cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player then
|
elseif player.type == this.types.other_player then
|
||||||
|
|
||||||
if not cached_config.settings.show_other_player_otomos_separately then
|
if not cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant then
|
elseif player.type == this.types.servant then
|
||||||
|
|
||||||
if not cached_config.settings.show_servant_otomos_separately then
|
if not cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.my_otomo then
|
elseif player.type == this.types.my_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_my_otomos_separately then
|
if cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player_otomo then
|
elseif player.type == this.types.other_player_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_other_player_otomos_separately then
|
if cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant_otomo then
|
elseif player.type == this.types.servant_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_servant_otomos_separately then
|
if cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif player.type == players.types.total then
|
elseif player.type == this.types.total then
|
||||||
|
|
||||||
players.merge_damage(player.display, monster_type.otomo_poison);
|
this.merge_damage(player.display, monster_type.otomo_poison);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.blast_damage then
|
if cached_config.tracked_damage_types.blast_damage then
|
||||||
players.merge_damage(player.display, monster_type.blast);
|
this.merge_damage(player.display, monster_type.blast);
|
||||||
|
|
||||||
if player.type == players.types.myself then
|
if player.type == this.types.myself then
|
||||||
|
|
||||||
if not cached_config.settings.show_my_otomos_separately then
|
if not cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player then
|
elseif player.type == this.types.other_player then
|
||||||
|
|
||||||
if not cached_config.settings.show_other_player_otomos_separately then
|
if not cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant then
|
elseif player.type == this.types.servant then
|
||||||
|
|
||||||
if not cached_config.settings.show_servant_otomos_separately then
|
if not cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.my_otomo then
|
elseif player.type == this.types.my_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_my_otomos_separately then
|
if cached_config.settings.show_my_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.other_player_otomo then
|
elseif player.type == this.types.other_player_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_other_player_otomos_separately then
|
if cached_config.settings.show_other_player_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.servant_otomo then
|
elseif player.type == this.types.servant_otomo then
|
||||||
|
|
||||||
if cached_config.settings.show_servant_otomos_separately then
|
if cached_config.settings.show_servant_otomos_separately then
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
elseif player.type == players.types.total then
|
elseif player.type == this.types.total then
|
||||||
|
|
||||||
players.merge_damage(player.display, monster_type.otomo_blast);
|
this.merge_damage(player.display, monster_type.otomo_blast);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.endemic_life_damage then
|
if cached_config.tracked_damage_types.endemic_life_damage then
|
||||||
players.merge_damage(player.display, monster_type.endemic_life);
|
this.merge_damage(player.display, monster_type.endemic_life);
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.tracked_damage_types.other_damage then
|
if cached_config.tracked_damage_types.other_damage then
|
||||||
players.merge_damage(player.display, monster_type.other);
|
this.merge_damage(player.display, monster_type.other);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.merge_damage(first, second)
|
function this.merge_damage(first, second)
|
||||||
first.total_damage = first.total_damage + second.total_damage;
|
first.total_damage = first.total_damage + second.total_damage;
|
||||||
first.physical_damage = first.physical_damage + second.physical_damage;
|
first.physical_damage = first.physical_damage + second.physical_damage;
|
||||||
first.elemental_damage = first.elemental_damage + second.elemental_damage;
|
first.elemental_damage = first.elemental_damage + second.elemental_damage;
|
||||||
@@ -403,28 +405,28 @@ function players.merge_damage(first, second)
|
|||||||
return first;
|
return first;
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.update_dps(bypass_freeze)
|
function this.update_dps(bypass_freeze)
|
||||||
local cached_config = config.current_config.damage_meter_UI.settings;
|
local cached_config = config.current_config.damage_meter_UI.settings;
|
||||||
|
|
||||||
if cached_config.freeze_dps_on_quest_end and quest_status.flow_state >= quest_status.flow_states.KILLCAM and not bypass_freeze then
|
if cached_config.freeze_dps_on_quest_end and quest_status.flow_state >= quest_status.flow_states.KILLCAM and not bypass_freeze then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
players.total.dps = 0;
|
this.total.dps = 0;
|
||||||
for _, player in pairs(players.list) do
|
for _, player in pairs(this.list) do
|
||||||
players.update_player_dps(player);
|
this.update_player_dps(player);
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, servant in pairs(non_players.servant_list) do
|
for _, servant in pairs(non_players.servant_list) do
|
||||||
players.update_player_dps(servant);
|
this.update_player_dps(servant);
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, otomo in pairs(non_players.otomo_list) do
|
for _, otomo in pairs(non_players.otomo_list) do
|
||||||
players.update_player_dps(otomo);
|
this.update_player_dps(otomo);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.update_player_dps(player)
|
function this.update_player_dps(player)
|
||||||
local cached_config = config.current_config.damage_meter_UI.settings;
|
local cached_config = config.current_config.damage_meter_UI.settings;
|
||||||
|
|
||||||
if player.join_time == -1 then
|
if player.join_time == -1 then
|
||||||
@@ -445,54 +447,54 @@ function players.update_player_dps(player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
players.total.dps = players.total.dps + player.dps;
|
this.total.dps = this.total.dps + player.dps;
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.sort_players()
|
function this.sort_players()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if cached_config.settings.my_damage_bar_location == "Normal" then
|
if cached_config.settings.my_damage_bar_location == "Normal" then
|
||||||
table.insert(players.display_list, players.myself);
|
table.insert(this.display_list, this.myself);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sort here
|
-- sort here
|
||||||
if cached_config.sorting.type == "Normal" then
|
if cached_config.sorting.type == "Normal" then
|
||||||
if cached_config.sorting.reversed_order then
|
if cached_config.sorting.reversed_order then
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.id > right.id;
|
return left.id > right.id;
|
||||||
end);
|
end);
|
||||||
else
|
else
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.id < right.id;
|
return left.id < right.id;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
elseif cached_config.sorting.type == "DPS" then
|
elseif cached_config.sorting.type == "DPS" then
|
||||||
if cached_config.sorting.reversed_order then
|
if cached_config.sorting.reversed_order then
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.dps < right.dps;
|
return left.dps < right.dps;
|
||||||
end);
|
end);
|
||||||
else
|
else
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.dps > right.dps;
|
return left.dps > right.dps;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if cached_config.sorting.reversed_order then
|
if cached_config.sorting.reversed_order then
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.display.total_damage < right.display.total_damage;
|
return left.display.total_damage < right.display.total_damage;
|
||||||
end);
|
end);
|
||||||
else
|
else
|
||||||
table.sort(players.display_list, function(left, right)
|
table.sort(this.display_list, function(left, right)
|
||||||
return left.display.total_damage > right.display.total_damage;
|
return left.display.total_damage > right.display.total_damage;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.settings.my_damage_bar_location == "First" then
|
if cached_config.settings.my_damage_bar_location == "First" then
|
||||||
table.insert(players.display_list, 1, players.myself);
|
table.insert(this.display_list, 1, this.myself);
|
||||||
|
|
||||||
elseif cached_config.settings.my_damage_bar_location == "Last" then
|
elseif cached_config.settings.my_damage_bar_location == "Last" then
|
||||||
table.insert(players.display_list, players.myself);
|
table.insert(this.display_list, this.myself);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -502,7 +504,7 @@ local find_master_player_method = player_manager_type_def:get_method("findMaster
|
|||||||
local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase");
|
local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase");
|
||||||
local get_pos_field = player_base_type_def:get_method("get_Pos");
|
local get_pos_field = player_base_type_def:get_method("get_Pos");
|
||||||
|
|
||||||
function players.update_myself_position()
|
function this.update_myself_position()
|
||||||
if singletons.player_manager == nil then
|
if singletons.player_manager == nil then
|
||||||
customization_menu.status = "No player manager";
|
customization_menu.status = "No player manager";
|
||||||
return;
|
return;
|
||||||
@@ -516,15 +518,15 @@ function players.update_myself_position()
|
|||||||
|
|
||||||
local position = get_pos_field:call(master_player);
|
local position = get_pos_field:call(master_player);
|
||||||
if position ~= nil then
|
if position ~= nil then
|
||||||
players.myself_position = position;
|
this.myself_position = position;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.init()
|
function this.init()
|
||||||
players.list = {};
|
this.list = {};
|
||||||
players.display_list = {};
|
this.display_list = {};
|
||||||
players.total = players.new(0, "Total", 0, 0, players.types.total);
|
this.total = this.new(0, "Total", 0, 0, this.types.total);
|
||||||
players.myself = players.new(-1, "DummyMHROverlay", -1, -1, players.types.myself);
|
this.myself = this.new(-1, "DummyMHROverlay", -1, -1, this.types.myself);
|
||||||
end
|
end
|
||||||
|
|
||||||
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
||||||
@@ -554,15 +556,15 @@ local get_master_rank_method = progress_manager_type_def:get_method("get_MasterR
|
|||||||
|
|
||||||
local get_master_player_id_method = player_manager_type_def:get_method("getMasterPlayerID");
|
local get_master_player_id_method = player_manager_type_def:get_method("getMasterPlayerID");
|
||||||
|
|
||||||
function players.update_player_list(is_on_quest)
|
function this.update_player_list(is_on_quest)
|
||||||
if is_on_quest then
|
if is_on_quest then
|
||||||
players.update_player_list_(quest_hunter_info_field);
|
this.update_player_list_(quest_hunter_info_field);
|
||||||
else
|
else
|
||||||
players.update_player_list_(hunter_info_field);
|
this.update_player_list_(hunter_info_field);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.update_player_list_(hunter_info_field_)
|
function this.update_player_list_(hunter_info_field_)
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if singletons.lobby_manager == nil then
|
if singletons.lobby_manager == nil then
|
||||||
@@ -596,10 +598,10 @@ function players.update_player_list_(hunter_info_field_)
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if players.myself == nil or myself_id ~= players.myself.id then
|
if this.myself == nil or myself_id ~= this.myself.id then
|
||||||
players.list[players.myself.id] = nil;
|
this.list[this.myself.id] = nil;
|
||||||
players.myself = players.new(myself_id, myself_player_name, myself_master_rank, myself_hunter_rank, players.types.myself);
|
this.myself = this.new(myself_id, myself_player_name, myself_master_rank, myself_hunter_rank, this.types.myself);
|
||||||
players.list[myself_id] = players.myself;
|
this.list[myself_id] = this.myself;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- other players
|
-- other players
|
||||||
@@ -635,64 +637,63 @@ function players.update_player_list_(hunter_info_field_)
|
|||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|
||||||
local player = players.list[id];
|
local player = this.list[id];
|
||||||
|
|
||||||
if player == nil then
|
if player == nil then
|
||||||
|
|
||||||
if name == players.myself.name then
|
if name == this.myself.name then
|
||||||
player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
|
player = this.new(id, name, master_rank, hunter_rank, this.types.myself);
|
||||||
players.myself = player;
|
this.myself = player;
|
||||||
players.list[id] = player;
|
this.list[id] = player;
|
||||||
else
|
else
|
||||||
player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
|
player = this.new(id, name, master_rank, hunter_rank, this.types.other_player);
|
||||||
players.list[id] = player;
|
this.list[id] = player;
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif player.name ~= name or player.hunter_rank ~= hunter_rank or player.master_rank ~= master_rank then
|
elseif player.name ~= name or player.hunter_rank ~= hunter_rank or player.master_rank ~= master_rank then
|
||||||
|
|
||||||
if name == players.myself.name then
|
if name == this.myself.name then
|
||||||
player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
|
player = this.new(id, name, master_rank, hunter_rank, this.types.myself);
|
||||||
players.myself = player;
|
this.myself = player;
|
||||||
players.list[id] = player;
|
this.list[id] = player;
|
||||||
else
|
else
|
||||||
player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
|
player = this.new(id, name, master_rank, hunter_rank, this.types.other_player);
|
||||||
players.list[id] = player;
|
this.list[id] = player;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if player ~= players.myself then
|
if player ~= this.myself then
|
||||||
table.insert(players.display_list, player);
|
table.insert(this.display_list, player);
|
||||||
end
|
end
|
||||||
|
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.init_UI(player)
|
function this.init_UI(player)
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
if player.type == players.types.myself then
|
if player.type == this.types.myself then
|
||||||
player.damage_UI = damage_UI_entity.new(cached_config.myself, player.type);
|
player.damage_UI = damage_UI_entity.new(cached_config.myself, player.type);
|
||||||
elseif player.type == players.types.other_player then
|
elseif player.type == this.types.other_player then
|
||||||
player.damage_UI = damage_UI_entity.new(cached_config.other_players, player.type);
|
player.damage_UI = damage_UI_entity.new(cached_config.other_players, player.type);
|
||||||
elseif player.type == players.types.total then
|
elseif player.type == this.types.total then
|
||||||
player.damage_UI = damage_UI_entity.new(cached_config.total, player.type);
|
player.damage_UI = damage_UI_entity.new(cached_config.total, player.type);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.init_highlighted_UI()
|
function this.init_highlighted_UI()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
players.highlighted_damage_UI = damage_UI_entity.new(cached_config.highlighted, players.types.highlight);
|
this.highlighted_damage_UI = damage_UI_entity.new(cached_config.highlighted, this.types.highlight);
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
|
function this.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||||
damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_damage, top_dps);
|
damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_damage, top_dps);
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
|
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
|
||||||
@@ -702,7 +703,7 @@ function players.init_module()
|
|||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
|
|
||||||
players.init();
|
this.init();
|
||||||
end
|
end
|
||||||
|
|
||||||
return players;
|
return this;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
local env_creature = {};
|
local this = {};
|
||||||
|
|
||||||
local drawing;
|
local drawing;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local singletons;
|
local singletons;
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -34,10 +34,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
env_creature.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function env_creature.new(REcreature)
|
function this.new(REcreature)
|
||||||
local creature = {};
|
local creature = {};
|
||||||
|
|
||||||
creature.life = 0;
|
creature.life = 0;
|
||||||
@@ -47,22 +50,22 @@ function env_creature.new(REcreature)
|
|||||||
creature.position = Vector3f.new(0, 0, 0);
|
creature.position = Vector3f.new(0, 0, 0);
|
||||||
creature.distance = 0;
|
creature.distance = 0;
|
||||||
|
|
||||||
env_creature.init(creature, REcreature);
|
this.init(creature, REcreature);
|
||||||
env_creature.init_UI(creature);
|
this.init_UI(creature);
|
||||||
|
|
||||||
if env_creature.list[REcreature] == nil then
|
if this.list[REcreature] == nil then
|
||||||
env_creature.list[REcreature] = creature;
|
this.list[REcreature] = creature;
|
||||||
end
|
end
|
||||||
|
|
||||||
return creature;
|
return creature;
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.get_creature(REcreature)
|
function this.get_creature(REcreature)
|
||||||
if env_creature.list[REcreature] == nil then
|
if this.list[REcreature] == nil then
|
||||||
env_creature.list[REcreature] = env_creature.new(REcreature);
|
this.list[REcreature] = this.new(REcreature);
|
||||||
end
|
end
|
||||||
|
|
||||||
return env_creature.list[REcreature];
|
return this.list[REcreature];
|
||||||
end
|
end
|
||||||
|
|
||||||
local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
|
local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
|
||||||
@@ -74,7 +77,7 @@ local get_env_creature_name_message_method = message_manager_type_def:get_method
|
|||||||
|
|
||||||
local get_pos_method = environment_creature_base_type_def:get_method("get_Pos");
|
local get_pos_method = environment_creature_base_type_def:get_method("get_Pos");
|
||||||
|
|
||||||
function env_creature.init(creature, REcreature)
|
function this.init(creature, REcreature)
|
||||||
local creature_type = creature_type_field:get_data(REcreature);
|
local creature_type = creature_type_field:get_data(REcreature);
|
||||||
if creature_type == nil then
|
if creature_type == nil then
|
||||||
customization_menu.status = "No env creature type";
|
customization_menu.status = "No env creature type";
|
||||||
@@ -88,8 +91,8 @@ function env_creature.init(creature, REcreature)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.init_UI(creature)
|
function this.init_UI(creature)
|
||||||
creature.name_label = table_helpers.deep_copy(config.current_config.endemic_life_UI.creature_name_label);
|
creature.name_label = utils.table.deep_copy(config.current_config.endemic_life_UI.creature_name_label);
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -97,13 +100,13 @@ function env_creature.init_UI(creature)
|
|||||||
creature.name_label.offset.y = creature.name_label.offset.y * global_scale_modifier;
|
creature.name_label.offset.y = creature.name_label.offset.y * global_scale_modifier;
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.update_position(REcreature, creature)
|
function this.update_position(REcreature, creature)
|
||||||
if not config.current_config.endemic_life_UI.enabled then
|
if not config.current_config.endemic_life_UI.enabled then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if creature == nil then
|
if creature == nil then
|
||||||
creature = env_creature.get_creature(REcreature);
|
creature = this.get_creature(REcreature);
|
||||||
end
|
end
|
||||||
|
|
||||||
local position = get_pos_method:call(REcreature);
|
local position = get_pos_method:call(REcreature);
|
||||||
@@ -112,13 +115,13 @@ function env_creature.update_position(REcreature, creature)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.update(REcreature, creature)
|
function this.update(REcreature, creature)
|
||||||
if not config.current_config.endemic_life_UI.enabled then
|
if not config.current_config.endemic_life_UI.enabled then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if creature == nil then
|
if creature == nil then
|
||||||
creature = env_creature.get_creature(REcreature);
|
creature = this.get_creature(REcreature);
|
||||||
end
|
end
|
||||||
|
|
||||||
local is_inactive = creature_is_inactive_field:get_data(REcreature);
|
local is_inactive = creature_is_inactive_field:get_data(REcreature);
|
||||||
@@ -127,7 +130,7 @@ function env_creature.update(REcreature, creature)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.draw(creature, position_on_screen, opacity_scale)
|
function this.draw(creature, position_on_screen, opacity_scale)
|
||||||
if d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available then
|
if d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available then
|
||||||
local text_width, text_height = drawing.font:measure(creature.name);
|
local text_width, text_height = drawing.font:measure(creature.name);
|
||||||
position_on_screen.x = position_on_screen.x - text_width / 2;
|
position_on_screen.x = position_on_screen.x - text_width / 2;
|
||||||
@@ -136,15 +139,15 @@ function env_creature.draw(creature, position_on_screen, opacity_scale)
|
|||||||
drawing.draw_label(creature.name_label, position_on_screen, opacity_scale, creature.name);
|
drawing.draw_label(creature.name_label, position_on_screen, opacity_scale, creature.name);
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.init_list()
|
function this.init_list()
|
||||||
env_creature.list = {};
|
this.list = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
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");
|
--health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
--stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
--stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
||||||
--screen = require("MHR_Overlay.Game_Handler.screen");
|
--screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -153,4 +156,4 @@ function env_creature.init_module()
|
|||||||
--ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
|
--ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
|
||||||
end
|
end
|
||||||
|
|
||||||
return env_creature;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local env_creature_hook = {};
|
local this = {};
|
||||||
|
|
||||||
local env_creature;
|
local env_creature;
|
||||||
local config;
|
local config;
|
||||||
@@ -32,26 +32,29 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
|
local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
|
||||||
local update_method = environment_creature_base_type_def:get_method("update");
|
local update_method = environment_creature_base_type_def:get_method("update");
|
||||||
|
|
||||||
function env_creature_hook.update(REcreature)
|
function this.update(REcreature)
|
||||||
local creature = env_creature.get_creature(REcreature);
|
local creature = env_creature.get_creature(REcreature);
|
||||||
env_creature.update(REcreature, creature);
|
env_creature.update(REcreature, creature);
|
||||||
env_creature.update_position(REcreature, creature);
|
env_creature.update_position(REcreature, creature);
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature_hook.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
|
|
||||||
sdk.hook(update_method, function(args)
|
sdk.hook(update_method, function(args)
|
||||||
pcall(env_creature_hook.update, sdk.to_managed_object(args[2]));
|
pcall(this.update, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
return env_creature_hook;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local keyboard = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local singletons;
|
local singletons;
|
||||||
@@ -37,6 +37,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
local game_keyboard_type_def = sdk.find_type_definition("snow.GameKeyboard");
|
local game_keyboard_type_def = sdk.find_type_definition("snow.GameKeyboard");
|
||||||
local hard_keyboard_field = game_keyboard_type_def:get_field("hardKeyboard");
|
local hard_keyboard_field = game_keyboard_type_def:get_field("hardKeyboard");
|
||||||
@@ -46,13 +49,13 @@ local get_down_method = hard_keyboard_field_type_def:get_method("getDown");
|
|||||||
local get_trigger_method = hard_keyboard_field_type_def:get_method("getTrg");
|
local get_trigger_method = hard_keyboard_field_type_def:get_method("getTrg");
|
||||||
local get_release_method = hard_keyboard_field_type_def:get_method("getRelease");
|
local get_release_method = hard_keyboard_field_type_def:get_method("getRelease");
|
||||||
|
|
||||||
keyboard.hotkey_modifiers_down = {
|
this.hotkey_modifiers_down = {
|
||||||
ctrl = false,
|
ctrl = false,
|
||||||
shift = false,
|
shift = false,
|
||||||
alt = false
|
alt = false
|
||||||
};
|
};
|
||||||
|
|
||||||
keyboard.keys = {
|
this.keys = {
|
||||||
[0] = "None",
|
[0] = "None",
|
||||||
[1] = "Left Mouse Button",
|
[1] = "Left Mouse Button",
|
||||||
[2] = "Right Mouse Button",
|
[2] = "Right Mouse Button",
|
||||||
@@ -331,7 +334,7 @@ keyboard.keys = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function keyboard.update()
|
function this.update()
|
||||||
if singletons.game_keyboard == nil then
|
if singletons.game_keyboard == nil then
|
||||||
customization_menu.status = "No game keyboard";
|
customization_menu.status = "No game keyboard";
|
||||||
return;
|
return;
|
||||||
@@ -343,137 +346,137 @@ function keyboard.update()
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
keyboard.check_modifiers(hard_keyboard);
|
this.check_modifiers(hard_keyboard);
|
||||||
|
|
||||||
local new_hotkey_registered = keyboard.register_hotkey(hard_keyboard);
|
local new_hotkey_registered = this.register_hotkey(hard_keyboard);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if new_hotkey_registered then
|
if new_hotkey_registered then
|
||||||
config.save();
|
config.save();
|
||||||
else
|
else
|
||||||
keyboard.check_hotkeys(hard_keyboard);
|
this.check_hotkeys(hard_keyboard);
|
||||||
end
|
end
|
||||||
|
|
||||||
keyboard.hotkey_modifiers_down.ctrl = false;
|
this.hotkey_modifiers_down.ctrl = false;
|
||||||
keyboard.hotkey_modifiers_down.shift = false;
|
this.hotkey_modifiers_down.shift = false;
|
||||||
keyboard.hotkey_modifiers_down.alt = false
|
this.hotkey_modifiers_down.alt = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyboard.check_modifiers(hard_keyboard)
|
function this.check_modifiers(hard_keyboard)
|
||||||
local is_ctrl_down = get_down_method:call(hard_keyboard, 17);
|
local is_ctrl_down = get_down_method:call(hard_keyboard, 17);
|
||||||
if is_ctrl_down ~= nil then
|
if is_ctrl_down ~= nil then
|
||||||
keyboard.hotkey_modifiers_down.ctrl = is_ctrl_down;
|
this.hotkey_modifiers_down.ctrl = is_ctrl_down;
|
||||||
end
|
end
|
||||||
|
|
||||||
local is_shift_down = get_down_method:call(hard_keyboard, 16);
|
local is_shift_down = get_down_method:call(hard_keyboard, 16);
|
||||||
if is_shift_down ~= nil then
|
if is_shift_down ~= nil then
|
||||||
keyboard.hotkey_modifiers_down.shift = is_shift_down;
|
this.hotkey_modifiers_down.shift = is_shift_down;
|
||||||
end
|
end
|
||||||
|
|
||||||
local is_alt_down = get_down_method:call(hard_keyboard, 18);
|
local is_alt_down = get_down_method:call(hard_keyboard, 18);
|
||||||
if is_alt_down ~= nil then
|
if is_alt_down ~= nil then
|
||||||
keyboard.hotkey_modifiers_down.alt = is_alt_down;
|
this.hotkey_modifiers_down.alt = is_alt_down;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyboard.register_hotkey(hard_keyboard)
|
function this.register_hotkey(hard_keyboard)
|
||||||
local cached_config = config.current_config.global_settings.hotkeys_with_modifiers;
|
local cached_config = config.current_config.global_settings.hotkeys_with_modifiers;
|
||||||
|
|
||||||
if customization_menu.all_UI_waiting_for_key then
|
if customization_menu.all_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.all_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.all_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.all_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.all_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.all_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.all_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.all_UI.key = key;
|
cached_config.all_UI.key = key;
|
||||||
customization_menu.all_UI_waiting_for_key = false;
|
customization_menu.all_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.small_monster_UI_waiting_for_key then
|
elseif customization_menu.small_monster_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.small_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.small_monster_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.small_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.small_monster_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.small_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.small_monster_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.small_monster_UI.key = key;
|
cached_config.small_monster_UI.key = key;
|
||||||
customization_menu.small_monster_UI_waiting_for_key = false;
|
customization_menu.small_monster_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.large_monster_UI_waiting_for_key then
|
elseif customization_menu.large_monster_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.large_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.large_monster_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.large_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.large_monster_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.large_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.large_monster_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.large_monster_UI.key = key;
|
cached_config.large_monster_UI.key = key;
|
||||||
customization_menu.large_monster_UI_waiting_for_key = false;
|
customization_menu.large_monster_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.large_monster_dynamic_UI_waiting_for_key then
|
elseif customization_menu.large_monster_dynamic_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.large_monster_dynamic_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.large_monster_dynamic_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.large_monster_dynamic_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.large_monster_dynamic_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.large_monster_dynamic_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.large_monster_dynamic_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.large_monster_dynamic_UI.key = key;
|
cached_config.large_monster_dynamic_UI.key = key;
|
||||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.large_monster_static_UI_waiting_for_key then
|
elseif customization_menu.large_monster_static_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.large_monster_static_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.large_monster_static_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.large_monster_static_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.large_monster_static_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.large_monster_static_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.large_monster_static_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.large_monster_static_UI.key = key;
|
cached_config.large_monster_static_UI.key = key;
|
||||||
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.large_monster_highlighted_UI_waiting_for_key then
|
elseif customization_menu.large_monster_highlighted_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.large_monster_highlighted_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.large_monster_highlighted_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.large_monster_highlighted_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.large_monster_highlighted_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.large_monster_highlighted_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.large_monster_highlighted_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.large_monster_highlighted_UI.key = key;
|
cached_config.large_monster_highlighted_UI.key = key;
|
||||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.time_UI_waiting_for_key then
|
elseif customization_menu.time_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.time_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.time_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.time_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.time_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.time_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.time_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.time_UI.key = key;
|
cached_config.time_UI.key = key;
|
||||||
customization_menu.time_UI_waiting_for_key = false;
|
customization_menu.time_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.damage_meter_UI_waiting_for_key then
|
elseif customization_menu.damage_meter_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.damage_meter_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.damage_meter_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.damage_meter_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.damage_meter_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.damage_meter_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.damage_meter_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.damage_meter_UI.key = key;
|
cached_config.damage_meter_UI.key = key;
|
||||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif customization_menu.endemic_life_UI_waiting_for_key then
|
elseif customization_menu.endemic_life_UI_waiting_for_key then
|
||||||
for key, key_name in pairs(keyboard.keys) do
|
for key, key_name in pairs(this.keys) do
|
||||||
if get_release_method:call(hard_keyboard, key) then
|
if get_release_method:call(hard_keyboard, key) then
|
||||||
cached_config.endemic_life_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
cached_config.endemic_life_UI.ctrl = this.hotkey_modifiers_down.ctrl;
|
||||||
cached_config.endemic_life_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
cached_config.endemic_life_UI.shift = this.hotkey_modifiers_down.shift;
|
||||||
cached_config.endemic_life_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
cached_config.endemic_life_UI.alt = this.hotkey_modifiers_down.alt;
|
||||||
cached_config.endemic_life_UI.key = key;
|
cached_config.endemic_life_UI.key = key;
|
||||||
customization_menu.endemic_life_UI_waiting_for_key = false;
|
customization_menu.endemic_life_UI_waiting_for_key = false;
|
||||||
return true;
|
return true;
|
||||||
@@ -484,12 +487,12 @@ function keyboard.register_hotkey(hard_keyboard)
|
|||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyboard.check_hotkeys(hard_keyboard)
|
function this.check_hotkeys(hard_keyboard)
|
||||||
local cached_config = config.current_config.global_settings.hotkeys_with_modifiers;
|
local cached_config = config.current_config.global_settings.hotkeys_with_modifiers;
|
||||||
|
|
||||||
if not (cached_config.all_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.all_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.all_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.all_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.all_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.all_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.all_UI.key)) then
|
||||||
|
|
||||||
local is_any_enabled = config.current_config.time_UI.enabled
|
local is_any_enabled = config.current_config.time_UI.enabled
|
||||||
@@ -508,17 +511,17 @@ function keyboard.check_hotkeys(hard_keyboard)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.small_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.small_monster_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.small_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.small_monster_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.small_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.small_monster_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.small_monster_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.small_monster_UI.key)) then
|
||||||
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
|
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.large_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.large_monster_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.large_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.large_monster_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.large_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.large_monster_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.large_monster_UI.key)) then
|
||||||
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
|
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
|
||||||
or config.current_config.large_monster_UI.static.enabled
|
or config.current_config.large_monster_UI.static.enabled
|
||||||
@@ -530,27 +533,27 @@ function keyboard.check_hotkeys(hard_keyboard)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.large_monster_dynamic_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.large_monster_dynamic_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.large_monster_dynamic_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard,
|
if get_release_method:call(hard_keyboard,
|
||||||
math.tointeger(cached_config.large_monster_dynamic_UI.key)) then
|
math.tointeger(cached_config.large_monster_dynamic_UI.key)) then
|
||||||
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
|
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.large_monster_static_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.large_monster_static_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.large_monster_static_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard,
|
if get_release_method:call(hard_keyboard,
|
||||||
math.tointeger(cached_config.large_monster_static_UI.key)) then
|
math.tointeger(cached_config.large_monster_static_UI.key)) then
|
||||||
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
|
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.large_monster_highlighted_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.large_monster_highlighted_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.large_monster_highlighted_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard,
|
if get_release_method:call(hard_keyboard,
|
||||||
math.tointeger(cached_config.large_monster_highlighted_UI.key)) then
|
math.tointeger(cached_config.large_monster_highlighted_UI.key)) then
|
||||||
config.current_config.large_monster_UI.highlighted.enabled = not
|
config.current_config.large_monster_UI.highlighted.enabled = not
|
||||||
@@ -558,32 +561,32 @@ function keyboard.check_hotkeys(hard_keyboard)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.time_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.time_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.time_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.time_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.time_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.time_UI.key)) then
|
||||||
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
|
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.damage_meter_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.damage_meter_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.damage_meter_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.damage_meter_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.damage_meter_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.damage_meter_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.damage_meter_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.damage_meter_UI.key)) then
|
||||||
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
|
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (cached_config.endemic_life_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
if not (cached_config.endemic_life_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
|
||||||
and not (cached_config.endemic_life_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
and not (cached_config.endemic_life_UI.shift and not this.hotkey_modifiers_down.shift)
|
||||||
and not (cached_config.endemic_life_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
and not (cached_config.endemic_life_UI.alt and not this.hotkey_modifiers_down.alt) then
|
||||||
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.endemic_life_UI.key)) then
|
if get_release_method:call(hard_keyboard, math.tointeger(cached_config.endemic_life_UI.key)) then
|
||||||
config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled;
|
config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyboard.get_hotkey_name(hotkey)
|
function this.get_hotkey_name(hotkey)
|
||||||
local hotkey_name = "";
|
local hotkey_name = "";
|
||||||
|
|
||||||
if hotkey.ctrl then
|
if hotkey.ctrl then
|
||||||
@@ -598,10 +601,10 @@ function keyboard.get_hotkey_name(hotkey)
|
|||||||
hotkey_name = hotkey_name .. "Alt + ";
|
hotkey_name = hotkey_name .. "Alt + ";
|
||||||
end
|
end
|
||||||
|
|
||||||
return hotkey_name .. tostring(keyboard.keys[hotkey.key]);
|
return hotkey_name .. tostring(this.keys[hotkey.key]);
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyboard.init_module()
|
function this.init_module()
|
||||||
config = require "MHR_Overlay.Misc.config"
|
config = require "MHR_Overlay.Misc.config"
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -612,4 +615,4 @@ function keyboard.init_module()
|
|||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
end
|
end
|
||||||
|
|
||||||
return keyboard;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local quest_status = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
@@ -38,8 +38,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
quest_status.flow_states = {
|
this.flow_states = {
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
IN_LOBBY = 1,
|
IN_LOBBY = 1,
|
||||||
IN_TRAINING_AREA = 2,
|
IN_TRAINING_AREA = 2,
|
||||||
@@ -61,15 +64,15 @@ quest_status.flow_states = {
|
|||||||
SUMMARY_SCREEN = 32768,
|
SUMMARY_SCREEN = 32768,
|
||||||
};
|
};
|
||||||
|
|
||||||
quest_status.previous_flow_state = quest_status.flow_states.NONE;
|
this.previous_flow_state = this.flow_states.NONE;
|
||||||
quest_status.flow_state = quest_status.flow_states.NONE;
|
this.flow_state = this.flow_states.NONE;
|
||||||
|
|
||||||
quest_status.index = 0;
|
this.index = 0;
|
||||||
quest_status.is_online = false;
|
this.is_online = false;
|
||||||
--quest_status.is_quest_host = false;
|
--quest_status.is_quest_host = false;
|
||||||
|
|
||||||
quest_status.cart_count = 0;
|
this.cart_count = 0;
|
||||||
quest_status.max_cart_count = 3;
|
this.max_cart_count = 3;
|
||||||
|
|
||||||
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
|
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
|
||||||
local on_changed_game_status_method = quest_manager_type_def:get_method("onChangedGameStatus");
|
local on_changed_game_status_method = quest_manager_type_def:get_method("onChangedGameStatus");
|
||||||
@@ -113,8 +116,8 @@ local unique_event_manager_type_def = sdk.find_type_definition("snow.eventcut.Un
|
|||||||
local play_event_common_method = unique_event_manager_type_def:get_method("playEventCommon");
|
local play_event_common_method = unique_event_manager_type_def:get_method("playEventCommon");
|
||||||
local event_manager_dispose_method = unique_event_manager_type_def:get_method("dispose");
|
local event_manager_dispose_method = unique_event_manager_type_def:get_method("dispose");
|
||||||
|
|
||||||
function quest_status.get_flow_state_name(flow_state, new_line)
|
function this.get_flow_state_name(flow_state, new_line)
|
||||||
for key, value in pairs(quest_status.flow_states) do
|
for key, value in pairs(this.flow_states) do
|
||||||
if value == flow_state then
|
if value == flow_state then
|
||||||
if new_line then
|
if new_line then
|
||||||
return "\n" .. tostring(key);
|
return "\n" .. tostring(key);
|
||||||
@@ -125,52 +128,52 @@ function quest_status.get_flow_state_name(flow_state, new_line)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.set_flow_state(new_flow_state)
|
function this.set_flow_state(new_flow_state)
|
||||||
quest_status.previous_flow_state = quest_status.flow_state;
|
this.previous_flow_state = this.flow_state;
|
||||||
quest_status.flow_state = new_flow_state;
|
this.flow_state = new_flow_state;
|
||||||
|
|
||||||
if quest_status.flow_state >= quest_status.flow_states.KILLCAM then
|
if this.flow_state >= this.flow_states.KILLCAM then
|
||||||
damage_meter_UI.freeze_displayed_players = true;
|
damage_meter_UI.freeze_displayed_players = true;
|
||||||
else
|
else
|
||||||
damage_meter_UI.freeze_displayed_players = false;
|
damage_meter_UI.freeze_displayed_players = false;
|
||||||
end
|
end
|
||||||
|
|
||||||
if quest_status.flow_state == quest_status.flow_states.IN_LOBBY or quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
|
if this.flow_state == this.flow_states.IN_LOBBY or this.flow_state == this.flow_states.IN_TRAINING_AREA then
|
||||||
players.init();
|
players.init();
|
||||||
non_players.init();
|
non_players.init();
|
||||||
small_monster.init_list();
|
small_monster.init_list();
|
||||||
large_monster.init_list();
|
large_monster.init_list();
|
||||||
env_creature.init_list();
|
env_creature.init_list();
|
||||||
damage_meter_UI.last_displayed_players = {};
|
damage_meter_UI.last_displayed_players = {};
|
||||||
elseif quest_status.flow_state >= quest_status.flow_states.LOADING_QUEST then
|
elseif this.flow_state >= this.flow_states.LOADING_QUEST then
|
||||||
quest_status.get_cart_count();
|
this.get_cart_count();
|
||||||
quest_status.get_max_cart_count();
|
this.get_max_cart_count();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.get_cart_count()
|
function this.get_cart_count()
|
||||||
local death_num = get_death_num_method:call(singletons.quest_manager);
|
local death_num = get_death_num_method:call(singletons.quest_manager);
|
||||||
if death_num ~= nil then
|
if death_num ~= nil then
|
||||||
quest_status.cart_count = death_num;
|
this.cart_count = death_num;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.get_max_cart_count()
|
function this.get_max_cart_count()
|
||||||
local quest_life = get_quest_life_method:call(singletons.quest_manager);
|
local quest_life = get_quest_life_method:call(singletons.quest_manager);
|
||||||
if quest_life ~= nil then
|
if quest_life ~= nil then
|
||||||
quest_status.max_cart_count = quest_life;
|
this.max_cart_count = quest_life;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--type 2 = quest start
|
--type 2 = quest start
|
||||||
--type 3 = monster killcam
|
--type 3 = monster killcam
|
||||||
--type 5 = end screen
|
--type 5 = end screen
|
||||||
function quest_status.on_demo_request_activation(request_data_base)
|
function this.on_demo_request_activation(request_data_base)
|
||||||
if request_data_base == nil then
|
if request_data_base == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if quest_status.index ~= 2 then
|
if this.index ~= 2 then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -181,125 +184,125 @@ function quest_status.on_demo_request_activation(request_data_base)
|
|||||||
|
|
||||||
-- QUEST_START_ANIMATION
|
-- QUEST_START_ANIMATION
|
||||||
if request_data_type == 2 then
|
if request_data_type == 2 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_START_ANIMATION);
|
this.set_flow_state(this.flow_states.QUEST_START_ANIMATION);
|
||||||
|
|
||||||
-- KILLCAM
|
-- KILLCAM
|
||||||
elseif request_data_type == 3 then
|
elseif request_data_type == 3 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.KILLCAM);
|
this.set_flow_state(this.flow_states.KILLCAM);
|
||||||
|
|
||||||
-- QUEST_END_ANIMATION
|
-- QUEST_END_ANIMATION
|
||||||
elseif request_data_type == 5 or request_data_type == 6 or request_data_type == 7 then
|
elseif request_data_type == 5 or request_data_type == 6 or request_data_type == 7 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_ANIMATION);
|
this.set_flow_state(this.flow_states.QUEST_END_ANIMATION);
|
||||||
|
|
||||||
-- PLAYER_DEATH_ANIMATION
|
-- PLAYER_DEATH_ANIMATION
|
||||||
elseif request_data_type == 8 then
|
elseif request_data_type == 8 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.PLAYER_DEATH_ANIMATION);
|
this.set_flow_state(this.flow_states.PLAYER_DEATH_ANIMATION);
|
||||||
|
|
||||||
-- PLAYER_CART_ANIMATION
|
-- PLAYER_CART_ANIMATION
|
||||||
elseif request_data_type == 9 then
|
elseif request_data_type == 9 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.PLAYER_CART_ANIMATION);
|
this.set_flow_state(this.flow_states.PLAYER_CART_ANIMATION);
|
||||||
|
|
||||||
-- FAST_TRAVEL_ANIMATION
|
-- FAST_TRAVEL_ANIMATION
|
||||||
elseif request_data_type == 10 then
|
elseif request_data_type == 10 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.FAST_TRAVEL_ANIMATION);
|
this.set_flow_state(this.flow_states.FAST_TRAVEL_ANIMATION);
|
||||||
|
|
||||||
-- WYVERN_RIDING_START_ANIMATION
|
-- WYVERN_RIDING_START_ANIMATION
|
||||||
elseif request_data_type == 11 then
|
elseif request_data_type == 11 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.WYVERN_RIDING_START_ANIMATION);
|
this.set_flow_state(this.flow_states.WYVERN_RIDING_START_ANIMATION);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_demo_end()
|
function this.on_demo_end()
|
||||||
if quest_status.index == 2 then
|
if this.index == 2 then
|
||||||
if quest_status.flow_state == quest_status.flow_states.PLAYER_DEATH_ANIMATION
|
if this.flow_state == this.flow_states.PLAYER_DEATH_ANIMATION
|
||||||
or quest_status.flow_state == quest_status.flow_states.PLAYER_CART_ANIMATION
|
or this.flow_state == this.flow_states.PLAYER_CART_ANIMATION
|
||||||
or quest_status.flow_state == quest_status.flow_states.FAST_TRAVEL_ANIMATION
|
or this.flow_state == this.flow_states.FAST_TRAVEL_ANIMATION
|
||||||
or quest_status.flow_state == quest_status.flow_states.WYVERN_RIDING_START_ANIMATION then
|
or this.flow_state == this.flow_states.WYVERN_RIDING_START_ANIMATION then
|
||||||
|
|
||||||
quest_status.set_flow_state(quest_status.previous_flow_state);
|
this.set_flow_state(this.previous_flow_state);
|
||||||
|
|
||||||
elseif quest_status.flow_state == quest_status.flow_states.QUEST_START_ANIMATION then
|
elseif this.flow_state == this.flow_states.QUEST_START_ANIMATION then
|
||||||
|
|
||||||
quest_status.set_flow_state(quest_status.flow_states.PLAYING_QUEST);
|
this.set_flow_state(this.flow_states.PLAYING_QUEST);
|
||||||
|
|
||||||
elseif quest_status.flow_state == quest_status.flow_states.KILLCAM then
|
elseif this.flow_state == this.flow_states.KILLCAM then
|
||||||
|
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_TIMER);
|
this.set_flow_state(this.flow_states.QUEST_END_TIMER);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_set_quest_clear()
|
function this.on_set_quest_clear()
|
||||||
if quest_status.index == 2 and quest_status.flow_state ~= quest_status.flow_states.KILLCAM then
|
if this.index == 2 and this.flow_state ~= this.flow_states.KILLCAM then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_TIMER);
|
this.set_flow_state(this.flow_states.QUEST_END_TIMER);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_quest_end_set_state()
|
function this.on_quest_end_set_state()
|
||||||
if quest_status.index == 2 then
|
if this.index == 2 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_SCREEN);
|
this.set_flow_state(this.flow_states.QUEST_END_SCREEN);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_gui_result_reward_do_open()
|
function this.on_gui_result_reward_do_open()
|
||||||
if quest_status.index == 3 then
|
if this.index == 3 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.REWARD_SCREEN);
|
this.set_flow_state(this.flow_states.REWARD_SCREEN);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_gui_result_pay_off_do_open()
|
function this.on_gui_result_pay_off_do_open()
|
||||||
if quest_status.index == 3 then
|
if this.index == 3 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
|
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_play_event_common()
|
function this.on_play_event_common()
|
||||||
quest_status.set_flow_state(quest_status.flow_states.CUTSCENE);
|
this.set_flow_state(this.flow_states.CUTSCENE);
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_event_manager_dispose()
|
function this.on_event_manager_dispose()
|
||||||
if quest_status.flow_state == quest_status.flow_states.CUTSCENE then
|
if this.flow_state == this.flow_states.CUTSCENE then
|
||||||
quest_status.set_flow_state(quest_status.previous_flow_state);
|
this.set_flow_state(this.previous_flow_state);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_set_quest_fail()
|
function this.on_set_quest_fail()
|
||||||
if quest_status.flow_state == quest_status.flow_states.PLAYER_DEATH_ANIMATION or
|
if this.flow_state == this.flow_states.PLAYER_DEATH_ANIMATION or
|
||||||
quest_status.flow_state == quest_status.flow_states.PLAYER_CART_ANIMATION or
|
this.flow_state == this.flow_states.PLAYER_CART_ANIMATION or
|
||||||
quest_status.flow_state == quest_status.flow_states.FAST_TRAVEL_ANIMATION or
|
this.flow_state == this.flow_states.FAST_TRAVEL_ANIMATION or
|
||||||
quest_status.flow_state == quest_status.flow_states.WYVERN_RIDING_START_ANIMATION then
|
this.flow_state == this.flow_states.WYVERN_RIDING_START_ANIMATION then
|
||||||
|
|
||||||
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_ANIMATION);
|
this.set_flow_state(this.flow_states.QUEST_END_ANIMATION);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_village_fast_travel(area)
|
function this.on_village_fast_travel(area)
|
||||||
if area == nil then
|
if area == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if area == 7 then
|
if area == 7 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.IN_TRAINING_AREA);
|
this.set_flow_state(this.flow_states.IN_TRAINING_AREA);
|
||||||
else
|
else
|
||||||
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
|
this.set_flow_state(this.flow_states.IN_LOBBY);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.on_changed_game_status(new_quest_status)
|
function this.on_changed_game_status(new_quest_status)
|
||||||
quest_status.index = new_quest_status;
|
this.index = new_quest_status;
|
||||||
|
|
||||||
if quest_status.index == 0 then
|
if this.index == 0 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.NONE);
|
this.set_flow_state(this.flow_states.NONE);
|
||||||
elseif quest_status.index == 1 then
|
elseif this.index == 1 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
|
this.set_flow_state(this.flow_states.IN_LOBBY);
|
||||||
elseif quest_status.index == 2 then
|
elseif this.index == 2 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.LOADING_QUEST);
|
this.set_flow_state(this.flow_states.LOADING_QUEST);
|
||||||
elseif quest_status.index == 3 then
|
elseif this.index == 3 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
|
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.init()
|
function this.init()
|
||||||
if singletons.quest_manager == nil then
|
if singletons.quest_manager == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -310,22 +313,22 @@ function quest_status.init()
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
quest_status.index = new_quest_status;
|
this.index = new_quest_status;
|
||||||
|
|
||||||
if quest_status.index == 0 then
|
if this.index == 0 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.NONE);
|
this.set_flow_state(this.flow_states.NONE);
|
||||||
elseif quest_status.index == 1 then
|
elseif this.index == 1 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
|
this.set_flow_state(this.flow_states.IN_LOBBY);
|
||||||
elseif quest_status.index == 2 then
|
elseif this.index == 2 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.PLAYING_QUEST);
|
this.set_flow_state(this.flow_states.PLAYING_QUEST);
|
||||||
elseif quest_status.index == 3 then
|
elseif this.index == 3 then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
|
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
|
||||||
end
|
end
|
||||||
|
|
||||||
quest_status.update_is_training_area();
|
this.update_is_training_area();
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.update_is_online()
|
function this.update_is_online()
|
||||||
if singletons.lobby_manager == nil then
|
if singletons.lobby_manager == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -335,7 +338,7 @@ function quest_status.update_is_online()
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
quest_status.is_online = is_quest_online;
|
this.is_online = is_quest_online;
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[function quest_status.update_is_quest_host()
|
--[[function quest_status.update_is_quest_host()
|
||||||
@@ -351,7 +354,7 @@ end
|
|||||||
quest_status.is_quest_host = is_quest_host;
|
quest_status.is_quest_host = is_quest_host;
|
||||||
end--]]
|
end--]]
|
||||||
|
|
||||||
function quest_status.update_is_training_area()
|
function this.update_is_training_area()
|
||||||
if singletons.village_area_manager == nil then
|
if singletons.village_area_manager == nil then
|
||||||
customization_menu.status = "No village area manager";
|
customization_menu.status = "No village area manager";
|
||||||
return;
|
return;
|
||||||
@@ -363,11 +366,11 @@ function quest_status.update_is_training_area()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if _is_training_area then
|
if _is_training_area then
|
||||||
quest_status.set_flow_state(quest_status.flow_states.IN_TRAINING_AREA);
|
this.set_flow_state(this.flow_states.IN_TRAINING_AREA);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function quest_status.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
@@ -378,63 +381,63 @@ function quest_status.init_module()
|
|||||||
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
|
|
||||||
quest_status.init();
|
this.init();
|
||||||
|
|
||||||
sdk.hook(on_changed_game_status_method, function(args)
|
sdk.hook(on_changed_game_status_method, function(args)
|
||||||
quest_status.on_changed_game_status(sdk.to_int64(args[3]));
|
this.on_changed_game_status(sdk.to_int64(args[3]));
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(set_quest_clear_method, function(args)
|
sdk.hook(set_quest_clear_method, function(args)
|
||||||
quest_status.on_set_quest_clear();
|
this.on_set_quest_clear();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(set_quest_clear_sub_method, function(args)
|
sdk.hook(set_quest_clear_sub_method, function(args)
|
||||||
quest_status.on_set_quest_clear();
|
this.on_set_quest_clear();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(set_quest_clear_sub_hyakurui_method, function(args)
|
sdk.hook(set_quest_clear_sub_hyakurui_method, function(args)
|
||||||
quest_status.on_set_quest_clear();
|
this.on_set_quest_clear();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(demo_request_activation_method, function(args)
|
sdk.hook(demo_request_activation_method, function(args)
|
||||||
quest_status.on_demo_request_activation(sdk.to_managed_object(args[3]));
|
this.on_demo_request_activation(sdk.to_managed_object(args[3]));
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(demo_end_method, function(args)
|
sdk.hook(demo_end_method, function(args)
|
||||||
quest_status.on_demo_end();
|
this.on_demo_end();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(set_quest_clear_method, function(args)
|
sdk.hook(set_quest_clear_method, function(args)
|
||||||
quest_status.on_set_quest_clear();
|
this.on_set_quest_clear();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(quest_end_set_state_method, function(args)
|
sdk.hook(quest_end_set_state_method, function(args)
|
||||||
quest_status.on_quest_end_set_state();
|
this.on_quest_end_set_state();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(gui_result_reward_do_open_method, function(args)
|
sdk.hook(gui_result_reward_do_open_method, function(args)
|
||||||
quest_status.on_gui_result_reward_do_open();
|
this.on_gui_result_reward_do_open();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(gui_result_pay_off_do_open_method, function(args)
|
sdk.hook(gui_result_pay_off_do_open_method, function(args)
|
||||||
quest_status.on_gui_result_pay_off_do_open();
|
this.on_gui_result_pay_off_do_open();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(play_event_common_method, function(args)
|
sdk.hook(play_event_common_method, function(args)
|
||||||
quest_status.on_play_event_common();
|
this.on_play_event_common();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(event_manager_dispose_method, function(args)
|
sdk.hook(event_manager_dispose_method, function(args)
|
||||||
quest_status.on_event_manager_dispose();
|
this.on_event_manager_dispose();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(set_quest_fail_method, function(args)
|
sdk.hook(set_quest_fail_method, function(args)
|
||||||
quest_status.on_set_quest_fail();
|
this.on_set_quest_fail();
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
|
|
||||||
sdk.hook(fast_travel_method, function(args)
|
sdk.hook(fast_travel_method, function(args)
|
||||||
quest_status.on_village_fast_travel(sdk.to_int64(args[3]));
|
this.on_village_fast_travel(sdk.to_int64(args[3]));
|
||||||
end, function(retval) return retval; end);
|
end, function(retval) return retval; end);
|
||||||
end
|
end
|
||||||
|
|
||||||
return quest_status;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local screen = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local singletons;
|
local singletons;
|
||||||
@@ -31,26 +31,29 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
screen.width = 1920;
|
this.width = 1920;
|
||||||
screen.height = 1080;
|
this.height = 1080;
|
||||||
|
|
||||||
function screen.update_window_size()
|
function this.update_window_size()
|
||||||
local width;
|
local width;
|
||||||
local height;
|
local height;
|
||||||
|
|
||||||
if d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available then
|
if d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available then
|
||||||
width, height = d2d.surface_size();
|
width, height = d2d.surface_size();
|
||||||
else
|
else
|
||||||
width, height = screen.get_game_window_size();
|
width, height = this.get_game_window_size();
|
||||||
end
|
end
|
||||||
|
|
||||||
if width ~= nil then
|
if width ~= nil then
|
||||||
screen.width = width;
|
this.width = width;
|
||||||
end
|
end
|
||||||
|
|
||||||
if height ~= nil then
|
if height ~= nil then
|
||||||
screen.height = height;
|
this.height = height;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ local size_type = get_size_method:get_return_type();
|
|||||||
local width_field = size_type:get_field("w");
|
local width_field = size_type:get_field("w");
|
||||||
local height_field = size_type:get_field("h");
|
local height_field = size_type:get_field("h");
|
||||||
|
|
||||||
function screen.get_game_window_size()
|
function this.get_game_window_size()
|
||||||
if scene_view == nil then
|
if scene_view == nil then
|
||||||
scene_view = sdk.call_native_func(singletons.scene_manager, sdk.find_type_definition("via.SceneManager") , "get_MainView");
|
scene_view = sdk.call_native_func(singletons.scene_manager, sdk.find_type_definition("via.SceneManager") , "get_MainView");
|
||||||
|
|
||||||
@@ -93,7 +96,7 @@ function screen.get_game_window_size()
|
|||||||
return screen_width, screen_height;
|
return screen_width, screen_height;
|
||||||
end
|
end
|
||||||
|
|
||||||
function screen.calculate_absolute_coordinates(position)
|
function this.calculate_absolute_coordinates(position)
|
||||||
local global_position_modifier = config.current_config.global_settings.modifiers.global_position_modifier;
|
local global_position_modifier = config.current_config.global_settings.modifiers.global_position_modifier;
|
||||||
|
|
||||||
local _position = {
|
local _position = {
|
||||||
@@ -108,29 +111,29 @@ function screen.calculate_absolute_coordinates(position)
|
|||||||
|
|
||||||
-- top right
|
-- top right
|
||||||
if position.anchor == "Top-Right" then
|
if position.anchor == "Top-Right" then
|
||||||
local screen_x = screen.width - _position.x;
|
local screen_x = this.width - _position.x;
|
||||||
return { x = screen_x, y = _position.y };
|
return { x = screen_x, y = _position.y };
|
||||||
end
|
end
|
||||||
|
|
||||||
-- bottom left
|
-- bottom left
|
||||||
if position.anchor == "Bottom-Left" then
|
if position.anchor == "Bottom-Left" then
|
||||||
local screen_y = screen.height - _position.y;
|
local screen_y = this.height - _position.y;
|
||||||
return { x = _position.x, y = screen_y };
|
return { x = _position.x, y = screen_y };
|
||||||
end
|
end
|
||||||
|
|
||||||
-- bottom right
|
-- bottom right
|
||||||
if position.anchor == "Bottom-Right" then
|
if position.anchor == "Bottom-Right" then
|
||||||
local screen_x = screen.width - _position.x;
|
local screen_x = this.width - _position.x;
|
||||||
local screen_y = screen.height - _position.y;
|
local screen_y = this.height - _position.y;
|
||||||
return { x = screen_x, y = screen_y };
|
return { x = screen_x, y = screen_y };
|
||||||
end
|
end
|
||||||
|
|
||||||
return { x = _position.x, y = _position.y };
|
return { x = _position.x, y = _position.y };
|
||||||
end
|
end
|
||||||
|
|
||||||
function screen.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
end
|
end
|
||||||
|
|
||||||
return screen;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local singletons = {};
|
local this = {};
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -28,208 +28,211 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
singletons.message_manager = nil;
|
this.message_manager = nil;
|
||||||
singletons.enemy_manager = nil;
|
this.enemy_manager = nil;
|
||||||
singletons.lobby_manager = nil;
|
this.lobby_manager = nil;
|
||||||
singletons.progress_manager = nil;
|
this.progress_manager = nil;
|
||||||
singletons.quest_manager = nil;
|
this.quest_manager = nil;
|
||||||
singletons.player_manager = nil;
|
this.player_manager = nil;
|
||||||
singletons.village_area_manager = nil;
|
this.village_area_manager = nil;
|
||||||
singletons.gui_manager = nil;
|
this.gui_manager = nil;
|
||||||
singletons.game_keyboard = nil;
|
this.game_keyboard = nil;
|
||||||
singletons.scene_manager = nil;
|
this.scene_manager = nil;
|
||||||
singletons.game_manager = nil;
|
this.game_manager = nil;
|
||||||
|
|
||||||
function singletons.init()
|
function this.init()
|
||||||
singletons.init_message_manager();
|
this.init_message_manager();
|
||||||
singletons.init_enemy_manager();
|
this.init_enemy_manager();
|
||||||
singletons.init_lobby_manager()
|
this.init_lobby_manager()
|
||||||
singletons.init_progress_manager();
|
this.init_progress_manager();
|
||||||
singletons.init_quest_manager();
|
this.init_quest_manager();
|
||||||
singletons.init_player_manager();
|
this.init_player_manager();
|
||||||
singletons.init_village_area_manager();
|
this.init_village_area_manager();
|
||||||
singletons.init_gui_manager();
|
this.init_gui_manager();
|
||||||
singletons.init_game_keyboard();
|
this.init_game_keyboard();
|
||||||
singletons.init_scene_manager();
|
this.init_scene_manager();
|
||||||
singletons.init_game_manager();
|
this.init_game_manager();
|
||||||
singletons.init_servant_manager();
|
this.init_servant_manager();
|
||||||
singletons.init_otomo_manager();
|
this.init_otomo_manager();
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_message_manager()
|
function this.init_message_manager()
|
||||||
if singletons.message_manager ~= nil then
|
if this.message_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.message_manager = sdk.get_managed_singleton("snow.gui.MessageManager");
|
this.message_manager = sdk.get_managed_singleton("snow.gui.MessageManager");
|
||||||
if singletons.message_manager == nil then
|
if this.message_manager == nil then
|
||||||
--log.error("[MHR Overlay] No message manager");
|
--log.error("[MHR Overlay] No message manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.message_manager;
|
return this.message_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_enemy_manager()
|
function this.init_enemy_manager()
|
||||||
if singletons.enemy_manager ~= nil then
|
if this.enemy_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.enemy_manager = sdk.get_managed_singleton("snow.enemy.EnemyManager");
|
this.enemy_manager = sdk.get_managed_singleton("snow.enemy.EnemyManager");
|
||||||
if singletons.enemy_manager == nil then
|
if this.enemy_manager == nil then
|
||||||
--log.error("[MHR Overlay] No enemy manager");
|
--log.error("[MHR Overlay] No enemy manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.enemy_manager;
|
return this.enemy_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_lobby_manager()
|
function this.init_lobby_manager()
|
||||||
if singletons.lobby_manager ~= nil then
|
if this.lobby_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.lobby_manager = sdk.get_managed_singleton("snow.LobbyManager");
|
this.lobby_manager = sdk.get_managed_singleton("snow.LobbyManager");
|
||||||
if singletons.lobby_manager == nil then
|
if this.lobby_manager == nil then
|
||||||
--log.error("[MHR Overlay] No lobby manager");
|
--log.error("[MHR Overlay] No lobby manager");
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.lobby_manager;
|
return this.lobby_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_progress_manager()
|
function this.init_progress_manager()
|
||||||
if singletons.progress_manager ~= nil then
|
if this.progress_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.progress_manager = sdk.get_managed_singleton("snow.progress.ProgressManager");
|
this.progress_manager = sdk.get_managed_singleton("snow.progress.ProgressManager");
|
||||||
if singletons.progress_manager == nil then
|
if this.progress_manager == nil then
|
||||||
--log.error("[MHR Overlay] No progress manager");
|
--log.error("[MHR Overlay] No progress manager");
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.progress_manager;
|
return this.progress_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_quest_manager()
|
function this.init_quest_manager()
|
||||||
if singletons.quest_manager ~= nil then
|
if this.quest_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.quest_manager = sdk.get_managed_singleton("snow.QuestManager");
|
this.quest_manager = sdk.get_managed_singleton("snow.QuestManager");
|
||||||
if singletons.quest_manager == nil then
|
if this.quest_manager == nil then
|
||||||
--log.error("[MHR Overlay] No quest manager");
|
--log.error("[MHR Overlay] No quest manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.quest_manager;
|
return this.quest_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_player_manager()
|
function this.init_player_manager()
|
||||||
if singletons.player_manager ~= nil then
|
if this.player_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.player_manager = sdk.get_managed_singleton("snow.player.PlayerManager");
|
this.player_manager = sdk.get_managed_singleton("snow.player.PlayerManager");
|
||||||
if singletons.player_manager == nil then
|
if this.player_manager == nil then
|
||||||
--log.error("[MHR Overlay] No player manager");
|
--log.error("[MHR Overlay] No player manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.player_manager;
|
return this.player_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_village_area_manager()
|
function this.init_village_area_manager()
|
||||||
if singletons.village_area_manager ~= nil then
|
if this.village_area_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.village_area_manager = sdk.get_managed_singleton("snow.VillageAreaManager");
|
this.village_area_manager = sdk.get_managed_singleton("snow.VillageAreaManager");
|
||||||
if singletons.village_area_manager == nil then
|
if this.village_area_manager == nil then
|
||||||
--log.error("[MHR Overlay] No village area manager");
|
--log.error("[MHR Overlay] No village area manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.village_area_manager;
|
return this.village_area_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_gui_manager()
|
function this.init_gui_manager()
|
||||||
if singletons.gui_manager ~= nil then
|
if this.gui_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.gui_manager = sdk.get_managed_singleton("snow.gui.GuiManager");
|
this.gui_manager = sdk.get_managed_singleton("snow.gui.GuiManager");
|
||||||
if singletons.gui_manager == nil then
|
if this.gui_manager == nil then
|
||||||
--log.error("[MHR Overlay] No gui manager");
|
--log.error("[MHR Overlay] No gui manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.gui_manager;
|
return this.gui_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_game_keyboard()
|
function this.init_game_keyboard()
|
||||||
if singletons.game_keyboard ~= nil then
|
if this.game_keyboard ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.game_keyboard = sdk.get_managed_singleton("snow.GameKeyboard");
|
this.game_keyboard = sdk.get_managed_singleton("snow.GameKeyboard");
|
||||||
if singletons.game_keyboard == nil then
|
if this.game_keyboard == nil then
|
||||||
--log.error("[MHR Overlay] No game keyboard");
|
--log.error("[MHR Overlay] No game keyboard");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.game_keyboard;
|
return this.game_keyboard;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_scene_manager()
|
function this.init_scene_manager()
|
||||||
if singletons.scene_manager ~= nil then
|
if this.scene_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.scene_manager = sdk.get_native_singleton("via.SceneManager");
|
this.scene_manager = sdk.get_native_singleton("via.SceneManager");
|
||||||
if singletons.scene_manager == nil then
|
if this.scene_manager == nil then
|
||||||
--log.error("[MHR Overlay] No enemy manager");
|
--log.error("[MHR Overlay] No enemy manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.scene_manager;
|
return this.scene_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_game_manager()
|
function this.init_game_manager()
|
||||||
if singletons.game_manager ~= nil then
|
if this.game_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.game_manager = sdk.get_managed_singleton("snow.SnowGameManager");
|
this.game_manager = sdk.get_managed_singleton("snow.SnowGameManager");
|
||||||
if singletons.game_manager == nil then
|
if this.game_manager == nil then
|
||||||
--log.error("[MHR Overlay] No enemy manager");
|
--log.error("[MHR Overlay] No enemy manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.game_manager;
|
return this.game_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_servant_manager()
|
function this.init_servant_manager()
|
||||||
if singletons.servant_manager ~= nil then
|
if this.servant_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.servant_manager = sdk.get_managed_singleton("snow.ai.ServantManager");
|
this.servant_manager = sdk.get_managed_singleton("snow.ai.ServantManager");
|
||||||
if singletons.servant_manager == nil then
|
if this.servant_manager == nil then
|
||||||
--log.error("[MHR Overlay] No enemy manager");
|
--log.error("[MHR Overlay] No enemy manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.servant_manager;
|
return this.servant_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_otomo_manager()
|
function this.init_otomo_manager()
|
||||||
if singletons.otomo_manager ~= nil then
|
if this.otomo_manager ~= nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
singletons.otomo_manager = sdk.get_managed_singleton("snow.otomo.OtomoManager");
|
this.otomo_manager = sdk.get_managed_singleton("snow.otomo.OtomoManager");
|
||||||
if singletons.otomo_manager == nil then
|
if this.otomo_manager == nil then
|
||||||
--log.error("[MHR Overlay] No enemy manager");
|
--log.error("[MHR Overlay] No enemy manager");
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons.otomo_manager;
|
return this.otomo_manager;
|
||||||
end
|
end
|
||||||
|
|
||||||
function singletons.init_module()
|
function this.init_module()
|
||||||
singletons.init();
|
this.init();
|
||||||
end
|
end
|
||||||
|
|
||||||
return singletons;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local time = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
@@ -36,24 +36,27 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
|
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
|
||||||
local get_quest_elapsed_time_min_method = quest_manager_type_def:get_method("getQuestElapsedTimeMin");
|
local get_quest_elapsed_time_min_method = quest_manager_type_def:get_method("getQuestElapsedTimeMin");
|
||||||
local get_quest_elapsed_time_sec_method = quest_manager_type_def:get_method("getQuestElapsedTimeSec");
|
local get_quest_elapsed_time_sec_method = quest_manager_type_def:get_method("getQuestElapsedTimeSec");
|
||||||
|
|
||||||
time.total_elapsed_seconds = 0;
|
this.total_elapsed_seconds = 0;
|
||||||
time.elapsed_minutes = 0;
|
this.elapsed_minutes = 0;
|
||||||
time.elapsed_seconds = 0;
|
this.elapsed_seconds = 0;
|
||||||
|
|
||||||
time.total_elapsed_script_seconds = 0;
|
this.total_elapsed_script_seconds = 0;
|
||||||
time.last_elapsed_script_seconds = 0;
|
this.last_elapsed_script_seconds = 0;
|
||||||
|
|
||||||
function time.update_script_time()
|
function this.update_script_time()
|
||||||
time.total_elapsed_script_seconds = os.clock();
|
this.total_elapsed_script_seconds = os.clock();
|
||||||
end
|
end
|
||||||
|
|
||||||
function time.tick()
|
function this.tick()
|
||||||
time.update_script_time();
|
this.update_script_time();
|
||||||
|
|
||||||
if singletons.quest_manager == nil then
|
if singletons.quest_manager == nil then
|
||||||
return;
|
return;
|
||||||
@@ -63,20 +66,20 @@ function time.tick()
|
|||||||
if quest_time_elapsed_minutes == nil then
|
if quest_time_elapsed_minutes == nil then
|
||||||
customization_menu.status = "No quest time elapsed minutes";
|
customization_menu.status = "No quest time elapsed minutes";
|
||||||
else
|
else
|
||||||
time.elapsed_minutes = quest_time_elapsed_minutes;
|
this.elapsed_minutes = quest_time_elapsed_minutes;
|
||||||
end
|
end
|
||||||
|
|
||||||
local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager);
|
local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager);
|
||||||
if quest_time_total_elapsed_seconds == nil then
|
if quest_time_total_elapsed_seconds == nil then
|
||||||
customization_menu.status = "No quest time total elapsed seconds";
|
customization_menu.status = "No quest time total elapsed seconds";
|
||||||
else
|
else
|
||||||
time.total_elapsed_seconds = quest_time_total_elapsed_seconds;
|
this.total_elapsed_seconds = quest_time_total_elapsed_seconds;
|
||||||
end
|
end
|
||||||
|
|
||||||
time.elapsed_seconds = quest_time_total_elapsed_seconds - quest_time_elapsed_minutes * 60;
|
this.elapsed_seconds = quest_time_total_elapsed_seconds - quest_time_elapsed_minutes * 60;
|
||||||
|
|
||||||
if time.total_elapsed_script_seconds - time.last_elapsed_script_seconds > 0.5 then
|
if this.total_elapsed_script_seconds - this.last_elapsed_script_seconds > 0.5 then
|
||||||
time.last_elapsed_script_seconds = time.total_elapsed_script_seconds;
|
this.last_elapsed_script_seconds = this.total_elapsed_script_seconds;
|
||||||
|
|
||||||
local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA;
|
local is_on_quest = quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA;
|
||||||
|
|
||||||
@@ -90,7 +93,7 @@ function time.tick()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function time.init_module()
|
function this.init_module()
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -100,4 +103,4 @@ function time.init_module()
|
|||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
end
|
end
|
||||||
|
|
||||||
return time;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local config = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local language;
|
local language;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
@@ -31,25 +31,28 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
config.version = "2.4.1";
|
this.version = "2.4.1";
|
||||||
|
|
||||||
config.config_folder = "MHR Overlay\\configs\\";
|
this.config_folder = "MHR Overlay\\configs\\";
|
||||||
config.current_config_value_file_name = "MHR Overlay\\config.json";
|
this.current_config_value_file_name = "MHR Overlay\\config.json";
|
||||||
|
|
||||||
config.current_config_name = nil;
|
this.current_config_name = nil;
|
||||||
config.current_config = nil;
|
this.current_config = nil;
|
||||||
|
|
||||||
config.config_names = {};
|
this.config_names = {};
|
||||||
config.configs = {};
|
this.configs = {};
|
||||||
|
|
||||||
config.default_config = nil;
|
this.default_config = nil;
|
||||||
|
|
||||||
local is_old_config_transferred = false;
|
local is_old_config_transferred = false;
|
||||||
|
|
||||||
function config.init_default()
|
function this.init_default()
|
||||||
config.default_config = {
|
this.default_config = {
|
||||||
version = config.version,
|
version = this.version,
|
||||||
|
|
||||||
global_settings = {
|
global_settings = {
|
||||||
language = "default",
|
language = "default",
|
||||||
@@ -5663,37 +5666,37 @@ function config.init_default()
|
|||||||
};
|
};
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.load_current_config_value()
|
function this.load_current_config_value()
|
||||||
local loaded_config = json.load_file(config.current_config_value_file_name);
|
local loaded_config = json.load_file(this.current_config_value_file_name);
|
||||||
if loaded_config ~= nil then
|
if loaded_config ~= nil then
|
||||||
if loaded_config.config == nil then
|
if loaded_config.config == nil then
|
||||||
log.info("[MHR Overlay] old config.json loaded successfully");
|
log.info("[MHR Overlay] old config.json loaded successfully");
|
||||||
|
|
||||||
local config_save = {
|
local config_save = {
|
||||||
config = config.current_config_name
|
config = this.current_config_name
|
||||||
};
|
};
|
||||||
|
|
||||||
config.current_config_name = "old_config";
|
this.current_config_name = "old_config";
|
||||||
config.current_config = table_helpers.merge(config.default_config, loaded_config);
|
this.current_config = utils.table.merge(this.default_config, loaded_config);
|
||||||
config.current_config.version = config.version;
|
this.current_config.version = this.version;
|
||||||
|
|
||||||
config.save(config.config_folder .. "old_config.json", config.current_config);
|
this.save(this.config_folder .. "old_config.json", this.current_config);
|
||||||
config.save_current_config_name();
|
this.save_current_config_name();
|
||||||
|
|
||||||
table.insert(config.config_names, "old_config");
|
table.insert(this.config_names, "old_config");
|
||||||
table.insert(config.configs, config.current_config);
|
table.insert(this.configs, this.current_config);
|
||||||
|
|
||||||
is_old_config_transferred = true;
|
is_old_config_transferred = true;
|
||||||
else
|
else
|
||||||
log.info("[MHR Overlay] config.json loaded successfully");
|
log.info("[MHR Overlay] config.json loaded successfully");
|
||||||
config.current_config_name = loaded_config.config;
|
this.current_config_name = loaded_config.config;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.error("[MHR Overlay] Failed to load config.json");
|
log.error("[MHR Overlay] Failed to load config.json");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.load_configs()
|
function this.load_configs()
|
||||||
local config_files = fs.glob([[MHR Overlay\\configs\\.*json]]);
|
local config_files = fs.glob([[MHR Overlay\\configs\\.*json]]);
|
||||||
|
|
||||||
if config_files == nil then
|
if config_files == nil then
|
||||||
@@ -5702,7 +5705,7 @@ function config.load_configs()
|
|||||||
|
|
||||||
for i, config_file_name in ipairs(config_files) do
|
for i, config_file_name in ipairs(config_files) do
|
||||||
|
|
||||||
local config_name = config_file_name:gsub(config.config_folder, ""):gsub(".json","");
|
local config_name = config_file_name:gsub(this.config_folder, ""):gsub(".json","");
|
||||||
|
|
||||||
if config_name == "old_config" and is_old_config_transferred then
|
if config_name == "old_config" and is_old_config_transferred then
|
||||||
goto continue;
|
goto continue;
|
||||||
@@ -5713,16 +5716,16 @@ function config.load_configs()
|
|||||||
log.info("[MHR Overlay] " .. config_name .. ".json loaded successfully");
|
log.info("[MHR Overlay] " .. config_name .. ".json loaded successfully");
|
||||||
|
|
||||||
|
|
||||||
local merged_config = table_helpers.merge(config.default_config, loaded_config);
|
local merged_config = utils.table.merge(this.default_config, loaded_config);
|
||||||
merged_config.version = config.version;
|
merged_config.version = this.version;
|
||||||
|
|
||||||
table.insert(config.config_names, config_name);
|
table.insert(this.config_names, config_name);
|
||||||
table.insert(config.configs, merged_config);
|
table.insert(this.configs, merged_config);
|
||||||
|
|
||||||
config.save(config_file_name, merged_config);
|
this.save(config_file_name, merged_config);
|
||||||
|
|
||||||
if config_name == config.current_config_name then
|
if config_name == this.current_config_name then
|
||||||
config.current_config = merged_config;
|
this.current_config = merged_config;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log.error("[MHR Overlay] Failed to load " .. config_name .. ".json");
|
log.error("[MHR Overlay] Failed to load " .. config_name .. ".json");
|
||||||
@@ -5731,29 +5734,29 @@ function config.load_configs()
|
|||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.current_config == nil then
|
if this.current_config == nil then
|
||||||
if #config.configs > 0 then
|
if #this.configs > 0 then
|
||||||
config.current_config_name = config.config_names[1];
|
this.current_config_name = this.config_names[1];
|
||||||
config.current_config = config.configs[1];
|
this.current_config = this.configs[1];
|
||||||
else
|
else
|
||||||
config.current_config_name = "default";
|
this.current_config_name = "default";
|
||||||
config.current_config = table_helpers.deep_copy(config.default_config);
|
this.current_config = utils.table.deep_copy(this.default_config);
|
||||||
|
|
||||||
table.insert(config.config_names, config.current_config_name);
|
table.insert(this.config_names, this.current_config_name);
|
||||||
table.insert(config.configs, config.current_config);
|
table.insert(this.configs, this.current_config);
|
||||||
|
|
||||||
config.save(config.current_config_name, config.current_config);
|
this.save(this.current_config_name, this.current_config);
|
||||||
end
|
end
|
||||||
|
|
||||||
config.save_current_config_name();
|
this.save_current_config_name();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.save_current_config_name()
|
function this.save_current_config_name()
|
||||||
config.save(config.current_config_value_file_name, { config = config.current_config_name });
|
this.save(this.current_config_value_file_name, { config = this.current_config_name });
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.save(file_name, config_table)
|
function this.save(file_name, config_table)
|
||||||
-- save current config to disk, replacing any existing file
|
-- save current config to disk, replacing any existing file
|
||||||
local success = json.dump_file(file_name, config_table);
|
local success = json.dump_file(file_name, config_table);
|
||||||
if success then
|
if success then
|
||||||
@@ -5763,63 +5766,63 @@ function config.save(file_name, config_table)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.save_current()
|
function this.save_current()
|
||||||
config.save(config.config_folder .. config.current_config_name .. ".json", config.current_config);
|
this.save(this.config_folder .. this.current_config_name .. ".json", this.current_config);
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.create_new(config_file_name, config_table)
|
function this.create_new(config_file_name, config_table)
|
||||||
table.insert(config.config_names, config_file_name);
|
table.insert(this.config_names, config_file_name);
|
||||||
table.insert(config.configs, config_table);
|
table.insert(this.configs, config_table);
|
||||||
|
|
||||||
config.save(config.config_folder .. config_file_name .. ".json", config_table);
|
this.save(this.config_folder .. config_file_name .. ".json", config_table);
|
||||||
|
|
||||||
config.current_config_name = config_file_name;
|
this.current_config_name = config_file_name;
|
||||||
config.current_config = config_table;
|
this.current_config = config_table;
|
||||||
|
|
||||||
config.save_current_config_name();
|
this.save_current_config_name();
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.new(config_name)
|
function this.new(config_name)
|
||||||
if config_name == "" then
|
if config_name == "" then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
local new_config = table_helpers.deep_copy(config.default_config);
|
local new_config = utils.table.deep_copy(this.default_config);
|
||||||
|
|
||||||
config.create_new(config_name, new_config);
|
this.create_new(config_name, new_config);
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.duplicate(config_name)
|
function this.duplicate(config_name)
|
||||||
if config_name == "" then
|
if config_name == "" then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
local new_config = table_helpers.deep_copy(config.current_config);
|
local new_config = utils.table.deep_copy(this.current_config);
|
||||||
|
|
||||||
config.create_new(config_name, new_config);
|
this.create_new(config_name, new_config);
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.reset()
|
function this.reset()
|
||||||
config.current_config = table_helpers.deep_copy(config.default_config);
|
this.current_config = utils.table.deep_copy(this.default_config);
|
||||||
|
|
||||||
local index = table_helpers.find_index(config.config_names, config.current_config_name);
|
local index = utils.table.find_index(this.config_names, this.current_config_name);
|
||||||
config.configs[index] = config.current_config;
|
this.configs[index] = this.current_config;
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.update(index)
|
function this.update(index)
|
||||||
config.current_config = config.configs[index];
|
this.current_config = this.configs[index];
|
||||||
config.save_current_config_name();
|
this.save_current_config_name();
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
|
|
||||||
config.init_default();
|
this.init_default();
|
||||||
config.load_current_config_value();
|
this.load_current_config_value();
|
||||||
config.load_configs();
|
this.load_configs();
|
||||||
|
|
||||||
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, this.current_config.global_settings.language, false));
|
||||||
end
|
end
|
||||||
|
|
||||||
return config;
|
return this;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local debug = {};
|
local this = {};
|
||||||
|
|
||||||
debug.enabled = false;
|
this.enabled = false;
|
||||||
|
|
||||||
return debug;
|
return this;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local language = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -30,13 +30,16 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
language.language_folder = "MHR Overlay\\languages\\";
|
this.language_folder = "MHR Overlay\\languages\\";
|
||||||
|
|
||||||
language.current_language = {};
|
this.current_language = {};
|
||||||
|
|
||||||
|
|
||||||
language.default_language = {
|
this.default_language = {
|
||||||
font_name = "NotoSansKR-Bold.otf",
|
font_name = "NotoSansKR-Bold.otf",
|
||||||
parts = {
|
parts = {
|
||||||
head = "Head",
|
head = "Head",
|
||||||
@@ -121,7 +124,9 @@ language.default_language = {
|
|||||||
chest = "Chest",
|
chest = "Chest",
|
||||||
shell = "Shell",
|
shell = "Shell",
|
||||||
|
|
||||||
thundersacs = "Thundersacs"
|
thundersacs = "Thundersacs",
|
||||||
|
|
||||||
|
amatsu_unknown = "?"
|
||||||
},
|
},
|
||||||
|
|
||||||
ailments = {
|
ailments = {
|
||||||
@@ -504,10 +509,10 @@ language.default_language = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
language.language_names = { "default"};
|
this.language_names = { "default"};
|
||||||
language.languages = { language.default_language };
|
this.languages = { this.default_language };
|
||||||
|
|
||||||
function language.load()
|
function this.load()
|
||||||
local language_files = fs.glob([[MHR Overlay\\languages\\.*json]]);
|
local language_files = fs.glob([[MHR Overlay\\languages\\.*json]]);
|
||||||
|
|
||||||
if language_files == nil then
|
if language_files == nil then
|
||||||
@@ -515,18 +520,18 @@ function language.load()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for i, language_file_name in ipairs(language_files) do
|
for i, language_file_name in ipairs(language_files) do
|
||||||
local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json","");
|
local language_name = language_file_name:gsub(this.language_folder, ""):gsub(".json","");
|
||||||
|
|
||||||
local loaded_language = json.load_file(language_file_name);
|
local loaded_language = json.load_file(language_file_name);
|
||||||
if loaded_language ~= nil then
|
if loaded_language ~= nil then
|
||||||
|
|
||||||
log.info("[MHR Overlay] " .. language_file_name .. ".json loaded successfully");
|
log.info("[MHR Overlay] " .. language_file_name .. ".json loaded successfully");
|
||||||
table.insert(language.language_names, language_name);
|
table.insert(this.language_names, language_name);
|
||||||
|
|
||||||
local merged_language = table_helpers.merge(language.default_language, loaded_language);
|
local merged_language = utils.table.merge(this.default_language, loaded_language);
|
||||||
table.insert(language.languages, merged_language);
|
table.insert(this.languages, merged_language);
|
||||||
|
|
||||||
language.save(language_file_name, merged_language);
|
this.save(language_file_name, merged_language);
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -535,7 +540,7 @@ function language.load()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function language.save(file_name, language_table)
|
function this.save(file_name, language_table)
|
||||||
local success = json.dump_file(file_name, language_table);
|
local success = json.dump_file(file_name, language_table);
|
||||||
if success then
|
if success then
|
||||||
log.info("[MHR Overlay] " .. file_name .. " saved successfully");
|
log.info("[MHR Overlay] " .. file_name .. " saved successfully");
|
||||||
@@ -544,20 +549,20 @@ function language.save(file_name, language_table)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function language.save_default()
|
function this.save_default()
|
||||||
language.save(language.language_folder .. "en-us.json", language.default_language);
|
this.save(this.language_folder .. "en-us.json", this.default_language);
|
||||||
end
|
end
|
||||||
|
|
||||||
function language.update(index)
|
function this.update(index)
|
||||||
language.current_language = language.languages[index];
|
this.current_language = this.languages[index];
|
||||||
end
|
end
|
||||||
|
|
||||||
function language.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
|
|
||||||
language.save_default();
|
this.save_default();
|
||||||
language.load();
|
this.load();
|
||||||
language.current_language = language.default_language;
|
this.current_language = this.default_language;
|
||||||
end
|
end
|
||||||
|
|
||||||
return language;
|
return this;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
local part_names = {};
|
local this = {};
|
||||||
|
|
||||||
local language;
|
local language;
|
||||||
local table_helpers;
|
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -31,11 +30,14 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
part_names.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function part_names.init()
|
function this.init()
|
||||||
part_names.list = {
|
this.list = {
|
||||||
[98] = -- Great Izuchi 98
|
[98] = -- Great Izuchi 98
|
||||||
{
|
{
|
||||||
language.current_language.parts.head,
|
language.current_language.parts.head,
|
||||||
@@ -883,11 +885,45 @@ function part_names.init()
|
|||||||
language.current_language.parts.hind_legs,
|
language.current_language.parts.hind_legs,
|
||||||
language.current_language.parts.chest
|
language.current_language.parts.chest
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--SUNBREAK TITLE UPDATE 5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[2120] = -- Risen Shagaru Magala 2120
|
||||||
|
{
|
||||||
|
language.current_language.parts.head,
|
||||||
|
language.current_language.parts.torso,
|
||||||
|
language.current_language.parts.wings,
|
||||||
|
language.current_language.parts.wingclaws,
|
||||||
|
language.current_language.parts.forelegs,
|
||||||
|
language.current_language.parts.hind_legs,
|
||||||
|
language.current_language.parts.tail
|
||||||
|
},
|
||||||
|
|
||||||
|
[58] = -- Amatsu 58
|
||||||
|
{
|
||||||
|
language.current_language.parts.head,
|
||||||
|
language.current_language.parts.left_arm,
|
||||||
|
language.current_language.parts.right_arm,
|
||||||
|
language.current_language.parts.abdomen,
|
||||||
|
language.current_language.parts.tail,
|
||||||
|
language.current_language.parts.back,
|
||||||
|
language.current_language.parts.amatsu_unknown,
|
||||||
|
language.current_language.parts.left_leg,
|
||||||
|
language.current_language.parts.right_leg
|
||||||
|
},
|
||||||
};
|
};
|
||||||
end
|
end
|
||||||
|
|
||||||
function part_names.get_part_name(monster_id, part_id)
|
function this.get_part_name(monster_id, part_id)
|
||||||
local monster_parts = part_names.list[monster_id];
|
local monster_parts = this.list[monster_id];
|
||||||
if monster_parts == nil then
|
if monster_parts == nil then
|
||||||
return "?";
|
return "?";
|
||||||
end
|
end
|
||||||
@@ -896,11 +932,10 @@ function part_names.get_part_name(monster_id, part_id)
|
|||||||
return part_name;
|
return part_name;
|
||||||
end
|
end
|
||||||
|
|
||||||
function part_names.init_module()
|
function this.init_module()
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
|
|
||||||
part_names.init();
|
this.init();
|
||||||
end
|
end
|
||||||
|
|
||||||
return part_names;
|
return this;
|
||||||
|
|||||||
@@ -1,194 +0,0 @@
|
|||||||
local table_helpers = {};
|
|
||||||
|
|
||||||
local sdk = sdk;
|
|
||||||
local tostring = tostring;
|
|
||||||
local pairs = pairs;
|
|
||||||
local ipairs = ipairs;
|
|
||||||
local tonumber = tonumber;
|
|
||||||
local require = require;
|
|
||||||
local pcall = pcall;
|
|
||||||
local table = table;
|
|
||||||
local string = string;
|
|
||||||
local Vector3f = Vector3f;
|
|
||||||
local d2d = d2d;
|
|
||||||
local math = math;
|
|
||||||
local json = json;
|
|
||||||
local log = log;
|
|
||||||
local fs = fs;
|
|
||||||
local next = next;
|
|
||||||
local type = type;
|
|
||||||
local setmetatable = setmetatable;
|
|
||||||
local getmetatable = getmetatable;
|
|
||||||
local assert = assert;
|
|
||||||
local select = select;
|
|
||||||
local coroutine = coroutine;
|
|
||||||
local utf8 = utf8;
|
|
||||||
local re = re;
|
|
||||||
local imgui = imgui;
|
|
||||||
local draw = draw;
|
|
||||||
local Vector2f = Vector2f;
|
|
||||||
local reframework = reframework;
|
|
||||||
|
|
||||||
function table_helpers.deep_copy(original, copies)
|
|
||||||
copies = copies or {};
|
|
||||||
local original_type = type(original);
|
|
||||||
local copy;
|
|
||||||
if original_type == "table" then
|
|
||||||
if copies[original] then
|
|
||||||
copy = copies[original];
|
|
||||||
else
|
|
||||||
copy = {};
|
|
||||||
copies[original] = copy;
|
|
||||||
for original_key, original_value in next, original, nil do
|
|
||||||
copy[table_helpers.deep_copy(original_key, copies)] = table_helpers.deep_copy(original_value,copies);
|
|
||||||
end
|
|
||||||
setmetatable(copy, table_helpers.deep_copy(getmetatable(original), copies));
|
|
||||||
end
|
|
||||||
else -- number, string, boolean, etc
|
|
||||||
copy = original;
|
|
||||||
end
|
|
||||||
return copy;
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.find_index(table_, value, nullable)
|
|
||||||
for i = 1, #table_ do
|
|
||||||
if table_[i] == value then
|
|
||||||
return i;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not nullable then
|
|
||||||
return 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil;
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.merge(...)
|
|
||||||
local tables_to_merge = { ... };
|
|
||||||
assert(#tables_to_merge > 1, "There should be at least two tables to merge them");
|
|
||||||
|
|
||||||
for key, table_ in ipairs(tables_to_merge) do
|
|
||||||
assert(type(table_) == "table", string.format("Expected a table as function parameter %d", key));
|
|
||||||
end
|
|
||||||
|
|
||||||
local result = table_helpers.deep_copy(tables_to_merge[1]);
|
|
||||||
|
|
||||||
for i = 2, #tables_to_merge do
|
|
||||||
local from = tables_to_merge[i];
|
|
||||||
for key, value in pairs(from) do
|
|
||||||
if type(value) == "table" then
|
|
||||||
result[key] = result[key] or {};
|
|
||||||
assert(type(result[key]) == "table", string.format("Expected a table: '%s'", key));
|
|
||||||
result[key] = table_helpers.merge(result[key], value);
|
|
||||||
else
|
|
||||||
result[key] = value;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return result;
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.tostring(table_)
|
|
||||||
if type(table_) == "number" or type(table_) == "boolean" or type(table_) == "string" then
|
|
||||||
return tostring(table_);
|
|
||||||
end
|
|
||||||
|
|
||||||
if table_helpers.is_empty(table_) then
|
|
||||||
return "{}";
|
|
||||||
end
|
|
||||||
|
|
||||||
local cache = {};
|
|
||||||
local stack = {};
|
|
||||||
local output = {};
|
|
||||||
local depth = 1;
|
|
||||||
local output_str = "{\n";
|
|
||||||
|
|
||||||
while true do
|
|
||||||
local size = 0;
|
|
||||||
for k,v in pairs(table_) do
|
|
||||||
size = size + 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
local cur_index = 1;
|
|
||||||
for k,v in pairs(table_) do
|
|
||||||
if cache[table_] == nil or cur_index >= cache[table_] then
|
|
||||||
|
|
||||||
if string.find(output_str, "}", output_str:len()) then
|
|
||||||
output_str = output_str .. ",\n";
|
|
||||||
elseif not string.find(output_str, "\n", output_str:len()) then
|
|
||||||
output_str = output_str .. "\n";
|
|
||||||
end
|
|
||||||
|
|
||||||
-- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
|
|
||||||
table.insert(output,output_str);
|
|
||||||
output_str = "";
|
|
||||||
|
|
||||||
local key;
|
|
||||||
if type(k) == "number" or type(k) == "boolean" then
|
|
||||||
key = "[" .. tostring(k) .. "]";
|
|
||||||
else
|
|
||||||
key = "['" .. tostring(k) .. "']";
|
|
||||||
end
|
|
||||||
|
|
||||||
if type(v) == "number" or type(v) == "boolean" then
|
|
||||||
output_str = output_str .. string.rep('\t', depth) .. key .. " = "..tostring(v);
|
|
||||||
elseif type(v) == "table" then
|
|
||||||
output_str = output_str .. string.rep('\t', depth) .. key .. " = {\n";
|
|
||||||
table.insert(stack, table_);
|
|
||||||
table.insert(stack, v);
|
|
||||||
cache[table_] = cur_index + 1;
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
output_str = output_str .. string.rep('\t', depth) .. key .. " = '" .. tostring(v) .. "'";
|
|
||||||
end
|
|
||||||
|
|
||||||
if cur_index == size then
|
|
||||||
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
|
||||||
else
|
|
||||||
output_str = output_str .. ",";
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- close the table
|
|
||||||
if cur_index == size then
|
|
||||||
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
cur_index = cur_index + 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
if size == 0 then
|
|
||||||
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
|
||||||
end
|
|
||||||
|
|
||||||
if #stack > 0 then
|
|
||||||
table_ = stack[#stack];
|
|
||||||
stack[#stack] = nil;
|
|
||||||
depth = cache[table_] == nil and depth + 1 or depth - 1;
|
|
||||||
else
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
|
|
||||||
table.insert(output, output_str);
|
|
||||||
output_str = table.concat(output);
|
|
||||||
|
|
||||||
return output_str;
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.tostringln(table_)
|
|
||||||
return "\n" .. table_helpers.tostring(table_);
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.is_empty(table_)
|
|
||||||
return next(table_) == nil;
|
|
||||||
end
|
|
||||||
|
|
||||||
function table_helpers.init_module()
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
return table_helpers;
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
local unicode_helpers = {};
|
|
||||||
|
|
||||||
local sdk = sdk;
|
|
||||||
local tostring = tostring;
|
|
||||||
local pairs = pairs;
|
|
||||||
local ipairs = ipairs;
|
|
||||||
local tonumber = tonumber;
|
|
||||||
local require = require;
|
|
||||||
local pcall = pcall;
|
|
||||||
local table = table;
|
|
||||||
local string = string;
|
|
||||||
local Vector3f = Vector3f;
|
|
||||||
local d2d = d2d;
|
|
||||||
local math = math;
|
|
||||||
local json = json;
|
|
||||||
local log = log;
|
|
||||||
local fs = fs;
|
|
||||||
local next = next;
|
|
||||||
local type = type;
|
|
||||||
local setmetatable = setmetatable;
|
|
||||||
local getmetatable = getmetatable;
|
|
||||||
local assert = assert;
|
|
||||||
local select = select;
|
|
||||||
local coroutine = coroutine;
|
|
||||||
local utf8 = utf8;
|
|
||||||
local re = re;
|
|
||||||
local imgui = imgui;
|
|
||||||
local draw = draw;
|
|
||||||
local Vector2f = Vector2f;
|
|
||||||
local reframework = reframework;
|
|
||||||
|
|
||||||
-- https://github.com/blitmap/lua-utf8-simple/blob/master/utf8_simple.lua
|
|
||||||
|
|
||||||
-- ABNF from RFC 3629
|
|
||||||
--
|
|
||||||
-- UTF8-octets = *( UTF8-char )
|
|
||||||
-- UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
|
|
||||||
-- UTF8-1 = %x00-7F
|
|
||||||
-- UTF8-2 = %xC2-DF UTF8-tail
|
|
||||||
-- UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
|
|
||||||
-- %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
|
|
||||||
-- UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
|
|
||||||
-- %xF4 %x80-8F 2( UTF8-tail )
|
|
||||||
-- UTF8-tail = %x80-BF
|
|
||||||
|
|
||||||
-- 0xxxxxxx | 007F (127)
|
|
||||||
-- 110xxxxx 10xxxxxx | 07FF (2047)
|
|
||||||
-- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535)
|
|
||||||
-- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111)
|
|
||||||
|
|
||||||
local pattern = "[%z\1-\127\194-\244][\128-\191]*";
|
|
||||||
|
|
||||||
-- helper function
|
|
||||||
function unicode_helpers.relative_position(position, length)
|
|
||||||
if position < 0 then
|
|
||||||
position = length + position + 1;
|
|
||||||
end
|
|
||||||
return position;
|
|
||||||
end
|
|
||||||
|
|
||||||
-- THE MEAT
|
|
||||||
|
|
||||||
-- maps f over s's utf8 characters f can accept args: (visual_index, utf8_character, byte_index)
|
|
||||||
function unicode_helpers.map(s, f, no_subs)
|
|
||||||
local i = 0;
|
|
||||||
|
|
||||||
if no_subs then
|
|
||||||
for b, e in s:gmatch("()" .. pattern .. "()") do
|
|
||||||
i = i + 1;
|
|
||||||
local c = e - b;
|
|
||||||
f(i, c, b);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for b, c in s:gmatch("()(" .. pattern .. ")") do
|
|
||||||
i = i + 1;
|
|
||||||
f(i, c, b);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- THE REST
|
|
||||||
|
|
||||||
-- returns the number of characters in a UTF-8 string
|
|
||||||
function unicode_helpers.len(s)
|
|
||||||
-- count the number of non-continuing bytes
|
|
||||||
return select(2, s:gsub('[^\128-\193]', ''));
|
|
||||||
end
|
|
||||||
|
|
||||||
-- replace all utf8 chars with mapping
|
|
||||||
function unicode_helpers.replace(s, map)
|
|
||||||
return s:gsub(pattern, map);
|
|
||||||
end
|
|
||||||
|
|
||||||
-- reverse a utf8 string
|
|
||||||
function unicode_helpers.reverse(s)
|
|
||||||
-- reverse the individual greater-than-single-byte characters
|
|
||||||
s = s:gsub(pattern,function (c)
|
|
||||||
return #c > 1 and c:reverse()
|
|
||||||
end);
|
|
||||||
|
|
||||||
return s:reverse();
|
|
||||||
end
|
|
||||||
|
|
||||||
-- strip non-ascii characters from a utf8 string
|
|
||||||
function unicode_helpers.strip(s)
|
|
||||||
return s:gsub(pattern, function(c)
|
|
||||||
return #c > 1 and '';
|
|
||||||
end);
|
|
||||||
end
|
|
||||||
|
|
||||||
-- generator for the above -- to iterate over all utf8 chars
|
|
||||||
function unicode_helpers.chars(s, no_subs)
|
|
||||||
return coroutine.wrap(function()
|
|
||||||
return unicode_helpers.map(s, coroutine.yield, no_subs);
|
|
||||||
end);
|
|
||||||
end
|
|
||||||
|
|
||||||
-- like string.sub() but i, j are utf8 strings
|
|
||||||
-- a utf8-safe string.sub()
|
|
||||||
function unicode_helpers.sub(str, i, j)
|
|
||||||
if coroutine == nil then
|
|
||||||
return str;
|
|
||||||
end
|
|
||||||
|
|
||||||
local l = utf8.len(str);
|
|
||||||
|
|
||||||
i = unicode_helpers.relative_position(i, l);
|
|
||||||
j = j and unicode_helpers.relative_position(j, l) or l;
|
|
||||||
|
|
||||||
if i < 1 then
|
|
||||||
i = 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
if j > l then
|
|
||||||
j = l;
|
|
||||||
end
|
|
||||||
|
|
||||||
if i > j then
|
|
||||||
return "";
|
|
||||||
end
|
|
||||||
|
|
||||||
local diff = j - i;
|
|
||||||
local iterator = unicode_helpers.chars(str, true);
|
|
||||||
|
|
||||||
-- advance up to i
|
|
||||||
for _ = 1, i - 1 do
|
|
||||||
iterator();
|
|
||||||
end
|
|
||||||
|
|
||||||
local c, b = select(2, iterator());
|
|
||||||
|
|
||||||
-- i and j are the same, single-charaacter sub
|
|
||||||
if diff == 0 then
|
|
||||||
return string.sub(str, b, b + c - 1);
|
|
||||||
end
|
|
||||||
|
|
||||||
i = b;
|
|
||||||
|
|
||||||
-- advance up to j
|
|
||||||
for _ = 1, diff - 1 do
|
|
||||||
iterator();
|
|
||||||
end
|
|
||||||
|
|
||||||
c, b = select(2, iterator());
|
|
||||||
|
|
||||||
return string.sub(str, i, b + c - 1);
|
|
||||||
end
|
|
||||||
|
|
||||||
function unicode_helpers.init_module()
|
|
||||||
end
|
|
||||||
|
|
||||||
return unicode_helpers;
|
|
||||||
419
reframework/autorun/MHR_Overlay/Misc/utils.lua
Normal file
419
reframework/autorun/MHR_Overlay/Misc/utils.lua
Normal file
@@ -0,0 +1,419 @@
|
|||||||
|
local this = {};
|
||||||
|
|
||||||
|
local sdk = sdk;
|
||||||
|
local tostring = tostring;
|
||||||
|
local pairs = pairs;
|
||||||
|
local ipairs = ipairs;
|
||||||
|
local tonumber = tonumber;
|
||||||
|
local require = require;
|
||||||
|
local pcall = pcall;
|
||||||
|
local table = table;
|
||||||
|
local string = string;
|
||||||
|
local Vector3f = Vector3f;
|
||||||
|
local d2d = d2d;
|
||||||
|
local math = math;
|
||||||
|
local json = json;
|
||||||
|
local log = log;
|
||||||
|
local fs = fs;
|
||||||
|
local next = next;
|
||||||
|
local type = type;
|
||||||
|
local setmetatable = setmetatable;
|
||||||
|
local getmetatable = getmetatable;
|
||||||
|
local assert = assert;
|
||||||
|
local select = select;
|
||||||
|
local coroutine = coroutine;
|
||||||
|
local utf8 = utf8;
|
||||||
|
local re = re;
|
||||||
|
local imgui = imgui;
|
||||||
|
local draw = draw;
|
||||||
|
local Vector2f = Vector2f;
|
||||||
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
|
local table_tostring;
|
||||||
|
local deep_copy;
|
||||||
|
local merge;
|
||||||
|
local is_empty;
|
||||||
|
local unicode_map;
|
||||||
|
local unicode_relative_position;
|
||||||
|
local unicode_chars;
|
||||||
|
|
||||||
|
this.table = {};
|
||||||
|
this.number = {};
|
||||||
|
this.string = {};
|
||||||
|
this.vec2 = {};
|
||||||
|
this.vec3 = {};
|
||||||
|
this.vec4 = {};
|
||||||
|
this.math = {};
|
||||||
|
this.unicode = {};
|
||||||
|
|
||||||
|
function this.table.tostring(table_)
|
||||||
|
if type(table_) == "number" or type(table_) == "boolean" or type(table_) == "string" then
|
||||||
|
return tostring(table_);
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_empty(table_) then
|
||||||
|
return "{}";
|
||||||
|
end
|
||||||
|
|
||||||
|
local cache = {};
|
||||||
|
local stack = {};
|
||||||
|
local output = {};
|
||||||
|
local depth = 1;
|
||||||
|
local output_str = "{\n";
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local size = 0;
|
||||||
|
for k,v in pairs(table_) do
|
||||||
|
size = size + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
local cur_index = 1;
|
||||||
|
for k,v in pairs(table_) do
|
||||||
|
if cache[table_] == nil or cur_index >= cache[table_] then
|
||||||
|
|
||||||
|
if string.find(output_str, "}", output_str:len()) then
|
||||||
|
output_str = output_str .. ",\n";
|
||||||
|
elseif not string.find(output_str, "\n", output_str:len()) then
|
||||||
|
output_str = output_str .. "\n";
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
|
||||||
|
table.insert(output,output_str);
|
||||||
|
output_str = "";
|
||||||
|
|
||||||
|
local key;
|
||||||
|
if type(k) == "number" or type(k) == "boolean" then
|
||||||
|
key = "[" .. tostring(k) .. "]";
|
||||||
|
else
|
||||||
|
key = "['" .. tostring(k) .. "']";
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(v) == "number" or type(v) == "boolean" then
|
||||||
|
output_str = output_str .. string.rep('\t', depth) .. key .. " = "..tostring(v);
|
||||||
|
elseif type(v) == "table" then
|
||||||
|
output_str = output_str .. string.rep('\t', depth) .. key .. " = {\n";
|
||||||
|
table.insert(stack, table_);
|
||||||
|
table.insert(stack, v);
|
||||||
|
cache[table_] = cur_index + 1;
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
output_str = output_str .. string.rep('\t', depth) .. key .. " = '" .. tostring(v) .. "'";
|
||||||
|
end
|
||||||
|
|
||||||
|
if cur_index == size then
|
||||||
|
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
||||||
|
else
|
||||||
|
output_str = output_str .. ",";
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- close the table
|
||||||
|
if cur_index == size then
|
||||||
|
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
cur_index = cur_index + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
if size == 0 then
|
||||||
|
output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}";
|
||||||
|
end
|
||||||
|
|
||||||
|
if #stack > 0 then
|
||||||
|
table_ = stack[#stack];
|
||||||
|
stack[#stack] = nil;
|
||||||
|
depth = cache[table_] == nil and depth + 1 or depth - 1;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
|
||||||
|
table.insert(output, output_str);
|
||||||
|
output_str = table.concat(output);
|
||||||
|
|
||||||
|
return output_str;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.table.tostringln(table_)
|
||||||
|
return "\n" .. table_tostring(table_);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.table.is_empty(table_)
|
||||||
|
return next(table_) == nil;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.table.deep_copy(original, copies)
|
||||||
|
copies = copies or {};
|
||||||
|
local original_type = type(original);
|
||||||
|
local copy;
|
||||||
|
if original_type == "table" then
|
||||||
|
if copies[original] then
|
||||||
|
copy = copies[original];
|
||||||
|
else
|
||||||
|
copy = {};
|
||||||
|
copies[original] = copy;
|
||||||
|
for original_key, original_value in next, original, nil do
|
||||||
|
copy[deep_copy(original_key, copies)] = deep_copy(original_value,copies);
|
||||||
|
end
|
||||||
|
setmetatable(copy, deep_copy(getmetatable(original), copies));
|
||||||
|
end
|
||||||
|
else -- number, string, boolean, etc
|
||||||
|
copy = original;
|
||||||
|
end
|
||||||
|
return copy;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.table.find_index(table_, value, nullable)
|
||||||
|
for i = 1, #table_ do
|
||||||
|
if table_[i] == value then
|
||||||
|
return i;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not nullable then
|
||||||
|
return 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.table.merge(...)
|
||||||
|
local tables_to_merge = { ... };
|
||||||
|
assert(#tables_to_merge > 1, "There should be at least two tables to merge them");
|
||||||
|
|
||||||
|
for key, table_ in ipairs(tables_to_merge) do
|
||||||
|
assert(type(table_) == "table", string.format("Expected a table as function parameter %d", key));
|
||||||
|
end
|
||||||
|
|
||||||
|
local result = deep_copy(tables_to_merge[1]);
|
||||||
|
|
||||||
|
for i = 2, #tables_to_merge do
|
||||||
|
local from = tables_to_merge[i];
|
||||||
|
for key, value in pairs(from) do
|
||||||
|
if type(value) == "table" then
|
||||||
|
result[key] = result[key] or {};
|
||||||
|
assert(type(result[key]) == "table", string.format("Expected a table: '%s'", key));
|
||||||
|
result[key] = merge(result[key], value);
|
||||||
|
else
|
||||||
|
result[key] = value;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return result;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.number.is_NaN(value)
|
||||||
|
return tostring(value) == tostring(0/0);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.number.round(value)
|
||||||
|
return math.floor(value + 0.5);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.string.trim(str)
|
||||||
|
return str:match("^%s*(.-)%s*$");
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.string.starts_with(str, pattern)
|
||||||
|
return str:find("^" .. pattern) ~= nil;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.vec2.tostring(vector2f)
|
||||||
|
return string.format("<%f, %f>", vector2f.x, vector2f.y);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.vec2.random(distance)
|
||||||
|
distance = distance or 1;
|
||||||
|
local radians = math.random() * math.pi * 2;
|
||||||
|
return Vector2f.new(
|
||||||
|
distance * math.cos(radians),
|
||||||
|
distance * math.sin(radians)
|
||||||
|
);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.vec3.tostring(vector3f)
|
||||||
|
return string.format("<%f, %f, %f>", vector3f.x, vector3f.y, vector3f.z);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.vec4.tostring(vector4f)
|
||||||
|
return string.format("<%f, %f, %f, %f>", vector4f.x, vector4f.y, vector4f.z, vector4f.w);
|
||||||
|
end
|
||||||
|
|
||||||
|
--- When called without arguments, returns a pseudo-random float with uniform distribution in the range [0,1). When called with two floats min and max, math.random returns a pseudo-random float with uniform distribution in the range [min, max). The call .random(max) is equivalent to .random(1, max)
|
||||||
|
---@param min number
|
||||||
|
---@param max number
|
||||||
|
---@return number
|
||||||
|
function this.math.random(min, max)
|
||||||
|
if min == nil and max == nil then
|
||||||
|
return math.random();
|
||||||
|
end
|
||||||
|
|
||||||
|
if max == nil then
|
||||||
|
return max * math.random();
|
||||||
|
end
|
||||||
|
|
||||||
|
return min + (max - min) * math.random();
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.math.sign(value)
|
||||||
|
return (value >= 0 and 1) or -1;
|
||||||
|
end
|
||||||
|
function this.math.round(value, bracket)
|
||||||
|
bracket = bracket or 1;
|
||||||
|
return math.floor(value / bracket + this.math.sign(value) * 0.5) * bracket;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- https://github.com/blitmap/lua-utf8-simple/blob/master/utf8_simple.lua
|
||||||
|
|
||||||
|
-- ABNF from RFC 3629
|
||||||
|
--
|
||||||
|
-- UTF8-octets = *( UTF8-char )
|
||||||
|
-- UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
|
||||||
|
-- UTF8-1 = %x00-7F
|
||||||
|
-- UTF8-2 = %xC2-DF UTF8-tail
|
||||||
|
-- UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
|
||||||
|
-- %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
|
||||||
|
-- UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
|
||||||
|
-- %xF4 %x80-8F 2( UTF8-tail )
|
||||||
|
-- UTF8-tail = %x80-BF
|
||||||
|
|
||||||
|
-- 0xxxxxxx | 007F (127)
|
||||||
|
-- 110xxxxx 10xxxxxx | 07FF (2047)
|
||||||
|
-- 1110xxxx 10xxxxxx 10xxxxxx | FFFF (65535)
|
||||||
|
-- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 10FFFF (1114111)
|
||||||
|
|
||||||
|
local pattern = "[%z\1-\127\194-\244][\128-\191]*";
|
||||||
|
|
||||||
|
-- helper function
|
||||||
|
function this.unicode.relative_position(position, length)
|
||||||
|
if position < 0 then
|
||||||
|
position = length + position + 1;
|
||||||
|
end
|
||||||
|
return position;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- THE MEAT
|
||||||
|
|
||||||
|
-- maps f over s's utf8 characters f can accept args: (visual_index, utf8_character, byte_index)
|
||||||
|
function this.unicode.map(s, f, no_subs)
|
||||||
|
local i = 0;
|
||||||
|
|
||||||
|
if no_subs then
|
||||||
|
for b, e in s:gmatch("()" .. pattern .. "()") do
|
||||||
|
i = i + 1;
|
||||||
|
local c = e - b;
|
||||||
|
f(i, c, b);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for b, c in s:gmatch("()(" .. pattern .. ")") do
|
||||||
|
i = i + 1;
|
||||||
|
f(i, c, b);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- THE REST
|
||||||
|
|
||||||
|
-- returns the number of characters in a UTF-8 string
|
||||||
|
function this.unicode.len(s)
|
||||||
|
-- count the number of non-continuing bytes
|
||||||
|
return select(2, s:gsub('[^\128-\193]', ''));
|
||||||
|
end
|
||||||
|
|
||||||
|
-- replace all utf8 chars with mapping
|
||||||
|
function this.unicode.replace(s, map)
|
||||||
|
return s:gsub(pattern, map);
|
||||||
|
end
|
||||||
|
|
||||||
|
-- reverse a utf8 string
|
||||||
|
function this.unicode.reverse(s)
|
||||||
|
-- reverse the individual greater-than-single-byte characters
|
||||||
|
s = s:gsub(pattern, function (c)
|
||||||
|
return #c > 1 and c:reverse()
|
||||||
|
end);
|
||||||
|
|
||||||
|
return s:reverse();
|
||||||
|
end
|
||||||
|
|
||||||
|
-- strip non-ascii characters from a utf8 string
|
||||||
|
function this.unicode.strip(s)
|
||||||
|
return s:gsub(pattern, function(c)
|
||||||
|
return #c > 1 and '';
|
||||||
|
end);
|
||||||
|
end
|
||||||
|
|
||||||
|
-- generator for the above -- to iterate over all utf8 chars
|
||||||
|
function this.unicode.chars(s, no_subs)
|
||||||
|
return coroutine.wrap(function()
|
||||||
|
return unicode_map(s, coroutine.yield, no_subs);
|
||||||
|
end);
|
||||||
|
end
|
||||||
|
|
||||||
|
-- like string.sub() but i, j are utf8 strings
|
||||||
|
-- a utf8-safe string.sub()
|
||||||
|
function this.unicode.sub(str, i, j)
|
||||||
|
if coroutine == nil then
|
||||||
|
return str;
|
||||||
|
end
|
||||||
|
|
||||||
|
local l = utf8.len(str);
|
||||||
|
|
||||||
|
i = unicode_relative_position(i, l);
|
||||||
|
j = j and unicode_relative_position(j, l) or l;
|
||||||
|
|
||||||
|
if i < 1 then
|
||||||
|
i = 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
if j > l then
|
||||||
|
j = l;
|
||||||
|
end
|
||||||
|
|
||||||
|
if i > j then
|
||||||
|
return "";
|
||||||
|
end
|
||||||
|
|
||||||
|
local diff = j - i;
|
||||||
|
local iterator = unicode_chars(str, true);
|
||||||
|
|
||||||
|
-- advance up to i
|
||||||
|
for _ = 1, i - 1 do
|
||||||
|
iterator();
|
||||||
|
end
|
||||||
|
|
||||||
|
local c, b = select(2, iterator());
|
||||||
|
|
||||||
|
-- i and j are the same, single-charaacter sub
|
||||||
|
if diff == 0 then
|
||||||
|
return string.sub(str, b, b + c - 1);
|
||||||
|
end
|
||||||
|
|
||||||
|
i = b;
|
||||||
|
|
||||||
|
-- advance up to j
|
||||||
|
for _ = 1, diff - 1 do
|
||||||
|
iterator();
|
||||||
|
end
|
||||||
|
|
||||||
|
c, b = select(2, iterator());
|
||||||
|
|
||||||
|
return string.sub(str, i, b + c - 1);
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.init_module()
|
||||||
|
end
|
||||||
|
|
||||||
|
table_tostring = this.table.tostring;
|
||||||
|
deep_copy = this.table.deep_copy;
|
||||||
|
merge = this.table.merge;
|
||||||
|
is_empty = this.table.is_empty;
|
||||||
|
unicode_map = this.unicode.map;
|
||||||
|
unicode_relative_position = this.unicode.relative_position;
|
||||||
|
unicode_chars = this.unicode.chars;
|
||||||
|
|
||||||
|
return this;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local ailment_buildup = {};
|
local this = {};
|
||||||
|
|
||||||
local players;
|
local players;
|
||||||
local language;
|
local language;
|
||||||
@@ -8,7 +8,6 @@ local ailment_buildup_UI_entity;
|
|||||||
local time;
|
local time;
|
||||||
local small_monster;
|
local small_monster;
|
||||||
local large_monster;
|
local large_monster;
|
||||||
local table_helpers;
|
|
||||||
local drawing;
|
local drawing;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
@@ -39,8 +38,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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)
|
function this.draw(monster, ailment_buildup_UI, cached_config, ailment_buildups_position_on_screen, opacity_scale)
|
||||||
|
|
||||||
local cached_config = cached_config.ailment_buildups;
|
local cached_config = cached_config.ailment_buildups;
|
||||||
local cached_damage_meter_UI_config = config.current_config.damage_meter_UI;
|
local cached_damage_meter_UI_config = config.current_config.damage_meter_UI;
|
||||||
@@ -229,7 +231,7 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_buildup.init_module()
|
function this.init_module()
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
@@ -238,8 +240,7 @@ function ailment_buildup.init_module()
|
|||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailment_buildup;
|
return this;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
local ailment_hook = {};
|
local this = {};
|
||||||
|
|
||||||
local small_monster;
|
local small_monster;
|
||||||
local large_monster;
|
local large_monster;
|
||||||
local config;
|
local config;
|
||||||
local ailments;
|
local ailments;
|
||||||
local table_helpers;
|
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -34,6 +33,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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 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");
|
local on_poison_activate_proc_method = enemy_poison_damage_param_type_def:get_method("onActivateProc");
|
||||||
@@ -58,7 +60,7 @@ local blast_param_type = blast_param_field:get_type();
|
|||||||
local blast_damage_method = blast_param_type:get_method("get_BlastDamage");
|
local blast_damage_method = blast_param_type:get_method("get_BlastDamage");
|
||||||
local blast_adjust_rate_method = blast_param_type:get_method("get_BlastDamageAdjustRateByEnemyLv");
|
local blast_adjust_rate_method = blast_param_type:get_method("get_BlastDamageAdjustRateByEnemyLv");
|
||||||
|
|
||||||
function ailment_hook.poison_proc(poison_param)
|
function this.poison_proc(poison_param)
|
||||||
if poison_param == nil then
|
if poison_param == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -86,7 +88,7 @@ function ailment_hook.poison_proc(poison_param)
|
|||||||
ailments.clear_ailment_contribution(monster, ailments.poison_id);
|
ailments.clear_ailment_contribution(monster, ailments.poison_id);
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_hook.blast_proc(blast_param)
|
function this.blast_proc(blast_param)
|
||||||
if blast_param == nil then
|
if blast_param == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -116,7 +118,7 @@ function ailment_hook.blast_proc(blast_param)
|
|||||||
ailments.clear_ailment_contribution(monster, ailments.blast_id);
|
ailments.clear_ailment_contribution(monster, ailments.blast_id);
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_hook.stock_damage()
|
function this.stock_damage()
|
||||||
for enemy, monster in pairs(large_monster.list) do
|
for enemy, monster in pairs(large_monster.list) do
|
||||||
local damage_param = damage_param_field:get_data(enemy);
|
local damage_param = damage_param_field:get_data(enemy);
|
||||||
if damage_param == nil then
|
if damage_param == nil then
|
||||||
@@ -142,30 +144,29 @@ function ailment_hook.stock_damage()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_hook.init_module()
|
function this.init_module()
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
ailments = require("MHR_Overlay.Monsters.ailments");
|
ailments = require("MHR_Overlay.Monsters.ailments");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
|
|
||||||
sdk.hook(stock_damage_method, function(args)
|
sdk.hook(stock_damage_method, function(args)
|
||||||
pcall(ailment_hook.stock_damage, sdk.to_managed_object(args[2]));
|
pcall(this.stock_damage, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(on_poison_activate_proc_method, function(args)
|
sdk.hook(on_poison_activate_proc_method, function(args)
|
||||||
pcall(ailment_hook.poison_proc, sdk.to_managed_object(args[2]));
|
pcall(this.poison_proc, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(on_blast_activate_proc_method, function(args)
|
sdk.hook(on_blast_activate_proc_method, function(args)
|
||||||
pcall(ailment_hook.blast_proc, sdk.to_managed_object(args[2]));
|
pcall(this.blast_proc, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailment_hook;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local ailments = {};
|
local this = {};
|
||||||
|
|
||||||
local players;
|
local players;
|
||||||
local language;
|
local language;
|
||||||
@@ -8,7 +8,6 @@ local ailment_buildup_UI_entity;
|
|||||||
local time;
|
local time;
|
||||||
local small_monster;
|
local small_monster;
|
||||||
local large_monster;
|
local large_monster;
|
||||||
local table_helpers;
|
|
||||||
local non_players;
|
local non_players;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
@@ -39,6 +38,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
--0 Paralyze
|
--0 Paralyze
|
||||||
--1 Sleep
|
--1 Sleep
|
||||||
@@ -58,29 +60,29 @@ local reframework = reframework;
|
|||||||
--15 Koyashi
|
--15 Koyashi
|
||||||
--16 SteelFang
|
--16 SteelFang
|
||||||
|
|
||||||
ailments.paralyze_id = 0;
|
this.paralyze_id = 0;
|
||||||
ailments.sleep_id = 1;
|
this.sleep_id = 1;
|
||||||
ailments.stun_id = 2;
|
this.stun_id = 2;
|
||||||
ailments.flash_id = 3;
|
this.flash_id = 3;
|
||||||
ailments.poison_id = 4;
|
this.poison_id = 4;
|
||||||
ailments.blast_id = 5;
|
this.blast_id = 5;
|
||||||
ailments.exhaust_id = 6;
|
this.exhaust_id = 6;
|
||||||
ailments.ride_id = 7;
|
this.ride_id = 7;
|
||||||
ailments.water_id = 8;
|
this.water_id = 8;
|
||||||
ailments.fire_id = 9;
|
this.fire_id = 9;
|
||||||
ailments.ice_id = 10;
|
this.ice_id = 10;
|
||||||
ailments.thunder_id = 11;
|
this.thunder_id = 11;
|
||||||
ailments.fall_trap_id = 12;
|
this.fall_trap_id = 12;
|
||||||
ailments.shock_trap_id = 13;
|
this.shock_trap_id = 13;
|
||||||
ailments.capture_id = 14 --tranq bomb
|
this.capture_id = 14 --tranq bomb
|
||||||
ailments.koyashi_id = 15; --dung bomb
|
this.koyashi_id = 15; --dung bomb
|
||||||
ailments.steel_fang_id = 16;
|
this.steel_fang_id = 16;
|
||||||
|
|
||||||
ailments.fall_quick_sand_id = 17;
|
this.fall_quick_sand_id = 17;
|
||||||
ailments.fall_otomo_trap_id = 18;
|
this.fall_otomo_trap_id = 18;
|
||||||
ailments.shock_otomo_trap_id = 19;
|
this.shock_otomo_trap_id = 19;
|
||||||
|
|
||||||
function ailments.new(_ailments, ailment_id)
|
function this.new(_ailments, ailment_id)
|
||||||
local new_ailment = {}
|
local new_ailment = {}
|
||||||
new_ailment = {};
|
new_ailment = {};
|
||||||
|
|
||||||
@@ -103,140 +105,140 @@ function ailments.new(_ailments, ailment_id)
|
|||||||
|
|
||||||
new_ailment.last_change_time = time.total_elapsed_script_seconds;
|
new_ailment.last_change_time = time.total_elapsed_script_seconds;
|
||||||
|
|
||||||
if ailment_id == ailments.paralyze_id then
|
if ailment_id == this.paralyze_id then
|
||||||
new_ailment.name = language.current_language.ailments.paralysis;
|
new_ailment.name = language.current_language.ailments.paralysis;
|
||||||
elseif ailment_id == ailments.sleep_id then
|
elseif ailment_id == this.sleep_id then
|
||||||
new_ailment.name = language.current_language.ailments.sleep;
|
new_ailment.name = language.current_language.ailments.sleep;
|
||||||
elseif ailment_id == ailments.stun_id then
|
elseif ailment_id == this.stun_id then
|
||||||
new_ailment.name = language.current_language.ailments.stun;
|
new_ailment.name = language.current_language.ailments.stun;
|
||||||
elseif ailment_id == ailments.flash_id then
|
elseif ailment_id == this.flash_id then
|
||||||
new_ailment.name = language.current_language.ailments.flash;
|
new_ailment.name = language.current_language.ailments.flash;
|
||||||
elseif ailment_id == ailments.poison_id then
|
elseif ailment_id == this.poison_id then
|
||||||
new_ailment.name = language.current_language.ailments.poison;
|
new_ailment.name = language.current_language.ailments.poison;
|
||||||
elseif ailment_id == ailments.blast_id then
|
elseif ailment_id == this.blast_id then
|
||||||
new_ailment.name = language.current_language.ailments.blast;
|
new_ailment.name = language.current_language.ailments.blast;
|
||||||
elseif ailment_id == ailments.exhaust_id then
|
elseif ailment_id == this.exhaust_id then
|
||||||
new_ailment.name = language.current_language.ailments.exhaust;
|
new_ailment.name = language.current_language.ailments.exhaust;
|
||||||
elseif ailment_id == ailments.ride_id then
|
elseif ailment_id == this.ride_id then
|
||||||
new_ailment.name = language.current_language.ailments.ride;
|
new_ailment.name = language.current_language.ailments.ride;
|
||||||
elseif ailment_id == ailments.water_id then
|
elseif ailment_id == this.water_id then
|
||||||
new_ailment.name = language.current_language.ailments.waterblight;
|
new_ailment.name = language.current_language.ailments.waterblight;
|
||||||
elseif ailment_id == ailments.fire_id then
|
elseif ailment_id == this.fire_id then
|
||||||
new_ailment.name = language.current_language.ailments.fireblight;
|
new_ailment.name = language.current_language.ailments.fireblight;
|
||||||
elseif ailment_id == ailments.ice_id then
|
elseif ailment_id == this.ice_id then
|
||||||
new_ailment.name = language.current_language.ailments.iceblight;
|
new_ailment.name = language.current_language.ailments.iceblight;
|
||||||
elseif ailment_id == ailments.thunder_id then
|
elseif ailment_id == this.thunder_id then
|
||||||
new_ailment.name = language.current_language.ailments.thunderblight;
|
new_ailment.name = language.current_language.ailments.thunderblight;
|
||||||
elseif ailment_id == ailments.fall_trap_id then
|
elseif ailment_id == this.fall_trap_id then
|
||||||
new_ailment.name = language.current_language.ailments.fall_trap;
|
new_ailment.name = language.current_language.ailments.fall_trap;
|
||||||
elseif ailment_id == ailments.shock_trap_id then
|
elseif ailment_id == this.shock_trap_id then
|
||||||
new_ailment.name = language.current_language.ailments.shock_trap;
|
new_ailment.name = language.current_language.ailments.shock_trap;
|
||||||
elseif ailment_id == ailments.capture_id then
|
elseif ailment_id == this.capture_id then
|
||||||
new_ailment.name = language.current_language.ailments.tranq_bomb;
|
new_ailment.name = language.current_language.ailments.tranq_bomb;
|
||||||
elseif ailment_id == ailments.koyashi_id then
|
elseif ailment_id == this.koyashi_id then
|
||||||
new_ailment.name = language.current_language.ailments.dung_bomb;
|
new_ailment.name = language.current_language.ailments.dung_bomb;
|
||||||
elseif ailment_id == ailments.steel_fang_id then
|
elseif ailment_id == this.steel_fang_id then
|
||||||
new_ailment.name = language.current_language.ailments.steel_fang;
|
new_ailment.name = language.current_language.ailments.steel_fang;
|
||||||
elseif ailment_id == ailments.fall_quick_sand_id then
|
elseif ailment_id == this.fall_quick_sand_id then
|
||||||
new_ailment.name = language.current_language.ailments.quick_sand;
|
new_ailment.name = language.current_language.ailments.quick_sand;
|
||||||
elseif ailment_id == ailments.fall_otomo_trap_id then
|
elseif ailment_id == this.fall_otomo_trap_id then
|
||||||
new_ailment.name = language.current_language.ailments.fall_otomo_trap;
|
new_ailment.name = language.current_language.ailments.fall_otomo_trap;
|
||||||
elseif ailment_id == ailments.shock_otomo_trap_id then
|
elseif ailment_id == this.shock_otomo_trap_id then
|
||||||
new_ailment.name = language.current_language.ailments.shock_otomo_trap;
|
new_ailment.name = language.current_language.ailments.shock_otomo_trap;
|
||||||
end
|
end
|
||||||
|
|
||||||
_ailments[ailment_id] = new_ailment;
|
_ailments[ailment_id] = new_ailment;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.init_ailments()
|
function this.init_ailments()
|
||||||
local _ailments = {};
|
local _ailments = {};
|
||||||
|
|
||||||
ailments.new(_ailments, ailments.paralyze_id);
|
this.new(_ailments, this.paralyze_id);
|
||||||
ailments.new(_ailments, ailments.sleep_id);
|
this.new(_ailments, this.sleep_id);
|
||||||
ailments.new(_ailments, ailments.stun_id);
|
this.new(_ailments, this.stun_id);
|
||||||
ailments.new(_ailments, ailments.flash_id);
|
this.new(_ailments, this.flash_id);
|
||||||
ailments.new(_ailments, ailments.poison_id);
|
this.new(_ailments, this.poison_id);
|
||||||
ailments.new(_ailments, ailments.blast_id);
|
this.new(_ailments, this.blast_id);
|
||||||
ailments.new(_ailments, ailments.exhaust_id);
|
this.new(_ailments, this.exhaust_id);
|
||||||
ailments.new(_ailments, ailments.ride_id);
|
this.new(_ailments, this.ride_id);
|
||||||
ailments.new(_ailments, ailments.water_id);
|
this.new(_ailments, this.water_id);
|
||||||
ailments.new(_ailments, ailments.fire_id);
|
this.new(_ailments, this.fire_id);
|
||||||
ailments.new(_ailments, ailments.ice_id);
|
this.new(_ailments, this.ice_id);
|
||||||
ailments.new(_ailments, ailments.thunder_id);
|
this.new(_ailments, this.thunder_id);
|
||||||
|
|
||||||
ailments.new(_ailments, ailments.fall_trap_id);
|
this.new(_ailments, this.fall_trap_id);
|
||||||
ailments.new(_ailments, ailments.shock_trap_id);
|
this.new(_ailments, this.shock_trap_id);
|
||||||
ailments.new(_ailments, ailments.capture_id); --tranq bomb
|
this.new(_ailments, this.capture_id); --tranq bomb
|
||||||
ailments.new(_ailments, ailments.koyashi_id); --dung bomb
|
this.new(_ailments, this.koyashi_id); --dung bomb
|
||||||
ailments.new(_ailments, ailments.steel_fang_id);
|
this.new(_ailments, this.steel_fang_id);
|
||||||
--ailments.new(_ailments, ailments.fall_quick_sand_id);
|
--ailments.new(_ailments, ailments.fall_quick_sand_id);
|
||||||
--ailments.new(_ailments, ailments.fall_otomo_trap_id);
|
--ailments.new(_ailments, ailments.fall_otomo_trap_id);
|
||||||
--ailments.new(_ailments, ailments.shock_otomo_trap_id);
|
--ailments.new(_ailments, ailments.shock_otomo_trap_id);
|
||||||
|
|
||||||
_ailments[ailments.poison_id].buildup = {};
|
_ailments[this.poison_id].buildup = {};
|
||||||
_ailments[ailments.poison_id].buildup_share = {};
|
_ailments[this.poison_id].buildup_share = {};
|
||||||
_ailments[ailments.poison_id].cached_buildup_share = {};
|
_ailments[this.poison_id].cached_buildup_share = {};
|
||||||
|
|
||||||
_ailments[ailments.blast_id].buildup = {};
|
_ailments[this.blast_id].buildup = {};
|
||||||
_ailments[ailments.blast_id].buildup_share = {};
|
_ailments[this.blast_id].buildup_share = {};
|
||||||
|
|
||||||
_ailments[ailments.stun_id].buildup = {};
|
_ailments[this.stun_id].buildup = {};
|
||||||
_ailments[ailments.stun_id].buildup_share = {};
|
_ailments[this.stun_id].buildup_share = {};
|
||||||
|
|
||||||
_ailments[ailments.poison_id].otomo_buildup = {};
|
_ailments[this.poison_id].otomo_buildup = {};
|
||||||
_ailments[ailments.poison_id].otomo_buildup_share = {};
|
_ailments[this.poison_id].otomo_buildup_share = {};
|
||||||
_ailments[ailments.poison_id].cached_otomo_buildup_share = {};
|
_ailments[this.poison_id].cached_otomo_buildup_share = {};
|
||||||
|
|
||||||
_ailments[ailments.blast_id].otomo_buildup = {};
|
_ailments[this.blast_id].otomo_buildup = {};
|
||||||
_ailments[ailments.blast_id].otomo_buildup_share = {};
|
_ailments[this.blast_id].otomo_buildup_share = {};
|
||||||
|
|
||||||
_ailments[ailments.stun_id].otomo_buildup = {};
|
_ailments[this.stun_id].otomo_buildup = {};
|
||||||
_ailments[ailments.stun_id].otomo_buildup_share = {};
|
_ailments[this.stun_id].otomo_buildup_share = {};
|
||||||
|
|
||||||
return _ailments;
|
return _ailments;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.init_ailment_names(_ailments)
|
function this.init_ailment_names(_ailments)
|
||||||
for ailment_id, ailment in pairs(_ailments) do
|
for ailment_id, ailment in pairs(_ailments) do
|
||||||
if ailment_id == ailments.paralyze_id then
|
if ailment_id == this.paralyze_id then
|
||||||
ailment.name = language.current_language.ailments.paralysis;
|
ailment.name = language.current_language.ailments.paralysis;
|
||||||
elseif ailment_id == ailments.sleep_id then
|
elseif ailment_id == this.sleep_id then
|
||||||
ailment.name = language.current_language.ailments.sleep;
|
ailment.name = language.current_language.ailments.sleep;
|
||||||
elseif ailment_id == ailments.stun_id then
|
elseif ailment_id == this.stun_id then
|
||||||
ailment.name = language.current_language.ailments.stun;
|
ailment.name = language.current_language.ailments.stun;
|
||||||
elseif ailment_id == ailments.flash_id then
|
elseif ailment_id == this.flash_id then
|
||||||
ailment.name = language.current_language.ailments.flash;
|
ailment.name = language.current_language.ailments.flash;
|
||||||
elseif ailment_id == ailments.poison_id then
|
elseif ailment_id == this.poison_id then
|
||||||
ailment.name = language.current_language.ailments.poison;
|
ailment.name = language.current_language.ailments.poison;
|
||||||
elseif ailment_id == ailments.blast_id then
|
elseif ailment_id == this.blast_id then
|
||||||
ailment.name = language.current_language.ailments.blast;
|
ailment.name = language.current_language.ailments.blast;
|
||||||
elseif ailment_id == ailments.exhaust_id then
|
elseif ailment_id == this.exhaust_id then
|
||||||
ailment.name = language.current_language.ailments.exhaust;
|
ailment.name = language.current_language.ailments.exhaust;
|
||||||
elseif ailment_id == ailments.ride_id then
|
elseif ailment_id == this.ride_id then
|
||||||
ailment.name = language.current_language.ailments.ride;
|
ailment.name = language.current_language.ailments.ride;
|
||||||
elseif ailment_id == ailments.water_id then
|
elseif ailment_id == this.water_id then
|
||||||
ailment.name = language.current_language.ailments.waterblight;
|
ailment.name = language.current_language.ailments.waterblight;
|
||||||
elseif ailment_id == ailments.fire_id then
|
elseif ailment_id == this.fire_id then
|
||||||
ailment.name = language.current_language.ailments.fireblight;
|
ailment.name = language.current_language.ailments.fireblight;
|
||||||
elseif ailment_id == ailments.ice_id then
|
elseif ailment_id == this.ice_id then
|
||||||
ailment.name = language.current_language.ailments.iceblight;
|
ailment.name = language.current_language.ailments.iceblight;
|
||||||
elseif ailment_id == ailments.thunder_id then
|
elseif ailment_id == this.thunder_id then
|
||||||
ailment.name = language.current_language.ailments.thunderblight;
|
ailment.name = language.current_language.ailments.thunderblight;
|
||||||
elseif ailment_id == ailments.fall_trap_id then
|
elseif ailment_id == this.fall_trap_id then
|
||||||
ailment.name = language.current_language.ailments.fall_trap;
|
ailment.name = language.current_language.ailments.fall_trap;
|
||||||
elseif ailment_id == ailments.shock_trap_id then
|
elseif ailment_id == this.shock_trap_id then
|
||||||
ailment.name = language.current_language.ailments.shock_trap;
|
ailment.name = language.current_language.ailments.shock_trap;
|
||||||
elseif ailment_id == ailments.capture_id then
|
elseif ailment_id == this.capture_id then
|
||||||
ailment.name = language.current_language.ailments.tranq_bomb;
|
ailment.name = language.current_language.ailments.tranq_bomb;
|
||||||
elseif ailment_id == ailments.koyashi_id then
|
elseif ailment_id == this.koyashi_id then
|
||||||
ailment.name = language.current_language.ailments.dung_bomb;
|
ailment.name = language.current_language.ailments.dung_bomb;
|
||||||
elseif ailment_id == ailments.steel_fang_id then
|
elseif ailment_id == this.steel_fang_id then
|
||||||
ailment.name = language.current_language.ailments.steel_fang;
|
ailment.name = language.current_language.ailments.steel_fang;
|
||||||
elseif ailment_id == ailments.fall_quick_sand_id then
|
elseif ailment_id == this.fall_quick_sand_id then
|
||||||
ailment.name = language.current_language.ailments.quick_sand;
|
ailment.name = language.current_language.ailments.quick_sand;
|
||||||
elseif ailment_id == ailments.fall_otomo_trap_id then
|
elseif ailment_id == this.fall_otomo_trap_id then
|
||||||
ailment.name = language.current_language.ailments.fall_otomo_trap;
|
ailment.name = language.current_language.ailments.fall_otomo_trap;
|
||||||
elseif ailment_id == ailments.shock_otomo_trap_id then
|
elseif ailment_id == this.shock_otomo_trap_id then
|
||||||
ailment.name = language.current_language.ailments.shock_otomo_trap;
|
ailment.name = language.current_language.ailments.shock_otomo_trap;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -272,7 +274,7 @@ local system_array_type_def = sdk.find_type_definition("System.Array");
|
|||||||
local length_method = system_array_type_def:get_method("get_Length");
|
local length_method = system_array_type_def:get_method("get_Length");
|
||||||
local get_value_method = system_array_type_def:get_method("GetValue(System.Int32)");
|
local get_value_method = system_array_type_def:get_method("GetValue(System.Int32)");
|
||||||
|
|
||||||
function ailments.update_ailments(enemy, monster)
|
function this.update_ailments(enemy, monster)
|
||||||
if enemy == nil then
|
if enemy == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -281,7 +283,7 @@ function ailments.update_ailments(enemy, monster)
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
ailments.update_stun_poison_blast_ailments(monster, damage_param);
|
this.update_stun_poison_blast_ailments(monster, damage_param);
|
||||||
|
|
||||||
if not config.current_config.large_monster_UI.dynamic.ailments.visibility
|
if not config.current_config.large_monster_UI.dynamic.ailments.visibility
|
||||||
and not config.current_config.large_monster_UI.static.ailments.visibility
|
and not config.current_config.large_monster_UI.static.ailments.visibility
|
||||||
@@ -305,7 +307,7 @@ function ailments.update_ailments(enemy, monster)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for id = 0, condition_param_array_length - 1 do
|
for id = 0, condition_param_array_length - 1 do
|
||||||
if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then
|
if id == this.stun_id or id == this.poison_id or id == this.blast_id then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -314,29 +316,29 @@ function ailments.update_ailments(enemy, monster)
|
|||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|
||||||
ailments.update_ailment(monster, ailment_param, id);
|
this.update_ailment(monster, ailment_param, id);
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.update_stun_poison_blast_ailments(monster, damage_param)
|
function this.update_stun_poison_blast_ailments(monster, damage_param)
|
||||||
local stun_param = stun_param_field:get_data(damage_param);
|
local stun_param = stun_param_field:get_data(damage_param);
|
||||||
if stun_param ~= nil then
|
if stun_param ~= nil then
|
||||||
ailments.update_ailment(monster, stun_param, ailments.stun_id);
|
this.update_ailment(monster, stun_param, this.stun_id);
|
||||||
end
|
end
|
||||||
|
|
||||||
local poison_param = poison_param_field:get_data(damage_param);
|
local poison_param = poison_param_field:get_data(damage_param);
|
||||||
if poison_param ~= nil then
|
if poison_param ~= nil then
|
||||||
ailments.update_ailment(monster, poison_param, ailments.poison_id);
|
this.update_ailment(monster, poison_param, this.poison_id);
|
||||||
end
|
end
|
||||||
|
|
||||||
local blast_param = blast_param_field:get_data(damage_param);
|
local blast_param = blast_param_field:get_data(damage_param);
|
||||||
if blast_param ~= nil then
|
if blast_param ~= nil then
|
||||||
ailments.update_ailment(monster, blast_param, ailments.blast_id);
|
this.update_ailment(monster, blast_param, this.blast_id);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.update_ailment(monster, ailment_param, id)
|
function this.update_ailment(monster, ailment_param, id)
|
||||||
local is_enable = get_is_enable_method:call(ailment_param);
|
local is_enable = get_is_enable_method:call(ailment_param);
|
||||||
local activate_count_array = get_activate_count_method:call(ailment_param);
|
local activate_count_array = get_activate_count_method:call(ailment_param);
|
||||||
local buildup_array = get_stock_method:call(ailment_param);
|
local buildup_array = get_stock_method:call(ailment_param);
|
||||||
@@ -411,17 +413,17 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if is_enable ~= monster.ailments[id].is_enable then
|
if is_enable ~= monster.ailments[id].is_enable then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].is_enable = is_enable;
|
monster.ailments[id].is_enable = is_enable;
|
||||||
|
|
||||||
if activate_count ~= nil then
|
if activate_count ~= nil then
|
||||||
if activate_count ~= monster.ailments[id].activate_count then
|
if activate_count ~= monster.ailments[id].activate_count then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
|
|
||||||
if id == ailments.stun_id then
|
if id == this.stun_id then
|
||||||
ailments.clear_ailment_contribution(monster, ailments.stun_id);
|
this.clear_ailment_contribution(monster, this.stun_id);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -430,7 +432,7 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
|
|
||||||
if buildup ~= nil then
|
if buildup ~= nil then
|
||||||
if buildup ~= monster.ailments[id].total_buildup then
|
if buildup ~= monster.ailments[id].total_buildup then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].total_buildup = buildup;
|
monster.ailments[id].total_buildup = buildup;
|
||||||
@@ -438,7 +440,7 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
|
|
||||||
if buildup_limit ~= nil then
|
if buildup_limit ~= nil then
|
||||||
if buildup_limit ~= monster.ailments[id].buildup_limit then
|
if buildup_limit ~= monster.ailments[id].buildup_limit then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].buildup_limit = buildup_limit;
|
monster.ailments[id].buildup_limit = buildup_limit;
|
||||||
@@ -450,7 +452,7 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
|
|
||||||
if timer ~= nil then
|
if timer ~= nil then
|
||||||
if timer ~= monster.ailments[id].timer then
|
if timer ~= monster.ailments[id].timer then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].timer = timer;
|
monster.ailments[id].timer = timer;
|
||||||
@@ -458,7 +460,7 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
|
|
||||||
if is_active ~= nil then
|
if is_active ~= nil then
|
||||||
if is_active ~= monster.ailments[id].is_active then
|
if is_active ~= monster.ailments[id].is_active then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].is_active = is_active;
|
monster.ailments[id].is_active = is_active;
|
||||||
@@ -466,7 +468,7 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
|
|
||||||
if duration ~= nil and not monster.ailments[id].is_active then
|
if duration ~= nil and not monster.ailments[id].is_active then
|
||||||
if duration ~= monster.ailments[id].duration then
|
if duration ~= monster.ailments[id].duration then
|
||||||
ailments.update_last_change_time(monster, id);
|
this.update_last_change_time(monster, id);
|
||||||
end
|
end
|
||||||
|
|
||||||
monster.ailments[id].duration = duration;
|
monster.ailments[id].duration = duration;
|
||||||
@@ -493,12 +495,12 @@ function ailments.update_ailment(monster, ailment_param, id)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.update_last_change_time(monster, id)
|
function this.update_last_change_time(monster, id)
|
||||||
monster.ailments[id].last_change_time = time.total_elapsed_script_seconds;
|
monster.ailments[id].last_change_time = time.total_elapsed_script_seconds;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Code by coavins
|
-- Code by coavins
|
||||||
function ailments.update_poison(monster, poison_param)
|
function this.update_poison(monster, poison_param)
|
||||||
if monster == nil then
|
if monster == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -509,95 +511,95 @@ function ailments.update_poison(monster, poison_param)
|
|||||||
if is_damage then
|
if is_damage then
|
||||||
local poison_damage = poison_damage_field:get_data(poison_param);
|
local poison_damage = poison_damage_field:get_data(poison_param);
|
||||||
|
|
||||||
ailments.apply_ailment_damage(monster, ailments.poison_id, poison_damage);
|
this.apply_ailment_damage(monster, this.poison_id, poison_damage);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.draw(monster, ailment_UI, cached_config, ailments_position_on_screen, opacity_scale)
|
function this.draw(monster, ailment_UI, cached_config, ailments_position_on_screen, opacity_scale)
|
||||||
local cached_config = cached_config.ailments;
|
local cached_config = cached_config.ailments;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
--sort parts here
|
--sort parts here
|
||||||
local displayed_ailments = {};
|
local displayed_ailments = {};
|
||||||
for id, ailment in pairs(monster.ailments) do
|
for id, ailment in pairs(monster.ailments) do
|
||||||
if id == ailments.paralyze_id then
|
if id == this.paralyze_id then
|
||||||
if not cached_config.filter.paralysis then
|
if not cached_config.filter.paralysis then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.sleep_id then
|
elseif id == this.sleep_id then
|
||||||
if not cached_config.filter.sleep then
|
if not cached_config.filter.sleep then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.stun_id then
|
elseif id == this.stun_id then
|
||||||
if not cached_config.filter.stun then
|
if not cached_config.filter.stun then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.flash_id then
|
elseif id == this.flash_id then
|
||||||
if not cached_config.filter.flash then
|
if not cached_config.filter.flash then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.poison_id then
|
elseif id == this.poison_id then
|
||||||
if not cached_config.filter.poison then
|
if not cached_config.filter.poison then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.blast_id then
|
elseif id == this.blast_id then
|
||||||
if not cached_config.filter.blast then
|
if not cached_config.filter.blast then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.exhaust_id then
|
elseif id == this.exhaust_id then
|
||||||
if not cached_config.filter.exhaust then
|
if not cached_config.filter.exhaust then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.ride_id then
|
elseif id == this.ride_id then
|
||||||
if not cached_config.filter.ride then
|
if not cached_config.filter.ride then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.water_id then
|
elseif id == this.water_id then
|
||||||
if not cached_config.filter.waterblight then
|
if not cached_config.filter.waterblight then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.fire_id then
|
elseif id == this.fire_id then
|
||||||
if not cached_config.filter.fireblight then
|
if not cached_config.filter.fireblight then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.ice_id then
|
elseif id == this.ice_id then
|
||||||
if not cached_config.filter.iceblight then
|
if not cached_config.filter.iceblight then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.thunder_id then
|
elseif id == this.thunder_id then
|
||||||
if not cached_config.filter.thunderblight then
|
if not cached_config.filter.thunderblight then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.fall_trap_id then
|
elseif id == this.fall_trap_id then
|
||||||
if not cached_config.filter.fall_trap then
|
if not cached_config.filter.fall_trap then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.shock_trap_id then
|
elseif id == this.shock_trap_id then
|
||||||
if not cached_config.filter.shock_trap then
|
if not cached_config.filter.shock_trap then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.capture_id then
|
elseif id == this.capture_id then
|
||||||
if not cached_config.filter.tranq_bomb then
|
if not cached_config.filter.tranq_bomb then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.koyashi_id then
|
elseif id == this.koyashi_id then
|
||||||
if not cached_config.filter.dung_bomb then
|
if not cached_config.filter.dung_bomb then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.steel_fang_id then
|
elseif id == this.steel_fang_id then
|
||||||
if not cached_config.filter.steel_fang then
|
if not cached_config.filter.steel_fang then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.fall_quick_sand_id then
|
elseif id == this.fall_quick_sand_id then
|
||||||
if not cached_config.filter.quick_sand then
|
if not cached_config.filter.quick_sand then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.fall_otomo_trap_id then
|
elseif id == this.fall_otomo_trap_id then
|
||||||
if not cached_config.filter.fall_otomo_trap then
|
if not cached_config.filter.fall_otomo_trap then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
elseif id == ailments.shock_otomo_trap_id then
|
elseif id == this.shock_otomo_trap_id then
|
||||||
if not cached_config.filter.shock_otomo_trap then
|
if not cached_config.filter.shock_otomo_trap then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
@@ -683,9 +685,9 @@ function ailments.draw(monster, ailment_UI, cached_config, ailments_position_on_
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.apply_ailment_buildup(monster, player, otomo, ailment_type, ailment_buildup)
|
function this.apply_ailment_buildup(monster, player, otomo, ailment_type, ailment_buildup)
|
||||||
if monster == nil or
|
if monster == nil or
|
||||||
(ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id)
|
(ailment_type ~= this.poison_id and ailment_type ~= this.blast_id and ailment_type ~= this.stun_id)
|
||||||
or (ailment_buildup == 0 or ailment_buildup == nil) then
|
or (ailment_buildup == 0 or ailment_buildup == nil) then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -707,11 +709,11 @@ function ailments.apply_ailment_buildup(monster, player, otomo, ailment_type, ai
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
ailments.calculate_ailment_contribution(monster, ailment_type);
|
this.calculate_ailment_contribution(monster, ailment_type);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Code by coavins
|
-- Code by coavins
|
||||||
function ailments.calculate_ailment_contribution(monster, ailment_type)
|
function this.calculate_ailment_contribution(monster, ailment_type)
|
||||||
-- get total
|
-- get total
|
||||||
local total = 0;
|
local total = 0;
|
||||||
for player, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
|
for player, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
|
||||||
@@ -737,7 +739,7 @@ function ailments.calculate_ailment_contribution(monster, ailment_type)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.clear_ailment_contribution(monster, ailment_type)
|
function this.clear_ailment_contribution(monster, ailment_type)
|
||||||
monster.ailments[ailment_type].buildup = {};
|
monster.ailments[ailment_type].buildup = {};
|
||||||
monster.ailments[ailment_type].otomo_buildup = {};
|
monster.ailments[ailment_type].otomo_buildup = {};
|
||||||
|
|
||||||
@@ -746,7 +748,7 @@ function ailments.clear_ailment_contribution(monster, ailment_type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Code by coavins
|
-- Code by coavins
|
||||||
function ailments.apply_ailment_damage(monster, ailment_type, ailment_damage)
|
function this.apply_ailment_damage(monster, ailment_type, ailment_damage)
|
||||||
-- we only track poison and blast for now
|
-- we only track poison and blast for now
|
||||||
if ailment_type == nil or ailment_damage == nil then
|
if ailment_type == nil or ailment_damage == nil then
|
||||||
return;
|
return;
|
||||||
@@ -757,13 +759,13 @@ function ailments.apply_ailment_damage(monster, ailment_type, ailment_damage)
|
|||||||
local buildup_share = monster.ailments[ailment_type].buildup_share;
|
local buildup_share = monster.ailments[ailment_type].buildup_share;
|
||||||
local otomo_buildup_share = monster.ailments[ailment_type].otomo_buildup_share;
|
local otomo_buildup_share = monster.ailments[ailment_type].otomo_buildup_share;
|
||||||
|
|
||||||
if ailment_type == ailments.poison_id then
|
if ailment_type == this.poison_id then
|
||||||
damage_source_type = "poison";
|
damage_source_type = "poison";
|
||||||
otomo_damage_source_type = "otomo poison";
|
otomo_damage_source_type = "otomo poison";
|
||||||
buildup_share = monster.ailments[ailment_type].cached_buildup_share;
|
buildup_share = monster.ailments[ailment_type].cached_buildup_share;
|
||||||
otomo_buildup_share = monster.ailments[ailment_type].cached_otomo_buildup_share;
|
otomo_buildup_share = monster.ailments[ailment_type].cached_otomo_buildup_share;
|
||||||
|
|
||||||
elseif ailment_type == ailments.blast_id then
|
elseif ailment_type == this.blast_id then
|
||||||
damage_source_type = "blast";
|
damage_source_type = "blast";
|
||||||
otomo_damage_source_type = "otomo blast";
|
otomo_damage_source_type = "otomo blast";
|
||||||
else
|
else
|
||||||
@@ -811,7 +813,7 @@ function ailments.apply_ailment_damage(monster, ailment_type, ailment_damage)
|
|||||||
players.update_damage(players.total, damage_source_type, monster.is_large, damage_object);
|
players.update_damage(players.total, damage_source_type, monster.is_large, damage_object);
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments.init_module()
|
function this.init_module()
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
@@ -821,7 +823,6 @@ function ailments.init_module()
|
|||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailments;
|
return this;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
local body_part = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
local rage_UI_entity;
|
local rage_UI_entity;
|
||||||
@@ -41,10 +40,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
body_part.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function body_part.new(id, name)
|
function this.new(id, name)
|
||||||
local part = {};
|
local part = {};
|
||||||
|
|
||||||
part.id = id;
|
part.id = id;
|
||||||
@@ -71,7 +73,7 @@ function body_part.new(id, name)
|
|||||||
return part;
|
return part;
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part.update_flinch(part, part_current, part_max)
|
function this.update_flinch(part, part_current, part_max)
|
||||||
if part_current > part.health then
|
if part_current > part.health then
|
||||||
part.flinch_count = part.flinch_count + 1;
|
part.flinch_count = part.flinch_count + 1;
|
||||||
end
|
end
|
||||||
@@ -92,7 +94,7 @@ function body_part.update_flinch(part, part_current, part_max)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part.update_break(part, part_break_current, part_break_max, part_break_count, part_break_max_count)
|
function this.update_break(part, part_break_current, part_break_max, part_break_count, part_break_max_count)
|
||||||
|
|
||||||
if part.break_health ~= part_break_current then
|
if part.break_health ~= part_break_current then
|
||||||
part.last_change_time = time.total_elapsed_script_seconds;
|
part.last_change_time = time.total_elapsed_script_seconds;
|
||||||
@@ -121,7 +123,7 @@ function body_part.update_break(part, part_break_current, part_break_max, part_b
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part.update_loss(part, part_loss_current, part_loss_max, is_severed)
|
function this.update_loss(part, part_loss_current, part_loss_max, is_severed)
|
||||||
if part.loss_health ~= part_loss_current then
|
if part.loss_health ~= part_loss_current then
|
||||||
part.last_change_time = time.total_elapsed_script_seconds;
|
part.last_change_time = time.total_elapsed_script_seconds;
|
||||||
end
|
end
|
||||||
@@ -145,7 +147,7 @@ function body_part.update_loss(part, part_loss_current, part_loss_max, is_severe
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part.draw(monster, part_UI, cached_config, parts_position_on_screen, opacity_scale)
|
function this.draw(monster, part_UI, cached_config, parts_position_on_screen, opacity_scale)
|
||||||
local cached_config = cached_config.body_parts;
|
local cached_config = cached_config.body_parts;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -338,11 +340,10 @@ function body_part.draw(monster, part_UI, cached_config, parts_position_on_scree
|
|||||||
return last_part_position_on_screen;
|
return last_part_position_on_screen;
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
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");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_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");
|
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
|
||||||
@@ -353,4 +354,4 @@ function body_part.init_module()
|
|||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
end
|
end
|
||||||
|
|
||||||
return body_part;
|
return this;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
local large_monster = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local config;
|
local config;
|
||||||
local language;
|
local language;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
local rage_UI_entity;
|
local rage_UI_entity;
|
||||||
@@ -48,10 +48,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
large_monster.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function large_monster.new(enemy)
|
function this.new(enemy)
|
||||||
local monster = {};
|
local monster = {};
|
||||||
monster.enemy = enemy;
|
monster.enemy = enemy;
|
||||||
monster.is_large = true;
|
monster.is_large = true;
|
||||||
@@ -121,35 +124,35 @@ function large_monster.new(enemy)
|
|||||||
monster.static_UI = {};
|
monster.static_UI = {};
|
||||||
monster.highlighted_UI = {};
|
monster.highlighted_UI = {};
|
||||||
|
|
||||||
large_monster.init(monster, enemy);
|
this.init(monster, enemy);
|
||||||
large_monster.init_UI(monster, monster.dynamic_UI, config.current_config.large_monster_UI.dynamic);
|
this.init_UI(monster, monster.dynamic_UI, config.current_config.large_monster_UI.dynamic);
|
||||||
large_monster.init_UI(monster, monster.static_UI, config.current_config.large_monster_UI.static);
|
this.init_UI(monster, monster.static_UI, config.current_config.large_monster_UI.static);
|
||||||
large_monster.init_UI(monster, monster.highlighted_UI, config.current_config.large_monster_UI.highlighted);
|
this.init_UI(monster, monster.highlighted_UI, config.current_config.large_monster_UI.highlighted);
|
||||||
|
|
||||||
large_monster.update_position(enemy, monster);
|
this.update_position(enemy, monster);
|
||||||
|
|
||||||
local physical_param = large_monster.update_health(enemy, monster);
|
local physical_param = this.update_health(enemy, monster);
|
||||||
|
|
||||||
large_monster.update_stamina(enemy, monster, nil);
|
this.update_stamina(enemy, monster, nil);
|
||||||
large_monster.update_stamina_timer(enemy, monster, nil);
|
this.update_stamina_timer(enemy, monster, nil);
|
||||||
|
|
||||||
large_monster.update_rage(enemy, monster, nil);
|
this.update_rage(enemy, monster, nil);
|
||||||
large_monster.update_rage_timer(enemy, monster, nil);
|
this.update_rage_timer(enemy, monster, nil);
|
||||||
|
|
||||||
large_monster.update(enemy, monster);
|
this.update(enemy, monster);
|
||||||
pcall(large_monster.update_parts, enemy, monster, physical_param);
|
pcall(this.update_parts, enemy, monster, physical_param);
|
||||||
|
|
||||||
if large_monster.list[enemy] == nil then
|
if this.list[enemy] == nil then
|
||||||
large_monster.list[enemy] = monster;
|
this.list[enemy] = monster;
|
||||||
end
|
end
|
||||||
|
|
||||||
return monster;
|
return monster;
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.get_monster(enemy)
|
function this.get_monster(enemy)
|
||||||
local monster = large_monster.list[enemy];
|
local monster = this.list[enemy];
|
||||||
if monster == nil then
|
if monster == nil then
|
||||||
monster = large_monster.new(enemy);
|
monster = this.new(enemy);
|
||||||
end
|
end
|
||||||
return monster;
|
return monster;
|
||||||
end
|
end
|
||||||
@@ -175,7 +178,7 @@ local get_set_info_method = enemy_character_base_type_def:get_method("get_SetInf
|
|||||||
local set_info_type = get_set_info_method:get_return_type();
|
local set_info_type = get_set_info_method:get_return_type();
|
||||||
local get_unique_id_method = set_info_type:get_method("get_UniqueId");
|
local get_unique_id_method = set_info_type:get_method("get_UniqueId");
|
||||||
|
|
||||||
function large_monster.init(monster, enemy)
|
function this.init(monster, enemy)
|
||||||
local enemy_type = enemy_type_field:get_data(enemy);
|
local enemy_type = enemy_type_field:get_data(enemy);
|
||||||
if enemy_type == nil then
|
if enemy_type == nil then
|
||||||
customization_menu.status = "No enemy type";
|
customization_menu.status = "No enemy type";
|
||||||
@@ -254,10 +257,10 @@ function large_monster.init(monster, enemy)
|
|||||||
monster.is_capturable = is_capture_enable and not is_anomaly;
|
monster.is_capturable = is_capture_enable and not is_anomaly;
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.init_UI(monster, monster_UI, cached_config)
|
function this.init_UI(monster, monster_UI, cached_config)
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
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(
|
monster_UI.health_UI = health_UI_entity.new(
|
||||||
cached_config.health.visibility,
|
cached_config.health.visibility,
|
||||||
@@ -380,7 +383,7 @@ local system_array_type_def = sdk.find_type_definition("System.Array");
|
|||||||
local length_method = system_array_type_def:get_method("get_Length");
|
local length_method = system_array_type_def:get_method("get_Length");
|
||||||
local get_value_method = system_array_type_def:get_method("GetValue(System.Int32)");
|
local get_value_method = system_array_type_def:get_method("GetValue(System.Int32)");
|
||||||
|
|
||||||
function large_monster.update_position(enemy, monster)
|
function this.update_position(enemy, monster)
|
||||||
if not config.current_config.large_monster_UI.dynamic.enabled and
|
if not config.current_config.large_monster_UI.dynamic.enabled and
|
||||||
config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then
|
config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then
|
||||||
return;
|
return;
|
||||||
@@ -393,24 +396,33 @@ function large_monster.update_position(enemy, monster)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Code by coavins
|
-- Code by coavins
|
||||||
function large_monster.update_all_riders()
|
function this.update_all_riders()
|
||||||
for enemy, monster in pairs(large_monster.list) do
|
for enemy, monster in pairs(this.list) do
|
||||||
-- get marionette rider
|
-- get marionette rider
|
||||||
local mario_param = enemy:get_field("<MarioParam>k__BackingField");
|
local mario_param = enemy:get_field("<MarioParam>k__BackingField");
|
||||||
if mario_param ~= nil then
|
if mario_param ~= nil then
|
||||||
local is_marionette = get_is_marionette_method:call(mario_param);
|
local is_marionette = get_is_marionette_method:call(mario_param);
|
||||||
|
|
||||||
|
if is_marionette == nil then
|
||||||
|
goto continue;
|
||||||
|
end
|
||||||
|
|
||||||
if is_marionette then
|
if is_marionette then
|
||||||
local player_id = get_mario_player_index_method:call(mario_param);
|
local player_id = get_mario_player_index_method:call(mario_param);
|
||||||
if monster.rider_id ~= player_id then
|
if player_id ~= nil then
|
||||||
monster.rider_id = player_id;
|
monster.rider_id = player_id;
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
monster.rider_id = -1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
::continue::
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update(enemy, monster)
|
function this.update(enemy, monster)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -459,7 +471,7 @@ function large_monster.update(enemy, monster)
|
|||||||
pcall(ailments.update_ailments, enemy, monster);
|
pcall(ailments.update_ailments, enemy, monster);
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_health(enemy, monster)
|
function this.update_health(enemy, monster)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -474,7 +486,7 @@ function large_monster.update_health(enemy, monster)
|
|||||||
return nil;
|
return nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
local physical_param = physical_param_field:get_data(enemy)
|
local physical_param = physical_param_field:get_data(enemy);
|
||||||
if physical_param == nil then
|
if physical_param == nil then
|
||||||
customization_menu.status = "No physical param";
|
customization_menu.status = "No physical param";
|
||||||
return nil;
|
return nil;
|
||||||
@@ -499,7 +511,7 @@ function large_monster.update_health(enemy, monster)
|
|||||||
return physical_param;
|
return physical_param;
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_stamina(enemy, monster, stamina_param)
|
function this.update_stamina(enemy, monster, stamina_param)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -536,7 +548,7 @@ function large_monster.update_stamina(enemy, monster, stamina_param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_stamina_timer(enemy, monster, stamina_param)
|
function this.update_stamina_timer(enemy, monster, stamina_param)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -583,7 +595,7 @@ function large_monster.update_stamina_timer(enemy, monster, stamina_param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_rage(enemy, monster, anger_param)
|
function this.update_rage(enemy, monster, anger_param)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -615,7 +627,7 @@ function large_monster.update_rage(enemy, monster, anger_param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_rage_timer(enemy, monster, anger_param)
|
function this.update_rage_timer(enemy, monster, anger_param)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -661,7 +673,7 @@ function large_monster.update_rage_timer(enemy, monster, anger_param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.update_parts(enemy, monster, physical_param)
|
function this.update_parts(enemy, monster, physical_param)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled
|
if not cached_config.dynamic.enabled
|
||||||
@@ -795,7 +807,7 @@ function large_monster.update_parts(enemy, monster, physical_param)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.draw(monster, type, cached_config, position_on_screen, opacity_scale)
|
function this.draw(monster, type, cached_config, position_on_screen, opacity_scale)
|
||||||
local monster_UI;
|
local monster_UI;
|
||||||
|
|
||||||
if type == "dynamic" then
|
if type == "dynamic" then
|
||||||
@@ -892,16 +904,16 @@ function large_monster.draw(monster, type, cached_config, position_on_screen, op
|
|||||||
drawing.draw_label(monster_UI.monster_name_label, position_on_screen, opacity_scale, monster_name_text);
|
drawing.draw_label(monster_UI.monster_name_label, position_on_screen, opacity_scale, monster_name_text);
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.init_list()
|
function this.init_list()
|
||||||
large_monster.list = {};
|
this.list = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
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");
|
body_part = require("MHR_Overlay.Monsters.body_part");
|
||||||
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
||||||
@@ -919,4 +931,4 @@ function large_monster.init_module()
|
|||||||
ailment_buildup = require("MHR_Overlay.Monsters.ailment_buildup");
|
ailment_buildup = require("MHR_Overlay.Monsters.ailment_buildup");
|
||||||
end
|
end
|
||||||
|
|
||||||
return large_monster;
|
return this;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local monster_hook = {};
|
local this = {};
|
||||||
|
|
||||||
local small_monster;
|
local small_monster;
|
||||||
local large_monster;
|
local large_monster;
|
||||||
@@ -35,6 +35,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
|
||||||
local enemy_character_base_update_method = enemy_character_base_type_def:get_method("update");
|
local enemy_character_base_update_method = enemy_character_base_type_def:get_method("update");
|
||||||
@@ -84,7 +87,7 @@ re.on_pre_application_entry("UpdateBehavior", function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function monster_hook.update_monster(enemy)
|
function this.update_monster(enemy)
|
||||||
if enemy == nil then
|
if enemy == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -105,13 +108,13 @@ function monster_hook.update_monster(enemy)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if is_large then
|
if is_large then
|
||||||
monster_hook.update_large_monster(enemy);
|
this.update_large_monster(enemy);
|
||||||
else
|
else
|
||||||
monster_hook.update_small_monster(enemy);
|
this.update_small_monster(enemy);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_large_monster(enemy)
|
function this.update_large_monster(enemy)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if not cached_config.dynamic.enabled and
|
if not cached_config.dynamic.enabled and
|
||||||
@@ -158,7 +161,7 @@ function monster_hook.update_large_monster(enemy)
|
|||||||
large_monster.update(enemy, monster);
|
large_monster.update(enemy, monster);
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_small_monster(enemy)
|
function this.update_small_monster(enemy)
|
||||||
if not config.current_config.small_monster_UI.enabled then
|
if not config.current_config.small_monster_UI.enabled then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -195,7 +198,7 @@ function monster_hook.update_small_monster(enemy)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_health(enemy_damage_check)
|
function this.update_health(enemy_damage_check)
|
||||||
local enemy = get_ref_enemy:call(enemy_damage_check);
|
local enemy = get_ref_enemy:call(enemy_damage_check);
|
||||||
if enemy == nil then
|
if enemy == nil then
|
||||||
return;
|
return;
|
||||||
@@ -217,7 +220,7 @@ function monster_hook.update_health(enemy_damage_check)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_stamina(stamina_param, stamina_sub)
|
function this.update_stamina(stamina_param, stamina_sub)
|
||||||
if stamina_sub <= 0 then
|
if stamina_sub <= 0 then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -231,12 +234,12 @@ function monster_hook.update_stamina(stamina_param, stamina_sub)
|
|||||||
large_monster.update_stamina(enemy, monster, stamina_param);
|
large_monster.update_stamina(enemy, monster, stamina_param);
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_stamina_timer(stamina_param, enemy)
|
function this.update_stamina_timer(stamina_param, enemy)
|
||||||
local monster = large_monster.get_monster(enemy);
|
local monster = large_monster.get_monster(enemy);
|
||||||
large_monster.update_stamina_timer(enemy, monster, stamina_param);
|
large_monster.update_stamina_timer(enemy, monster, stamina_param);
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_rage(anger_param, anger_add, enemy)
|
function this.update_rage(anger_param, anger_add, enemy)
|
||||||
if anger_add <= 0 then
|
if anger_add <= 0 then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -245,12 +248,12 @@ function monster_hook.update_rage(anger_param, anger_add, enemy)
|
|||||||
large_monster.update_rage(enemy, monster, anger_param);
|
large_monster.update_rage(enemy, monster, anger_param);
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.update_rage_timer(anger_param, enemy)
|
function this.update_rage_timer(anger_param, enemy)
|
||||||
local monster = large_monster.get_monster(enemy);
|
local monster = large_monster.get_monster(enemy);
|
||||||
large_monster.update_rage_timer(enemy, monster, anger_param);
|
large_monster.update_rage_timer(enemy, monster, anger_param);
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_hook.init_module()
|
function this.init_module()
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
large_monster = require("MHR_Overlay.Monsters.large_monster");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
@@ -259,29 +262,29 @@ function monster_hook.init_module()
|
|||||||
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||||
|
|
||||||
sdk.hook(enemy_character_base_update_method, function(args)
|
sdk.hook(enemy_character_base_update_method, function(args)
|
||||||
pcall(monster_hook.update_monster, sdk.to_managed_object(args[2]));
|
pcall(this.update_monster, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(damage_check_update_param_update_method, function(args)
|
sdk.hook(damage_check_update_param_update_method, function(args)
|
||||||
pcall(monster_hook.update_health, sdk.to_managed_object(args[2]));
|
pcall(this.update_health, sdk.to_managed_object(args[2]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(stamina_sub_method, function(args)
|
sdk.hook(stamina_sub_method, function(args)
|
||||||
pcall(monster_hook.update_stamina, sdk.to_managed_object(args[2]), sdk.to_float(args[3]));
|
pcall(this.update_stamina, sdk.to_managed_object(args[2]), sdk.to_float(args[3]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
sdk.hook(anger_add_method, function(args)
|
sdk.hook(anger_add_method, function(args)
|
||||||
pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]),
|
pcall(this.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]),
|
||||||
sdk.to_managed_object(args[4]));
|
sdk.to_managed_object(args[4]));
|
||||||
end, function(retval)
|
end, function(retval)
|
||||||
return retval;
|
return retval;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
return monster_hook;
|
return this;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
local small_monster = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
local screen;
|
local screen;
|
||||||
@@ -41,10 +41,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
small_monster.list = {};
|
this.list = {};
|
||||||
|
|
||||||
function small_monster.new(enemy)
|
function this.new(enemy)
|
||||||
local monster = {};
|
local monster = {};
|
||||||
monster.is_large = false;
|
monster.is_large = false;
|
||||||
|
|
||||||
@@ -63,24 +66,24 @@ function small_monster.new(enemy)
|
|||||||
|
|
||||||
monster.UI = {};
|
monster.UI = {};
|
||||||
|
|
||||||
small_monster.init(monster, enemy);
|
this.init(monster, enemy);
|
||||||
small_monster.init_UI(monster);
|
this.init_UI(monster);
|
||||||
|
|
||||||
small_monster.update_position(enemy, monster);
|
this.update_position(enemy, monster);
|
||||||
small_monster.update_health(enemy, monster);
|
this.update_health(enemy, monster);
|
||||||
small_monster.update(enemy, monster);
|
this.update(enemy, monster);
|
||||||
|
|
||||||
if small_monster.list[enemy] == nil then
|
if this.list[enemy] == nil then
|
||||||
small_monster.list[enemy] = monster;
|
this.list[enemy] = monster;
|
||||||
end
|
end
|
||||||
|
|
||||||
return monster;
|
return monster;
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.get_monster(enemy)
|
function this.get_monster(enemy)
|
||||||
local monster = small_monster.list[enemy];
|
local monster = this.list[enemy];
|
||||||
if monster == nil then
|
if monster == nil then
|
||||||
monster = small_monster.new(enemy);
|
monster = this.new(enemy);
|
||||||
end
|
end
|
||||||
|
|
||||||
return monster;
|
return monster;
|
||||||
@@ -92,7 +95,7 @@ local enemy_type_field = enemy_character_base_type_def:get_field("<EnemyType>k__
|
|||||||
local message_manager_type_def = sdk.find_type_definition("snow.gui.MessageManager");
|
local message_manager_type_def = sdk.find_type_definition("snow.gui.MessageManager");
|
||||||
local get_enemy_name_message_method = message_manager_type_def:get_method("getEnemyNameMessage");
|
local get_enemy_name_message_method = message_manager_type_def:get_method("getEnemyNameMessage");
|
||||||
|
|
||||||
function small_monster.init(monster, enemy)
|
function this.init(monster, enemy)
|
||||||
local enemy_type = enemy_type_field:get_data(enemy);
|
local enemy_type = enemy_type_field:get_data(enemy);
|
||||||
if enemy_type == nil then
|
if enemy_type == nil then
|
||||||
customization_menu.status = "No enemy type";
|
customization_menu.status = "No enemy type";
|
||||||
@@ -107,13 +110,13 @@ function small_monster.init(monster, enemy)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.init_UI(monster)
|
function this.init_UI(monster)
|
||||||
local cached_config = config.current_config.small_monster_UI;
|
local cached_config = config.current_config.small_monster_UI;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
local monster_UI = monster.UI;
|
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.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;
|
monster_UI.name_label.offset.y = monster_UI.name_label.offset.y * global_scale_modifier;
|
||||||
@@ -160,7 +163,7 @@ local get_max_method = vital_param_type:get_method("get_Max");
|
|||||||
|
|
||||||
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
|
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
|
||||||
|
|
||||||
function small_monster.update_position(enemy, monster)
|
function this.update_position(enemy, monster)
|
||||||
local cached_config = config.current_config.small_monster_UI;
|
local cached_config = config.current_config.small_monster_UI;
|
||||||
|
|
||||||
if not cached_config.enabled then
|
if not cached_config.enabled then
|
||||||
@@ -177,7 +180,7 @@ function small_monster.update_position(enemy, monster)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.update(enemy, monster)
|
function this.update(enemy, monster)
|
||||||
if not config.current_config.small_monster_UI.enabled then
|
if not config.current_config.small_monster_UI.enabled then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -190,7 +193,7 @@ function small_monster.update(enemy, monster)
|
|||||||
pcall(ailments.update_ailments, enemy, monster);
|
pcall(ailments.update_ailments, enemy, monster);
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.update_health(enemy, monster)
|
function this.update_health(enemy, monster)
|
||||||
if not config.current_config.small_monster_UI.enabled or not config.current_config.small_monster_UI.health.visibility then
|
if not config.current_config.small_monster_UI.enabled or not config.current_config.small_monster_UI.health.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -217,7 +220,7 @@ function small_monster.update_health(enemy, monster)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.draw(monster, cached_config, position_on_screen, opacity_scale)
|
function this.draw(monster, cached_config, position_on_screen, opacity_scale)
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
drawing.draw_label(monster.UI.name_label, position_on_screen, opacity_scale, monster.name);
|
drawing.draw_label(monster.UI.name_label, position_on_screen, opacity_scale, monster.name);
|
||||||
@@ -242,15 +245,15 @@ function small_monster.draw(monster, cached_config, position_on_screen, opacity_
|
|||||||
ailment_buildup.draw(monster, monster.UI.ailment_buildup_UI, cached_config, ailment_buildups_position_on_screen, opacity_scale);
|
ailment_buildup.draw(monster, monster.UI.ailment_buildup_UI, cached_config, ailment_buildups_position_on_screen, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.init_list()
|
function this.init_list()
|
||||||
small_monster.list = {};
|
this.list = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
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");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -261,4 +264,4 @@ function small_monster.init_module()
|
|||||||
ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
|
ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
|
||||||
end
|
end
|
||||||
|
|
||||||
return small_monster;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local ailment_buildups_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +43,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function ailment_buildups_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
local index = 1;
|
local index = 1;
|
||||||
@@ -100,7 +103,7 @@ function ailment_buildups_customization.draw(cached_config)
|
|||||||
if imgui.tree_node(language.current_language.customization_menu.settings) then
|
if imgui.tree_node(language.current_language.customization_menu.settings) then
|
||||||
changed, index = imgui.combo(
|
changed, index = imgui.combo(
|
||||||
language.current_language.customization_menu.highlighted_bar,
|
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);
|
customization_menu.displayed_highlighted_buildup_bar_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
@@ -111,7 +114,7 @@ function ailment_buildups_customization.draw(cached_config)
|
|||||||
|
|
||||||
changed, index = imgui.combo(
|
changed, index = imgui.combo(
|
||||||
language.current_language.customization_menu.buildup_bars_are_relative_to,
|
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);
|
customization_menu.displayed_buildup_bar_relative_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
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
|
if imgui.tree_node(language.current_language.customization_menu.sorting) then
|
||||||
changed, index = imgui.combo(
|
changed, index = imgui.combo(
|
||||||
language.current_language.customization_menu.type,
|
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);
|
customization_menu.displayed_ailment_buildups_sorting_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
@@ -197,8 +200,8 @@ function ailment_buildups_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_buildups_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -215,4 +218,4 @@ function ailment_buildups_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailment_buildups_customization;
|
return this;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local ailments_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +43,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function ailments_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
local index = 0;
|
local index = 0;
|
||||||
@@ -140,7 +143,7 @@ function ailments_customization.draw(cached_config)
|
|||||||
if imgui.tree_node(language.current_language.customization_menu.sorting) then
|
if imgui.tree_node(language.current_language.customization_menu.sorting) then
|
||||||
changed, index = imgui.combo(
|
changed, index = imgui.combo(
|
||||||
language.current_language.customization_menu.type,
|
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);
|
customization_menu.displayed_ailments_sorting_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
@@ -362,8 +365,8 @@ function ailments_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailments_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -379,4 +382,4 @@ function ailments_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailments_customization;
|
return this;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local bar_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -42,8 +42,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function bar_customization.draw(bar_name, bar)
|
function this.draw(bar_name, bar)
|
||||||
if bar == nil then
|
if bar == nil then
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
@@ -96,7 +99,7 @@ function bar_customization.draw(bar_name, bar)
|
|||||||
|
|
||||||
|
|
||||||
changed, index = imgui.combo(language.current_language.customization_menu.style,
|
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),
|
bar.outline.style),
|
||||||
customization_menu.displayed_outline_styles);
|
customization_menu.displayed_outline_styles);
|
||||||
bar_changed = bar_changed or changed;
|
bar_changed = bar_changed or changed;
|
||||||
@@ -188,8 +191,8 @@ function bar_customization.draw(bar_name, bar)
|
|||||||
return bar_changed;
|
return bar_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function bar_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -204,4 +207,4 @@ function bar_customization.init_module()
|
|||||||
line_customization = require("MHR_Overlay.UI.Customizations.line_customization");
|
line_customization = require("MHR_Overlay.UI.Customizations.line_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return bar_customization;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local body_parts_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +43,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function body_parts_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
local index = 0;
|
local index = 0;
|
||||||
@@ -88,7 +91,7 @@ function body_parts_customization.draw(cached_config)
|
|||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
|
|
||||||
changed, index = imgui.combo(language.current_language.customization_menu.filter_mode,
|
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);
|
customization_menu.displayed_large_monster_UI_parts_filter_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
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
|
if imgui.tree_node(language.current_language.customization_menu.sorting) then
|
||||||
changed, index = imgui.combo(
|
changed, index = imgui.combo(
|
||||||
language.current_language.customization_menu.type,
|
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);
|
customization_menu.displayed_large_monster_UI_parts_sorting_types);
|
||||||
|
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
@@ -365,8 +368,8 @@ function body_parts_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_parts_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -382,4 +385,4 @@ function body_parts_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return body_parts_customization;
|
return this;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
local large_monster_UI_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +42,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function large_monster_UI_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
|
|
||||||
@@ -86,8 +88,7 @@ function large_monster_UI_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -103,4 +104,4 @@ function large_monster_UI_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return large_monster_UI_customization;
|
return this;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
local label_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -41,8 +40,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function label_customization.draw(label_name, label)
|
function this.draw(label_name, label)
|
||||||
local label_changed = false;
|
local label_changed = false;
|
||||||
local changed = false;
|
local changed = false;
|
||||||
|
|
||||||
@@ -113,8 +115,7 @@ function label_customization.draw(label_name, label)
|
|||||||
return label_changed;
|
return label_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function label_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -128,4 +129,4 @@ function label_customization.init_module()
|
|||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
end
|
end
|
||||||
|
|
||||||
return label_customization;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
local large_monster_UI_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -50,8 +49,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function large_monster_UI_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
|
|
||||||
@@ -79,8 +81,7 @@ function large_monster_UI_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -103,4 +104,4 @@ function large_monster_UI_customization.init_module()
|
|||||||
ailment_buildups_customization = require("MHR_Overlay.UI.Customizations.ailment_buildups_customization");
|
ailment_buildups_customization = require("MHR_Overlay.UI.Customizations.ailment_buildups_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return large_monster_UI_customization;
|
return this;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
local line_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -41,8 +40,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function line_customization.draw(line_name, line)
|
function this.draw(line_name, line)
|
||||||
if line == nil then
|
if line == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -93,8 +95,7 @@ function line_customization.draw(line_name, line)
|
|||||||
return line_changed;
|
return line_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function line_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -108,4 +109,4 @@ function line_customization.init_module()
|
|||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
end
|
end
|
||||||
|
|
||||||
return line_customization;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
local module_visibility_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +42,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function module_visibility_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
|
|
||||||
@@ -99,8 +101,7 @@ function module_visibility_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function module_visibility_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -114,4 +115,4 @@ function module_visibility_customization.init_module()
|
|||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
end
|
end
|
||||||
|
|
||||||
return module_visibility_customization;
|
return this;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
local rage_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +42,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function rage_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
|
|
||||||
@@ -89,8 +91,7 @@ function rage_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function rage_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -106,4 +107,4 @@ function rage_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return rage_customization;
|
return this;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
local stamina_customization = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
|
||||||
local config;
|
local config;
|
||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
@@ -43,8 +42,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function stamina_customization.draw(cached_config)
|
function this.draw(cached_config)
|
||||||
local changed = false;
|
local changed = false;
|
||||||
local config_changed = false;
|
local config_changed = false;
|
||||||
|
|
||||||
@@ -89,8 +91,7 @@ function stamina_customization.draw(cached_config)
|
|||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|
||||||
function stamina_customization.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
@@ -106,4 +107,4 @@ function stamina_customization.init_module()
|
|||||||
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
|
||||||
end
|
end
|
||||||
|
|
||||||
return stamina_customization;
|
return this;
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
local buff_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local buff_UI_entity;
|
local buff_UI_entity;
|
||||||
local config;
|
local config;
|
||||||
local buffs;
|
local buffs;
|
||||||
local screen;
|
local screen;
|
||||||
local table_helpers;
|
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -34,8 +33,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function buff_UI.draw()
|
function this.draw()
|
||||||
local cached_config = config.current_config.buff_UI;
|
local cached_config = config.current_config.buff_UI;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -108,12 +110,11 @@ function buff_UI.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function buff_UI.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
||||||
buffs = require("MHR_Overlay.Buffs.buffs");
|
buffs = require("MHR_Overlay.Buffs.buffs");
|
||||||
--singletons = require("MHR_Overlay.Game_Handler.singletons");
|
--singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
--customization_menu = require("MHR_Overlay.UI.customization_menu");
|
--customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
--players = require("MHR_Overlay.Damage_Meter.players");
|
--players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
@@ -123,4 +124,4 @@ function buff_UI.init_module()
|
|||||||
--drawing = require("MHR_Overlay.UI.drawing");
|
--drawing = require("MHR_Overlay.UI.drawing");
|
||||||
end
|
end
|
||||||
|
|
||||||
return buff_UI;
|
return this;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local damage_meter_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local config;
|
local config;
|
||||||
@@ -9,7 +9,7 @@ local quest_status;
|
|||||||
local screen;
|
local screen;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
local table_helpers;
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -39,9 +39,12 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
damage_meter_UI.last_displayed_players = {};
|
this.last_displayed_players = {};
|
||||||
damage_meter_UI.freeze_displayed_players = false;
|
this.freeze_displayed_players = false;
|
||||||
|
|
||||||
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
||||||
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
|
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
|
||||||
@@ -54,7 +57,7 @@ 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 hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterInfo");
|
||||||
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
|
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
|
||||||
|
|
||||||
function damage_meter_UI.draw()
|
function this.draw()
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -64,13 +67,13 @@ function damage_meter_UI.draw()
|
|||||||
|
|
||||||
local quest_players = {};
|
local quest_players = {};
|
||||||
|
|
||||||
if damage_meter_UI.freeze_displayed_players and not table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
|
if this.freeze_displayed_players and not utils.table.is_empty(this.last_displayed_players) then
|
||||||
quest_players = damage_meter_UI.last_displayed_players;
|
quest_players = this.last_displayed_players;
|
||||||
else
|
else
|
||||||
quest_players = players.display_list;
|
quest_players = players.display_list;
|
||||||
end
|
end
|
||||||
|
|
||||||
damage_meter_UI.last_displayed_players = quest_players;
|
this.last_displayed_players = quest_players;
|
||||||
|
|
||||||
local top_damage = 0;
|
local top_damage = 0;
|
||||||
local top_dps = 0;
|
local top_dps = 0;
|
||||||
@@ -172,7 +175,7 @@ function damage_meter_UI.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function damage_meter_UI.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -182,7 +185,7 @@ function damage_meter_UI.init_module()
|
|||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
end
|
end
|
||||||
|
|
||||||
return damage_meter_UI;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local env_creature_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local config;
|
local config;
|
||||||
@@ -7,7 +7,6 @@ local large_monster;
|
|||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
local drawing;
|
local drawing;
|
||||||
local table_helpers;
|
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
local rage_UI_entity;
|
local rage_UI_entity;
|
||||||
@@ -41,10 +40,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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 enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
|
||||||
|
|
||||||
function env_creature_UI.draw()
|
function this.draw()
|
||||||
if singletons.enemy_manager == nil then
|
if singletons.enemy_manager == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -92,7 +94,7 @@ function env_creature_UI.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function env_creature_UI.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -100,11 +102,10 @@ function env_creature_UI.init_module()
|
|||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
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");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_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");
|
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
|
||||||
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
|
||||||
end
|
end
|
||||||
|
|
||||||
return env_creature_UI;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local large_monster_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local config;
|
local config;
|
||||||
@@ -7,7 +7,6 @@ local large_monster;
|
|||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
local drawing;
|
local drawing;
|
||||||
local table_helpers;
|
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
local rage_UI_entity;
|
local rage_UI_entity;
|
||||||
@@ -40,6 +39,9 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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 enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
|
||||||
local get_boss_enemy_count_method = enemy_manager_type_def:get_method("getBossEnemyCount");
|
local get_boss_enemy_count_method = enemy_manager_type_def:get_method("getBossEnemyCount");
|
||||||
@@ -51,7 +53,7 @@ local get_tg_camera_method = gui_manager_type_def:get_method("get_refGuiHud_TgCa
|
|||||||
local tg_camera_type_def = get_tg_camera_method:get_return_type();
|
local tg_camera_type_def = get_tg_camera_method:get_return_type();
|
||||||
local get_targeting_enemy_index_field = tg_camera_type_def:get_field("OldTargetingEmIndex");
|
local get_targeting_enemy_index_field = tg_camera_type_def:get_field("OldTargetingEmIndex");
|
||||||
|
|
||||||
function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enabled)
|
function this.draw(dynamic_enabled, static_enabled, highlighted_enabled)
|
||||||
local cached_config = config.current_config.large_monster_UI;
|
local cached_config = config.current_config.large_monster_UI;
|
||||||
|
|
||||||
if singletons.enemy_manager == nil then
|
if singletons.enemy_manager == nil then
|
||||||
@@ -151,27 +153,27 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
|
|||||||
end
|
end
|
||||||
|
|
||||||
if dynamic_enabled then
|
if dynamic_enabled then
|
||||||
local success = pcall(large_monster_UI.draw_dynamic, displayed_monsters, highlighted_monster, cached_config);
|
local success = pcall(this.draw_dynamic, displayed_monsters, highlighted_monster, cached_config);
|
||||||
if not success then
|
if not success then
|
||||||
customization_menu.status = string.format("[%s] Dynamic Large Monster drawing function threw an exception");
|
customization_menu.status = string.format("[%s] Dynamic Large Monster drawing function threw an exception");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if highlighted_enabled then
|
if highlighted_enabled then
|
||||||
local success = pcall(large_monster_UI.draw_highlighted, highlighted_monster, cached_config);
|
local success = pcall(this.draw_highlighted, highlighted_monster, cached_config);
|
||||||
if not success then
|
if not success then
|
||||||
customization_menu.status = string.format("[%s] Highlighted Large Monster drawing function threw an exception");
|
customization_menu.status = string.format("[%s] Highlighted Large Monster drawing function threw an exception");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if static_enabled then
|
if static_enabled then
|
||||||
local success = pcall(large_monster_UI.draw_static, displayed_monsters, highlighted_monster, cached_config);
|
local success = pcall(this.draw_static, displayed_monsters, highlighted_monster, cached_config);
|
||||||
if not success then
|
if not success then
|
||||||
customization_menu.status = string.format("[%s] Static Large Monster drawing function threw an exception");
|
customization_menu.status = string.format("[%s] Static Large Monster drawing function threw an exception");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster, cached_config)
|
function this.draw_dynamic(displayed_monsters, highlighted_monster, cached_config)
|
||||||
cached_config = cached_config.dynamic;
|
cached_config = cached_config.dynamic;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -228,7 +230,7 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI.draw_static(displayed_monsters, highlighted_monster, cached_config)
|
function this.draw_static(displayed_monsters, highlighted_monster, cached_config)
|
||||||
cached_config = cached_config.static;
|
cached_config = cached_config.static;
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
@@ -309,7 +311,7 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster, c
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI.draw_highlighted(monster, cached_config)
|
function this.draw_highlighted(monster, cached_config)
|
||||||
cached_config = cached_config.highlighted;
|
cached_config = cached_config.highlighted;
|
||||||
|
|
||||||
if monster == nil then
|
if monster == nil then
|
||||||
@@ -325,7 +327,7 @@ function large_monster_UI.draw_highlighted(monster, cached_config)
|
|||||||
large_monster.draw(monster, "highlighted", cached_config, position_on_screen, 1);
|
large_monster.draw(monster, "highlighted", cached_config, position_on_screen, 1);
|
||||||
end
|
end
|
||||||
|
|
||||||
function large_monster_UI.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -333,10 +335,9 @@ function large_monster_UI.init_module()
|
|||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
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");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_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");
|
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
|
||||||
end
|
end
|
||||||
|
|
||||||
return large_monster_UI;
|
return this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local small_monster_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local singletons;
|
local singletons;
|
||||||
local config;
|
local config;
|
||||||
@@ -7,7 +7,6 @@ local customization_menu;
|
|||||||
local screen;
|
local screen;
|
||||||
local players;
|
local players;
|
||||||
local drawing;
|
local drawing;
|
||||||
local table_helpers;
|
|
||||||
local health_UI_entity;
|
local health_UI_entity;
|
||||||
local stamina_UI_entity;
|
local stamina_UI_entity;
|
||||||
|
|
||||||
@@ -39,12 +38,15 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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 enemy_manager_type_def = sdk.find_type_definition("snow.enemy.EnemyManager");
|
||||||
local get_zako_enemy_count_method = enemy_manager_type_def:get_method("getZakoEnemyCount");
|
local get_zako_enemy_count_method = enemy_manager_type_def:get_method("getZakoEnemyCount");
|
||||||
local get_zako_enemy_method = enemy_manager_type_def:get_method("getZakoEnemy");
|
local get_zako_enemy_method = enemy_manager_type_def:get_method("getZakoEnemy");
|
||||||
|
|
||||||
function small_monster_UI.draw()
|
function this.draw()
|
||||||
if singletons.enemy_manager == nil then
|
if singletons.enemy_manager == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -184,7 +186,7 @@ function small_monster_UI.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function small_monster_UI.init_module()
|
function this.init_module()
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
@@ -192,9 +194,8 @@ function small_monster_UI.init_module()
|
|||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
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");
|
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
|
||||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
||||||
end
|
end
|
||||||
|
|
||||||
return small_monster_UI;
|
return this;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
local time_UI = {};
|
local this = {};
|
||||||
|
|
||||||
local time;
|
local time;
|
||||||
local screen;
|
local screen;
|
||||||
local config;
|
local config;
|
||||||
local drawing;
|
local drawing;
|
||||||
local table_helpers;
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -34,10 +34,13 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
time_UI.label = nil;
|
this.label = nil;
|
||||||
|
|
||||||
function time_UI.draw()
|
function this.draw()
|
||||||
local elapsed_minutes = time.elapsed_minutes;
|
local elapsed_minutes = time.elapsed_minutes;
|
||||||
local elapsed_seconds = time.elapsed_seconds;
|
local elapsed_seconds = time.elapsed_seconds;
|
||||||
|
|
||||||
@@ -47,26 +50,26 @@ function time_UI.draw()
|
|||||||
|
|
||||||
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position);
|
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position);
|
||||||
|
|
||||||
drawing.draw_label(time_UI.label, position_on_screen, 1, elapsed_minutes, elapsed_seconds);
|
drawing.draw_label(this.label, position_on_screen, 1, elapsed_minutes, elapsed_seconds);
|
||||||
end
|
end
|
||||||
|
|
||||||
function time_UI.init_UI()
|
function this.init_UI()
|
||||||
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
|
this.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;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
time_UI.label.offset.x = time_UI.label.offset.x * global_scale_modifier;
|
this.label.offset.x = this.label.offset.x * global_scale_modifier;
|
||||||
time_UI.label.offset.y = time_UI.label.offset.y * global_scale_modifier;
|
this.label.offset.y = this.label.offset.y * global_scale_modifier;
|
||||||
end
|
end
|
||||||
|
|
||||||
function time_UI.init_module()
|
function this.init_module()
|
||||||
time = require("MHR_Overlay.Game_Handler.time");
|
time = require("MHR_Overlay.Game_Handler.time");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
|
|
||||||
time_UI.init_UI()
|
this.init_UI()
|
||||||
end
|
end
|
||||||
|
|
||||||
return time_UI;
|
return this;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local ailment_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
|
|
||||||
@@ -33,19 +33,22 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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)
|
function this.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
entity.visibility = visibility;
|
entity.visibility = visibility;
|
||||||
entity.bar = table_helpers.deep_copy(bar);
|
entity.bar = utils.table.deep_copy(bar);
|
||||||
entity.name_label = table_helpers.deep_copy(name_label);
|
entity.name_label = utils.table.deep_copy(name_label);
|
||||||
entity.text_label = table_helpers.deep_copy(text_label);
|
entity.text_label = utils.table.deep_copy(text_label);
|
||||||
entity.value_label = table_helpers.deep_copy(value_label);
|
entity.value_label = utils.table.deep_copy(value_label);
|
||||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
entity.percentage_label = utils.table.deep_copy(percentage_label);
|
||||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
entity.timer_label = utils.table.deep_copy(timer_label);
|
||||||
|
|
||||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||||
@@ -72,7 +75,7 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_UI_entity.draw(ailment, ailment_UI, cached_config, position_on_screen, opacity_scale)
|
function this.draw(ailment, ailment_UI, cached_config, position_on_screen, opacity_scale)
|
||||||
if not ailment_UI.visibility then
|
if not ailment_UI.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -115,11 +118,11 @@ function ailment_UI_entity.draw(ailment, ailment_UI, cached_config, position_on_
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailment_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local ailment_buildup_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local config;
|
local config;
|
||||||
local players;
|
local players;
|
||||||
@@ -34,8 +34,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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,
|
function this.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label,
|
||||||
buildup_value_label, buildup_percentage_label, total_buildup_label,
|
buildup_value_label, buildup_percentage_label, total_buildup_label,
|
||||||
total_buildup_value_label)
|
total_buildup_value_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
@@ -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;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
--entity.visibility = visibility;
|
--entity.visibility = visibility;
|
||||||
entity.buildup_bar = table_helpers.deep_copy(buildup_bar);
|
entity.buildup_bar = utils.table.deep_copy(buildup_bar);
|
||||||
entity.highlighted_buildup_bar = table_helpers.deep_copy(highlighted_buildup_bar);
|
entity.highlighted_buildup_bar = utils.table.deep_copy(highlighted_buildup_bar);
|
||||||
entity.ailment_name_label = table_helpers.deep_copy(ailment_name_label);
|
entity.ailment_name_label = utils.table.deep_copy(ailment_name_label);
|
||||||
entity.player_name_label = table_helpers.deep_copy(player_name_label);
|
entity.player_name_label = utils.table.deep_copy(player_name_label);
|
||||||
entity.buildup_value_label = table_helpers.deep_copy(buildup_value_label);
|
entity.buildup_value_label = utils.table.deep_copy(buildup_value_label);
|
||||||
entity.buildup_percentage_label = table_helpers.deep_copy(buildup_percentage_label);
|
entity.buildup_percentage_label = utils.table.deep_copy(buildup_percentage_label);
|
||||||
entity.total_buildup_label = table_helpers.deep_copy(total_buildup_label);
|
entity.total_buildup_label = utils.table.deep_copy(total_buildup_label);
|
||||||
entity.total_buildup_value_label = table_helpers.deep_copy(total_buildup_value_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.x = entity.buildup_bar.offset.x * global_scale_modifier;
|
||||||
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
|
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
|
||||||
@@ -85,7 +88,7 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_buildup_UI_entity.draw(player, player_buildup, ailment_buildup_UI, cached_config, position_on_screen, opacity_scale, top_buildup)
|
function this.draw(player, player_buildup, ailment_buildup_UI, cached_config, position_on_screen, opacity_scale, top_buildup)
|
||||||
local player_buildup_bar_percentage = 0;
|
local player_buildup_bar_percentage = 0;
|
||||||
|
|
||||||
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
|
||||||
@@ -114,12 +117,12 @@ function ailment_buildup_UI_entity.draw(player, player_buildup, ailment_buildup_
|
|||||||
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * player_buildup.buildup_share);
|
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * player_buildup.buildup_share);
|
||||||
end
|
end
|
||||||
|
|
||||||
function ailment_buildup_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
end
|
end
|
||||||
|
|
||||||
return ailment_buildup_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local body_part_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
@@ -32,8 +32,11 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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,
|
function this.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,
|
flinch_value_label, flinch_percentage_label, break_visibility, break_bar, break_text_label, break_value_label,
|
||||||
break_percentage_label, loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
|
break_percentage_label, loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
|
||||||
|
|
||||||
@@ -46,15 +49,15 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
|
|||||||
entity.break_visibility = break_visibility;
|
entity.break_visibility = break_visibility;
|
||||||
entity.loss_visibility = loss_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.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.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_bar = utils.table.deep_copy(flinch_bar);
|
||||||
entity.flinch_text_label = table_helpers.deep_copy(flinch_text_label);
|
entity.flinch_text_label = utils.table.deep_copy(flinch_text_label);
|
||||||
entity.flinch_value_label = table_helpers.deep_copy(flinch_value_label);
|
entity.flinch_value_label = utils.table.deep_copy(flinch_value_label);
|
||||||
entity.flinch_percentage_label = table_helpers.deep_copy(flinch_percentage_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.x = entity.flinch_bar.offset.x * global_scale_modifier;
|
||||||
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * 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.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.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_bar = utils.table.deep_copy(break_bar);
|
||||||
entity.break_text_label = table_helpers.deep_copy(break_text_label);
|
entity.break_text_label = utils.table.deep_copy(break_text_label);
|
||||||
entity.break_value_label = table_helpers.deep_copy(break_value_label);
|
entity.break_value_label = utils.table.deep_copy(break_value_label);
|
||||||
entity.break_percentage_label = table_helpers.deep_copy(break_percentage_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.x = entity.break_bar.offset.x * global_scale_modifier;
|
||||||
entity.break_bar.offset.y = entity.break_bar.offset.y * 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.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.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_bar = utils.table.deep_copy(loss_bar);
|
||||||
entity.loss_text_label = table_helpers.deep_copy(loss_text_label);
|
entity.loss_text_label = utils.table.deep_copy(loss_text_label);
|
||||||
entity.loss_value_label = table_helpers.deep_copy(loss_value_label);
|
entity.loss_value_label = utils.table.deep_copy(loss_value_label);
|
||||||
entity.loss_health_percentage_label = table_helpers.deep_copy(loss_health_percentage_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.x = entity.loss_bar.offset.x * global_scale_modifier;
|
||||||
entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier;
|
entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier;
|
||||||
@@ -117,7 +120,7 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_screen, opacity_scale)
|
function this.draw(part, part_UI, cached_config, position_on_screen, opacity_scale)
|
||||||
if not part_UI.part_visibility then
|
if not part_UI.part_visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -247,10 +250,10 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function body_part_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
end
|
end
|
||||||
|
|
||||||
return body_part_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local buff_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
|
|
||||||
@@ -33,16 +33,19 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function buff_UI_entity.new(bar, name_label, timer_label)
|
function this.new(bar, name_label, timer_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
--entity.visibility = visibility;
|
--entity.visibility = visibility;
|
||||||
entity.bar = table_helpers.deep_copy(bar);
|
entity.bar = utils.table.deep_copy(bar);
|
||||||
entity.name_label = table_helpers.deep_copy(name_label);
|
entity.name_label = utils.table.deep_copy(name_label);
|
||||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
entity.timer_label = utils.table.deep_copy(timer_label);
|
||||||
|
|
||||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||||
@@ -60,7 +63,7 @@ function buff_UI_entity.new(bar, name_label, timer_label)
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
||||||
local cached_config = config.current_config.buff_UI;
|
local cached_config = config.current_config.buff_UI;
|
||||||
|
|
||||||
if not buff.is_infinite then
|
if not buff.is_infinite then
|
||||||
@@ -78,11 +81,11 @@ function buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function buff_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
end
|
end
|
||||||
|
|
||||||
return buff_UI_entity;
|
return this;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local damage_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local config;
|
local config;
|
||||||
local players;
|
local players;
|
||||||
@@ -36,19 +36,22 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
function damage_UI_entity.new(damage_meter_UI_elements, type)
|
function this.new(damage_meter_UI_elements, type)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
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.bar = utils.table.deep_copy(damage_meter_UI_elements.damage_bar);
|
||||||
entity.name_label = table_helpers.deep_copy(damage_meter_UI_elements.name_label);
|
entity.name_label = utils.table.deep_copy(damage_meter_UI_elements.name_label);
|
||||||
entity.hunter_rank_label = table_helpers.deep_copy(damage_meter_UI_elements.hunter_rank_label);
|
entity.hunter_rank_label = utils.table.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.cart_count_label = utils.table.deep_copy(damage_meter_UI_elements.cart_count_label);
|
||||||
entity.dps_label = table_helpers.deep_copy(damage_meter_UI_elements.dps_label);
|
entity.dps_label = utils.table.deep_copy(damage_meter_UI_elements.dps_label);
|
||||||
entity.value_label = table_helpers.deep_copy(damage_meter_UI_elements.damage_value_label);
|
entity.value_label = utils.table.deep_copy(damage_meter_UI_elements.damage_value_label);
|
||||||
entity.percentage_label = table_helpers.deep_copy(damage_meter_UI_elements.damage_percentage_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;
|
entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit;
|
||||||
|
|
||||||
@@ -108,7 +111,7 @@ function damage_UI_entity.new(damage_meter_UI_elements, type)
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
|
function this.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||||
local cached_config = config.current_config.damage_meter_UI;
|
local cached_config = config.current_config.damage_meter_UI;
|
||||||
|
|
||||||
local name_include = nil;
|
local name_include = nil;
|
||||||
@@ -230,8 +233,8 @@ function damage_UI_entity.draw(player, position_on_screen, opacity_scale, top_da
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function damage_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
players = require("MHR_Overlay.Damage_Meter.players");
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
@@ -240,4 +243,4 @@ function damage_UI_entity.init_module()
|
|||||||
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
non_players = require("MHR_Overlay.Damage_Meter.non_players");
|
||||||
end
|
end
|
||||||
|
|
||||||
return damage_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local health_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
local config;
|
local config;
|
||||||
@@ -33,17 +33,20 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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)
|
function this.new(visibility, bar, text_label, value_label, percentage_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
entity.visibility = visibility;
|
entity.visibility = visibility;
|
||||||
entity.bar = table_helpers.deep_copy(bar);
|
entity.bar = utils.table.deep_copy(bar);
|
||||||
entity.text_label = table_helpers.deep_copy(text_label);
|
entity.text_label = utils.table.deep_copy(text_label);
|
||||||
entity.value_label = table_helpers.deep_copy(value_label);
|
entity.value_label = utils.table.deep_copy(value_label);
|
||||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
entity.percentage_label = utils.table.deep_copy(percentage_label);
|
||||||
|
|
||||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||||
@@ -64,7 +67,7 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function health_UI_entity.draw(monster, health_UI, position_on_screen, opacity_scale)
|
function this.draw(monster, health_UI, position_on_screen, opacity_scale)
|
||||||
if not health_UI.visibility then
|
if not health_UI.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -88,11 +91,11 @@ function health_UI_entity.draw(monster, health_UI, position_on_screen, opacity_s
|
|||||||
drawing.draw_label(health_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.health_percentage);
|
drawing.draw_label(health_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.health_percentage);
|
||||||
end
|
end
|
||||||
|
|
||||||
function health_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
end
|
end
|
||||||
|
|
||||||
return health_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local rage_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
local config;
|
local config;
|
||||||
@@ -33,18 +33,21 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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)
|
function this.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
entity.visibility = visibility;
|
entity.visibility = visibility;
|
||||||
entity.bar = table_helpers.deep_copy(bar);
|
entity.bar = utils.table.deep_copy(bar);
|
||||||
entity.text_label = table_helpers.deep_copy(text_label);
|
entity.text_label = utils.table.deep_copy(text_label);
|
||||||
entity.value_label = table_helpers.deep_copy(value_label);
|
entity.value_label = utils.table.deep_copy(value_label);
|
||||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
entity.percentage_label = utils.table.deep_copy(percentage_label);
|
||||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
entity.timer_label = utils.table.deep_copy(timer_label);
|
||||||
|
|
||||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||||
@@ -68,7 +71,7 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale)
|
function this.draw(monster, rage_UI, position_on_screen, opacity_scale)
|
||||||
if not rage_UI.visibility then
|
if not rage_UI.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -102,11 +105,11 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function rage_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
end
|
end
|
||||||
|
|
||||||
return rage_UI_entity;
|
return this;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local stamina_UI_entity = {};
|
local this = {};
|
||||||
|
|
||||||
local table_helpers;
|
local utils;
|
||||||
local drawing;
|
local drawing;
|
||||||
local language;
|
local language;
|
||||||
local config;
|
local config;
|
||||||
@@ -33,18 +33,21 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
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)
|
function this.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
|
||||||
local entity = {};
|
local entity = {};
|
||||||
|
|
||||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||||
|
|
||||||
entity.visibility = visibility;
|
entity.visibility = visibility;
|
||||||
entity.bar = table_helpers.deep_copy(bar);
|
entity.bar = utils.table.deep_copy(bar);
|
||||||
entity.text_label = table_helpers.deep_copy(text_label);
|
entity.text_label = utils.table.deep_copy(text_label);
|
||||||
entity.value_label = table_helpers.deep_copy(value_label);
|
entity.value_label = utils.table.deep_copy(value_label);
|
||||||
entity.percentage_label = table_helpers.deep_copy(percentage_label);
|
entity.percentage_label = utils.table.deep_copy(percentage_label);
|
||||||
entity.timer_label = table_helpers.deep_copy(timer_label);
|
entity.timer_label = utils.table.deep_copy(timer_label);
|
||||||
|
|
||||||
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
|
||||||
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
|
||||||
@@ -66,7 +69,7 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
|
|||||||
return entity;
|
return entity;
|
||||||
end
|
end
|
||||||
|
|
||||||
function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity_scale)
|
function this.draw(monster, stamina_UI, position_on_screen, opacity_scale)
|
||||||
if not stamina_UI.visibility then
|
if not stamina_UI.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -99,11 +102,11 @@ function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function stamina_UI_entity.init_module()
|
function this.init_module()
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
drawing = require("MHR_Overlay.UI.drawing");
|
drawing = require("MHR_Overlay.UI.drawing");
|
||||||
language = require("MHR_Overlay.Misc.language");
|
language = require("MHR_Overlay.Misc.language");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
end
|
end
|
||||||
|
|
||||||
return stamina_UI_entity;
|
return this;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,7 @@
|
|||||||
local drawing = {};
|
local this = {};
|
||||||
|
|
||||||
local config;
|
local config;
|
||||||
local table_helpers;
|
local utils;
|
||||||
local unicode_helpers;
|
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -32,15 +31,18 @@ local imgui = imgui;
|
|||||||
local draw = draw;
|
local draw = draw;
|
||||||
local Vector2f = Vector2f;
|
local Vector2f = Vector2f;
|
||||||
local reframework = reframework;
|
local reframework = reframework;
|
||||||
|
local os = os;
|
||||||
|
local ValueType = ValueType;
|
||||||
|
local package = package;
|
||||||
|
|
||||||
drawing.font = nil;
|
this.font = nil;
|
||||||
|
|
||||||
function drawing.init_font()
|
function this.init_font()
|
||||||
local cached_config = config.current_config.global_settings.UI_font;
|
local cached_config = config.current_config.global_settings.UI_font;
|
||||||
drawing.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold, cached_config.italic);
|
this.font = d2d.Font.new(cached_config.family, cached_config.size, cached_config.bold, cached_config.italic);
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.argb_color_to_abgr_color(argb_color)
|
function this.argb_color_to_abgr_color(argb_color)
|
||||||
local alpha = (argb_color >> 24) & 0xFF;
|
local alpha = (argb_color >> 24) & 0xFF;
|
||||||
local red = (argb_color >> 16) & 0xFF;
|
local red = (argb_color >> 16) & 0xFF;
|
||||||
local green = (argb_color >> 8) & 0xFF;
|
local green = (argb_color >> 8) & 0xFF;
|
||||||
@@ -51,7 +53,7 @@ function drawing.argb_color_to_abgr_color(argb_color)
|
|||||||
return abgr_color;
|
return abgr_color;
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.color_to_argb(color)
|
function this.color_to_argb(color)
|
||||||
local alpha = (color >> 24) & 0xFF;
|
local alpha = (color >> 24) & 0xFF;
|
||||||
local red = (color >> 16) & 0xFF;
|
local red = (color >> 16) & 0xFF;
|
||||||
local green = (color >> 8) & 0xFF;
|
local green = (color >> 8) & 0xFF;
|
||||||
@@ -60,24 +62,24 @@ function drawing.color_to_argb(color)
|
|||||||
return alpha, red, green, blue;
|
return alpha, red, green, blue;
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.argb_to_color(alpha, red, green, blue)
|
function this.argb_to_color(alpha, red, green, blue)
|
||||||
return 0x1000000 * alpha + 0x10000 * red + 0x100 * green + blue;
|
return 0x1000000 * alpha + 0x10000 * red + 0x100 * green + blue;
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.limit_text_size(text, size_limit)
|
function this.limit_text_size(text, size_limit)
|
||||||
if d2d == nil or not config.current_config.global_settings.renderer.use_d2d_if_available or size_limit <= 0 then
|
if d2d == nil or not config.current_config.global_settings.renderer.use_d2d_if_available or size_limit <= 0 then
|
||||||
return text;
|
return text;
|
||||||
end
|
end
|
||||||
|
|
||||||
local limited_text = text;
|
local limited_text = text;
|
||||||
while limited_text ~= "..." do
|
while limited_text ~= "..." do
|
||||||
local text_width, text_height = drawing.font:measure(limited_text);
|
local text_width, text_height = this.font:measure(limited_text);
|
||||||
|
|
||||||
if text_width < size_limit then
|
if text_width < size_limit then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
local old_limited_text = limited_text;
|
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
|
if limited_text == old_limited_text then
|
||||||
break
|
break
|
||||||
@@ -88,8 +90,8 @@ function drawing.limit_text_size(text, size_limit)
|
|||||||
return limited_text;
|
return limited_text;
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.scale_color_opacity(color, scale)
|
function this.scale_color_opacity(color, scale)
|
||||||
local alpha, red, green, blue = drawing.color_to_argb(color);
|
local alpha, red, green, blue = this.color_to_argb(color);
|
||||||
local new_alpha = math.floor(alpha * scale);
|
local new_alpha = math.floor(alpha * scale);
|
||||||
if new_alpha < 0 then
|
if new_alpha < 0 then
|
||||||
new_alpha = 0;
|
new_alpha = 0;
|
||||||
@@ -98,28 +100,28 @@ function drawing.scale_color_opacity(color, scale)
|
|||||||
new_alpha = 255;
|
new_alpha = 255;
|
||||||
end
|
end
|
||||||
|
|
||||||
return drawing.argb_to_color(new_alpha, red, green, blue);
|
return this.argb_to_color(new_alpha, red, green, blue);
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.scale_bar_opacity(bar, scale)
|
function this.scale_bar_opacity(bar, scale)
|
||||||
if bar == nil or scale == nil or not bar.visibility then
|
if bar == nil or scale == nil or not bar.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
bar.colors.foreground = drawing.scale_color_opacity(bar.colors.foreground, scale);
|
bar.colors.foreground = this.scale_color_opacity(bar.colors.foreground, scale);
|
||||||
bar.colors.background = drawing.scale_color_opacity(bar.colors.background, scale);
|
bar.colors.background = this.scale_color_opacity(bar.colors.background, scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.scale_label_opacity(label, scale)
|
function this.scale_label_opacity(label, scale)
|
||||||
if label == nil or scale == nil or not label.visibility then
|
if label == nil or scale == nil or not label.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
label.color = drawing.scale_color_opacity(label.color, scale);
|
label.color = this.scale_color_opacity(label.color, scale);
|
||||||
label.shadow.color = drawing.scale_color_opacity(label.shadow.color, scale);
|
label.shadow.color = this.scale_color_opacity(label.shadow.color, scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.draw_label(label, position, opacity_scale, ...)
|
function this.draw_label(label, position, opacity_scale, ...)
|
||||||
if label == nil or not label.visibility then
|
if label == nil or not label.visibility then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -139,32 +141,32 @@ function drawing.draw_label(label, position, opacity_scale, ...)
|
|||||||
local new_shadow_color = label.shadow.color;
|
local new_shadow_color = label.shadow.color;
|
||||||
|
|
||||||
if opacity_scale < 1 then
|
if opacity_scale < 1 then
|
||||||
new_shadow_color = drawing.scale_color_opacity(new_shadow_color, opacity_scale);
|
new_shadow_color = this.scale_color_opacity(new_shadow_color, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
if use_d2d then
|
if use_d2d then
|
||||||
d2d.text(drawing.font, text, position_x + label.shadow.offset.x, position_y + label.shadow.offset.y, new_shadow_color);
|
d2d.text(this.font, text, position_x + label.shadow.offset.x, position_y + label.shadow.offset.y, new_shadow_color);
|
||||||
else
|
else
|
||||||
new_shadow_color = drawing.argb_color_to_abgr_color(new_shadow_color);
|
new_shadow_color = this.argb_color_to_abgr_color(new_shadow_color);
|
||||||
draw.text(text, position_x + label.shadow.offset.x, position_y + label.shadow.offset.y, new_shadow_color);
|
draw.text(text, position_x + label.shadow.offset.x, position_y + label.shadow.offset.y, new_shadow_color);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local new_color = label.color;
|
local new_color = label.color;
|
||||||
if opacity_scale < 1 then
|
if opacity_scale < 1 then
|
||||||
new_color = drawing.scale_color_opacity(new_color, opacity_scale);
|
new_color = this.scale_color_opacity(new_color, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
if use_d2d then
|
if use_d2d then
|
||||||
d2d.text(drawing.font, text, position_x, position_y, new_color);
|
d2d.text(this.font, text, position_x, position_y, new_color);
|
||||||
else
|
else
|
||||||
new_color = drawing.argb_color_to_abgr_color(new_color);
|
new_color = this.argb_color_to_abgr_color(new_color);
|
||||||
draw.text(text, position_x, position_y, new_color);
|
draw.text(text, position_x, position_y, new_color);
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
function this.draw_bar(bar, position, opacity_scale, percentage)
|
||||||
|
|
||||||
if bar == nil or not bar.visibility then
|
if bar == nil or not bar.visibility then
|
||||||
return;
|
return;
|
||||||
@@ -262,9 +264,9 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
|||||||
local outline_color = bar.colors.outline;
|
local outline_color = bar.colors.outline;
|
||||||
|
|
||||||
if opacity_scale < 1 then
|
if opacity_scale < 1 then
|
||||||
foreground_color = drawing.scale_color_opacity(foreground_color, opacity_scale);
|
foreground_color = this.scale_color_opacity(foreground_color, opacity_scale);
|
||||||
background_color = drawing.scale_color_opacity(background_color, opacity_scale);
|
background_color = this.scale_color_opacity(background_color, opacity_scale);
|
||||||
outline_color = drawing.scale_color_opacity(outline_color, opacity_scale);
|
outline_color = this.scale_color_opacity(outline_color, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
|
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
|
||||||
@@ -275,7 +277,7 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
|||||||
d2d.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_thickness,
|
d2d.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_thickness,
|
||||||
outline_color);
|
outline_color);
|
||||||
else
|
else
|
||||||
outline_color = drawing.argb_color_to_abgr_color(outline_color);
|
outline_color = this.argb_color_to_abgr_color(outline_color);
|
||||||
draw.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_color);
|
draw.outline_rect(outline_position_x, outline_position_y, outline_width, outline_height, outline_color);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -286,7 +288,7 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
|||||||
d2d.fill_rect(position_x, position_y, foreground_width, height, foreground_color);
|
d2d.fill_rect(position_x, position_y, foreground_width, height, foreground_color);
|
||||||
|
|
||||||
else
|
else
|
||||||
foreground_color = drawing.argb_color_to_abgr_color(foreground_color);
|
foreground_color = this.argb_color_to_abgr_color(foreground_color);
|
||||||
draw.filled_rect(position_x, position_y, foreground_width, height, foreground_color)
|
draw.filled_rect(position_x, position_y, foreground_width, height, foreground_color)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -296,13 +298,13 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
|||||||
if use_d2d then
|
if use_d2d then
|
||||||
d2d.fill_rect(position_x + foreground_width, position_y, background_width, height, background_color);
|
d2d.fill_rect(position_x + foreground_width, position_y, background_width, height, background_color);
|
||||||
else
|
else
|
||||||
background_color = drawing.argb_color_to_abgr_color(background_color);
|
background_color = this.argb_color_to_abgr_color(background_color);
|
||||||
draw.filled_rect(position_x + foreground_width, position_y, background_width, height, background_color)
|
draw.filled_rect(position_x + foreground_width, position_y, background_width, height, background_color)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.draw_capture_line(health_UI, position, opacity_scale, percentage)
|
function this.draw_capture_line(health_UI, position, opacity_scale, percentage)
|
||||||
if health_UI == nil or not health_UI.visibility or health_UI.bar == nil or not health_UI.bar.visibility or
|
if health_UI == nil or not health_UI.visibility or health_UI.bar == nil or not health_UI.bar.visibility or
|
||||||
health_UI.bar.capture_line == nil or not health_UI.bar.capture_line.visibility or percentage >= 1 or percentage <= 0 then
|
health_UI.bar.capture_line == nil or not health_UI.bar.capture_line.visibility or percentage >= 1 or percentage <= 0 then
|
||||||
return;
|
return;
|
||||||
@@ -315,7 +317,7 @@ function drawing.draw_capture_line(health_UI, position, opacity_scale, percentag
|
|||||||
local color = health_UI.bar.capture_line.color;
|
local color = health_UI.bar.capture_line.color;
|
||||||
|
|
||||||
if opacity_scale < 1 then
|
if opacity_scale < 1 then
|
||||||
color = drawing.scale_color_opacity(color, opacity_scale);
|
color = this.scale_color_opacity(color, opacity_scale);
|
||||||
end
|
end
|
||||||
|
|
||||||
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
|
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
|
||||||
@@ -324,16 +326,15 @@ function drawing.draw_capture_line(health_UI, position, opacity_scale, percentag
|
|||||||
d2d.fill_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height,
|
d2d.fill_rect(position_x, position_y, health_UI.bar.capture_line.size.width, health_UI.bar.capture_line.size.height,
|
||||||
color);
|
color);
|
||||||
else
|
else
|
||||||
color = drawing.argb_color_to_abgr_color(color);
|
color = this.argb_color_to_abgr_color(color);
|
||||||
draw.filled_rect(position_x, position_y, health_UI.bar.capture_line.size.width,
|
draw.filled_rect(position_x, position_y, health_UI.bar.capture_line.size.width,
|
||||||
health_UI.bar.capture_line.size.height, color)
|
health_UI.bar.capture_line.size.height, color)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawing.init_module()
|
function this.init_module()
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
table_helpers = require("MHR_Overlay.Misc.table_helpers");
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
unicode_helpers = require("MHR_Overlay.Misc.unicode_helpers");
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return drawing;
|
return this;
|
||||||
|
|||||||
@@ -306,6 +306,7 @@
|
|||||||
"font_name": "NotoSansKR-Bold.otf",
|
"font_name": "NotoSansKR-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "Abdomen",
|
"abdomen": "Abdomen",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "Antenna",
|
"antenna": "Antenna",
|
||||||
"arms": "Arms",
|
"arms": "Arms",
|
||||||
"arms_mud": "Arms (Mud)",
|
"arms_mud": "Arms (Mud)",
|
||||||
|
|||||||
@@ -306,6 +306,7 @@
|
|||||||
"font_name": "NotoSansJP-Bold.otf",
|
"font_name": "NotoSansJP-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "腹部",
|
"abdomen": "腹部",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "触角",
|
"antenna": "触角",
|
||||||
"arms": "腕",
|
"arms": "腕",
|
||||||
"arms_mud": "腕(泥)",
|
"arms_mud": "腕(泥)",
|
||||||
|
|||||||
@@ -306,6 +306,7 @@
|
|||||||
"font_name": "NotoSansKR-Bold.otf",
|
"font_name": "NotoSansKR-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "배",
|
"abdomen": "배",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "더듬이",
|
"antenna": "더듬이",
|
||||||
"arms": "팔",
|
"arms": "팔",
|
||||||
"arms_mud": "팔(진흙)",
|
"arms_mud": "팔(진흙)",
|
||||||
|
|||||||
@@ -83,8 +83,8 @@
|
|||||||
"creature_name_label": "Метка имени существа",
|
"creature_name_label": "Метка имени существа",
|
||||||
"crown": "Корона",
|
"crown": "Корона",
|
||||||
"crown_thresholds": "Лимиты корон",
|
"crown_thresholds": "Лимиты корон",
|
||||||
"current_state": "Current State",
|
"current_state": "Текущее состояние",
|
||||||
"current_value": "Current Value",
|
"current_value": "Текущее значение",
|
||||||
"cutscene": "Катсцена",
|
"cutscene": "Катсцена",
|
||||||
"damage": "Урон",
|
"damage": "Урон",
|
||||||
"damage_bar": "Шкала урона",
|
"damage_bar": "Шкала урона",
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
"damage_meter_UI": "Интерфейс модуля урона",
|
"damage_meter_UI": "Интерфейс модуля урона",
|
||||||
"damage_percentage_label": "Метка урона в процентах",
|
"damage_percentage_label": "Метка урона в процентах",
|
||||||
"damage_value_label": "Метка значений урона",
|
"damage_value_label": "Метка значений урона",
|
||||||
"default_state": "Default State",
|
"default_state": "Состояние по умолчанию",
|
||||||
"delete": "Удалить",
|
"delete": "Удалить",
|
||||||
"distance": "Расстояние",
|
"distance": "Расстояние",
|
||||||
"dps": "Урон в секунду",
|
"dps": "Урон в секунду",
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
"farthest": "Самый дальний",
|
"farthest": "Самый дальний",
|
||||||
"fight_time": "Время в бою",
|
"fight_time": "Время в бою",
|
||||||
"filter": "Фильтр",
|
"filter": "Фильтр",
|
||||||
"filter_mode": "Filter Mode",
|
"filter_mode": "Режим Фильтра",
|
||||||
"first": "Первый",
|
"first": "Первый",
|
||||||
"first_hit": "Первый удар",
|
"first_hit": "Первый удар",
|
||||||
"flinch_count": "Кол-во вздрагиваний",
|
"flinch_count": "Кол-во вздрагиваний",
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
"master_rank": "Ранг мастера",
|
"master_rank": "Ранг мастера",
|
||||||
"max_distance": "Макс. расстояние",
|
"max_distance": "Макс. расстояние",
|
||||||
"max_monster_updates_per_tick": "Макс. кол-во обновлений за тик",
|
"max_monster_updates_per_tick": "Макс. кол-во обновлений за тик",
|
||||||
"max_value": "Max Value",
|
"max_value": "Максимальное значение",
|
||||||
"me": "Я",
|
"me": "Я",
|
||||||
"menu_font": "Шрифт меню",
|
"menu_font": "Шрифт меню",
|
||||||
"menu_font_change_disclaimer": "Изменение языка и размера шрифта меню несколько раз приведёт к вылету!",
|
"menu_font_change_disclaimer": "Изменение языка и размера шрифта меню несколько раз приведёт к вылету!",
|
||||||
@@ -306,6 +306,7 @@
|
|||||||
"font_name": "NotoSansKR-Bold.otf",
|
"font_name": "NotoSansKR-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "Брюхо",
|
"abdomen": "Брюхо",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "Антернна",
|
"antenna": "Антернна",
|
||||||
"arms": "Передние лапы",
|
"arms": "Передние лапы",
|
||||||
"arms_mud": "Передние лапы (в грязи)",
|
"arms_mud": "Передние лапы (в грязи)",
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
"blast_damage": "爆破伤害",
|
"blast_damage": "爆破伤害",
|
||||||
"body_parts": "身体部位",
|
"body_parts": "身体部位",
|
||||||
"bold": "粗体",
|
"bold": "粗体",
|
||||||
"bomb_damage": "炸弹伤害",
|
"bomb_damage": "爆弹桶伤害",
|
||||||
"bottom_left": "左下",
|
"bottom_left": "左下",
|
||||||
"bottom_right": "右下",
|
"bottom_right": "右下",
|
||||||
"break_count": "破坏次数",
|
"break_count": "破坏次数",
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
"cart_count": "猫车数",
|
"cart_count": "猫车数",
|
||||||
"cart_count_label": "猫车数标签",
|
"cart_count_label": "猫车数标签",
|
||||||
"center": "中央",
|
"center": "中央",
|
||||||
"closest": "最近",
|
"closest": "最近的",
|
||||||
"color": "颜色",
|
"color": "颜色",
|
||||||
"colors": "颜色",
|
"colors": "颜色",
|
||||||
"config": "设置",
|
"config": "设置",
|
||||||
@@ -149,14 +149,14 @@
|
|||||||
"highlighted_bar": "高亮条",
|
"highlighted_bar": "高亮条",
|
||||||
"highlighted_buildup_bar": "高亮积累值条",
|
"highlighted_buildup_bar": "高亮积累值条",
|
||||||
"highlighted_damage_bar": "高亮伤害条",
|
"highlighted_damage_bar": "高亮伤害条",
|
||||||
"highlighted_targeted": "高亮(目标)",
|
"highlighted_targeted": "高亮目标[锁定目标的UI]",
|
||||||
"horizontal": "水平",
|
"horizontal": "水平",
|
||||||
"hotkeys": "热键",
|
"hotkeys": "热键",
|
||||||
"hunter_rank": "猎人等级",
|
"hunter_rank": "猎人等级",
|
||||||
"hunter_rank_label": "猎人等级标签",
|
"hunter_rank_label": "猎人等级标签",
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"in_lobby": "在大厅",
|
"in_lobby": "在大厅",
|
||||||
"in_training_area": "在训练场",
|
"in_training_area": "在修炼场",
|
||||||
"include": "包含",
|
"include": "包含",
|
||||||
"inside": "里面",
|
"inside": "里面",
|
||||||
"installation_damage": "设施伤害",
|
"installation_damage": "设施伤害",
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"mode": "模式",
|
"mode": "模式",
|
||||||
"modifiers": "更改项",
|
"modifiers": "更改项",
|
||||||
"module_visibility_based_on_game_state": "模块可见性基于游戏阶段",
|
"module_visibility_based_on_game_state": "基于游戏状态的模组可视化设置",
|
||||||
"modules": "模块",
|
"modules": "模块",
|
||||||
"monster_can_be_captured": "可捕获的怪物",
|
"monster_can_be_captured": "可捕获的怪物",
|
||||||
"monster_damage": "怪物伤害",
|
"monster_damage": "怪物伤害",
|
||||||
@@ -198,9 +198,9 @@
|
|||||||
"my_damage_bar_location": "我的伤害条位置",
|
"my_damage_bar_location": "我的伤害条位置",
|
||||||
"my_otomos": "我的随从",
|
"my_otomos": "我的随从",
|
||||||
"myself": "我自己",
|
"myself": "我自己",
|
||||||
"name": "名字",
|
"name": "名称",
|
||||||
"name_label": "名字标签",
|
"name_label": "名字标签",
|
||||||
"new": "新",
|
"new": "新建",
|
||||||
"none": "空",
|
"none": "空",
|
||||||
"normal": "正常",
|
"normal": "正常",
|
||||||
"offset": "偏移",
|
"offset": "偏移",
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
"player_name_label": "玩家名标签",
|
"player_name_label": "玩家名标签",
|
||||||
"player_name_size_limit": "玩家名长度限制",
|
"player_name_size_limit": "玩家名长度限制",
|
||||||
"player_spacing": "玩家间距",
|
"player_spacing": "玩家间距",
|
||||||
"playing_quest": "Playing Quest",
|
"playing_quest": "操作界面/正常游玩时",
|
||||||
"poison_damage": "中毒伤害",
|
"poison_damage": "中毒伤害",
|
||||||
"position": "位置",
|
"position": "位置",
|
||||||
"press_any_key": "按任意键...",
|
"press_any_key": "按任意键...",
|
||||||
@@ -238,8 +238,8 @@
|
|||||||
"rename": "重命名",
|
"rename": "重命名",
|
||||||
"render_highlighted_monster": "渲染高亮怪物",
|
"render_highlighted_monster": "渲染高亮怪物",
|
||||||
"render_not_highlighted_monsters": "渲染非高亮怪物",
|
"render_not_highlighted_monsters": "渲染非高亮怪物",
|
||||||
"renderer": "渲染",
|
"renderer": "渲染器",
|
||||||
"reset": "充值",
|
"reset": "重置",
|
||||||
"reversed_order": "逆向排序",
|
"reversed_order": "逆向排序",
|
||||||
"reward_screen": "奖励界面",
|
"reward_screen": "奖励界面",
|
||||||
"servant_otomos": "盟友随从",
|
"servant_otomos": "盟友随从",
|
||||||
@@ -247,9 +247,9 @@
|
|||||||
"settings": "设定",
|
"settings": "设定",
|
||||||
"severe_filter": "切断",
|
"severe_filter": "切断",
|
||||||
"shadow": "阴影",
|
"shadow": "阴影",
|
||||||
"show_my_otomos_separately": "将我的随从分开显示",
|
"show_my_otomos_separately": "分开显示我的随从",
|
||||||
"show_other_player_otomos_separately": "将其他玩家的随从分开显示",
|
"show_other_player_otomos_separately": "分开显示其他玩家的随从",
|
||||||
"show_servant_otomos_separately": "将盟友的随从分开显示",
|
"show_servant_otomos_separately": "分开显示盟友的随从",
|
||||||
"size": "大小",
|
"size": "大小",
|
||||||
"small_monster_UI": "小型怪物UI",
|
"small_monster_UI": "小型怪物UI",
|
||||||
"small_monsters": "小型怪物群",
|
"small_monsters": "小型怪物群",
|
||||||
@@ -306,13 +306,14 @@
|
|||||||
"font_name": "NotoSansSC-Bold.otf",
|
"font_name": "NotoSansSC-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "腹部",
|
"abdomen": "腹部",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "触角",
|
"antenna": "触角",
|
||||||
"arms": "手臂",
|
"arms": "手臂",
|
||||||
"arms_mud": "手臂(泥土)",
|
"arms_mud": "手臂(泥)",
|
||||||
"back": "背部",
|
"back": "背部",
|
||||||
"back_windsac": "背部(风袋)",
|
"back_windsac": "背部(风袋)",
|
||||||
"body": "本体",
|
"body": "本体",
|
||||||
"body_mud": "身体(泥土)",
|
"body_mud": "身体(泥)",
|
||||||
"carapace": "甲壳",
|
"carapace": "甲壳",
|
||||||
"chest": "胸部",
|
"chest": "胸部",
|
||||||
"chest_windsac": "胸部(风袋)",
|
"chest_windsac": "胸部(风袋)",
|
||||||
@@ -333,8 +334,8 @@
|
|||||||
"left_foreleg": "左前腿",
|
"left_foreleg": "左前腿",
|
||||||
"left_hind_leg": "左后腿",
|
"left_hind_leg": "左后腿",
|
||||||
"left_leg": "左腿",
|
"left_leg": "左腿",
|
||||||
"left_leg_mud": "左腿(泥土)",
|
"left_leg_mud": "左腿(泥)",
|
||||||
"left_legs": "左腿部",
|
"left_legs": "左腿",
|
||||||
"left_wing": "左翼",
|
"left_wing": "左翼",
|
||||||
"left_wingclaw": "左翼爪",
|
"left_wingclaw": "左翼爪",
|
||||||
"legs": "四肢",
|
"legs": "四肢",
|
||||||
@@ -351,8 +352,8 @@
|
|||||||
"right_foreleg": "右前腿",
|
"right_foreleg": "右前腿",
|
||||||
"right_hind_leg": "右后腿",
|
"right_hind_leg": "右后腿",
|
||||||
"right_leg": "右腿",
|
"right_leg": "右腿",
|
||||||
"right_leg_mud": "右腿(泥土)",
|
"right_leg_mud": "右腿(泥)",
|
||||||
"right_legs": "右腿部",
|
"right_legs": "右腿",
|
||||||
"right_wing": "右翼",
|
"right_wing": "右翼",
|
||||||
"right_wingclaw": "右翼爪",
|
"right_wingclaw": "右翼爪",
|
||||||
"rock": "岩石",
|
"rock": "岩石",
|
||||||
@@ -364,9 +365,9 @@
|
|||||||
"tail_windsac": "尾巴(风袋)",
|
"tail_windsac": "尾巴(风袋)",
|
||||||
"thundersacs": "雷袋",
|
"thundersacs": "雷袋",
|
||||||
"torso": "躯干",
|
"torso": "躯干",
|
||||||
"torso_mud": "躯干(泥土)",
|
"torso_mud": "躯干(泥)",
|
||||||
"unknown": "?",
|
"unknown": "未知【等待更新】",
|
||||||
"upper_back": "上背部",
|
"upper_back": "上背",
|
||||||
"upper_body": "上半身",
|
"upper_body": "上半身",
|
||||||
"wingclaw": "翼爪",
|
"wingclaw": "翼爪",
|
||||||
"wingclaws": "翼爪",
|
"wingclaws": "翼爪",
|
||||||
|
|||||||
@@ -306,6 +306,7 @@
|
|||||||
"font_name": "NotoSansTC-Bold.otf",
|
"font_name": "NotoSansTC-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "腹部",
|
"abdomen": "腹部",
|
||||||
|
"amatsu_unknown": "?",
|
||||||
"antenna": "觸角",
|
"antenna": "觸角",
|
||||||
"arms": "手臂",
|
"arms": "手臂",
|
||||||
"arms_mud": "手臂 (泥)",
|
"arms_mud": "手臂 (泥)",
|
||||||
|
|||||||
Reference in New Issue
Block a user