52 Commits

Author SHA1 Message Date
GreenComfyTea
40820f98a7 Return missing debug.lua 2023-04-21 12:54:35 +03:00
GreenComfyTea
dd8a6bc2d7 Update README.md 2023-04-21 11:37:51 +03:00
GreenComfyTea
5dbfcb89f4 Update README.md 2023-04-21 11:27:21 +03:00
GreenComfyTea
75a7d8fa8c Update ru-ru 2023-04-21 11:06:37 +03:00
GreenComfyTea
d4e97854c3 Mark Amatsu 7th Part as Unknown 2023-04-21 11:04:55 +03:00
GreenComfyTea
81a803cc7c Dont register global xy debug variable if debug is missing or debug.enabled = false 2023-04-21 10:21:27 +03:00
GreenComfyTea
9b1ff5b264 Utilize this keyword everywhere 2023-04-21 10:19:12 +03:00
GreenComfyTea
94e9e5d18b Merge branch 'main' of https://github.com/GreenComfyTea/MHR-Overlay.git; branch 'main' of https://github.com/GreenComfyTea/MHR-Overlay 2023-04-21 10:13:24 +03:00
GreenComfyTea
96afca0ade Map Risen Shagaru Magala and Amatsu part names 2023-04-21 10:13:14 +03:00
GreenComfyTea
f627a0b19b Merge table_helpers and unicode_helpers into utils 2023-04-21 10:08:07 +03:00
GreenComfyTea
ad2097b380 Merge pull request #63 from sukiqwq/patch-1 2023-04-21 08:55:31 +03:00
RqLiu
a08ecff5d7 Update zh-cn.json 2023-04-20 16:10:05 -04:00
GreenComfyTea
3dcb55e086 Update LICENSE 2023-04-20 10:39:50 +03:00
GreenComfyTea
23df95e30e Merge remote-tracking branch 'origin/main' into main 2023-04-19 11:36:13 +03:00
GreenComfyTea
ba3ec120b2 ; 2023-04-19 11:35:08 +03:00
GreenComfyTea
c8cad67d15 Merge pull request #62 from etnAtker/update-zh-cn-translation
Update zh-cn translation
2023-03-25 09:31:15 +02:00
etnAtker
3090e6bb6a Update zh-cn translation 2023-03-25 12:00:20 +08:00
GreenComfyTea
0a9c8488d6 Add wall hit damage (only host/local) 2023-03-07 11:55:30 +02:00
GreenComfyTea
c2531b77a2 Add option to filter parts based on current state 2023-03-06 13:48:55 +02:00
GreenComfyTea
6a4f4a9dfe Add include options for value/max labels 2023-03-06 13:24:01 +02:00
GreenComfyTea
7346b8d96f Update Korean Localization to v2.4.1 2023-03-01 17:41:02 +02:00
GreenComfyTea
7158c0d367 Uncomment Poison and Stun Ailment Buildup UIs 2023-03-01 16:59:24 +02:00
GreenComfyTea
c145c8a37b Move debug xy 2023-03-01 16:46:29 +02:00
GreenComfyTea
c1464dcc12 Fix poison damage not being accounted due to buildup_share being deep-copied 2023-03-01 16:46:11 +02:00
GreenComfyTea
6723091294 Bump version to 2.4.1 2023-02-07 20:01:42 +02:00
GreenComfyTea
650eba5568 Mapped TU4 Monsters: Velkhana and Risen Valstrax 2023-02-07 20:01:27 +02:00
GreenComfyTea
80b6977e0f Localization fixes 2023-02-07 19:41:50 +02:00
GreenComfyTea
ce250961fe Localization fixes 2023-02-07 19:41:38 +02:00
GreenComfyTea
09d82dea54 Add Buff UI (visuals only/commented out) 2023-02-07 19:41:08 +02:00
GreenComfyTea
c74a93a3b2 Fix "highlighted (targeted)" being used in damage meter 2023-02-06 16:53:13 +02:00
GreenComfyTea
ccd64f534c Cache some methods 2023-02-06 16:43:00 +02:00
GreenComfyTea
60bcd5770d Cache all global variables 2023-02-06 16:31:59 +02:00
GreenComfyTea
9252beba11 pcall each large monster UI individually 2023-02-06 15:58:28 +02:00
GreenComfyTea
9958817989 Fix a bug when autotarget was trying to target dead monster causing all large monster UI to not work 2023-02-06 15:55:57 +02:00
GreenComfyTea
fcf35d817f Potential fix to damage meter showing incorrect players sometimes 2023-02-06 15:26:03 +02:00
GreenComfyTea
b1d84ab739 Move default static large mon. UI from screen edge 2023-02-06 15:25:20 +02:00
GreenComfyTea
82033313ba Merge branch 'main' of https://github.com/GreenComfyTea/MHR-Overlay 2023-02-06 12:47:24 +02:00
GreenComfyTea
23213fcab0 Dont highlight if dps/damage is 0 2023-02-06 12:47:01 +02:00
GreenComfyTea
976abee356 Fix Highlighted Damage UI not being initialized 2023-02-06 12:45:23 +02:00
GreenComfyTea
d8f6e2f9bb Update README.md 2023-01-24 19:11:31 +02:00
GreenComfyTea
a0a4df7b91 fix 2023-01-14 15:17:33 +02:00
GreenComfyTea
667be5793e Hide otomos on screen end when option has been toggled 2023-01-14 15:07:45 +02:00
GreenComfyTea
b321896eeb Fix Total Cart Count 2023-01-14 14:16:50 +02:00
GreenComfyTea
3b94c67071 Fix a bug when my buddy was incorrect when disconnecting from online quest 2023-01-14 13:52:24 +02:00
GreenComfyTea
7b9e376db1 Fix typo 2023-01-14 13:51:25 +02:00
GreenComfyTea
fdab487b7e Language fixes 2023-01-14 13:31:00 +02:00
GreenComfyTea
b9d44a9b67 Change table tostring function to a better one 2023-01-14 13:30:35 +02:00
GreenComfyTea
3513d77714 Added Support for multiple configs
1) Implemented ailment damage for buddies;
2) Bugfixes;
2023-01-14 13:30:09 +02:00
GreenComfyTea
9a3cb399e2 Damage Meter UI customization refactoring 2023-01-05 18:15:18 +02:00
GreenComfyTea
a8ec321dae Refactor Damage Meter UI config; 2023-01-02 14:18:32 +02:00
GreenComfyTea
575b46c70d Added Buddies to Damage Meter UI 2023-01-02 11:46:10 +02:00
GreenComfyTea
592defcd99 fix last_displayed_players not clearing 2022-12-04 10:06:21 +02:00
64 changed files with 8601 additions and 4544 deletions

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 GreenComfyTea
Copyright (c) 2023 GreenComfyTea
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -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)**
# Requirements
1. [REFramework](https://www.nexusmods.com/monsterhunterrise/mods/26) (v1.3.6 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).
# How to install:
@@ -35,7 +35,7 @@ Exposes in-game data about monsters, creatures, players and damage. Draws a high
**neatnet** - Korean translation.
**s9000008, mcc1** - Traditional Chinese translation.
**etnAtker** - Simplified Chinese translation.
**etnAtker**, **sukiqwq** - Simplified Chinese translation.
**AKILAND0214** - Japanese translation.
***
# Support

View File

@@ -1,4 +1,34 @@
xy = "";
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 debug = require("MHR_Overlay.Misc.debug");
@@ -10,11 +40,12 @@ local time = require("MHR_Overlay.Game_Handler.time");
local config = require("MHR_Overlay.Misc.config");
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 utils = require("MHR_Overlay.Misc.utils");
local player = require("MHR_Overlay.Damage_Meter.player");
--local buffs = require("MHR_Overlay.Buffs.buffs");
local players = require("MHR_Overlay.Damage_Meter.players");
local non_players = require("MHR_Overlay.Damage_Meter.non_players");
local damage_hook = require("MHR_Overlay.Damage_Meter.damage_hook");
@@ -34,15 +65,16 @@ local large_monster_UI = require("MHR_Overlay.UI.Modules.large_monster_UI");
local small_monster_UI = require("MHR_Overlay.UI.Modules.small_monster_UI");
local time_UI = require("MHR_Overlay.UI.Modules.time_UI");
local env_creature_UI = require("MHR_Overlay.UI.Modules.env_creature_UI");
--local buff_UI = require("MHR_Overlay.UI.Modules.buff_UI");
local body_part_UI_entity = require("MHR_Overlay.UI.UI_Entities.body_part_UI_entity");
local player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.player_damage_UI_entity");
local non_player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.non_player_damage_UI_entity");
local damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
local health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
local stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
local rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
local ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
local ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
--local buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
local customization_menu = require("MHR_Overlay.UI.customization_menu");
local label_customization = require("MHR_Overlay.UI.Customizations.label_customization");
@@ -61,29 +93,34 @@ local large_monster_UI_customization = require("MHR_Overlay.UI.Customizations.la
local drawing = require("MHR_Overlay.UI.drawing");
if debug ~= nil and debug.enabled then
xy = "";
end
------------------------INIT MODULES-------------------------
-- #region
screen.init_module();
singletons.init_module();
table_helpers.init_module();
unicode_helpers.init_module();
utils.init_module();
time.init_module();
language.init_module();
config.init_module();
part_names.init_module();
player_damage_UI_entity.init_module();
non_player_damage_UI_entity.init_module();
damage_UI_entity.init_module();
health_UI_entity.init_module();
stamina_UI_entity.init_module();
rage_UI_entity.init_module();
ailment_UI_entity.init_module();
ailment_buildup_UI_entity.init_module();
body_part_UI_entity.init_module();
--buff_UI_entity.init_module();
--buffs.init_module();
damage_hook.init_module();
player.init_module();
players.init_module();
non_players.init_module();
quest_status.init_module();
@@ -121,6 +158,7 @@ large_monster_UI.init_module();
small_monster_UI.init_module();
time_UI.init_module();
env_creature_UI.init_module();
--buff_UI.init_module();
keyboard.init_module();
@@ -135,7 +173,7 @@ local function draw_modules(module_visibility_config, flow_state_name)
if module_visibility_config.small_monster_UI and config.current_config.small_monster_UI.enabled then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = string.format("[%s] Small monster drawing function threw an exception", flow_state_name);
customization_menu.status = string.format("[%s] Small Monster UI Drawing Function threw an Exception", flow_state_name);
end
end
@@ -151,44 +189,48 @@ local function draw_modules(module_visibility_config, flow_state_name)
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = string.format("[%s] Large Monster drawing function threw an exception", flow_state_name);
customization_menu.status = string.format("[%s] Large Monster UI Drawing Function threw an Exception", flow_state_name);
end
end
if config.current_config.time_UI.enabled and module_visibility_config.time_UI then
local success = pcall(time_UI.draw);
if not success then
customization_menu.status = string.format("[%s] Time Drawing function threw an exception", flow_state_name);
customization_menu.status = string.format("[%s] Time UI Drawing Function threw an Exception", flow_state_name);
end
end
if config.current_config.damage_meter_UI.enabled and module_visibility_config.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = string.format("[%s] Damage Meter drawing function threw an exception", flow_state_name);
customization_menu.status = string.format("[%s] Damage Meter UI Drawing Function threw an Exception", flow_state_name);
end
end
if config.current_config.endemic_life_UI.enabled and module_visibility_config.endemic_life_UI then
local success = pcall(env_creature_UI.draw);
if not success then
customization_menu.status = string.format("[%s] Endemic Life drawing function threw an exception", flow_state_name);
customization_menu.status = string.format("[%s] Endemic Life UI Drawing Function threw an Exception", flow_state_name);
end
end
--[[if config.current_config.buff_UI.enabled and module_visibility_config.buff_UI then
local success = truepcall(buff_UI.draw);
if not success then
customization_menu.status = string.format("[%s] Buff UI Drawing Function threw an Exception", flow_state_name);
end
end]]
end
local function main_loop()
customization_menu.status = "OK";
singletons.init();
screen.update_window_size();
player.update_myself_position();
players.update_myself_position();
quest_status.update_is_online();
--quest_status.update_is_quest_host();
time.tick();
player.update_player_list(quest_status.index >= 2);
non_players.update_servant_list();
if quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
local large_monster_UI_config = config.current_config.large_monster_UI;
@@ -201,24 +243,32 @@ local function main_loop()
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = "[In Training Area] Large monster drawing function threw an exception";
customization_menu.status = "[In Training Area] Large Monster UI Drawing Function threw an Exception";
end
end
if config.current_config.damage_meter_UI.enabled and module_visibility_config.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "[In Training Area] Damage meter drawing function threw an exception";
customization_menu.status = "[In Training Area] Damage Meter UI Drawing Function threw an Exception";
end
end
if config.current_config.endemic_life_UI.enabled and module_visibility_config.endemic_life_UI then
local success = pcall(env_creature_UI.draw);
if not success then
customization_menu.status = "[In Training Area] Endemic life drawing function threw an exception";
customization_menu.status = "[In Training Area] Endemic Life UI Drawing Function threw an Exception";
end
end
--[[if config.current_config.buff_UI.enabled and module_visibility_config.buff_UI then
local success = pcall(buff_UI.draw);
if not success then
customization_menu.status = "[In Training Area] Buff UI Drawing Function threw an Exception";
end
end]]
elseif quest_status.flow_state == quest_status.flow_states.CUTSCENE then
draw_modules(config.current_config.global_settings.module_visibility.cutscene, "Cutscene");
elseif quest_status.flow_state == quest_status.flow_states.LOADING_QUEST then
@@ -287,7 +337,7 @@ end);
-- #endregion
----------------------------D2D------------------------------
if debug.enabled then
if debug ~= nil and debug.enabled then
if d2d ~= nil then
d2d.register(function()
end, function()
@@ -296,8 +346,8 @@ if debug.enabled then
end
if xy ~= "" then
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 551, 11, 0xFF000000);
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF);
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 256, 71, 0xFF000000);
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 255, 70, 0xFFFFFFFF);
end
end);
end
@@ -308,12 +358,12 @@ if debug.enabled then
end
if xy ~= "" then
draw.text("xy:\n" .. tostring(xy), 551, 11, 0xFF000000);
draw.text("xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF);
draw.text("xy:\n" .. tostring(xy), 256, 31, 0xFF000000);
draw.text("xy:\n" .. tostring(xy), 255, 30, 0xFFFFFFFF);
end
end);
end
if imgui.begin_table == nil then
re.msg(language.current_language.customization_menu.reframework_outdated);
end
end

View File

@@ -0,0 +1,108 @@
local this = {};
local buff_UI_entity;
local config;
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;
this.list = {};
function this.new(name)
local buff = {};
buff.name = name;
buff.timer = 0;
buff.duration = 0;
buff.is_active = true;
buff.timer_percentage = 0;
buff.minutes_left = 0;
buff.seconds_left = 0;
buff.is_infinite = false;
this.init_UI(buff);
return buff;
end
function this.init_buffs()
this.list = {};
end
function this.init_UI(buff)
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);
end
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
buff_UI_entity.draw(buff, buff_UI, position_on_screen, opacity_scale);
end
function this.init_module()
config = require("MHR_Overlay.Misc.config");
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
local buff = this.new("Enviroment Damage Negated");
buff.duration = 90;
buff.timer = 65;
buff.timer_percentage = 0.66;
buff.minutes_left = 1;
buff.seconds_left = 5
this.list["Enviroment Damage Negated"] = buff;
local buff = this.new("Sharpness Loss Reduced");
buff.duration = 120;
buff.timer = 70;
buff.timer_percentage = 0.583;
buff.minutes_left = 1;
buff.seconds_left = 10
this.list["Sharpness Loss Reduced"] = buff;
local buff = this.new("Sharpness Loss Reduced 2");
buff.duration = 120;
buff.timer = 70;
buff.timer_percentage = 0.583;
buff.minutes_left = 1;
buff.seconds_left = 10
buff.is_infinite = true;
this.list["Sharpness Loss Reduced 2"] = buff;
end
return this;

View File

@@ -1,12 +1,47 @@
local damage_hook = {};
local this = {};
local quest_status;
local player;
local players;
local small_monster;
local large_monster;
local ailments;
local table_helpers;
local singletons;
local non_players;
local utils;
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 wall_hit_damage_queue = {};
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");
@@ -14,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 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 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");
@@ -42,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 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
return "wyvern riding";
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
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
return "player";
elseif damage_source_type_id == 1 or damage_source_type_id == 8 then
return "bomb";
@@ -58,15 +94,13 @@ function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette
return "otomo";
elseif damage_source_type_id >= 25 and damage_source_type_id <= 32 then
return "endemic life";
elseif damage_source_type_id == 34 then
return "other";
end
return tostring(damage_source_type_id);
return "other";
end
-- 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);
if is_large_monster == nil then
@@ -83,20 +117,18 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
end
local attacker_id = get_attacker_id_method:call(enemy_calc_damage_info);
local otomo_id = attacker_id;
local attacker_type = get_damage_attacker_type_method:call(enemy_calc_damage_info);
local is_marionette_attack = is_marionette_attack_method:call(enemy_calc_damage_info)
-- 4 is virtual player in singleplayer that "owns" 2nd otomo
if not quest_status.is_online and attacker_id == 4 then
--attacker_id = player.myself.id;
end
local is_otomo_attack = attacker_type >= 21 and attacker_type <= 23;
if is_marionette_attack then
large_monster.update_all_riders();
for enemy, monster in pairs(large_monster.list) do
if monster.unique_id == attacker_id then
--attacker_id = monster.rider_id;
break
attacker_id = monster.rider_id;
break;
end
end
end
@@ -152,25 +184,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
-- 31 - EcSwampLeech
-- 32 - EcPenetrateFish
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack);
local attacking_player = non_players.get_servant(attacker_id);
if attacking_player == nil then
attacking_player = player.get_player(attacker_id);
end
--[[xy = xy .. "\nPlayer: " .. tostring(attacker_id) ..
" " .. tostring(attacking_player.name) ..
" Damage: " .. tostring(damage_object.total_damage) ..
" Type: (" .. tostring(attacker_type) ..
") " ..
" Condition Damage: " .. tostring(condition_damage) ..
" Condition Type: (" .. tostring(attacker_type) ..
") " .. tostring(condition_type);
if string.len(xy) > 2300 then
xy = "";
end--]]
local damage_source_type = this.get_damage_source_type(attacker_type, is_marionette_attack);
local monster;
if is_large_monster then
@@ -179,69 +193,153 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
monster = small_monster.get_monster(enemy);
end
local stun_damage = stun_damage_field:get_data(enemy_calc_damage_info);
if attacking_player ~= nil then
ailments.apply_ailment_buildup(monster, attacker_id, ailments.stun_id, stun_damage);
local player = nil;
local otomo = nil;
ailments.apply_ailment_buildup(monster, attacker_id, condition_type, condition_damage);
ailments.apply_ailment_buildup(monster, attacker_id, condition_type2, condition_damage2);
ailments.apply_ailment_buildup(monster, attacker_id, condition_type3, condition_damage3);
if not is_otomo_attack then
player = players.get_player(attacker_id);
if player == nil then
player = non_players.get_servant(attacker_id);
end
else
if attacker_id < 4 then
player = players.get_player(attacker_id);
otomo = non_players.get_otomo(attacker_id);
elseif attacker_id == 4 then
player = players.myself;
otomo = non_players.get_otomo(non_players.my_second_otomo_id);
else
player = non_players.get_servant(attacker_id - 1);
otomo = non_players.get_otomo(attacker_id - 1);
end
players.update_damage(otomo, damage_source_type, is_large_monster, damage_object);
end
player.update_damage(player.total, damage_source_type, is_large_monster, damage_object);
player.update_damage(attacking_player, damage_source_type, is_large_monster, damage_object);
local stun_damage = stun_damage_field:get_data(enemy_calc_damage_info);
ailments.apply_ailment_buildup(monster, player, otomo, ailments.stun_id, stun_damage);
ailments.apply_ailment_buildup(monster, player, otomo, condition_type, condition_damage);
ailments.apply_ailment_buildup(monster, player, otomo, condition_type2, condition_damage2);
ailments.apply_ailment_buildup(monster, player, otomo, condition_type3, condition_damage3);
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);
end
--function damage_hook.on_mystery_core_break(enemy)
--end
-- Coavins code
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 = 1
local player_ = player.list[dead_player_id];
if player_ == nil then
local player = players.list[dead_player_id];
if player == nil then
return;
end
player_.cart_count = player_.cart_count + 1;
player.cart_count = player.cart_count + 1;
quest_status.get_cart_count();
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));
--end
local damage = utils.math.round(monster.max_health * damage_rate);
large_monster.update_all_riders();
local attacker_id = monster.rider_id;
table.insert(wall_hit_damage_queue,
{
damage = damage,
is_large = monster.is_large
}
);
if attacker_id == -1 then
return;
end
local get_finish_shoot_wall_hit_damage_rate_method = enemy_character_base_type_def:get_method("stockFinishShootHitDamage");
local player = players.get_player(attacker_id);
if player == nil then
player = non_players.get_servant(attacker_id);
end
function damage_hook.init_module()
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");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
ailments = require("MHR_Overlay.Monsters.ailments");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
singletons = require("MHR_Overlay.Game_Handler.singletons");
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)
-- 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]));
--end, function(retval)
-- return retval;
--end);
sdk.hook(stock_direct_marionette_finish_shoot_hit_parts_damage_method, function(args)
local enemy = sdk.to_managed_object(args[2]);
local damage_rate = sdk.to_float(args[3]);
local is_endure = (sdk.to_int64(args[4]) & 1) == 1;
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)
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)
return retval;
end);
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)
return retval;
end);
@@ -253,4 +351,4 @@ function damage_hook.init_module()
--end);
end
return damage_hook;
return this;

View File

@@ -1,32 +1,66 @@
local non_players = {};
local this = {};
local config;
local table_helpers;
local singletons;
local customization_menu;
local non_player_damage_UI_entity;
local damage_UI_entity;
local time;
local quest_status;
local drawing;
local language;
local player;
local players;
non_players.servant_list = {};
non_players.otomo_list = {};
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;
function non_players.new(id, name, is_otomo)
this.servant_list = {};
this.otomo_list = {};
this.my_second_otomo_id = -1;
function this.new(id, name, level, type)
local non_player = {};
non_player.id = id;
non_player.name = name;
non_player.level = level;
non_player.is_player = false;
non_player.is_otomo = is_otomo;
non_player.type = type;
non_player.join_time = -1;
non_player.first_hit_time = -1;
non_player.dps = 0;
non_player.small_monsters = player.init_damage_sources()
non_player.large_monsters = player.init_damage_sources();
non_player.small_monsters = players.init_damage_sources()
non_player.large_monsters = players.init_damage_sources();
non_player.display = {};
non_player.display.total_damage = 0;
@@ -34,31 +68,31 @@ function non_players.new(id, name, is_otomo)
non_player.display.elemental_damage = 0;
non_player.display.ailment_damage = 0;
non_players.init_UI(non_player);
this.init_UI(non_player);
return non_player;
end
function non_players.get_servant(servant_id)
return non_players.servant_list[servant_id];
function this.get_servant(servant_id)
return this.servant_list[servant_id];
end
function non_players.get_otomo(otomo_id)
return non_players.otomo_list[otomo_id];
function this.get_otomo(otomo_id)
return this.otomo_list[otomo_id];
end
function non_players.init()
non_players.servant_list = {};
non_players.otomo_list = {};
function this.init()
this.servant_list = {};
this.otomo_list = {};
end
local servant_manager_type_def = sdk.find_type_definition("snow.ai.ServantManager");
local get_quest_servant_id_list_method = servant_manager_type_def:get_method("getQuestServantIdList");
local get_ai_control_by_servant_id_method = servant_manager_type_def:get_method("getAIControlByServantID");
local list_type_def = get_quest_servant_id_list_method:get_return_type();
local get_count_method = list_type_def:get_method("get_Count");
local get_item_method = list_type_def:get_method("get_Item");
local servant_list_type_def = get_quest_servant_id_list_method:get_return_type();
local servant_get_count_method = servant_list_type_def:get_method("get_Count");
local servant_get_item_method = servant_list_type_def:get_method("get_Item");
local ai_control_type_def = get_ai_control_by_servant_id_method:get_return_type();
local get_servant_info_method = ai_control_type_def:get_method("get_ServantInfo");
@@ -67,7 +101,36 @@ local servant_info_type_def = get_servant_info_method:get_return_type();
local get_servant_name_method = servant_info_type_def:get_method("get_ServantName");
local get_servant_player_index_method = servant_info_type_def:get_method("get_ServantPlayerIndex");
function non_players.update_servant_list()
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local quest_otomo_info_field = lobby_manager_type_def:get_field("_questOtomoInfo");
local otomo_info_field = lobby_manager_type_def:get_field("_OtomoInfo");
local otomo_manager_type_def = sdk.find_type_definition("snow.otomo.OtomoManager");
local get_master_otomo_info_method = otomo_manager_type_def:get_method("getMasterOtomoInfo");
local otomo_create_data_type_def = get_master_otomo_info_method:get_return_type();
local otomo_create_data_name_field = otomo_create_data_type_def:get_field("Name");
local otomo_create_data_level_field = otomo_create_data_type_def:get_field("Level");
local get_servant_otomo_list_method = otomo_manager_type_def:get_method("getServantOtomoList");
local otomo_list_type_def = get_servant_otomo_list_method:get_return_type();
local otomo_get_count_method = otomo_list_type_def:get_method("get_Count");
local otomo_get_item_method = otomo_list_type_def:get_method("get_Item");
local otomo_info_list_type_def = quest_otomo_info_field:get_type();
local otomo_info_get_count_method = otomo_info_list_type_def:get_method("get_Count");
local otomo_info_get_item_method = otomo_info_list_type_def:get_method("get_Item");
local otomo_info_type_def = otomo_info_get_item_method:get_return_type();
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_order_field = otomo_info_type_def:get_field("_Order");
function this.update_servant_list()
local cached_config = config.current_config.damage_meter_UI;
if singletons.servant_manager == nil then
return;
end
@@ -77,77 +140,255 @@ function non_players.update_servant_list()
return;
end
local servant_count = get_count_method:call(quest_servant_id_list);
local servant_count = servant_get_count_method:call(quest_servant_id_list);
if servant_count == nil then
customization_menu.status = "No quest servant id list count";
return;
end
for i = 0, servant_count - 1 do
local servant_id = get_item_method:call(quest_servant_id_list, i);
local servant_id = servant_get_item_method:call(quest_servant_id_list, i);
if servant_id == nil then
goto continue;
end
local servant_name = "Follower";
local player_id = -1;
local ai_control = get_ai_control_by_servant_id_method:call(singletons.servant_manager, servant_id);
if ai_control ~= nil then
local servant_info = get_servant_info_method:call(ai_control);
if servant_info ~= nil then
local name = get_servant_name_method:call(servant_info);
if name ~= nil then
servant_name = name;
end
local id = get_servant_player_index_method:call(servant_info);
if id == nil then
goto continue;
end
player_id = id;
end
if ai_control == nil then
customization_menu.status = "No quest servant ai control";
goto continue;
end
if non_players.servant_list[player_id] == nil then
local servant = non_players.new(player_id, servant_name, false);
non_players.servant_list[player_id] = servant;
local servant_info = get_servant_info_method:call(ai_control);
if servant_info == nil then
customization_menu.status = "No quest servant info";
goto continue;
end
local name = get_servant_name_method:call(servant_info);
if name == nil then
goto continue;
end
local id = get_servant_player_index_method:call(servant_info);
if id == nil then
goto continue;
end
if this.servant_list[id] == nil then
this.servant_list[id] = this.new(id, name, 0, players.types.servant);
end
if not cached_config.settings.hide_servants then
table.insert(players.display_list, this.servant_list[id]);
end
::continue::
end
end
function non_players.init_UI(non_player)
function this.update_otomo_list(is_on_quest, is_online)
if is_online then
if is_on_quest then
--non_players.update_my_otomos();
this.update_otomos(quest_otomo_info_field);
else
this.update_otomos(otomo_info_field);
end
else
if is_on_quest then
this.update_my_otomos();
this.update_servant_otomos();
else
this.update_my_otomos();
end
end
end
function this.update_my_otomos()
local cached_config = config.current_config.damage_meter_UI;
non_player.damage_UI = non_player_damage_UI_entity.new(cached_config.damage_bar,
cached_config.highlighted_damage_bar, cached_config.player_name_label, cached_config.dps_label,
cached_config.damage_value_label, cached_config.damage_percentage_label);
local first_otomo = get_master_otomo_info_method:call(singletons.otomo_manager, 0);
if first_otomo ~= nil then
local name = otomo_create_data_name_field:get_data(first_otomo);
if name ~= nil and name ~= "" then
local level = otomo_create_data_level_field:get_data(first_otomo) or 0;
local myself_id = players.myself.id;
if this.otomo_list[myself_id] == nil then
this.otomo_list[myself_id] = this.new(0, name, level, players.types.my_otomo);
end
if cached_config.settings.show_my_otomos_separately then
table.insert(players.display_list, this.otomo_list[myself_id]);
end
end
end
local second_otomo = get_master_otomo_info_method:call(singletons.otomo_manager, 1);
if second_otomo ~= nil then
local name = otomo_create_data_name_field:get_data(second_otomo);
if name ~= nil and name ~= "" then
local level = otomo_create_data_level_field:get_data(second_otomo) or 0;
-- the secondary otomo is actually the 4th one!
if this.otomo_list[this.my_second_otomo_id] == nil then
this.otomo_list[this.my_second_otomo_id] = this.new(this.my_second_otomo_id, name, level, players.types.my_otomo);
end
if cached_config.settings.show_my_otomos_separately then
table.insert(players.display_list, this.otomo_list[this.my_second_otomo_id]);
end
end
end
end
function non_players.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps)
non_player_damage_UI_entity.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps);
function this.update_servant_otomos()
local cached_config = config.current_config.damage_meter_UI;
local servant_otomo_list = get_servant_otomo_list_method:call(singletons.otomo_manager);
if servant_otomo_list == nil then
customization_menu.status = "No servant otomo list";
return;
end
local count = otomo_get_count_method:call(servant_otomo_list);
if count == nil then
customization_menu.status = "No servant otomo list count";
return;
end
for i = 0, count - 1 do
local servant_otomo = otomo_get_item_method:call(servant_otomo_list, i);
if servant_otomo == nil then
goto continue
end
local otomo_create_data = servant_otomo:call("get_OtCreateData");
if otomo_create_data ~= nil then
local name = otomo_create_data_name_field:get_data(otomo_create_data);
local level = otomo_create_data_level_field:get_data(otomo_create_data) or 0;
local member_id = otomo_create_data:get_field("MemberID");
if name == nil then
goto continue;
end
if this.otomo_list[member_id] == nil then
this.otomo_list[member_id] = this.new(member_id, name, level, players.types.servant_otomo);
end
if cached_config.settings.show_servant_otomos_separately then
table.insert(players.display_list, this.otomo_list[member_id]);
end
end
::continue::
end
end
function non_players.init_module()
function this.update_otomos(otomo_info_field_)
local cached_config = config.current_config.damage_meter_UI;
if singletons.lobby_manager == nil then
return;
end
-- other players
local otomo_info_list = otomo_info_field_:get_data(singletons.lobby_manager);
if otomo_info_list == nil then
customization_menu.status = "No otomo info list";
return;
end
local count = otomo_info_get_count_method:call(otomo_info_list);
if count == nil then
customization_menu.status = "No otomo info list count";
return;
end
for id = 0, count - 1 do
local otomo_info = otomo_info_get_item_method:call(otomo_info_list, id);
if otomo_info == nil then
goto continue;
end
local name = otomo_info_name_field:get_data(otomo_info);
if name == nil then
goto continue;
end
local level = otomo_info_level_field:get_data(otomo_info) or 0;
local otomo = this.otomo_list[id];
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) then
if id == players.myself.id then
otomo = this.new(id, name, level, players.types.my_otomo);
this.otomo_list[id] = otomo;
elseif id >= 4 then
otomo = this.new(id, name, level, players.types.servant_otomo);
this.otomo_list[id] = otomo;
else
otomo = this.new(id, name, level, players.types.other_player_otomo);
this.otomo_list[id] = otomo;
end
end
if id == players.myself.id then
if cached_config.settings.show_my_otomos_separately then
table.insert(players.display_list, otomo);
end
elseif id >= 4 then
if cached_config.settings.show_servant_otomos_separately then
table.insert(players.display_list, otomo);
end
else
if cached_config.settings.show_other_player_otomos_separately then
table.insert(players.display_list, otomo);
end
end
::continue::
end
end
function this.init_UI(non_player)
local cached_config = config.current_config.damage_meter_UI;
if non_player.type == players.types.servant then
non_player.damage_UI = damage_UI_entity.new(cached_config.servants, non_player.type);
elseif non_player.type == players.types.my_otomo then
non_player.damage_UI = damage_UI_entity.new(cached_config.my_otomos, non_player.type);
elseif non_player.type == players.types.other_player_otomo then
non_player.damage_UI = damage_UI_entity.new(cached_config.other_player_otomos, non_player.type);
elseif non_player.type == players.types.servant_otomo then
non_player.damage_UI = damage_UI_entity.new(cached_config.servant_otomos, non_player.type);
end
end
function this.init_module()
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
non_player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.non_player_damage_UI_entity");
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
time = require("MHR_Overlay.Game_Handler.time");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
non_players.init();
this.init();
end
return non_players;
return this;

View File

@@ -1,509 +0,0 @@
local player = {};
local config;
local table_helpers;
local singletons;
local customization_menu;
local player_damage_UI_entity;
local time;
local quest_status;
local drawing;
local language;
player.list = {};
player.myself = nil;
player.myself_position = Vector3f.new(0, 0, 0);
player.total = nil;
function player.new(id, guid, name, master_rank, hunter_rank)
local new_player = {};
new_player.id = id;
new_player.guid = guid;
new_player.name = name; -- 齁ODO
new_player.hunter_rank = hunter_rank;
new_player.master_rank = master_rank;
new_player.is_player = true;
new_player.cart_count = 0;
new_player.join_time = -1;
new_player.first_hit_time = -1;
new_player.dps = 0;
new_player.small_monsters = player.init_damage_sources()
new_player.large_monsters = player.init_damage_sources();
new_player.display = {};
new_player.display.total_damage = 0;
new_player.display.physical_damage = 0;
new_player.display.elemental_damage = 0;
new_player.display.ailment_damage = 0;
if name == "Total" then
player.init_total_UI(new_player);
else
player.init_UI(new_player);
end
return new_player;
end
function player.init_damage_sources()
local monster_type = {};
monster_type.total_damage = 0;
monster_type.physical_damage = 0;
monster_type.elemental_damage = 0;
monster_type.ailment_damage = 0;
monster_type.bombs = {};
monster_type.bombs.total_damage = 0;
monster_type.bombs.physical_damage = 0;
monster_type.bombs.elemental_damage = 0;
monster_type.bombs.ailment_damage = 0;
monster_type.kunai = {};
monster_type.kunai.total_damage = 0;
monster_type.kunai.physical_damage = 0;
monster_type.kunai.elemental_damage = 0;
monster_type.kunai.ailment_damage = 0;
monster_type.installations = {};
monster_type.installations.total_damage = 0;
monster_type.installations.physical_damage = 0;
monster_type.installations.elemental_damage = 0;
monster_type.installations.ailment_damage = 0;
monster_type.otomo = {};
monster_type.otomo.total_damage = 0;
monster_type.otomo.physical_damage = 0;
monster_type.otomo.elemental_damage = 0;
monster_type.otomo.ailment_damage = 0;
monster_type.wyvern_riding = {};
monster_type.wyvern_riding.total_damage = 0;
monster_type.wyvern_riding.physical_damage = 0;
monster_type.wyvern_riding.elemental_damage = 0;
monster_type.wyvern_riding.ailment_damage = 0;
monster_type.poison = {};
monster_type.poison.total_damage = 0;
monster_type.poison.physical_damage = 0;
monster_type.poison.elemental_damage = 0;
monster_type.poison.ailment_damage = 0;
monster_type.blast = {};
monster_type.blast.total_damage = 0;
monster_type.blast.physical_damage = 0;
monster_type.blast.elemental_damage = 0;
monster_type.blast.ailment_damage = 0;
monster_type.endemic_life = {};
monster_type.endemic_life.total_damage = 0;
monster_type.endemic_life.physical_damage = 0;
monster_type.endemic_life.elemental_damage = 0;
monster_type.endemic_life.ailment_damage = 0;
monster_type.other = {};
monster_type.other.total_damage = 0;
monster_type.other.physical_damage = 0;
monster_type.other.elemental_damage = 0;
monster_type.other.ailment_damage = 0;
return monster_type;
end
function player.get_player(player_id)
return player.list[player_id];
end
function player.update_damage(_player, damage_source_type, is_large_monster, damage_object)
if _player == nil then
return;
end
if _player.first_hit_time == -1 then
_player.first_hit_time = time.total_elapsed_script_seconds;
end
local player_monster_type = _player.small_monsters;
if is_large_monster then
player_monster_type = _player.large_monsters;
end
if damage_source_type == "player" then
player.merge_damage(player_monster_type, damage_object);
elseif damage_source_type == "bomb" then
player.merge_damage(player_monster_type.bombs, damage_object);
elseif damage_source_type == "kunai" then
player.merge_damage(player_monster_type.kunai, damage_object);
elseif damage_source_type == "installation" then
player.merge_damage(player_monster_type.installations, damage_object);
elseif damage_source_type == "otomo" then
player.merge_damage(player_monster_type.otomo, damage_object);
elseif damage_source_type == "wyvern riding" then
player.merge_damage(player_monster_type.wyvern_riding, damage_object);
elseif damage_source_type == "poison" then
player.merge_damage(player_monster_type.poison, damage_object);
elseif damage_source_type == "blast" then
player.merge_damage(player_monster_type.blast, damage_object);
elseif damage_source_type == "endemic life" then
player.merge_damage(player_monster_type.endemic_life, damage_object);
elseif damage_source_type == "other" then
player.merge_damage(player_monster_type.other, damage_object);
else
player.merge_damage(player_monster_type, damage_object);
end
player.update_display(_player);
end
function player.update_display(_player)
if _player == nil then
return;
end
_player.display.total_damage = 0;
_player.display.physical_damage = 0;
_player.display.elemental_damage = 0;
_player.display.ailment_damage = 0;
local cached_config = config.current_config.damage_meter_UI;
if cached_config.tracked_monster_types.small_monsters then
if cached_config.tracked_damage_types.player_damage then
player.merge_damage(_player.display, _player.small_monsters);
end
if cached_config.tracked_damage_types.bomb_damage then
player.merge_damage(_player.display, _player.small_monsters.bombs);
end
if cached_config.tracked_damage_types.kunai_damage then
player.merge_damage(_player.display, _player.small_monsters.kunai);
end
if cached_config.tracked_damage_types.installation_damage then
player.merge_damage(_player.display, _player.small_monsters.installations);
end
if cached_config.tracked_damage_types.otomo_damage then
player.merge_damage(_player.display, _player.small_monsters.otomo);
end
if cached_config.tracked_damage_types.wyvern_riding_damage then
player.merge_damage(_player.display, _player.small_monsters.wyvern_riding);
end
if cached_config.tracked_damage_types.poison_damage then
player.merge_damage(_player.display, _player.small_monsters.poison);
end
if cached_config.tracked_damage_types.blast_damage then
player.merge_damage(_player.display, _player.small_monsters.blast);
end
if cached_config.tracked_damage_types.endemic_life_damage then
player.merge_damage(_player.display, _player.small_monsters.endemic_life);
end
if cached_config.tracked_damage_types.other_damage then
player.merge_damage(_player.display, _player.small_monsters.other);
end
end
if cached_config.tracked_monster_types.large_monsters then
if cached_config.tracked_damage_types.player_damage then
player.merge_damage(_player.display, _player.large_monsters);
end
if cached_config.tracked_damage_types.bomb_damage then
player.merge_damage(_player.display, _player.large_monsters.bombs);
end
if cached_config.tracked_damage_types.kunai_damage then
player.merge_damage(_player.display, _player.large_monsters.kunai);
end
if cached_config.tracked_damage_types.installation_damage then
player.merge_damage(_player.display, _player.large_monsters.installations);
end
if cached_config.tracked_damage_types.otomo_damage then
player.merge_damage(_player.display, _player.large_monsters.otomo);
end
if cached_config.tracked_damage_types.wyvern_riding_damage then
player.merge_damage(_player.display, _player.large_monsters.wyvern_riding);
end
if cached_config.tracked_damage_types.poison_damage then
player.merge_damage(_player.display, _player.large_monsters.poison);
end
if cached_config.tracked_damage_types.blast_damage then
player.merge_damage(_player.display, _player.large_monsters.blast);
end
if cached_config.tracked_damage_types.endemic_life_damage then
player.merge_damage(_player.display, _player.large_monsters.endemic_life);
end
if cached_config.tracked_damage_types.other_damage then
player.merge_damage(_player.display, _player.large_monsters.other);
end
end
end
function player.merge_damage(first, second)
first.total_damage = first.total_damage + second.total_damage;
first.physical_damage = first.physical_damage + second.physical_damage;
first.elemental_damage = first.elemental_damage + second.elemental_damage;
first.ailment_damage = first.ailment_damage + second.ailment_damage;
return first;
end
local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager");
local find_master_player_method = player_manager_type_def:get_method("findMasterPlayer");
local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase");
local get_pos_field = player_base_type_def:get_method("get_Pos");
function player.update_myself_position()
if singletons.player_manager == nil then
customization_menu.status = "No player manager";
return;
end
local master_player = find_master_player_method:call(singletons.player_manager);
if master_player == nil then
customization_menu.status = "No master player";
return;
end
local position = get_pos_field:call(master_player);
if position ~= nil then
player.myself_position = position;
end
end
function player.init()
player.list = {};
player.total = player.new(0, -2, "Total", 0, 0);
player.myself = player.new(-1, -1, "Dummy", -1, -1);
end
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local my_hunter_info_field = lobby_manager_type_def:get_field("_myHunterInfo");
local myself_quest_index_field = lobby_manager_type_def:get_field("_myselfQuestIndex");
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
local hunter_info_field = lobby_manager_type_def:get_field("_hunterInfo");
local my_hunter_info_type_def = my_hunter_info_field:get_type();
local name_field = my_hunter_info_type_def:get_field("_name");
local hunter_unique_id_field = my_hunter_info_type_def:get_field("_HunterUniqueId");
local member_index_field = my_hunter_info_type_def:get_field("_memberIndex");
local hunter_rank_field = my_hunter_info_type_def:get_field("_hunterRank");
local master_rank_field = my_hunter_info_type_def:get_field("_masterRank");
local hunter_info_type_def = hunter_info_field:get_type();
local get_count_method = hunter_info_type_def:get_method("get_Count");
local get_item_method = hunter_info_type_def:get_method("get_Item");
local guid_type = hunter_unique_id_field:get_type();
local guid_equals_method = guid_type:get_method("Equals(System.Guid)");
local progress_manager_type_def = sdk.find_type_definition("snow.progress.ProgressManager");
local get_hunter_rank_method = progress_manager_type_def:get_method("get_HunterRank");
local get_master_rank_method = progress_manager_type_def:get_method("get_MasterRank");
local get_master_player_id_method = player_manager_type_def:get_method("getMasterPlayerID");
function player.update_player_list(is_on_quest)
if is_on_quest then
player.update_player_list_(quest_hunter_info_field);
else
player.update_player_list_(hunter_info_field);
end
end
function player.update_player_list_(hunter_info_field_)
if singletons.lobby_manager == nil then
return;
end
if singletons.progress_manager == nil then
return;
end
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
customization_menu.status = "No myself player info list";
return;
end
local myself_player_name = name_field:get_data(myself_player_info);
if myself_player_name == nil then
customization_menu.status = "No myself player name";
return;
end
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager) or 0;
local myself_master_rank = get_master_rank_method:call(singletons.progress_manager) or 0;
local myself_id = get_master_player_id_method:call(singletons.player_manager) or -1;
-- if quest_status.is_online then
-- myself_id = get_master_player_id_method:call(singletons.player_manager) or -1;
-- else
-- myself_id = myself_quest_index_field:call(singletons.lobby_manager) or -1;
-- end
if myself_id == nil then
customization_menu.status = "No myself player id";
return;
end
local myself_guid = hunter_unique_id_field:get_data(myself_player_info);
if myself_guid == nil then
customization_menu.status = "No myself guid";
return;
end
-- local myself_guid_string = guid_tostring_method:call(myself_guid);
-- if myself_guid_string == nil then
-- customization_menu.status = "No myself guid string";
-- return;
-- end
if myself_id ~= player.myself.id then
player.list[player.myself.id] = nil;
player.myself = player.new(myself_id, myself_guid, myself_player_name, myself_master_rank, myself_hunter_rank);
player.list[myself_id] = player.myself;
end
-- other players
local player_info_list = hunter_info_field_:get_data(singletons.lobby_manager);
if player_info_list == nil then
customization_menu.status = "No player info list";
return;
end
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return;
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local player_id = member_index_field:get_data(player_info);
if player_id == nil then
goto continue
end
local player_guid = hunter_unique_id_field:get_data(player_info);
if player_guid == nil then
customization_menu.status = "No player guid";
return;
end
-- local player_guid_string = guid_tostring_method:call(player_guid);
-- if player_guid_string == nil then
-- customization_menu.status = "No player guid string";
-- return;
-- end
local player_hunter_rank = hunter_rank_field:get_data(player_info) or 0;
local player_master_rank = master_rank_field:get_data(player_info) or 0;
local player_name = name_field:get_data(player_info);
if player_name == nil then
goto continue
end
if player.list[player_id] == nil or not guid_equals_method:call(player.list[player_id].guid, player_guid) -- player.list[player_id].guid ~= player_guid
then
local _player = player.new(player_id, player_guid, player_name, player_master_rank, player_hunter_rank);
player.list[player_id] = _player;
if player_name == player.myself.name and player_hunter_rank == player.myself.hunter_rank and player_master_rank ==
player.myself.master_rank then
player.myself = _player;
end
end
::continue::
end
end
function player.init_UI(_player)
local cached_config = config.current_config.damage_meter_UI;
_player.damage_UI = player_damage_UI_entity.new(cached_config.damage_bar, cached_config.highlighted_damage_bar,
cached_config.player_name_label, cached_config.dps_label, cached_config.master_hunter_rank_label,
cached_config.damage_value_label, cached_config.damage_percentage_label, cached_config.cart_count_label);
end
function player.init_total_UI(_player)
local cached_config = config.current_config.damage_meter_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
_player.damage_UI = {
total_damage_label = table_helpers.deep_copy(cached_config.total_damage_label),
total_damage_value_label = table_helpers.deep_copy(cached_config.total_damage_value_label),
total_dps_label = table_helpers.deep_copy(cached_config.total_dps_label),
total_cart_count_label = table_helpers.deep_copy(cached_config.total_cart_count_label),
};
_player.damage_UI.total_damage_label.offset.x = _player.damage_UI.total_damage_label.offset.x * global_scale_modifier;
_player.damage_UI.total_damage_label.offset.y = _player.damage_UI.total_damage_label.offset.y * global_scale_modifier;
_player.damage_UI.total_damage_value_label.offset.x = _player.damage_UI.total_damage_value_label.offset.x *
global_scale_modifier;
_player.damage_UI.total_damage_value_label.offset.y = _player.damage_UI.total_damage_value_label.offset.y *
global_scale_modifier;
_player.damage_UI.total_dps_label.offset.x = _player.damage_UI.total_dps_label.offset.x * global_scale_modifier;
_player.damage_UI.total_dps_label.offset.y = _player.damage_UI.total_dps_label.offset.y * global_scale_modifier;
_player.damage_UI.total_cart_count_label.offset.x = _player.damage_UI.total_cart_count_label.offset.x * global_scale_modifier;
_player.damage_UI.total_cart_count_label.offset.y = _player.damage_UI.total_cart_count_label.offset.y * global_scale_modifier;
end
function player.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
player_damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps);
end
function player.draw_total(position_on_screen, opacity_scale)
drawing.draw_label(player.total.damage_UI.total_damage_label, position_on_screen, opacity_scale, language.current_language.UI.total_damage);
drawing.draw_label(player.total.damage_UI.total_damage_value_label, position_on_screen, opacity_scale, player.total.display.total_damage);
drawing.draw_label(player.total.damage_UI.total_dps_label, position_on_screen, opacity_scale, player.total.dps);
if quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
drawing.draw_label(player.total.damage_UI.total_cart_count_label, position_on_screen, opacity_scale, quest_status.cart_count, quest_status.max_cart_count);
end
end
function player.init_module()
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
player_damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.player_damage_UI_entity");
time = require("MHR_Overlay.Game_Handler.time");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
player.init();
end
return player;

View File

@@ -0,0 +1,709 @@
local this = {};
local config;
local singletons;
local customization_menu;
local damage_UI_entity;
local time;
local quest_status;
local drawing;
local language;
local non_players;
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;
this.list = {};
this.myself = nil;
this.myself_position = Vector3f.new(0, 0, 0);
this.total = nil;
this.display_list = {};
this.highlighted_damage_UI = nil;
this.types = {
["myself"] = 0,
["other_player"] = 1,
["servant"] = 2,
["my_otomo"] = 4,
["other_player_otomo"] = 8,
["servant_otomo"] = 16,
["total"] = 32,
["highlight"] = 64
}
function this.new(id, name, master_rank, hunter_rank, type)
local player = {};
player.id = id;
player.name = name;
player.hunter_rank = hunter_rank;
player.master_rank = master_rank;
player.type = type;
player.cart_count = 0;
player.join_time = -1;
player.first_hit_time = -1;
player.dps = 0;
player.small_monsters = this.init_damage_sources()
player.large_monsters = this.init_damage_sources();
player.display = {};
player.display.total_damage = 0;
player.display.physical_damage = 0;
player.display.elemental_damage = 0;
player.display.ailment_damage = 0;
this.init_UI(player);
if this.highlighted_damage_UI == nil then
this.init_highlighted_UI();
end
return player;
end
function this.init_damage_sources()
local monster_type = {};
monster_type.total_damage = 0;
monster_type.physical_damage = 0;
monster_type.elemental_damage = 0;
monster_type.ailment_damage = 0;
monster_type.bombs = {};
monster_type.bombs.total_damage = 0;
monster_type.bombs.physical_damage = 0;
monster_type.bombs.elemental_damage = 0;
monster_type.bombs.ailment_damage = 0;
monster_type.kunai = {};
monster_type.kunai.total_damage = 0;
monster_type.kunai.physical_damage = 0;
monster_type.kunai.elemental_damage = 0;
monster_type.kunai.ailment_damage = 0;
monster_type.installations = {};
monster_type.installations.total_damage = 0;
monster_type.installations.physical_damage = 0;
monster_type.installations.elemental_damage = 0;
monster_type.installations.ailment_damage = 0;
monster_type.otomo = {};
monster_type.otomo.total_damage = 0;
monster_type.otomo.physical_damage = 0;
monster_type.otomo.elemental_damage = 0;
monster_type.otomo.ailment_damage = 0;
monster_type.wyvern_riding = {};
monster_type.wyvern_riding.total_damage = 0;
monster_type.wyvern_riding.physical_damage = 0;
monster_type.wyvern_riding.elemental_damage = 0;
monster_type.wyvern_riding.ailment_damage = 0;
monster_type.poison = {};
monster_type.poison.total_damage = 0;
monster_type.poison.physical_damage = 0;
monster_type.poison.elemental_damage = 0;
monster_type.poison.ailment_damage = 0;
monster_type.otomo_poison = {};
monster_type.otomo_poison.total_damage = 0;
monster_type.otomo_poison.physical_damage = 0;
monster_type.otomo_poison.elemental_damage = 0;
monster_type.otomo_poison.ailment_damage = 0;
monster_type.blast = {};
monster_type.blast.total_damage = 0;
monster_type.blast.physical_damage = 0;
monster_type.blast.elemental_damage = 0;
monster_type.blast.ailment_damage = 0;
monster_type.otomo_blast = {};
monster_type.otomo_blast.total_damage = 0;
monster_type.otomo_blast.physical_damage = 0;
monster_type.otomo_blast.elemental_damage = 0;
monster_type.otomo_blast.ailment_damage = 0;
monster_type.endemic_life = {};
monster_type.endemic_life.total_damage = 0;
monster_type.endemic_life.physical_damage = 0;
monster_type.endemic_life.elemental_damage = 0;
monster_type.endemic_life.ailment_damage = 0;
monster_type.other = {};
monster_type.other.total_damage = 0;
monster_type.other.physical_damage = 0;
monster_type.other.elemental_damage = 0;
monster_type.other.ailment_damage = 0;
return monster_type;
end
function this.get_player(player_id)
if player_id == non_players.my_second_otomo_id then
return this.myself;
end
return this.list[player_id];
end
function this.update_damage(player, damage_source_type, is_large_monster, damage_object)
if player == nil then
return;
end
if player.first_hit_time == -1 then
player.first_hit_time = time.total_elapsed_script_seconds;
end
local player_monster_type = player.small_monsters;
if is_large_monster then
player_monster_type = player.large_monsters;
end
if damage_source_type == "player" then
this.merge_damage(player_monster_type, damage_object);
elseif damage_source_type == "bomb" then
this.merge_damage(player_monster_type.bombs, damage_object);
elseif damage_source_type == "kunai" then
this.merge_damage(player_monster_type.kunai, damage_object);
elseif damage_source_type == "installation" then
this.merge_damage(player_monster_type.installations, damage_object);
elseif damage_source_type == "otomo" then
this.merge_damage(player_monster_type.otomo, damage_object);
elseif damage_source_type == "wyvern riding" then
this.merge_damage(player_monster_type.wyvern_riding, damage_object);
elseif damage_source_type == "poison" then
this.merge_damage(player_monster_type.poison, damage_object);
elseif damage_source_type == "blast" then
this.merge_damage(player_monster_type.blast, damage_object);
elseif damage_source_type == "otomo poison" then
this.merge_damage(player_monster_type.otomo_poison, damage_object);
elseif damage_source_type == "otomo blast" then
this.merge_damage(player_monster_type.otomo_blast, damage_object);
elseif damage_source_type == "endemic life" then
this.merge_damage(player_monster_type.endemic_life, damage_object);
elseif damage_source_type == "other" then
this.merge_damage(player_monster_type.other, damage_object);
else
this.merge_damage(player_monster_type, damage_object);
end
this.update_display(player);
end
function this.update_display(player)
if player == nil then
return;
end
local cached_config = config.current_config.damage_meter_UI;
player.display.total_damage = 0;
player.display.physical_damage = 0;
player.display.elemental_damage = 0;
player.display.ailment_damage = 0;
local monster_types = {};
if cached_config.tracked_monster_types.small_monsters then
table.insert(monster_types, player.small_monsters);
end
if cached_config.tracked_monster_types.large_monsters then
table.insert(monster_types, player.large_monsters);
end
for _, monster_type in ipairs(monster_types) do
if cached_config.tracked_damage_types.player_damage then
this.merge_damage(player.display, monster_type);
end
if cached_config.tracked_damage_types.bomb_damage then
this.merge_damage(player.display, monster_type.bombs);
end
if cached_config.tracked_damage_types.kunai_damage then
this.merge_damage(player.display, monster_type.kunai);
end
if cached_config.tracked_damage_types.installation_damage then
this.merge_damage(player.display, monster_type.installations);
end
if cached_config.tracked_damage_types.otomo_damage then
if player.type == this.types.myself then
if not cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.other_player then
if not cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.servant then
if not cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.my_otomo then
if cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.other_player_otomo then
if cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.servant_otomo then
if cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo);
end
elseif player.type == this.types.total then
this.merge_damage(player.display, monster_type.otomo);
end
end
if cached_config.tracked_damage_types.wyvern_riding_damage then
this.merge_damage(player.display, monster_type.wyvern_riding);
end
if cached_config.tracked_damage_types.poison_damage then
this.merge_damage(player.display, monster_type.poison);
if player.type == this.types.myself then
if not cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.other_player then
if not cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.servant then
if not cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.my_otomo then
if cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.other_player_otomo then
if cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.servant_otomo then
if cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_poison);
end
elseif player.type == this.types.total then
this.merge_damage(player.display, monster_type.otomo_poison);
end
end
if cached_config.tracked_damage_types.blast_damage then
this.merge_damage(player.display, monster_type.blast);
if player.type == this.types.myself then
if not cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.other_player then
if not cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.servant then
if not cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.my_otomo then
if cached_config.settings.show_my_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.other_player_otomo then
if cached_config.settings.show_other_player_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.servant_otomo then
if cached_config.settings.show_servant_otomos_separately then
this.merge_damage(player.display, monster_type.otomo_blast);
end
elseif player.type == this.types.total then
this.merge_damage(player.display, monster_type.otomo_blast);
end
end
if cached_config.tracked_damage_types.endemic_life_damage then
this.merge_damage(player.display, monster_type.endemic_life);
end
if cached_config.tracked_damage_types.other_damage then
this.merge_damage(player.display, monster_type.other);
end
end
end
function this.merge_damage(first, second)
first.total_damage = first.total_damage + second.total_damage;
first.physical_damage = first.physical_damage + second.physical_damage;
first.elemental_damage = first.elemental_damage + second.elemental_damage;
first.ailment_damage = first.ailment_damage + second.ailment_damage;
return first;
end
function this.update_dps(bypass_freeze)
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
return;
end
this.total.dps = 0;
for _, player in pairs(this.list) do
this.update_player_dps(player);
end
for _, servant in pairs(non_players.servant_list) do
this.update_player_dps(servant);
end
for _, otomo in pairs(non_players.otomo_list) do
this.update_player_dps(otomo);
end
end
function this.update_player_dps(player)
local cached_config = config.current_config.damage_meter_UI.settings;
if player.join_time == -1 then
player.join_time = time.total_elapsed_script_seconds;
end
if cached_config.dps_mode == "Quest Time" then
if time.total_elapsed_seconds > 0 then
player.dps = player.display.total_damage / time.total_elapsed_seconds;
end
elseif cached_config.dps_mode == "Join Time" then
if time.total_elapsed_script_seconds - player.join_time > 0 then
player.dps = player.display.total_damage / (time.total_elapsed_script_seconds - player.join_time);
end
elseif cached_config.dps_mode == "First Hit" then
if time.total_elapsed_script_seconds - player.first_hit_time > 0 then
player.dps = player.display.total_damage / (time.total_elapsed_script_seconds - player.first_hit_time);
end
end
this.total.dps = this.total.dps + player.dps;
end
function this.sort_players()
local cached_config = config.current_config.damage_meter_UI;
if cached_config.settings.my_damage_bar_location == "Normal" then
table.insert(this.display_list, this.myself);
end
-- sort here
if cached_config.sorting.type == "Normal" then
if cached_config.sorting.reversed_order then
table.sort(this.display_list, function(left, right)
return left.id > right.id;
end);
else
table.sort(this.display_list, function(left, right)
return left.id < right.id;
end);
end
elseif cached_config.sorting.type == "DPS" then
if cached_config.sorting.reversed_order then
table.sort(this.display_list, function(left, right)
return left.dps < right.dps;
end);
else
table.sort(this.display_list, function(left, right)
return left.dps > right.dps;
end);
end
else
if cached_config.sorting.reversed_order then
table.sort(this.display_list, function(left, right)
return left.display.total_damage < right.display.total_damage;
end);
else
table.sort(this.display_list, function(left, right)
return left.display.total_damage > right.display.total_damage;
end);
end
end
if cached_config.settings.my_damage_bar_location == "First" then
table.insert(this.display_list, 1, this.myself);
elseif cached_config.settings.my_damage_bar_location == "Last" then
table.insert(this.display_list, this.myself);
end
end
local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager");
local find_master_player_method = player_manager_type_def:get_method("findMasterPlayer");
local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase");
local get_pos_field = player_base_type_def:get_method("get_Pos");
function this.update_myself_position()
if singletons.player_manager == nil then
customization_menu.status = "No player manager";
return;
end
local master_player = find_master_player_method:call(singletons.player_manager);
if master_player == nil then
customization_menu.status = "No master player";
return;
end
local position = get_pos_field:call(master_player);
if position ~= nil then
this.myself_position = position;
end
end
function this.init()
this.list = {};
this.display_list = {};
this.total = this.new(0, "Total", 0, 0, this.types.total);
this.myself = this.new(-1, "DummyMHROverlay", -1, -1, this.types.myself);
end
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local my_hunter_info_field = lobby_manager_type_def:get_field("_myHunterInfo");
local myself_quest_index_field = lobby_manager_type_def:get_field("_myselfQuestIndex");
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
local hunter_info_field = lobby_manager_type_def:get_field("_hunterInfo");
local my_hunter_info_type_def = my_hunter_info_field:get_type();
local name_field = my_hunter_info_type_def:get_field("_name");
local hunter_unique_id_field = my_hunter_info_type_def:get_field("_HunterUniqueId");
local member_index_field = my_hunter_info_type_def:get_field("_memberIndex");
local hunter_rank_field = my_hunter_info_type_def:get_field("_hunterRank");
local master_rank_field = my_hunter_info_type_def:get_field("_masterRank");
local hunter_info_type_def = hunter_info_field:get_type();
local get_count_method = hunter_info_type_def:get_method("get_Count");
local get_item_method = hunter_info_type_def:get_method("get_Item");
local guid_type = hunter_unique_id_field:get_type();
local guid_equals_method = guid_type:get_method("Equals(System.Guid)");
local progress_manager_type_def = sdk.find_type_definition("snow.progress.ProgressManager");
local get_hunter_rank_method = progress_manager_type_def:get_method("get_HunterRank");
local get_master_rank_method = progress_manager_type_def:get_method("get_MasterRank");
local get_master_player_id_method = player_manager_type_def:get_method("getMasterPlayerID");
function this.update_player_list(is_on_quest)
if is_on_quest then
this.update_player_list_(quest_hunter_info_field);
else
this.update_player_list_(hunter_info_field);
end
end
function this.update_player_list_(hunter_info_field_)
local cached_config = config.current_config.damage_meter_UI;
if singletons.lobby_manager == nil then
return;
end
if singletons.progress_manager == nil then
return;
end
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
customization_menu.status = "No myself player info list";
return;
end
local myself_player_name = name_field:get_data(myself_player_info);
if myself_player_name == nil then
customization_menu.status = "No myself player name";
return;
end
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager) or 0;
local myself_master_rank = get_master_rank_method:call(singletons.progress_manager) or 0;
local myself_id = get_master_player_id_method:call(singletons.player_manager);
if myself_id == nil then
customization_menu.status = "No myself player id";
return;
end
if this.myself == nil or myself_id ~= this.myself.id then
this.list[this.myself.id] = nil;
this.myself = this.new(myself_id, myself_player_name, myself_master_rank, myself_hunter_rank, this.types.myself);
this.list[myself_id] = this.myself;
end
-- other players
local player_info_list = hunter_info_field_:get_data(singletons.lobby_manager);
if player_info_list == nil then
customization_menu.status = "No player info list";
return;
end
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return;
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local id = member_index_field:get_data(player_info);
if id == nil then
goto continue
end
local hunter_rank = hunter_rank_field:get_data(player_info) or 0;
local master_rank = master_rank_field:get_data(player_info) or 0;
local name = name_field:get_data(player_info);
if name == nil then
goto continue
end
local player = this.list[id];
if player == nil then
if name == this.myself.name then
player = this.new(id, name, master_rank, hunter_rank, this.types.myself);
this.myself = player;
this.list[id] = player;
else
player = this.new(id, name, master_rank, hunter_rank, this.types.other_player);
this.list[id] = player;
end
elseif player.name ~= name or player.hunter_rank ~= hunter_rank or player.master_rank ~= master_rank then
if name == this.myself.name then
player = this.new(id, name, master_rank, hunter_rank, this.types.myself);
this.myself = player;
this.list[id] = player;
else
player = this.new(id, name, master_rank, hunter_rank, this.types.other_player);
this.list[id] = player;
end
end
if player ~= this.myself then
table.insert(this.display_list, player);
end
::continue::
end
end
function this.init_UI(player)
local cached_config = config.current_config.damage_meter_UI;
if player.type == this.types.myself then
player.damage_UI = damage_UI_entity.new(cached_config.myself, player.type);
elseif player.type == this.types.other_player then
player.damage_UI = damage_UI_entity.new(cached_config.other_players, player.type);
elseif player.type == this.types.total then
player.damage_UI = damage_UI_entity.new(cached_config.total, player.type);
end
end
function this.init_highlighted_UI()
local cached_config = config.current_config.damage_meter_UI;
this.highlighted_damage_UI = damage_UI_entity.new(cached_config.highlighted, this.types.highlight);
end
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);
end
function this.init_module()
config = require("MHR_Overlay.Misc.config");
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
time = require("MHR_Overlay.Game_Handler.time");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
non_players = require("MHR_Overlay.Damage_Meter.non_players");
this.init();
end
return this;

View File

@@ -1,13 +1,46 @@
local env_creature = {};
local this = {};
local drawing;
local customization_menu;
local singletons;
local config;
local table_helpers;
local utils;
env_creature.list = {};
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;
function env_creature.new(REcreature)
this.list = {};
function this.new(REcreature)
local creature = {};
creature.life = 0;
@@ -17,22 +50,22 @@ function env_creature.new(REcreature)
creature.position = Vector3f.new(0, 0, 0);
creature.distance = 0;
env_creature.init(creature, REcreature);
env_creature.init_UI(creature);
this.init(creature, REcreature);
this.init_UI(creature);
if env_creature.list[REcreature] == nil then
env_creature.list[REcreature] = creature;
if this.list[REcreature] == nil then
this.list[REcreature] = creature;
end
return creature;
end
function env_creature.get_creature(REcreature)
if env_creature.list[REcreature] == nil then
env_creature.list[REcreature] = env_creature.new(REcreature);
function this.get_creature(REcreature)
if this.list[REcreature] == nil then
this.list[REcreature] = this.new(REcreature);
end
return env_creature.list[REcreature];
return this.list[REcreature];
end
local environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
@@ -44,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");
function env_creature.init(creature, REcreature)
function this.init(creature, REcreature)
local creature_type = creature_type_field:get_data(REcreature);
if creature_type == nil then
customization_menu.status = "No env creature type";
@@ -58,8 +91,8 @@ function env_creature.init(creature, REcreature)
end
end
function env_creature.init_UI(creature)
creature.name_label = table_helpers.deep_copy(config.current_config.endemic_life_UI.creature_name_label);
function this.init_UI(creature)
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;
@@ -67,13 +100,13 @@ function env_creature.init_UI(creature)
creature.name_label.offset.y = creature.name_label.offset.y * global_scale_modifier;
end
function env_creature.update_position(REcreature, creature)
function this.update_position(REcreature, creature)
if not config.current_config.endemic_life_UI.enabled then
return;
end
if creature == nil then
creature = env_creature.get_creature(REcreature);
creature = this.get_creature(REcreature);
end
local position = get_pos_method:call(REcreature);
@@ -82,13 +115,13 @@ function env_creature.update_position(REcreature, creature)
end
end
function env_creature.update(REcreature, creature)
function this.update(REcreature, creature)
if not config.current_config.endemic_life_UI.enabled then
return;
end
if creature == nil then
creature = env_creature.get_creature(REcreature);
creature = this.get_creature(REcreature);
end
local is_inactive = creature_is_inactive_field:get_data(REcreature);
@@ -97,7 +130,7 @@ function env_creature.update(REcreature, creature)
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
local text_width, text_height = drawing.font:measure(creature.name);
position_on_screen.x = position_on_screen.x - text_width / 2;
@@ -106,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);
end
function env_creature.init_list()
env_creature.list = {};
function this.init_list()
this.list = {};
end
function env_creature.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
--health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
--stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
--screen = require("MHR_Overlay.Game_Handler.screen");
@@ -123,4 +156,4 @@ function env_creature.init_module()
--ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
end
return env_creature;
return this;

View File

@@ -1,27 +1,60 @@
local env_creature_hook = {};
local this = {};
local env_creature;
local config;
local time;
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 environment_creature_base_type_def = sdk.find_type_definition("snow.envCreature.EnvironmentCreatureBase");
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);
env_creature.update(REcreature, creature);
env_creature.update_position(REcreature, creature);
end
function env_creature_hook.init_module()
function this.init_module()
config = require("MHR_Overlay.Misc.config");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
time = require("MHR_Overlay.Game_Handler.time");
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)
return retval;
end);
end
return env_creature_hook;
return this;

View File

@@ -1,13 +1,46 @@
local config = require "MHR_Overlay.Misc.config"
local keyboard = {};
local this = {};
local config;
local singletons;
local customization_menu;
local player;
local players;
local small_monster;
local large_monster;
local damage_meter_UI;
local time;
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 game_keyboard_type_def = sdk.find_type_definition("snow.GameKeyboard");
local hard_keyboard_field = game_keyboard_type_def:get_field("hardKeyboard");
@@ -16,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_release_method = hard_keyboard_field_type_def:get_method("getRelease");
keyboard.hotkey_modifiers_down = {
this.hotkey_modifiers_down = {
ctrl = false,
shift = false,
alt = false
};
keyboard.keys = {
this.keys = {
[0] = "None",
[1] = "Left Mouse Button",
[2] = "Right Mouse Button",
@@ -301,7 +334,7 @@ keyboard.keys = {
};
function keyboard.update()
function this.update()
if singletons.game_keyboard == nil then
customization_menu.status = "No game keyboard";
return;
@@ -313,137 +346,137 @@ function keyboard.update()
return;
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
config.save();
else
keyboard.check_hotkeys(hard_keyboard);
this.check_hotkeys(hard_keyboard);
end
keyboard.hotkey_modifiers_down.ctrl = false;
keyboard.hotkey_modifiers_down.shift = false;
keyboard.hotkey_modifiers_down.alt = false
this.hotkey_modifiers_down.ctrl = false;
this.hotkey_modifiers_down.shift = false;
this.hotkey_modifiers_down.alt = false
end
function keyboard.check_modifiers(hard_keyboard)
function this.check_modifiers(hard_keyboard)
local is_ctrl_down = get_down_method:call(hard_keyboard, 17);
if is_ctrl_down ~= nil then
keyboard.hotkey_modifiers_down.ctrl = is_ctrl_down;
this.hotkey_modifiers_down.ctrl = is_ctrl_down;
end
local is_shift_down = get_down_method:call(hard_keyboard, 16);
if is_shift_down ~= nil then
keyboard.hotkey_modifiers_down.shift = is_shift_down;
this.hotkey_modifiers_down.shift = is_shift_down;
end
local is_alt_down = get_down_method:call(hard_keyboard, 18);
if is_alt_down ~= nil then
keyboard.hotkey_modifiers_down.alt = is_alt_down;
this.hotkey_modifiers_down.alt = is_alt_down;
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;
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
cached_config.all_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.all_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.all_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.all_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.all_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.all_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.all_UI.key = key;
customization_menu.all_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.small_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.small_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.small_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.small_monster_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.small_monster_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.small_monster_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.small_monster_UI.key = key;
customization_menu.small_monster_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.large_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.large_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.large_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.large_monster_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.large_monster_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.large_monster_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.large_monster_UI.key = key;
customization_menu.large_monster_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.large_monster_dynamic_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.large_monster_dynamic_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.large_monster_dynamic_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.large_monster_dynamic_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.large_monster_dynamic_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.large_monster_dynamic_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.large_monster_dynamic_UI.key = key;
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.large_monster_static_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.large_monster_static_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.large_monster_static_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.large_monster_static_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.large_monster_static_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.large_monster_static_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.large_monster_static_UI.key = key;
customization_menu.large_monster_static_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.large_monster_highlighted_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.large_monster_highlighted_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.large_monster_highlighted_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.large_monster_highlighted_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.large_monster_highlighted_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.large_monster_highlighted_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.large_monster_highlighted_UI.key = key;
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.time_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.time_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.time_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.time_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.time_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.time_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.time_UI.key = key;
customization_menu.time_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.damage_meter_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.damage_meter_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.damage_meter_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.damage_meter_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.damage_meter_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.damage_meter_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.damage_meter_UI.key = key;
customization_menu.damage_meter_UI_waiting_for_key = false;
return true;
end
end
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
cached_config.endemic_life_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
cached_config.endemic_life_UI.shift = keyboard.hotkey_modifiers_down.shift;
cached_config.endemic_life_UI.alt = keyboard.hotkey_modifiers_down.alt;
cached_config.endemic_life_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.endemic_life_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.endemic_life_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.endemic_life_UI.key = key;
customization_menu.endemic_life_UI_waiting_for_key = false;
return true;
@@ -454,12 +487,12 @@ function keyboard.register_hotkey(hard_keyboard)
return false;
end
function keyboard.check_hotkeys(hard_keyboard)
function this.check_hotkeys(hard_keyboard)
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)
and not (cached_config.all_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if not (cached_config.all_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
and not (cached_config.all_UI.shift and not this.hotkey_modifiers_down.shift)
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
local is_any_enabled = config.current_config.time_UI.enabled
@@ -478,17 +511,17 @@ function keyboard.check_hotkeys(hard_keyboard)
end
end
if not (cached_config.small_monster_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
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
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
end
end
if not (cached_config.large_monster_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
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
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
or config.current_config.large_monster_UI.static.enabled
@@ -500,27 +533,27 @@ function keyboard.check_hotkeys(hard_keyboard)
end
end
if not (cached_config.large_monster_dynamic_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_dynamic_UI.alt and not this.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard,
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;
end
end
if not (cached_config.large_monster_static_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_static_UI.alt and not this.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard,
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;
end
end
if not (cached_config.large_monster_highlighted_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
and not (cached_config.large_monster_highlighted_UI.alt and not this.hotkey_modifiers_down.alt) then
if get_release_method:call(hard_keyboard,
math.tointeger(cached_config.large_monster_highlighted_UI.key)) then
config.current_config.large_monster_UI.highlighted.enabled = not
@@ -528,32 +561,32 @@ function keyboard.check_hotkeys(hard_keyboard)
end
end
if not (cached_config.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
and not (cached_config.time_UI.shift and not keyboard.hotkey_modifiers_down.shift)
and not (cached_config.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
if not (cached_config.time_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
and not (cached_config.time_UI.shift and not this.hotkey_modifiers_down.shift)
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
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
end
end
if not (cached_config.damage_meter_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
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
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
end
end
if not (cached_config.endemic_life_UI.ctrl and not keyboard.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.alt and not keyboard.hotkey_modifiers_down.alt) then
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 this.hotkey_modifiers_down.shift)
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
config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled;
end
end
end
function keyboard.get_hotkey_name(hotkey)
function this.get_hotkey_name(hotkey)
local hotkey_name = "";
if hotkey.ctrl then
@@ -568,17 +601,18 @@ function keyboard.get_hotkey_name(hotkey)
hotkey_name = hotkey_name .. "Alt + ";
end
return hotkey_name .. tostring(keyboard.keys[hotkey.key]);
return hotkey_name .. tostring(this.keys[hotkey.key]);
end
function keyboard.init_module()
function this.init_module()
config = require "MHR_Overlay.Misc.config"
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
damage_meter_UI = require("MHR_Overlay.UI.Modules.damage_meter_UI");
time = require("MHR_Overlay.Game_Handler.time");
end
return keyboard;
return this;

View File

@@ -1,8 +1,8 @@
local quest_status = {};
local this = {};
local singletons;
local customization_menu;
local player;
local players;
local small_monster;
local large_monster;
local damage_meter_UI;
@@ -10,7 +10,39 @@ local time;
local env_creature;
local non_players;
quest_status.flow_states = {
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;
this.flow_states = {
NONE = 0,
IN_LOBBY = 1,
IN_TRAINING_AREA = 2,
@@ -32,15 +64,15 @@ quest_status.flow_states = {
SUMMARY_SCREEN = 32768,
};
quest_status.previous_flow_state = quest_status.flow_states.NONE;
quest_status.flow_state = quest_status.flow_states.NONE;
this.previous_flow_state = this.flow_states.NONE;
this.flow_state = this.flow_states.NONE;
quest_status.index = 0;
quest_status.is_online = false;
this.index = 0;
this.is_online = false;
--quest_status.is_quest_host = false;
quest_status.cart_count = 0;
quest_status.max_cart_count = 3;
this.cart_count = 0;
this.max_cart_count = 3;
local quest_manager_type_def = sdk.find_type_definition("snow.QuestManager");
local on_changed_game_status_method = quest_manager_type_def:get_method("onChangedGameStatus");
@@ -84,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 event_manager_dispose_method = unique_event_manager_type_def:get_method("dispose");
function quest_status.get_flow_state_name(flow_state, new_line)
for key, value in pairs(quest_status.flow_states) do
function this.get_flow_state_name(flow_state, new_line)
for key, value in pairs(this.flow_states) do
if value == flow_state then
if new_line then
return "\n" .. tostring(key);
@@ -96,53 +128,52 @@ function quest_status.get_flow_state_name(flow_state, new_line)
end
end
function quest_status.set_flow_state(new_flow_state)
quest_status.previous_flow_state = quest_status.flow_state;
quest_status.flow_state = new_flow_state;
function this.set_flow_state(new_flow_state)
this.previous_flow_state = this.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;
quest_status.is_quest_end = true;
else
damage_meter_UI.freeze_displayed_players = false;
quest_status.is_quest_end = false;
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
player.init();
if this.flow_state == this.flow_states.IN_LOBBY or this.flow_state == this.flow_states.IN_TRAINING_AREA then
players.init();
non_players.init();
small_monster.init_list();
large_monster.init_list();
env_creature.init_list();
elseif quest_status.flow_state >= quest_status.flow_states.LOADING_QUEST then
quest_status.get_cart_count();
quest_status.get_max_cart_count();
damage_meter_UI.last_displayed_players = {};
elseif this.flow_state >= this.flow_states.LOADING_QUEST then
this.get_cart_count();
this.get_max_cart_count();
end
end
function quest_status.get_cart_count()
function this.get_cart_count()
local death_num = get_death_num_method:call(singletons.quest_manager);
if death_num ~= nil then
quest_status.cart_count = death_num;
this.cart_count = death_num;
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);
if quest_life ~= nil then
quest_status.max_cart_count = quest_life;
this.max_cart_count = quest_life;
end
end
--type 2 = quest start
--type 3 = monster killcam
--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
return;
end
if quest_status.index ~= 2 then
if this.index ~= 2 then
return;
end
@@ -153,125 +184,125 @@ function quest_status.on_demo_request_activation(request_data_base)
-- QUEST_START_ANIMATION
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
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
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
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
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
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
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
function quest_status.on_demo_end()
if quest_status.index == 2 then
if quest_status.flow_state == quest_status.flow_states.PLAYER_DEATH_ANIMATION
or quest_status.flow_state == quest_status.flow_states.PLAYER_CART_ANIMATION
or quest_status.flow_state == quest_status.flow_states.FAST_TRAVEL_ANIMATION
or quest_status.flow_state == quest_status.flow_states.WYVERN_RIDING_START_ANIMATION then
function this.on_demo_end()
if this.index == 2 then
if this.flow_state == this.flow_states.PLAYER_DEATH_ANIMATION
or this.flow_state == this.flow_states.PLAYER_CART_ANIMATION
or this.flow_state == this.flow_states.FAST_TRAVEL_ANIMATION
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
function quest_status.on_set_quest_clear()
if quest_status.index == 2 and quest_status.flow_state ~= quest_status.flow_states.KILLCAM then
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_TIMER);
function this.on_set_quest_clear()
if this.index == 2 and this.flow_state ~= this.flow_states.KILLCAM then
this.set_flow_state(this.flow_states.QUEST_END_TIMER);
end
end
function quest_status.on_quest_end_set_state()
if quest_status.index == 2 then
quest_status.set_flow_state(quest_status.flow_states.QUEST_END_SCREEN);
function this.on_quest_end_set_state()
if this.index == 2 then
this.set_flow_state(this.flow_states.QUEST_END_SCREEN);
end
end
function quest_status.on_gui_result_reward_do_open()
if quest_status.index == 3 then
quest_status.set_flow_state(quest_status.flow_states.REWARD_SCREEN);
function this.on_gui_result_reward_do_open()
if this.index == 3 then
this.set_flow_state(this.flow_states.REWARD_SCREEN);
end
end
function quest_status.on_gui_result_pay_off_do_open()
if quest_status.index == 3 then
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
function this.on_gui_result_pay_off_do_open()
if this.index == 3 then
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
end
end
function quest_status.on_play_event_common()
quest_status.set_flow_state(quest_status.flow_states.CUTSCENE);
function this.on_play_event_common()
this.set_flow_state(this.flow_states.CUTSCENE);
end
function quest_status.on_event_manager_dispose()
if quest_status.flow_state == quest_status.flow_states.CUTSCENE then
quest_status.set_flow_state(quest_status.previous_flow_state);
function this.on_event_manager_dispose()
if this.flow_state == this.flow_states.CUTSCENE then
this.set_flow_state(this.previous_flow_state);
end
end
function quest_status.on_set_quest_fail()
if quest_status.flow_state == quest_status.flow_states.PLAYER_DEATH_ANIMATION or
quest_status.flow_state == quest_status.flow_states.PLAYER_CART_ANIMATION or
quest_status.flow_state == quest_status.flow_states.FAST_TRAVEL_ANIMATION or
quest_status.flow_state == quest_status.flow_states.WYVERN_RIDING_START_ANIMATION then
function this.on_set_quest_fail()
if this.flow_state == this.flow_states.PLAYER_DEATH_ANIMATION or
this.flow_state == this.flow_states.PLAYER_CART_ANIMATION or
this.flow_state == this.flow_states.FAST_TRAVEL_ANIMATION or
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
function quest_status.on_village_fast_travel(area)
function this.on_village_fast_travel(area)
if area == nil then
return;
end
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
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
this.set_flow_state(this.flow_states.IN_LOBBY);
end
end
function quest_status.on_changed_game_status(new_quest_status)
quest_status.index = new_quest_status;
function this.on_changed_game_status(new_quest_status)
this.index = new_quest_status;
if quest_status.index == 0 then
quest_status.set_flow_state(quest_status.flow_states.NONE);
elseif quest_status.index == 1 then
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
elseif quest_status.index == 2 then
quest_status.set_flow_state(quest_status.flow_states.LOADING_QUEST);
elseif quest_status.index == 3 then
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
if this.index == 0 then
this.set_flow_state(this.flow_states.NONE);
elseif this.index == 1 then
this.set_flow_state(this.flow_states.IN_LOBBY);
elseif this.index == 2 then
this.set_flow_state(this.flow_states.LOADING_QUEST);
elseif this.index == 3 then
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
end
end
function quest_status.init()
function this.init()
if singletons.quest_manager == nil then
return;
end
@@ -282,22 +313,22 @@ function quest_status.init()
return;
end
quest_status.index = new_quest_status;
this.index = new_quest_status;
if quest_status.index == 0 then
quest_status.set_flow_state(quest_status.flow_states.NONE);
elseif quest_status.index == 1 then
quest_status.set_flow_state(quest_status.flow_states.IN_LOBBY);
elseif quest_status.index == 2 then
quest_status.set_flow_state(quest_status.flow_states.PLAYING_QUEST);
elseif quest_status.index == 3 then
quest_status.set_flow_state(quest_status.flow_states.SUMMARY_SCREEN);
if this.index == 0 then
this.set_flow_state(this.flow_states.NONE);
elseif this.index == 1 then
this.set_flow_state(this.flow_states.IN_LOBBY);
elseif this.index == 2 then
this.set_flow_state(this.flow_states.PLAYING_QUEST);
elseif this.index == 3 then
this.set_flow_state(this.flow_states.SUMMARY_SCREEN);
end
quest_status.update_is_training_area();
this.update_is_training_area();
end
function quest_status.update_is_online()
function this.update_is_online()
if singletons.lobby_manager == nil then
return;
end
@@ -307,7 +338,7 @@ function quest_status.update_is_online()
return;
end
quest_status.is_online = is_quest_online;
this.is_online = is_quest_online;
end
--[[function quest_status.update_is_quest_host()
@@ -323,7 +354,7 @@ end
quest_status.is_quest_host = is_quest_host;
end--]]
function quest_status.update_is_training_area()
function this.update_is_training_area()
if singletons.village_area_manager == nil then
customization_menu.status = "No village area manager";
return;
@@ -335,14 +366,14 @@ function quest_status.update_is_training_area()
end
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
function quest_status.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
damage_meter_UI = require("MHR_Overlay.UI.Modules.damage_meter_UI");
@@ -350,63 +381,63 @@ function quest_status.init_module()
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
non_players = require("MHR_Overlay.Damage_Meter.non_players");
quest_status.init();
this.init();
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);
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);
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);
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);
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);
sdk.hook(demo_end_method, function(args)
quest_status.on_demo_end();
this.on_demo_end();
end, function(retval) return retval; end);
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);
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);
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);
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);
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);
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);
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);
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
return quest_status;
return this;

View File

@@ -1,27 +1,59 @@
local screen = {};
local this = {};
local config;
local singletons;
screen.width = 1920;
screen.height = 1080;
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;
function screen.update_window_size()
this.width = 1920;
this.height = 1080;
function this.update_window_size()
local width;
local height;
if d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available then
width, height = d2d.surface_size();
else
width, height = screen.get_game_window_size();
width, height = this.get_game_window_size();
end
if width ~= nil then
screen.width = width;
this.width = width;
end
if height ~= nil then
screen.height = height;
this.height = height;
end
end
@@ -33,11 +65,9 @@ local size_type = get_size_method:get_return_type();
local width_field = size_type:get_field("w");
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
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");
if scene_view == nil then
--log.error("[MHR_Overlay.lua] No scene view");
@@ -66,7 +96,7 @@ function screen.get_game_window_size()
return screen_width, screen_height;
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 _position = {
@@ -81,29 +111,29 @@ function screen.calculate_absolute_coordinates(position)
-- top right
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 };
end
-- bottom left
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 };
end
-- bottom right
if position.anchor == "Bottom-Right" then
local screen_x = screen.width - _position.x;
local screen_y = screen.height - _position.y;
local screen_x = this.width - _position.x;
local screen_y = this.height - _position.y;
return { x = screen_x, y = screen_y };
end
return { x = _position.x, y = _position.y };
end
function screen.init_module()
function this.init_module()
config = require("MHR_Overlay.Misc.config");
singletons = require("MHR_Overlay.Game_Handler.singletons");
end
return screen;
return this;

View File

@@ -1,192 +1,238 @@
local singletons = {};
local this = {};
singletons.message_manager = nil;
singletons.enemy_manager = nil;
singletons.lobby_manager = nil;
singletons.progress_manager = nil;
singletons.quest_manager = nil;
singletons.player_manager = nil;
singletons.village_area_manager = nil;
singletons.gui_manager = nil;
singletons.game_keyboard = nil;
singletons.scene_manager = nil;
singletons.game_manager = nil;
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;
function singletons.init()
singletons.init_message_manager();
singletons.init_enemy_manager();
singletons.init_lobby_manager()
singletons.init_progress_manager();
singletons.init_quest_manager();
singletons.init_player_manager();
singletons.init_village_area_manager();
singletons.init_gui_manager();
singletons.init_game_keyboard();
singletons.init_scene_manager();
singletons.init_game_manager();
singletons.init_servant_manager();
this.message_manager = nil;
this.enemy_manager = nil;
this.lobby_manager = nil;
this.progress_manager = nil;
this.quest_manager = nil;
this.player_manager = nil;
this.village_area_manager = nil;
this.gui_manager = nil;
this.game_keyboard = nil;
this.scene_manager = nil;
this.game_manager = nil;
function this.init()
this.init_message_manager();
this.init_enemy_manager();
this.init_lobby_manager()
this.init_progress_manager();
this.init_quest_manager();
this.init_player_manager();
this.init_village_area_manager();
this.init_gui_manager();
this.init_game_keyboard();
this.init_scene_manager();
this.init_game_manager();
this.init_servant_manager();
this.init_otomo_manager();
end
function singletons.init_message_manager()
if singletons.message_manager ~= nil then
function this.init_message_manager()
if this.message_manager ~= nil then
return;
end
singletons.message_manager = sdk.get_managed_singleton("snow.gui.MessageManager");
if singletons.message_manager == nil then
this.message_manager = sdk.get_managed_singleton("snow.gui.MessageManager");
if this.message_manager == nil then
--log.error("[MHR Overlay] No message manager");
end
return singletons.message_manager;
return this.message_manager;
end
function singletons.init_enemy_manager()
if singletons.enemy_manager ~= nil then
function this.init_enemy_manager()
if this.enemy_manager ~= nil then
return;
end
singletons.enemy_manager = sdk.get_managed_singleton("snow.enemy.EnemyManager");
if singletons.enemy_manager == nil then
this.enemy_manager = sdk.get_managed_singleton("snow.enemy.EnemyManager");
if this.enemy_manager == nil then
--log.error("[MHR Overlay] No enemy manager");
end
return singletons.enemy_manager;
return this.enemy_manager;
end
function singletons.init_lobby_manager()
if singletons.lobby_manager ~= nil then
function this.init_lobby_manager()
if this.lobby_manager ~= nil then
return;
end
singletons.lobby_manager = sdk.get_managed_singleton("snow.LobbyManager");
if singletons.lobby_manager == nil then
this.lobby_manager = sdk.get_managed_singleton("snow.LobbyManager");
if this.lobby_manager == nil then
--log.error("[MHR Overlay] No lobby manager");
return false;
end
return singletons.lobby_manager;
return this.lobby_manager;
end
function singletons.init_progress_manager()
if singletons.progress_manager ~= nil then
function this.init_progress_manager()
if this.progress_manager ~= nil then
return;
end
singletons.progress_manager = sdk.get_managed_singleton("snow.progress.ProgressManager");
if singletons.progress_manager == nil then
this.progress_manager = sdk.get_managed_singleton("snow.progress.ProgressManager");
if this.progress_manager == nil then
--log.error("[MHR Overlay] No progress manager");
return false;
end
return singletons.progress_manager;
return this.progress_manager;
end
function singletons.init_quest_manager()
if singletons.quest_manager ~= nil then
function this.init_quest_manager()
if this.quest_manager ~= nil then
return;
end
singletons.quest_manager = sdk.get_managed_singleton("snow.QuestManager");
if singletons.quest_manager == nil then
this.quest_manager = sdk.get_managed_singleton("snow.QuestManager");
if this.quest_manager == nil then
--log.error("[MHR Overlay] No quest manager");
end
return singletons.quest_manager;
return this.quest_manager;
end
function singletons.init_player_manager()
if singletons.player_manager ~= nil then
function this.init_player_manager()
if this.player_manager ~= nil then
return;
end
singletons.player_manager = sdk.get_managed_singleton("snow.player.PlayerManager");
if singletons.player_manager == nil then
this.player_manager = sdk.get_managed_singleton("snow.player.PlayerManager");
if this.player_manager == nil then
--log.error("[MHR Overlay] No player manager");
end
return singletons.player_manager;
return this.player_manager;
end
function singletons.init_village_area_manager()
if singletons.village_area_manager ~= nil then
function this.init_village_area_manager()
if this.village_area_manager ~= nil then
return;
end
singletons.village_area_manager = sdk.get_managed_singleton("snow.VillageAreaManager");
if singletons.village_area_manager == nil then
this.village_area_manager = sdk.get_managed_singleton("snow.VillageAreaManager");
if this.village_area_manager == nil then
--log.error("[MHR Overlay] No village area manager");
end
return singletons.village_area_manager;
return this.village_area_manager;
end
function singletons.init_gui_manager()
if singletons.gui_manager ~= nil then
function this.init_gui_manager()
if this.gui_manager ~= nil then
return;
end
singletons.gui_manager = sdk.get_managed_singleton("snow.gui.GuiManager");
if singletons.gui_manager == nil then
this.gui_manager = sdk.get_managed_singleton("snow.gui.GuiManager");
if this.gui_manager == nil then
--log.error("[MHR Overlay] No gui manager");
end
return singletons.gui_manager;
return this.gui_manager;
end
function singletons.init_game_keyboard()
if singletons.game_keyboard ~= nil then
function this.init_game_keyboard()
if this.game_keyboard ~= nil then
return;
end
singletons.game_keyboard = sdk.get_managed_singleton("snow.GameKeyboard");
if singletons.game_keyboard == nil then
this.game_keyboard = sdk.get_managed_singleton("snow.GameKeyboard");
if this.game_keyboard == nil then
--log.error("[MHR Overlay] No game keyboard");
end
return singletons.game_keyboard;
return this.game_keyboard;
end
function singletons.init_scene_manager()
if singletons.scene_manager ~= nil then
function this.init_scene_manager()
if this.scene_manager ~= nil then
return;
end
singletons.scene_manager = sdk.get_native_singleton("via.SceneManager");
if singletons.scene_manager == nil then
this.scene_manager = sdk.get_native_singleton("via.SceneManager");
if this.scene_manager == nil then
--log.error("[MHR Overlay] No enemy manager");
end
return singletons.scene_manager;
return this.scene_manager;
end
function singletons.init_game_manager()
if singletons.game_manager ~= nil then
function this.init_game_manager()
if this.game_manager ~= nil then
return;
end
singletons.game_manager = sdk.get_managed_singleton("snow.SnowGameManager");
if singletons.game_manager == nil then
this.game_manager = sdk.get_managed_singleton("snow.SnowGameManager");
if this.game_manager == nil then
--log.error("[MHR Overlay] No enemy manager");
end
return singletons.game_manager;
return this.game_manager;
end
function singletons.init_servant_manager()
if singletons.servant_manager ~= nil then
function this.init_servant_manager()
if this.servant_manager ~= nil then
return;
end
singletons.servant_manager = sdk.get_managed_singleton("snow.ai.ServantManager");
if singletons.servant_manager == nil then
this.servant_manager = sdk.get_managed_singleton("snow.ai.ServantManager");
if this.servant_manager == nil then
--log.error("[MHR Overlay] No enemy manager");
end
return singletons.servant_manager;
return this.servant_manager;
end
function singletons.init_module()
singletons.init();
function this.init_otomo_manager()
if this.otomo_manager ~= nil then
return;
end
this.otomo_manager = sdk.get_managed_singleton("snow.otomo.OtomoManager");
if this.otomo_manager == nil then
--log.error("[MHR Overlay] No enemy manager");
end
return this.otomo_manager;
end
return singletons;
function this.init_module()
this.init();
end
return this;

View File

@@ -1,29 +1,62 @@
local time = {};
local this = {};
local singletons;
local customization_menu;
local quest_status;
local player;
local players;
local non_players;
local config;
local small_monster;
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 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_sec_method = quest_manager_type_def:get_method("getQuestElapsedTimeSec");
time.total_elapsed_seconds = 0;
time.elapsed_minutes = 0;
time.elapsed_seconds = 0;
this.total_elapsed_seconds = 0;
this.elapsed_minutes = 0;
this.elapsed_seconds = 0;
time.total_elapsed_script_seconds = 0;
time.last_elapsed_script_seconds = 0;
this.total_elapsed_script_seconds = 0;
this.last_elapsed_script_seconds = 0;
function time.update_script_time()
time.total_elapsed_script_seconds = os.clock();
function this.update_script_time()
this.total_elapsed_script_seconds = os.clock();
end
function time.tick()
time.update_script_time();
function this.tick()
this.update_script_time();
if singletons.quest_manager == nil then
return;
@@ -32,83 +65,36 @@ function time.tick()
local quest_time_elapsed_minutes = get_quest_elapsed_time_min_method:call(singletons.quest_manager);
if quest_time_elapsed_minutes == nil then
customization_menu.status = "No quest time elapsed minutes";
return;
else
this.elapsed_minutes = quest_time_elapsed_minutes;
end
time.elapsed_minutes = quest_time_elapsed_minutes;
local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager);
if quest_time_total_elapsed_seconds == nil then
customization_menu.status = "No quest time total elapsed seconds";
return;
else
this.total_elapsed_seconds = quest_time_total_elapsed_seconds;
end
time.total_elapsed_seconds = quest_time_total_elapsed_seconds;
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 > 1 then
time.last_elapsed_script_seconds = time.total_elapsed_script_seconds;
time.update_players_dps();
if this.total_elapsed_script_seconds - this.last_elapsed_script_seconds > 0.5 then
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;
players.display_list = {};
players.update_player_list(is_on_quest);
non_players.update_servant_list();
non_players.update_otomo_list(is_on_quest, quest_status.is_online);
players.update_dps(false);
players.sort_players();
end
end
function time.update_players_dps()
local cached_config = config.current_config.damage_meter_UI.settings;
if cached_config.freeze_dps_on_quest_end and quest_status.is_quest_end then
return;
end
local new_total_dps = 0;
for _, _player in pairs(player.list) do
if _player.join_time == -1 then
_player.join_time = time.total_elapsed_script_seconds;
end
if cached_config.dps_mode == "Quest Time" then
if time.total_elapsed_seconds > 0 then
_player.dps = _player.display.total_damage / time.total_elapsed_seconds;
end
elseif cached_config.dps_mode == "Join Time" then
if time.total_elapsed_script_seconds - _player.join_time > 0 then
_player.dps = _player.display.total_damage / (time.total_elapsed_script_seconds - _player.join_time);
end
elseif cached_config.dps_mode == "First Hit" then
if time.total_elapsed_script_seconds - _player.first_hit_time > 0 then
_player.dps = _player.display.total_damage / (time.total_elapsed_script_seconds - _player.first_hit_time);
end
end
new_total_dps = new_total_dps + _player.dps;
end
for _, servant in pairs(non_players.servant_list) do
if servant.join_time == -1 then
servant.join_time = time.total_elapsed_script_seconds;
end
if cached_config.dps_mode == "Quest Time" then
if time.total_elapsed_seconds > 0 then
servant.dps = servant.display.total_damage / time.total_elapsed_seconds;
end
elseif cached_config.dps_mode == "Join Time" then
if time.total_elapsed_script_seconds - servant.join_time > 0 then
servant.dps = servant.display.total_damage / (time.total_elapsed_script_seconds - servant.join_time);
end
elseif cached_config.dps_mode == "First Hit" then
if time.total_elapsed_script_seconds - servant.first_hit_time > 0 then
servant.dps = servant.display.total_damage / (time.total_elapsed_script_seconds - servant.first_hit_time);
end
end
new_total_dps = new_total_dps + servant.dps;
end
player.total.dps = new_total_dps;
end
function time.init_module()
player = require("MHR_Overlay.Damage_Meter.player");
function this.init_module()
players = require("MHR_Overlay.Damage_Meter.players");
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
@@ -117,4 +103,4 @@ function time.init_module()
non_players = require("MHR_Overlay.Damage_Meter.non_players");
end
return time;
return this;

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
local debug = {};
debug.enabled = false;
return debug;
local this = {};
this.enabled = false;
return this;

View File

@@ -1,9 +1,45 @@
local language = {};
local table_helpers;
local this = {};
language.language_folder = "MHR Overlay\\languages\\";
local utils;
language.default_language = {
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;
this.language_folder = "MHR Overlay\\languages\\";
this.current_language = {};
this.default_language = {
font_name = "NotoSansKR-Bold.otf",
parts = {
head = "Head",
@@ -88,7 +124,9 @@ language.default_language = {
chest = "Chest",
shell = "Shell",
thundersacs = "Thundersacs"
thundersacs = "Thundersacs",
amatsu_unknown = "?"
},
ailments = {
@@ -235,7 +273,7 @@ language.default_language = {
dynamically_positioned = "Dynamically Positioned",
statically_positioned = "Statically Positioned",
highlighted = "Highlighted (targeted)",
highlighted_targeted = "Highlighted (targeted)",
include = "Include",
monster_name = "Monster Name",
@@ -317,9 +355,9 @@ language.default_language = {
id = "ID",
name = "Name",
show_my_otomos_separately = "Show my Buddies separately",
show_other_otomos_separately = "Show other Buddies separately",
show_followers_separately = "Show Followers separately",
show_my_otomos_separately = "Show My Buddies separately",
show_other_player_otomos_separately = "Show Other Player Buddies separately",
show_servant_otomos_separately = "Show Follower Buddies separately",
dps_mode = "DPS Mode",
dps = "DPS",
@@ -394,6 +432,7 @@ language.default_language = {
hide_myself = "Hide Myself",
hide_other_players = "Hide Other Players",
hide_servants = "Hide Followers",
hide_total_damage = "Hide Total Damage",
player_name_size_limit = "Player Name Size Limit",
@@ -433,15 +472,47 @@ language.default_language = {
highest_health_percentage = "Highest Health Percentage",
reframework_outdated = "Installed REFramework version is outdated. Please, update. Otherwise, MHR Overlay won't work correctly.",
servants = "Followers",
my_otomos = "My Buddies",
other_player_otomos = "Other Player Buddies",
servant_otomos = "Servant Buddies",
level = "Level",
name_label = "Name Label",
myself = "Myself",
total = "Total",
level_label = "Level Label",
config = "Config",
rename = "Rename",
duplicate = "Duplicate",
delete = "Delete",
new = "New",
reset = "Reset",
highlighted = "Highlighted",
buff_UI = "Buff UI",
timer = "Timer",
duration = "Duration",
hide_bar_for_infinite_buffs = "Hide Bar for infinite Buffs",
hide_timer_for_infinite_buffs = "Hide Timer for infinite Buffs",
current_value = "Current Value",
max_value = "Max Value",
filter_mode = "Filter Mode",
current_state = "Current State",
default_state = "Default State"
}
};
language.current_language = {};
this.language_names = { "default"};
this.languages = { this.default_language };
language.language_names = { "default" };
language.languages = { language.default_language };
function language.load()
function this.load()
local language_files = fs.glob([[MHR Overlay\\languages\\.*json]]);
if language_files == nil then
@@ -449,48 +520,49 @@ function language.load()
end
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);
if loaded_language ~= nil then
log.info("[MHR Overlay] " .. language_name .. ".json loaded successfully");
table.insert(language.language_names, language_name);
local merged_language = table_helpers.merge(language.default_language, loaded_language);
table.insert(language.languages, merged_language);
log.info("[MHR Overlay] " .. language_file_name .. ".json loaded successfully");
table.insert(this.language_names, language_name);
local merged_language = utils.table.merge(this.default_language, loaded_language);
table.insert(this.languages, merged_language);
this.save(language_file_name, merged_language);
language.save(language_file_name, merged_language);
else
log.error("[MHR Overlay] Failed to load " .. language_name .. ".json");
log.error("[MHR Overlay] Failed to load " .. language_file_name .. ".json");
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);
if success then
log.info("[MHR Overlay] en-us.json saved successfully");
log.info("[MHR Overlay] " .. file_name .. " saved successfully");
else
log.error("[MHR Overlay] Failed to save en-us.json");
log.error("[MHR Overlay] Failed to save " .. file_name);
end
end
function language.save_default()
language.save(language.language_folder .. "en-us.json", language.default_language)
function this.save_default()
this.save(this.language_folder .. "en-us.json", this.default_language);
end
function language.update(index)
language.current_language = table_helpers.deep_copy(language.languages[index]);
function this.update(index)
this.current_language = this.languages[index];
end
function language.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
language.save_default();
language.load();
language.current_language = table_helpers.deep_copy(language.default_language);
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
this.save_default();
this.load();
this.current_language = this.default_language;
end
return language;
return this;

View File

@@ -1,11 +1,43 @@
local part_names = {};
local this = {};
local language;
local table_helpers;
part_names.list = {};
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;
function part_names.init()
part_names.list = {
this.list = {};
function this.init()
this.list = {
[98] = -- Great Izuchi 98
{
language.current_language.parts.head,
@@ -819,12 +851,79 @@ function part_names.init()
language.current_language.parts.hind_legs,
language.current_language.parts.wings,
language.current_language.parts.tail
}
},
--SUNBREAK TITLE UPDATE 4
[124] = -- Velkhana 124
{
language.current_language.parts.head,
language.current_language.parts.body,
language.current_language.parts.forelegs,
language.current_language.parts.hind_legs,
language.current_language.parts.wings,
language.current_language.parts.tail
},
[2134] = -- Risen Crimson Glow Valstrax 2134
{
language.current_language.parts.head,
language.current_language.parts.body,
language.current_language.parts.left_wing,
language.current_language.parts.right_wing,
language.current_language.parts.left_foreleg,
language.current_language.parts.right_foreleg,
language.current_language.parts.tail,
language.current_language.parts.hind_legs,
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
function part_names.get_part_name(monster_id, part_id)
local monster_parts = part_names.list[monster_id];
function this.get_part_name(monster_id, part_id)
local monster_parts = this.list[monster_id];
if monster_parts == nil then
return "?";
end
@@ -833,11 +932,10 @@ function part_names.get_part_name(monster_id, part_id)
return part_name;
end
function part_names.init_module()
function this.init_module()
language = require("MHR_Overlay.Misc.language");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
part_names.init();
this.init();
end
return part_names;
return this;

View File

@@ -1,93 +0,0 @@
local table_helpers = {};
local next = next;
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_) == "table" then
local s = "{ \n";
for k, v in pairs(table_) do
if type(k) ~= "number" then
k = "\"" .. k .. "\"";
end
s = s .. "\t[" .. k .. "] = " .. table_helpers.tostring(v) .. ",\n";
end
return s .. "} \n";
else
return tostring(table_);
end
end
function table_helpers.is_empty(table_)
return next(table_) == nil;
end
function table_helpers.init_module()
end
return table_helpers;

View File

@@ -1,115 +0,0 @@
local unicode_helpers = {};
-- 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
-- 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;

View 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;

View File

@@ -1,5 +1,6 @@
local ailment_buildup = {};
local player;
local this = {};
local players;
local language;
local config;
local ailments;
@@ -7,18 +8,51 @@ local ailment_buildup_UI_entity;
local time;
local small_monster;
local large_monster;
local table_helpers;
local drawing;
function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailment_buildups_position_on_screen, opacity_scale)
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;
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_damage_meter_UI_config = config.current_config.damage_meter_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
if not cached_config.visibility then
return;
end
for id, ailment in pairs(monster.ailments) do
if id == ailments.stun_id then
if not cached_config.filter.stun then
@@ -42,24 +76,81 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
goto continue
end
local total_buildup = 0;
local top_buildup = 0;
local displayed_players = {};
for player_id, player_buildup in pairs(ailment.buildup) do
for player, player_buildup in pairs(ailment.buildup) do
total_buildup = total_buildup + player_buildup;
if player_buildup > top_buildup then
top_buildup = player_buildup;
end
table.insert(displayed_players,
{
["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player_id],
["id"] = player_id
}
);
displayed_players[player] = {
["buildup"] = player_buildup,
["buildup_share"] = ailment.buildup_share[player],
["id"] = player.id
};
end
for otomo, otomo_buildup in pairs(ailment.otomo_buildup) do
total_buildup = total_buildup + otomo_buildup;
if otomo_buildup > top_buildup then
top_buildup = otomo_buildup;
end
local player = players.get_player(otomo.id);
local displayed_player = displayed_players[player];
if otomo.type == players.types.my_otomo then
if cached_damage_meter_UI_config.settings.show_my_otomos_separately then
displayed_players[otomo] = {
["buildup"] = otomo_buildup,
["buildup_share"] = ailment.otomo_buildup_share[otomo],
["id"] = otomo.id
};
elseif player ~= nil then
displayed_players[player].buildup = displayed_players[player].buildup + otomo_buildup;
displayed_players[player].buildup_share = displayed_players[player].buildup_share + ailment.otomo_buildup_share[otomo];
end
elseif otomo.type == players.types.other_player_otomo then
if cached_damage_meter_UI_config.settings.show_other_player_otomos_separately then
displayed_players[otomo] = {
["buildup"] = otomo_buildup,
["buildup_share"] = ailment.otomo_buildup_share[otomo],
["id"] = otomo.id
};
elseif player ~= nil then
displayed_players[player].buildup = displayed_players[player].buildup + otomo_buildup;
displayed_players[player].buildup_share = displayed_players[player].buildup_share + ailment.otomo_buildup_share[otomo];
end
elseif otomo.type == players.types.servant_otomo then
if cached_damage_meter_UI_config.settings.show_servant_otomos_separately then
displayed_players[otomo] = {
["buildup"] = otomo_buildup,
["buildup_share"] = ailment.otomo_buildup_share[otomo],
["id"] = otomo.id
};
elseif player ~= nil then
displayed_players[player].buildup = displayed_players[player].buildup + otomo_buildup;
displayed_players[player].buildup_share = displayed_players[player].buildup_share + ailment.otomo_buildup_share[otomo];
end
end
end
if total_buildup == 0 then
@@ -98,6 +189,7 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
end
end
local ailment_name = "";
if cached_config.ailment_name_label.include.ailment_name then
ailment_name = ailment.name .. " ";
@@ -108,20 +200,20 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
drawing.draw_label(ailment_buildup_UI.ailment_name_label, ailment_buildups_position_on_screen, opacity_scale, ailment_name);
local last_j = 0;
for j, _player in ipairs(displayed_players) do
local j = 0;
for player, displayed_player in pairs(displayed_players) do
local ailment_buildup_position_on_screen = {
x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * (j - 1) * global_scale_modifier,
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * (j - 1) * global_scale_modifier;
x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * j * global_scale_modifier,
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * j * global_scale_modifier;
};
ailment_buildup_UI_entity.draw(_player, ailment_buildup_UI, cached_config, ailment_buildup_position_on_screen, opacity_scale, top_buildup);
last_j = j;
ailment_buildup_UI_entity.draw(player, displayed_player, ailment_buildup_UI, cached_config, ailment_buildup_position_on_screen, opacity_scale, top_buildup);
j = j + 1;
end
local total_buildup_position_on_screen = {
x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * last_j * global_scale_modifier,
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * last_j * global_scale_modifier;
x = ailment_buildups_position_on_screen.x + cached_config.player_spacing.x * j * global_scale_modifier,
y = ailment_buildups_position_on_screen.y + cached_config.player_spacing.y * j * global_scale_modifier;
};
drawing.draw_label(ailment_buildup_UI.total_buildup_label, total_buildup_position_on_screen, opacity_scale, language.current_language.UI.total_buildup);
@@ -132,14 +224,15 @@ function ailment_buildup.draw(monster, ailment_buildup_UI, cached_config, ailmen
y = total_buildup_position_on_screen.y + 17 + cached_config.ailment_spacing.y * global_scale_modifier
};
::continue::
end
end
function ailment_buildup.init_module()
player = require("MHR_Overlay.Damage_Meter.player");
function this.init_module()
players = require("MHR_Overlay.Damage_Meter.players");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
ailments = require("MHR_Overlay.Monsters.ailments");
@@ -147,8 +240,7 @@ function ailment_buildup.init_module()
time = require("MHR_Overlay.Game_Handler.time");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
end
return ailment_buildup;
return this;

View File

@@ -1,9 +1,41 @@
local ailment_hook = {};
local this = {};
local small_monster;
local large_monster;
local config;
local ailments;
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;
local os = os;
local ValueType = ValueType;
local package = package;
local enemy_poison_damage_param_type_def = sdk.find_type_definition("snow.enemy.EnemyPoisonDamageParam");
local on_poison_activate_proc_method = enemy_poison_damage_param_type_def:get_method("onActivateProc");
@@ -28,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_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
return;
end
@@ -50,12 +82,13 @@ function ailment_hook.poison_proc(poison_param)
monster = small_monster.get_monster(enemy);
end
monster.ailments[ailments.poison_id].cached_buildup_share = table_helpers.deep_copy(monster.ailments[ailments
.poison_id].buildup_share);
monster.ailments[ailments.poison_id].cached_buildup_share = monster.ailments[ailments.poison_id].buildup_share;
monster.ailments[ailments.poison_id].cached_otomo_buildup_share = monster.ailments[ailments.poison_id].otomo_buildup_share;
ailments.clear_ailment_contribution(monster, ailments.poison_id);
end
function ailment_hook.blast_proc(blast_param)
function this.blast_proc(blast_param)
if blast_param == nil then
return;
end
@@ -85,7 +118,7 @@ function ailment_hook.blast_proc(blast_param)
ailments.clear_ailment_contribution(monster, ailments.blast_id);
end
function ailment_hook.stock_damage()
function this.stock_damage()
for enemy, monster in pairs(large_monster.list) do
local damage_param = damage_param_field:get_data(enemy);
if damage_param == nil then
@@ -111,30 +144,29 @@ function ailment_hook.stock_damage()
end
end
function ailment_hook.init_module()
function this.init_module()
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
config = require("MHR_Overlay.Misc.config");
ailments = require("MHR_Overlay.Monsters.ailments");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
sdk.hook(stock_damage_method, function(args)
pcall(ailment_hook.stock_damage, sdk.to_managed_object(args[2]));
pcall(this.stock_damage, sdk.to_managed_object(args[2]));
end, function(retval)
return retval;
end);
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)
return retval;
end);
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)
return retval;
end);
end
return ailment_hook;
return this;

View File

@@ -1,5 +1,6 @@
local ailments = {};
local player;
local this = {};
local players;
local language;
local config;
local ailment_UI_entity;
@@ -7,7 +8,39 @@ local ailment_buildup_UI_entity;
local time;
local small_monster;
local large_monster;
local table_helpers;
local non_players;
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;
--0 Paralyze
--1 Sleep
@@ -27,131 +60,190 @@ local table_helpers;
--15 Koyashi
--16 SteelFang
ailments.paralyze_id = 0;
ailments.sleep_id = 1;
ailments.stun_id = 2;
ailments.flash_id = 3;
ailments.poison_id = 4;
ailments.blast_id = 5;
ailments.exhaust_id = 6;
ailments.ride_id = 7;
ailments.water_id = 8;
ailments.fire_id = 9;
ailments.ice_id = 10;
ailments.thunder_id = 11;
ailments.fall_trap_id = 12;
ailments.shock_trap_id = 13;
ailments.capture_id = 14 --tranq bomb
ailments.koyashi_id = 15; --dung bomb
ailments.steel_fang_id = 16;
this.paralyze_id = 0;
this.sleep_id = 1;
this.stun_id = 2;
this.flash_id = 3;
this.poison_id = 4;
this.blast_id = 5;
this.exhaust_id = 6;
this.ride_id = 7;
this.water_id = 8;
this.fire_id = 9;
this.ice_id = 10;
this.thunder_id = 11;
this.fall_trap_id = 12;
this.shock_trap_id = 13;
this.capture_id = 14 --tranq bomb
this.koyashi_id = 15; --dung bomb
this.steel_fang_id = 16;
ailments.fall_quick_sand_id = 17;
ailments.fall_otomo_trap_id = 18;
ailments.shock_otomo_trap_id = 19;
this.fall_quick_sand_id = 17;
this.fall_otomo_trap_id = 18;
this.shock_otomo_trap_id = 19;
function ailments.new(_ailments, ailment_id)
_ailments[ailment_id] = {};
function this.new(_ailments, ailment_id)
local new_ailment = {}
new_ailment = {};
_ailments[ailment_id].is_enable = true;
_ailments[ailment_id].id = ailment_id;
new_ailment.is_enable = true;
new_ailment.id = ailment_id;
_ailments[ailment_id].total_buildup = 0;
_ailments[ailment_id].buildup_limit = 0;
_ailments[ailment_id].buildup_percentage = 0;
new_ailment.total_buildup = 0;
new_ailment.buildup_limit = 0;
new_ailment.buildup_percentage = 0;
_ailments[ailment_id].timer = 0;
_ailments[ailment_id].duration = 100000;
_ailments[ailment_id].timer_percentage = 0;
new_ailment.timer = 0;
new_ailment.duration = 100000;
new_ailment.timer_percentage = 0;
_ailments[ailment_id].minutes_left = 0;
_ailments[ailment_id].seconds_left = 0;
new_ailment.minutes_left = 0;
new_ailment.seconds_left = 0;
_ailments[ailment_id].is_active = false;
_ailments[ailment_id].activate_count = 0;
new_ailment.is_active = false;
new_ailment.activate_count = 0;
_ailments[ailment_id].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
_ailments[ailment_id].name = language.current_language.ailments.paralysis;
elseif ailment_id == ailments.sleep_id then
_ailments[ailment_id].name = language.current_language.ailments.sleep;
elseif ailment_id == ailments.stun_id then
_ailments[ailment_id].name = language.current_language.ailments.stun;
elseif ailment_id == ailments.flash_id then
_ailments[ailment_id].name = language.current_language.ailments.flash;
elseif ailment_id == ailments.poison_id then
_ailments[ailment_id].name = language.current_language.ailments.poison;
elseif ailment_id == ailments.blast_id then
_ailments[ailment_id].name = language.current_language.ailments.blast;
elseif ailment_id == ailments.exhaust_id then
_ailments[ailment_id].name = language.current_language.ailments.exhaust;
elseif ailment_id == ailments.ride_id then
_ailments[ailment_id].name = language.current_language.ailments.ride;
elseif ailment_id == ailments.water_id then
_ailments[ailment_id].name = language.current_language.ailments.waterblight;
elseif ailment_id == ailments.fire_id then
_ailments[ailment_id].name = language.current_language.ailments.fireblight;
elseif ailment_id == ailments.ice_id then
_ailments[ailment_id].name = language.current_language.ailments.iceblight;
elseif ailment_id == ailments.thunder_id then
_ailments[ailment_id].name = language.current_language.ailments.thunderblight;
elseif ailment_id == ailments.fall_trap_id then
_ailments[ailment_id].name = language.current_language.ailments.fall_trap;
elseif ailment_id == ailments.shock_trap_id then
_ailments[ailment_id].name = language.current_language.ailments.shock_trap;
elseif ailment_id == ailments.capture_id then
_ailments[ailment_id].name = language.current_language.ailments.tranq_bomb;
elseif ailment_id == ailments.koyashi_id then
_ailments[ailment_id].name = language.current_language.ailments.dung_bomb;
elseif ailment_id == ailments.steel_fang_id then
_ailments[ailment_id].name = language.current_language.ailments.steel_fang;
elseif ailment_id == ailments.fall_quick_sand_id then
_ailments[ailment_id].name = language.current_language.ailments.quick_sand;
elseif ailment_id == ailments.fall_otomo_trap_id then
_ailments[ailment_id].name = language.current_language.ailments.fall_otomo_trap;
elseif ailment_id == ailments.shock_otomo_trap_id then
_ailments[ailment_id].name = language.current_language.ailments.shock_otomo_trap;
if ailment_id == this.paralyze_id then
new_ailment.name = language.current_language.ailments.paralysis;
elseif ailment_id == this.sleep_id then
new_ailment.name = language.current_language.ailments.sleep;
elseif ailment_id == this.stun_id then
new_ailment.name = language.current_language.ailments.stun;
elseif ailment_id == this.flash_id then
new_ailment.name = language.current_language.ailments.flash;
elseif ailment_id == this.poison_id then
new_ailment.name = language.current_language.ailments.poison;
elseif ailment_id == this.blast_id then
new_ailment.name = language.current_language.ailments.blast;
elseif ailment_id == this.exhaust_id then
new_ailment.name = language.current_language.ailments.exhaust;
elseif ailment_id == this.ride_id then
new_ailment.name = language.current_language.ailments.ride;
elseif ailment_id == this.water_id then
new_ailment.name = language.current_language.ailments.waterblight;
elseif ailment_id == this.fire_id then
new_ailment.name = language.current_language.ailments.fireblight;
elseif ailment_id == this.ice_id then
new_ailment.name = language.current_language.ailments.iceblight;
elseif ailment_id == this.thunder_id then
new_ailment.name = language.current_language.ailments.thunderblight;
elseif ailment_id == this.fall_trap_id then
new_ailment.name = language.current_language.ailments.fall_trap;
elseif ailment_id == this.shock_trap_id then
new_ailment.name = language.current_language.ailments.shock_trap;
elseif ailment_id == this.capture_id then
new_ailment.name = language.current_language.ailments.tranq_bomb;
elseif ailment_id == this.koyashi_id then
new_ailment.name = language.current_language.ailments.dung_bomb;
elseif ailment_id == this.steel_fang_id then
new_ailment.name = language.current_language.ailments.steel_fang;
elseif ailment_id == this.fall_quick_sand_id then
new_ailment.name = language.current_language.ailments.quick_sand;
elseif ailment_id == this.fall_otomo_trap_id then
new_ailment.name = language.current_language.ailments.fall_otomo_trap;
elseif ailment_id == this.shock_otomo_trap_id then
new_ailment.name = language.current_language.ailments.shock_otomo_trap;
end
_ailments[ailment_id] = new_ailment;
end
function ailments.init_ailments()
function this.init_ailments()
local _ailments = {};
ailments.new(_ailments, ailments.paralyze_id);
ailments.new(_ailments, ailments.sleep_id);
ailments.new(_ailments, ailments.stun_id);
ailments.new(_ailments, ailments.flash_id);
ailments.new(_ailments, ailments.poison_id);
ailments.new(_ailments, ailments.blast_id);
ailments.new(_ailments, ailments.exhaust_id);
ailments.new(_ailments, ailments.ride_id);
ailments.new(_ailments, ailments.water_id);
ailments.new(_ailments, ailments.fire_id);
ailments.new(_ailments, ailments.ice_id);
ailments.new(_ailments, ailments.thunder_id);
this.new(_ailments, this.paralyze_id);
this.new(_ailments, this.sleep_id);
this.new(_ailments, this.stun_id);
this.new(_ailments, this.flash_id);
this.new(_ailments, this.poison_id);
this.new(_ailments, this.blast_id);
this.new(_ailments, this.exhaust_id);
this.new(_ailments, this.ride_id);
this.new(_ailments, this.water_id);
this.new(_ailments, this.fire_id);
this.new(_ailments, this.ice_id);
this.new(_ailments, this.thunder_id);
ailments.new(_ailments, ailments.fall_trap_id);
ailments.new(_ailments, ailments.shock_trap_id);
ailments.new(_ailments, ailments.capture_id); --tranq bomb
ailments.new(_ailments, ailments.koyashi_id); --dung bomb
ailments.new(_ailments, ailments.steel_fang_id);
this.new(_ailments, this.fall_trap_id);
this.new(_ailments, this.shock_trap_id);
this.new(_ailments, this.capture_id); --tranq bomb
this.new(_ailments, this.koyashi_id); --dung bomb
this.new(_ailments, this.steel_fang_id);
--ailments.new(_ailments, ailments.fall_quick_sand_id);
--ailments.new(_ailments, ailments.fall_otomo_trap_id);
--ailments.new(_ailments, ailments.shock_otomo_trap_id);
_ailments[ailments.poison_id].buildup = {};
_ailments[ailments.poison_id].buildup_share = {};
_ailments[ailments.poison_id].cached_buildup_share = {};
_ailments[this.poison_id].buildup = {};
_ailments[this.poison_id].buildup_share = {};
_ailments[this.poison_id].cached_buildup_share = {};
_ailments[ailments.blast_id].buildup = {};
_ailments[ailments.blast_id].buildup_share = {};
_ailments[this.blast_id].buildup = {};
_ailments[this.blast_id].buildup_share = {};
_ailments[ailments.stun_id].buildup = {};
_ailments[ailments.stun_id].buildup_share = {};
_ailments[this.stun_id].buildup = {};
_ailments[this.stun_id].buildup_share = {};
_ailments[this.poison_id].otomo_buildup = {};
_ailments[this.poison_id].otomo_buildup_share = {};
_ailments[this.poison_id].cached_otomo_buildup_share = {};
_ailments[this.blast_id].otomo_buildup = {};
_ailments[this.blast_id].otomo_buildup_share = {};
_ailments[this.stun_id].otomo_buildup = {};
_ailments[this.stun_id].otomo_buildup_share = {};
return _ailments;
end
function this.init_ailment_names(_ailments)
for ailment_id, ailment in pairs(_ailments) do
if ailment_id == this.paralyze_id then
ailment.name = language.current_language.ailments.paralysis;
elseif ailment_id == this.sleep_id then
ailment.name = language.current_language.ailments.sleep;
elseif ailment_id == this.stun_id then
ailment.name = language.current_language.ailments.stun;
elseif ailment_id == this.flash_id then
ailment.name = language.current_language.ailments.flash;
elseif ailment_id == this.poison_id then
ailment.name = language.current_language.ailments.poison;
elseif ailment_id == this.blast_id then
ailment.name = language.current_language.ailments.blast;
elseif ailment_id == this.exhaust_id then
ailment.name = language.current_language.ailments.exhaust;
elseif ailment_id == this.ride_id then
ailment.name = language.current_language.ailments.ride;
elseif ailment_id == this.water_id then
ailment.name = language.current_language.ailments.waterblight;
elseif ailment_id == this.fire_id then
ailment.name = language.current_language.ailments.fireblight;
elseif ailment_id == this.ice_id then
ailment.name = language.current_language.ailments.iceblight;
elseif ailment_id == this.thunder_id then
ailment.name = language.current_language.ailments.thunderblight;
elseif ailment_id == this.fall_trap_id then
ailment.name = language.current_language.ailments.fall_trap;
elseif ailment_id == this.shock_trap_id then
ailment.name = language.current_language.ailments.shock_trap;
elseif ailment_id == this.capture_id then
ailment.name = language.current_language.ailments.tranq_bomb;
elseif ailment_id == this.koyashi_id then
ailment.name = language.current_language.ailments.dung_bomb;
elseif ailment_id == this.steel_fang_id then
ailment.name = language.current_language.ailments.steel_fang;
elseif ailment_id == this.fall_quick_sand_id then
ailment.name = language.current_language.ailments.quick_sand;
elseif ailment_id == this.fall_otomo_trap_id then
ailment.name = language.current_language.ailments.fall_otomo_trap;
elseif ailment_id == this.shock_otomo_trap_id then
ailment.name = language.current_language.ailments.shock_otomo_trap;
end
end
end
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
local enemy_condition_damage_param_base_type_def = sdk.find_type_definition("snow.enemy.EnemyConditionDamageParamBase");
@@ -182,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 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
return;
end
@@ -191,7 +283,7 @@ function ailments.update_ailments(enemy, monster)
return;
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
and not config.current_config.large_monster_UI.static.ailments.visibility
@@ -215,7 +307,7 @@ function ailments.update_ailments(enemy, monster)
end
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
end
@@ -224,29 +316,29 @@ function ailments.update_ailments(enemy, monster)
goto continue
end
ailments.update_ailment(monster, ailment_param, id);
this.update_ailment(monster, ailment_param, id);
::continue::
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);
if stun_param ~= nil then
ailments.update_ailment(monster, stun_param, ailments.stun_id);
this.update_ailment(monster, stun_param, this.stun_id);
end
local poison_param = poison_param_field:get_data(damage_param);
if poison_param ~= nil then
ailments.update_ailment(monster, poison_param, ailments.poison_id);
this.update_ailment(monster, poison_param, this.poison_id);
end
local blast_param = blast_param_field:get_data(damage_param);
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
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 activate_count_array = get_activate_count_method:call(ailment_param);
local buildup_array = get_stock_method:call(ailment_param);
@@ -321,17 +413,17 @@ function ailments.update_ailment(monster, ailment_param, id)
end
if is_enable ~= monster.ailments[id].is_enable then
ailments.update_last_change_time(monster, id);
this.update_last_change_time(monster, id);
end
monster.ailments[id].is_enable = is_enable;
if activate_count ~= nil 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
ailments.clear_ailment_contribution(monster, ailments.stun_id);
if id == this.stun_id then
this.clear_ailment_contribution(monster, this.stun_id);
end
end
@@ -340,7 +432,7 @@ function ailments.update_ailment(monster, ailment_param, id)
if buildup ~= nil then
if buildup ~= monster.ailments[id].total_buildup then
ailments.update_last_change_time(monster, id);
this.update_last_change_time(monster, id);
end
monster.ailments[id].total_buildup = buildup;
@@ -348,7 +440,7 @@ function ailments.update_ailment(monster, ailment_param, id)
if buildup_limit ~= nil 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
monster.ailments[id].buildup_limit = buildup_limit;
@@ -360,7 +452,7 @@ function ailments.update_ailment(monster, ailment_param, id)
if timer ~= nil then
if timer ~= monster.ailments[id].timer then
ailments.update_last_change_time(monster, id);
this.update_last_change_time(monster, id);
end
monster.ailments[id].timer = timer;
@@ -368,7 +460,7 @@ function ailments.update_ailment(monster, ailment_param, id)
if is_active ~= nil 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
monster.ailments[id].is_active = is_active;
@@ -376,7 +468,7 @@ function ailments.update_ailment(monster, ailment_param, id)
if duration ~= nil and not monster.ailments[id].is_active then
if duration ~= monster.ailments[id].duration then
ailments.update_last_change_time(monster, id);
this.update_last_change_time(monster, id);
end
monster.ailments[id].duration = duration;
@@ -403,12 +495,12 @@ function ailments.update_ailment(monster, ailment_param, id)
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;
end
-- Code by coavins
function ailments.update_poison(monster, poison_param)
function this.update_poison(monster, poison_param)
if monster == nil then
return;
end
@@ -419,95 +511,95 @@ function ailments.update_poison(monster, poison_param)
if is_damage then
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
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 global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--sort parts here
local displayed_ailments = {};
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
goto continue
end
elseif id == ailments.sleep_id then
elseif id == this.sleep_id then
if not cached_config.filter.sleep then
goto continue
end
elseif id == ailments.stun_id then
elseif id == this.stun_id then
if not cached_config.filter.stun then
goto continue
end
elseif id == ailments.flash_id then
elseif id == this.flash_id then
if not cached_config.filter.flash then
goto continue
end
elseif id == ailments.poison_id then
elseif id == this.poison_id then
if not cached_config.filter.poison then
goto continue
end
elseif id == ailments.blast_id then
elseif id == this.blast_id then
if not cached_config.filter.blast then
goto continue
end
elseif id == ailments.exhaust_id then
elseif id == this.exhaust_id then
if not cached_config.filter.exhaust then
goto continue
end
elseif id == ailments.ride_id then
elseif id == this.ride_id then
if not cached_config.filter.ride then
goto continue
end
elseif id == ailments.water_id then
elseif id == this.water_id then
if not cached_config.filter.waterblight then
goto continue
end
elseif id == ailments.fire_id then
elseif id == this.fire_id then
if not cached_config.filter.fireblight then
goto continue
end
elseif id == ailments.ice_id then
elseif id == this.ice_id then
if not cached_config.filter.iceblight then
goto continue
end
elseif id == ailments.thunder_id then
elseif id == this.thunder_id then
if not cached_config.filter.thunderblight then
goto continue
end
elseif id == ailments.fall_trap_id then
elseif id == this.fall_trap_id then
if not cached_config.filter.fall_trap then
goto continue
end
elseif id == ailments.shock_trap_id then
elseif id == this.shock_trap_id then
if not cached_config.filter.shock_trap then
goto continue
end
elseif id == ailments.capture_id then
elseif id == this.capture_id then
if not cached_config.filter.tranq_bomb then
goto continue
end
elseif id == ailments.koyashi_id then
elseif id == this.koyashi_id then
if not cached_config.filter.dung_bomb then
goto continue
end
elseif id == ailments.steel_fang_id then
elseif id == this.steel_fang_id then
if not cached_config.filter.steel_fang then
goto continue
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
goto continue
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
goto continue
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
goto continue
end
@@ -593,14 +685,10 @@ function ailments.draw(monster, ailment_UI, cached_config, ailments_position_on_
end
function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailment_buildup)
function this.apply_ailment_buildup(monster, player, otomo, ailment_type, ailment_buildup)
if monster == nil or
(ailment_type ~= ailments.poison_id and ailment_type ~= ailments.blast_id and ailment_type ~= ailments.stun_id) then
return;
end
if ailment_buildup == 0 or ailment_buildup == nil then
(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
return;
end
@@ -609,53 +697,83 @@ function ailments.apply_ailment_buildup(monster, attacker_id, ailment_type, ailm
monster.ailments[ailment_type].buildup = {};
end
-- accumulate this buildup for this attacker
monster.ailments[ailment_type].buildup[attacker_id] = (monster.ailments[ailment_type].buildup[attacker_id] or 0) + ailment_buildup;
-- get the otomo buildup accumulator for this type
if monster.ailments[ailment_type].otomo_buildup == nil then
monster.ailments[ailment_type].otomo_buildup = {};
end
ailments.calculate_ailment_contribution(monster, ailment_type);
if otomo == nil then
monster.ailments[ailment_type].buildup[player] = (monster.ailments[ailment_type].buildup[player] or 0) + ailment_buildup;
else
monster.ailments[ailment_type].otomo_buildup[otomo] = (monster.ailments[ailment_type].otomo_buildup[otomo] or 0) + ailment_buildup;
end
this.calculate_ailment_contribution(monster, ailment_type);
end
-- Code by coavins
function ailments.calculate_ailment_contribution(monster, ailment_type)
function this.calculate_ailment_contribution(monster, ailment_type)
-- get total
local total = 0;
for attacker_id, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
for player, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
total = total + player_buildup;
end
for attacker_id, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
-- update ratio for this attacker
monster.ailments[ailment_type].buildup_share[attacker_id] = player_buildup / total;
for otomo, otomo_buildup in pairs(monster.ailments[ailment_type].otomo_buildup) do
total = total + otomo_buildup;
end
if total == 0 then
total = 1;
end
for player, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
-- update ratio for this player
monster.ailments[ailment_type].buildup_share[player] = player_buildup / total;
end
for otomo, otomo_buildup in pairs(monster.ailments[ailment_type].otomo_buildup) do
-- update ratio for this otomo
monster.ailments[ailment_type].otomo_buildup_share[otomo] = otomo_buildup / total;
end
end
function ailments.clear_ailment_contribution(monster, ailment_type)
for attacker_id, player_buildup in pairs(monster.ailments[ailment_type].buildup) do
monster.ailments[ailment_type].buildup_share[attacker_id] = 0;
monster.ailments[ailment_type].buildup[attacker_id] = 0;
end
function this.clear_ailment_contribution(monster, ailment_type)
monster.ailments[ailment_type].buildup = {};
monster.ailments[ailment_type].otomo_buildup = {};
monster.ailments[ailment_type].buildup_share = {};
monster.ailments[ailment_type].otomo_buildup_share = {};
end
-- 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
if ailment_type == nil or ailment_damage == nil then
return;
end
local damage_source_type = "";
local otomo_damage_source_type = "";
local buildup_share = monster.ailments[ailment_type].buildup_share;
if ailment_type == ailments.poison_id then
local otomo_buildup_share = monster.ailments[ailment_type].otomo_buildup_share;
if ailment_type == this.poison_id then
damage_source_type = "poison";
otomo_damage_source_type = "otomo poison";
buildup_share = monster.ailments[ailment_type].cached_buildup_share;
elseif ailment_type == ailments.blast_id then
otomo_buildup_share = monster.ailments[ailment_type].cached_otomo_buildup_share;
elseif ailment_type == this.blast_id then
damage_source_type = "blast";
otomo_damage_source_type = "otomo blast";
else
return;
end
-- split up damage according to ratio of buildup on boss for this type
for attacker_id, percentage in pairs(buildup_share) do
for player, percentage in pairs(buildup_share) do
local damage_portion = ailment_damage * percentage;
local damage_object = {};
@@ -664,11 +782,26 @@ function ailments.apply_ailment_damage(monster, ailment_type, ailment_damage)
damage_object.elemental_damage = 0;
damage_object.ailment_damage = damage_portion;
local attacking_player = player.get_player(attacker_id);
players.update_damage(player, damage_source_type, monster.is_large, damage_object);
end
if attacking_player ~= nil then
player.update_damage(attacking_player, damage_source_type, true, damage_object);
-- split up damage according to ratio of buildup on boss for this type
for otomo, percentage in pairs(otomo_buildup_share) do
local damage_portion = ailment_damage * percentage;
local damage_object = {};
damage_object.total_damage = damage_portion;
damage_object.physical_damage = 0;
damage_object.elemental_damage = 0;
damage_object.ailment_damage = damage_portion;
local player = players.get_player(otomo.id);
if player ~= nil then
players.update_damage(player, otomo_damage_source_type, monster.is_large, damage_object);
end
players.update_damage(otomo, otomo_damage_source_type, monster.is_large, damage_object);
end
local damage_object = {};
@@ -677,11 +810,12 @@ function ailments.apply_ailment_damage(monster, ailment_type, ailment_damage)
damage_object.elemental_damage = 0;
damage_object.ailment_damage = ailment_damage;
player.update_damage(player.total, damage_source_type, true, damage_object);
players.update_damage(players.total, damage_source_type, monster.is_large, damage_object);
end
function ailments.init_module()
player = require("MHR_Overlay.Damage_Meter.player");
function this.init_module()
players = require("MHR_Overlay.Damage_Meter.players");
non_players = require("MHR_Overlay.Damage_Meter.non_players");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
@@ -689,7 +823,6 @@ function ailments.init_module()
time = require("MHR_Overlay.Game_Handler.time");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
end
return ailments;
return this;

View File

@@ -1,8 +1,8 @@
local body_part = {};
local this = {};
local singletons;
local customization_menu;
local config;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
@@ -12,9 +12,41 @@ local drawing;
local part_names;
local time;
body_part.list = {};
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;
function body_part.new(id, name)
this.list = {};
function this.new(id, name)
local part = {};
part.id = id;
@@ -41,7 +73,7 @@ function body_part.new(id, name)
return part;
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
part.flinch_count = part.flinch_count + 1;
end
@@ -62,7 +94,7 @@ function body_part.update_flinch(part, part_current, part_max)
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
part.last_change_time = time.total_elapsed_script_seconds;
@@ -91,7 +123,7 @@ function body_part.update_break(part, part_break_current, part_break_max, part_b
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
part.last_change_time = time.total_elapsed_script_seconds;
end
@@ -115,7 +147,7 @@ function body_part.update_loss(part, part_loss_current, part_loss_max, is_severe
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 global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -125,6 +157,16 @@ function body_part.draw(monster, part_UI, cached_config, parts_position_on_scree
local break_supported = part.break_max_health > 0;
local severe_supported = part.loss_max_health > 0;
if cached_config.settings.filter_mode == "Current State" then
if break_supported and part.break_count >= part.break_max_count then
break_supported = false;
end
if severe_supported and part.is_severed then
severe_supported = false;
end
end
if health_supported then
if break_supported then
if severe_supported then
@@ -298,11 +340,10 @@ function body_part.draw(monster, part_UI, cached_config, parts_position_on_scree
return last_part_position_on_screen;
end
function body_part.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
@@ -313,4 +354,4 @@ function body_part.init_module()
time = require("MHR_Overlay.Game_Handler.time");
end
return body_part;
return this;

View File

@@ -1,9 +1,10 @@
local large_monster = {};
local this = {};
local singletons;
local customization_menu;
local config;
local language;
local table_helpers;
local utils;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
@@ -14,15 +15,46 @@ local body_part_UI_entity;
local screen;
local drawing;
local ailments;
local player;
local players;
local time;
local body_part;
local part_names;
large_monster.list = {};
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;
function large_monster.new(enemy)
this.list = {};
function this.new(enemy)
local monster = {};
monster.enemy = enemy;
monster.is_large = true;
@@ -92,35 +124,35 @@ function large_monster.new(enemy)
monster.static_UI = {};
monster.highlighted_UI = {};
large_monster.init(monster, enemy);
large_monster.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);
large_monster.init_UI(monster, monster.highlighted_UI, config.current_config.large_monster_UI.highlighted);
this.init(monster, enemy);
this.init_UI(monster, monster.dynamic_UI, config.current_config.large_monster_UI.dynamic);
this.init_UI(monster, monster.static_UI, config.current_config.large_monster_UI.static);
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);
large_monster.update_stamina_timer(enemy, monster, nil);
this.update_stamina(enemy, monster, nil);
this.update_stamina_timer(enemy, monster, nil);
large_monster.update_rage(enemy, monster, nil);
large_monster.update_rage_timer(enemy, monster, nil);
this.update_rage(enemy, monster, nil);
this.update_rage_timer(enemy, monster, nil);
large_monster.update(enemy, monster);
pcall(large_monster.update_parts, enemy, monster, physical_param);
this.update(enemy, monster);
pcall(this.update_parts, enemy, monster, physical_param);
if large_monster.list[enemy] == nil then
large_monster.list[enemy] = monster;
if this.list[enemy] == nil then
this.list[enemy] = monster;
end
return monster;
end
function large_monster.get_monster(enemy)
local monster = large_monster.list[enemy];
function this.get_monster(enemy)
local monster = this.list[enemy];
if monster == nil then
monster = large_monster.new(enemy);
monster = this.new(enemy);
end
return monster;
end
@@ -146,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 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);
if enemy_type == nil then
customization_menu.status = "No enemy type";
@@ -225,10 +257,10 @@ function large_monster.init(monster, enemy)
monster.is_capturable = is_capture_enable and not is_anomaly;
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;
monster_UI.monster_name_label = table_helpers.deep_copy(cached_config.monster_name_label);
monster_UI.monster_name_label = utils.table.deep_copy(cached_config.monster_name_label);
monster_UI.health_UI = health_UI_entity.new(
cached_config.health.visibility,
@@ -303,6 +335,8 @@ function large_monster.init_UI(monster, monster_UI, cached_config)
cached_config.ailment_buildups.total_buildup_label,
cached_config.ailment_buildups.total_buildup_value_label
);
ailments.init_ailment_names(monster.ailments);
end
local physical_param_field = enemy_character_base_type_def:get_field("<PhysicalParam>k__BackingField");
@@ -349,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 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
config.current_config.large_monster_UI.static.sorting.type ~= "Distance" then
return;
@@ -362,24 +396,33 @@ function large_monster.update_position(enemy, monster)
end
-- Code by coavins
function large_monster.update_all_riders()
for enemy, monster in pairs(large_monster.list) do
function this.update_all_riders()
for enemy, monster in pairs(this.list) do
-- get marionette rider
local mario_param = enemy:get_field("<MarioParam>k__BackingField");
if mario_param ~= nil then
local is_marionette = get_is_marionette_method:call(mario_param);
if is_marionette == nil then
goto continue;
end
if is_marionette then
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;
end
else
monster.rider_id = -1;
end
end
::continue::
end
end
function large_monster.update(enemy, monster)
function this.update(enemy, monster)
local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
@@ -428,7 +471,7 @@ function large_monster.update(enemy, monster)
pcall(ailments.update_ailments, enemy, monster);
end
function large_monster.update_health(enemy, monster)
function this.update_health(enemy, monster)
local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
@@ -443,7 +486,7 @@ function large_monster.update_health(enemy, monster)
return nil;
end
local physical_param = physical_param_field:get_data(enemy)
local physical_param = physical_param_field:get_data(enemy);
if physical_param == nil then
customization_menu.status = "No physical param";
return nil;
@@ -468,7 +511,7 @@ function large_monster.update_health(enemy, monster)
return physical_param;
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;
if not cached_config.dynamic.enabled
@@ -505,7 +548,7 @@ function large_monster.update_stamina(enemy, monster, stamina_param)
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;
if not cached_config.dynamic.enabled
@@ -552,7 +595,7 @@ function large_monster.update_stamina_timer(enemy, monster, stamina_param)
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;
if not cached_config.dynamic.enabled
@@ -584,7 +627,7 @@ function large_monster.update_rage(enemy, monster, anger_param)
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;
if not cached_config.dynamic.enabled
@@ -630,7 +673,7 @@ function large_monster.update_rage_timer(enemy, monster, anger_param)
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;
if not cached_config.dynamic.enabled
@@ -764,7 +807,7 @@ function large_monster.update_parts(enemy, monster, physical_param)
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;
if type == "dynamic" then
@@ -861,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);
end
function large_monster.init_list()
large_monster.list = {};
function this.init_list()
this.list = {};
end
function large_monster.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
body_part = require("MHR_Overlay.Monsters.body_part");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
@@ -883,9 +926,9 @@ function large_monster.init_module()
drawing = require("MHR_Overlay.UI.drawing");
part_names = require("MHR_Overlay.Misc.part_names");
ailments = require("MHR_Overlay.Monsters.ailments");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
time = require("MHR_Overlay.Game_Handler.time");
ailment_buildup = require("MHR_Overlay.Monsters.ailment_buildup");
end
return large_monster;
return this;

View File

@@ -1,11 +1,44 @@
local monster_hook = {};
local this = {};
local small_monster;
local large_monster;
local config;
local ailments;
local player;
local players;
local quest_status;
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 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");
@@ -13,12 +46,14 @@ local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBos
local enemy_damage_check_type_def = sdk.find_type_definition("snow.enemy.EnemyDamageCheck");
local damage_check_update_param_update_method = enemy_damage_check_type_def:get_method("updateParam");
local get_ref_enemy = enemy_damage_check_type_def:get_method("get_RefEnemy");
local anger_param_type_def = sdk.find_type_definition("snow.enemy.EnemyAngerParam");
local anger_add_method = anger_param_type_def:get_method("add");
local stamina_param_type_def = sdk.find_type_definition("snow.enemy.EnemyStaminaParam");
local stamina_sub_method = stamina_param_type_def:get_method("sub");
local get_enemy_method = stamina_param_type_def:get_method("get_Em");
local tick_count = 0;
local last_update_tick = 0;
@@ -52,7 +87,7 @@ re.on_pre_application_entry("UpdateBehavior", function()
end
end)
function monster_hook.update_monster(enemy)
function this.update_monster(enemy)
if enemy == nil then
return;
end
@@ -73,13 +108,13 @@ function monster_hook.update_monster(enemy)
end
if is_large then
monster_hook.update_large_monster(enemy);
this.update_large_monster(enemy);
else
monster_hook.update_small_monster(enemy);
this.update_small_monster(enemy);
end
end
function monster_hook.update_large_monster(enemy)
function this.update_large_monster(enemy)
local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled and
@@ -118,7 +153,7 @@ function monster_hook.update_large_monster(enemy)
large_monster.update_stamina_timer(enemy, monster, nil);
large_monster.update_rage_timer(enemy, monster, nil);
if quest_status.is_online and player.myself.id ~= 0 then
if quest_status.is_online and players.myself.id ~= 0 then
local physical_param = large_monster.update_health(enemy, monster);
pcall(large_monster.update_parts, enemy, monster, physical_param);
end
@@ -126,7 +161,7 @@ function monster_hook.update_large_monster(enemy)
large_monster.update(enemy, monster);
end
function monster_hook.update_small_monster(enemy)
function this.update_small_monster(enemy)
if not config.current_config.small_monster_UI.enabled then
return;
end
@@ -158,13 +193,13 @@ function monster_hook.update_small_monster(enemy)
small_monster.update(enemy, monster);
if quest_status.is_online and player.myself.id ~= 0 then
if quest_status.is_online and players.myself.id ~= 0 then
small_monster.update_health(enemy, monster);
end
end
function monster_hook.update_health(enemy_damage_stock_param)
local enemy = enemy_damage_stock_param:call("get_RefEnemy");
function this.update_health(enemy_damage_check)
local enemy = get_ref_enemy:call(enemy_damage_check);
if enemy == nil then
return;
end
@@ -185,12 +220,12 @@ function monster_hook.update_health(enemy_damage_stock_param)
end
end
function monster_hook.update_stamina(stamina_param, stamina_sub)
function this.update_stamina(stamina_param, stamina_sub)
if stamina_sub <= 0 then
return;
end
local enemy = stamina_param:call("get_Em");
local enemy = get_enemy_method:call(stamina_param);
if enemy == nil then
return;
end
@@ -199,12 +234,12 @@ function monster_hook.update_stamina(stamina_param, stamina_sub)
large_monster.update_stamina(enemy, monster, stamina_param);
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);
large_monster.update_stamina_timer(enemy, monster, stamina_param);
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
return;
end
@@ -213,43 +248,43 @@ function monster_hook.update_rage(anger_param, anger_add, enemy)
large_monster.update_rage(enemy, monster, anger_param);
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);
large_monster.update_rage_timer(enemy, monster, anger_param);
end
function monster_hook.init_module()
function this.init_module()
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
config = require("MHR_Overlay.Misc.config");
ailments = require("MHR_Overlay.Monsters.ailments");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
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)
return retval;
end);
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)
return retval;
end);
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)
return retval;
end);
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]));
end, function(retval)
return retval;
end);
end
return monster_hook;
return this;

View File

@@ -1,8 +1,9 @@
local small_monster = {};
local this = {};
local singletons;
local customization_menu;
local config;
local table_helpers;
local utils;
local health_UI_entity;
local stamina_UI_entity;
local screen;
@@ -12,9 +13,41 @@ local ailment_UI_entity;
local ailment_buildup;
local ailment_buildup_UI_entity;
small_monster.list = {};
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;
function small_monster.new(enemy)
this.list = {};
function this.new(enemy)
local monster = {};
monster.is_large = false;
@@ -33,24 +66,24 @@ function small_monster.new(enemy)
monster.UI = {};
small_monster.init(monster, enemy);
small_monster.init_UI(monster);
this.init(monster, enemy);
this.init_UI(monster);
small_monster.update_position(enemy, monster);
small_monster.update_health(enemy, monster);
small_monster.update(enemy, monster);
this.update_position(enemy, monster);
this.update_health(enemy, monster);
this.update(enemy, monster);
if small_monster.list[enemy] == nil then
small_monster.list[enemy] = monster;
if this.list[enemy] == nil then
this.list[enemy] = monster;
end
return monster;
end
function small_monster.get_monster(enemy)
local monster = small_monster.list[enemy];
function this.get_monster(enemy)
local monster = this.list[enemy];
if monster == nil then
monster = small_monster.new(enemy);
monster = this.new(enemy);
end
return monster;
@@ -62,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 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);
if enemy_type == nil then
customization_menu.status = "No enemy type";
@@ -77,13 +110,13 @@ function small_monster.init(monster, enemy)
end
end
function small_monster.init_UI(monster)
function this.init_UI(monster)
local cached_config = config.current_config.small_monster_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
local monster_UI = monster.UI;
monster_UI.name_label = table_helpers.deep_copy(cached_config.monster_name_label);
monster_UI.name_label = utils.table.deep_copy(cached_config.monster_name_label);
monster_UI.name_label.offset.x = monster_UI.name_label.offset.x * global_scale_modifier;
monster_UI.name_label.offset.y = monster_UI.name_label.offset.y * global_scale_modifier;
@@ -130,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");
function small_monster.update_position(enemy, monster)
function this.update_position(enemy, monster)
local cached_config = config.current_config.small_monster_UI;
if not cached_config.enabled then
@@ -147,7 +180,7 @@ function small_monster.update_position(enemy, monster)
end
end
function small_monster.update(enemy, monster)
function this.update(enemy, monster)
if not config.current_config.small_monster_UI.enabled then
return;
end
@@ -160,7 +193,7 @@ function small_monster.update(enemy, monster)
pcall(ailments.update_ailments, enemy, monster);
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
return;
end
@@ -187,7 +220,7 @@ function small_monster.update_health(enemy, monster)
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;
drawing.draw_label(monster.UI.name_label, position_on_screen, opacity_scale, monster.name);
@@ -212,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);
end
function small_monster.init_list()
small_monster.list = {};
function this.init_list()
this.list = {};
end
function small_monster.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
screen = require("MHR_Overlay.Game_Handler.screen");
@@ -231,4 +264,4 @@ function small_monster.init_module()
ailment_buildup_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_buildup_UI_entity");
end
return small_monster;
return this;

View File

@@ -1,9 +1,9 @@
local ailment_buildups_customization = {};
local this = {};
local table_helpers;
local utils;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,9 +15,42 @@ local customization_menu;
local label_customization;
local bar_customization;
function ailment_buildups_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
local index = 1;
if imgui.tree_node(language.current_language.customization_menu.ailment_buildups) then
changed, cached_config.visibility = imgui.checkbox(
@@ -70,7 +103,7 @@ function ailment_buildups_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.settings) then
changed, index = imgui.combo(
language.current_language.customization_menu.highlighted_bar,
table_helpers.find_index(customization_menu.highlighted_buildup_bar_types, cached_config.settings.highlighted_bar),
utils.table.find_index(customization_menu.highlighted_buildup_bar_types, cached_config.settings.highlighted_bar),
customization_menu.displayed_highlighted_buildup_bar_types);
config_changed = config_changed or changed;
@@ -81,7 +114,7 @@ function ailment_buildups_customization.draw(cached_config)
changed, index = imgui.combo(
language.current_language.customization_menu.buildup_bars_are_relative_to,
table_helpers.find_index(customization_menu.displayed_buildup_bar_relative_types, cached_config.settings.buildup_bar_relative_to),
utils.table.find_index(customization_menu.displayed_buildup_bar_relative_types, cached_config.settings.buildup_bar_relative_to),
customization_menu.displayed_buildup_bar_relative_types);
config_changed = config_changed or changed;
@@ -101,7 +134,7 @@ function ailment_buildups_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.ailment_buildups_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.ailment_buildups_sorting_types, cached_config.sorting.type),
customization_menu.displayed_ailment_buildups_sorting_types);
config_changed = config_changed or changed;
@@ -137,90 +170,8 @@ function ailment_buildups_customization.draw(cached_config)
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.ailment_name_label) then
changed, cached_config.ailment_name_label.visibility =
imgui.checkbox(language.current_language.customization_menu.visible,
cached_config.ailment_name_label.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.include) then
changed, cached_config.ailment_name_label.include.ailment_name = imgui.checkbox(
language.current_language.customization_menu.ailment_name,
cached_config.ailment_name_label.include.ailment_name);
config_changed = config_changed or changed;
changed, cached_config.ailment_name_label.include.activation_count = imgui.checkbox(
language.current_language.customization_menu.activation_count,
cached_config.ailment_name_label.include.activation_count);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.ailment_name_label.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.ailment_name_label.offset.x,
0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.ailment_name_label.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.ailment_name_label.offset.y,
0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.ailment_name_label.color = imgui.color_picker_argb(
"", cached_config.ailment_name_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, cached_config.ailment_name_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.ailment_name_label.shadow.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.ailment_name_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.ailment_name_label.shadow.offset.x,
0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.ailment_name_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.ailment_name_label.shadow.offset.y,
0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.ailment_name_label.shadow.color = imgui.color_picker_argb(
"", cached_config.ailment_name_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
changed = label_customization.draw(language.current_language.customization_menu.ailment_name_label, cached_config.ailment_name_label);
config_changed = config_changed or changed;
changed = label_customization.draw(language.current_language.customization_menu.player_name_label, cached_config.player_name_label);
config_changed = config_changed or changed;
@@ -249,12 +200,12 @@ function ailment_buildups_customization.draw(cached_config)
return config_changed;
end
function ailment_buildups_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -267,4 +218,4 @@ function ailment_buildups_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return ailment_buildups_customization;
return this;

View File

@@ -1,9 +1,9 @@
local ailments_customization = {};
local this = {};
local table_helpers;
local utils;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,9 +15,42 @@ local customization_menu;
local label_customization;
local bar_customization;
function ailments_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
local index = 0;
if imgui.tree_node(language.current_language.customization_menu.ailments) then
changed, cached_config.visibility = imgui.checkbox(
@@ -110,7 +143,7 @@ function ailments_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.ailments_sorting_types, cached_config.sorting.type),
utils.table.find_index(customization_menu.ailments_sorting_types, cached_config.sorting.type),
customization_menu.displayed_ailments_sorting_types);
config_changed = config_changed or changed;
@@ -332,12 +365,12 @@ function ailments_customization.draw(cached_config)
return config_changed;
end
function ailments_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -349,4 +382,4 @@ function ailments_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return ailments_customization;
return this;

View File

@@ -1,9 +1,9 @@
local bar_customization = {};
local this = {};
local table_helpers;
local utils;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -14,7 +14,39 @@ local keyboard;
local customization_menu;
local line_customization;
function bar_customization.draw(bar_name, bar)
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;
function this.draw(bar_name, bar)
if bar == nil then
return false;
end
@@ -67,7 +99,7 @@ function bar_customization.draw(bar_name, bar)
changed, index = imgui.combo(language.current_language.customization_menu.style,
table_helpers.find_index(customization_menu.outline_styles,
utils.table.find_index(customization_menu.outline_styles,
bar.outline.style),
customization_menu.displayed_outline_styles);
bar_changed = bar_changed or changed;
@@ -159,12 +191,12 @@ function bar_customization.draw(bar_name, bar)
return bar_changed;
end
function bar_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -175,4 +207,4 @@ function bar_customization.init_module()
line_customization = require("MHR_Overlay.UI.Customizations.line_customization");
end
return bar_customization;
return this;

View File

@@ -1,9 +1,9 @@
local body_parts_customization = {};
local this = {};
local table_helpers;
local utils;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,9 +15,42 @@ local customization_menu;
local label_customization;
local bar_customization;
function body_parts_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
local index = 0;
if imgui.tree_node(language.current_language.customization_menu.body_parts) then
changed, cached_config.visibility = imgui.checkbox(
@@ -57,6 +90,16 @@ function body_parts_customization.draw(cached_config)
config_changed = config_changed or changed;
changed, index = imgui.combo(language.current_language.customization_menu.filter_mode,
utils.table.find_index(customization_menu.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
customization_menu.displayed_large_monster_UI_parts_filter_types);
config_changed = config_changed or changed;
if changed then
cached_config.settings.filter_mode = customization_menu.large_monster_UI_parts_filter_types[index];
end
changed, cached_config.settings.time_limit = imgui.drag_float(
language.current_language.customization_menu.time_limit, cached_config.settings.time_limit, 0.1, 0, 99999, "%.1f");
@@ -68,8 +111,8 @@ function body_parts_customization.draw(cached_config)
if imgui.tree_node(language.current_language.customization_menu.sorting) then
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
customization_menu.displayed_monster_UI_parts_sorting_types);
utils.table.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
customization_menu.displayed_large_monster_UI_parts_sorting_types);
config_changed = config_changed or changed;
@@ -325,12 +368,12 @@ function body_parts_customization.draw(cached_config)
return config_changed;
end
function body_parts_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -342,4 +385,4 @@ function body_parts_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return body_parts_customization;
return this;

View File

@@ -1,9 +1,8 @@
local large_monster_UI_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,7 +14,39 @@ local customization_menu;
local label_customization;
local bar_customization;
function large_monster_UI_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
@@ -57,12 +88,11 @@ function large_monster_UI_customization.draw(cached_config)
return config_changed;
end
function large_monster_UI_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -74,4 +104,4 @@ function large_monster_UI_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return large_monster_UI_customization;
return this;

View File

@@ -1,9 +1,8 @@
local label_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -13,41 +12,78 @@ local time_UI;
local keyboard;
local customization_menu;
function label_customization.draw(label_name, label)
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;
function this.draw(label_name, label)
local label_changed = false;
local changed = false;
if imgui.tree_node(label_name) then
changed, label.visibility = imgui.checkbox(language.current_language.customization_menu.visible
, label.visibility);
changed, label.visibility = imgui.checkbox(language.current_language.customization_menu.visible, label.visibility);
label_changed = label_changed or changed;
if label.include ~= nil then
if imgui.tree_node(language.current_language.customization_menu.include) then
for include_name, include in pairs(label.include) do
changed, label.include[include_name] = imgui.checkbox(language.current_language.customization_menu[include_name], include);
label_changed = label_changed or changed;
end
imgui.tree_pop();
end
end
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, label.offset.x = imgui.drag_float(language.current_language.customization_menu.x,
label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
changed, label.offset.x = imgui.drag_float(language.current_language.customization_menu.x, label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
label_changed = label_changed or changed;
changed, label.offset.y = imgui.drag_float(language.current_language.customization_menu.y,
label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
changed, label.offset.y = imgui.drag_float(language.current_language.customization_menu.y, label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
label_changed = label_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, label.color = imgui.color_picker_argb("", label.color,
customization_menu.color_picker_flags);
changed, label.color = imgui.color_picker_argb("", label.color, customization_menu.color_picker_flags);
label_changed = label_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, label.shadow.visibility = imgui.checkbox(language.current_language.customization_menu.visible
, label.shadow.visibility);
changed, label.shadow.visibility = imgui.checkbox(language.current_language.customization_menu.visible, label.shadow.visibility);
label_changed = label_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
@@ -79,12 +115,11 @@ function label_customization.draw(label_name, label)
return label_changed;
end
function label_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -94,4 +129,4 @@ function label_customization.init_module()
customization_menu = require("MHR_Overlay.UI.customization_menu");
end
return label_customization;
return this;

View File

@@ -1,9 +1,8 @@
local large_monster_UI_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -22,104 +21,44 @@ local body_parts_customization;
local ailments_customization;
local ailment_buildups_customization;
function large_monster_UI_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
if imgui.tree_node(language.current_language.customization_menu.monster_name_label) then
changed, cached_config.monster_name_label.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.monster_name_label.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.include) then
changed, cached_config.monster_name_label.include.monster_name = imgui.checkbox(
language.current_language.customization_menu.monster_name, cached_config.monster_name_label.include.monster_name);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.monster_id = imgui.checkbox(
language.current_language.customization_menu.monster_id, cached_config.monster_name_label.include.monster_id);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.crown = imgui.checkbox(
language.current_language.customization_menu.crown, cached_config.monster_name_label.include.crown);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.size = imgui.checkbox(
language.current_language.customization_menu.size, cached_config.monster_name_label.include.size);
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.include.scrown_thresholds = imgui.checkbox(
language.current_language.customization_menu.crown_thresholds, cached_config.monster_name_label.include.scrown_thresholds);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.monster_name_label.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.monster_name_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.monster_name_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.monster_name_label.color = imgui.color_picker_argb(
"", cached_config.monster_name_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, cached_config.monster_name_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible, cached_config.monster_name_label.shadow.visibility);
config_changed = config_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, cached_config.monster_name_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x, cached_config.monster_name_label.shadow.offset.x,
0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
changed, cached_config.monster_name_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y, cached_config.monster_name_label.shadow.offset.y,
0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, cached_config.monster_name_label.shadow.color = imgui.color_picker_argb(
"", cached_config.monster_name_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
changed = label_customization.draw(language.current_language.customization_menu.monster_name_label, cached_config.monster_name_label);
config_changed = config_changed or changed;
changed = health_customization.draw(cached_config.health);
config_changed = config_changed or changed;
@@ -142,12 +81,11 @@ function large_monster_UI_customization.draw(cached_config)
return config_changed;
end
function large_monster_UI_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -166,4 +104,4 @@ function large_monster_UI_customization.init_module()
ailment_buildups_customization = require("MHR_Overlay.UI.Customizations.ailment_buildups_customization");
end
return large_monster_UI_customization;
return this;

View File

@@ -1,9 +1,8 @@
local line_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -13,7 +12,39 @@ local time_UI;
local keyboard;
local customization_menu;
function line_customization.draw(line_name, line)
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;
function this.draw(line_name, line)
if line == nil then
return;
end
@@ -64,12 +95,11 @@ function line_customization.draw(line_name, line)
return line_changed;
end
function line_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -79,4 +109,4 @@ function line_customization.init_module()
customization_menu = require("MHR_Overlay.UI.customization_menu");
end
return line_customization;
return this;

View File

@@ -1,9 +1,8 @@
local module_visibility_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,7 +14,39 @@ local customization_menu;
local label_customization;
local bar_customization;
function module_visibility_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
@@ -61,15 +92,20 @@ function module_visibility_customization.draw(cached_config)
config_changed = config_changed or changed;
--[[changed, cached_config.buff_UI = imgui.checkbox(
language.current_language.customization_menu.buff_UI,
cached_config.buff_UI);
config_changed = config_changed or changed;]]
return config_changed;
end
function module_visibility_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -79,4 +115,4 @@ function module_visibility_customization.init_module()
customization_menu = require("MHR_Overlay.UI.customization_menu");
end
return module_visibility_customization;
return this;

View File

@@ -1,9 +1,8 @@
local rage_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,7 +14,39 @@ local customization_menu;
local label_customization;
local bar_customization;
function rage_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
@@ -60,12 +91,11 @@ function rage_customization.draw(cached_config)
return config_changed;
end
function rage_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -77,4 +107,4 @@ function rage_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return rage_customization;
return this;

View File

@@ -1,9 +1,8 @@
local stamina_customization = {};
local this = {};
local table_helpers;
local config;
local screen;
local player;
local players;
local large_monster;
local small_monster;
local env_creature;
@@ -15,7 +14,39 @@ local customization_menu;
local label_customization;
local bar_customization;
function stamina_customization.draw(cached_config)
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;
function this.draw(cached_config)
local changed = false;
local config_changed = false;
@@ -60,12 +91,11 @@ function stamina_customization.draw(cached_config)
return config_changed;
end
function stamina_customization.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
@@ -77,4 +107,4 @@ function stamina_customization.init_module()
bar_customization = require("MHR_Overlay.UI.Customizations.bar_customization");
end
return stamina_customization;
return this;

View File

@@ -0,0 +1,127 @@
local this = {};
local buff_UI_entity;
local config;
local buffs;
local screen;
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;
function this.draw()
local cached_config = config.current_config.buff_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
local displayed_buffs = {};
for _, buff in pairs(buffs.list) do
if not buff.is_active then
goto continue
end
table.insert(displayed_buffs, buff);
::continue::
end
-- sort
if cached_config.sorting.type == "Name" then
if cached_config.sorting.reversed_order then
table.sort(displayed_buffs, function(left, right)
return left.name > right.name;
end);
else
table.sort(displayed_buffs, function(left, right)
return left.name < right.name;
end);
end
elseif cached_config.sorting.type == "Timer" then
if cached_config.sorting.reversed_order then
table.sort(displayed_buffs, function(left, right)
return left.timer > right.timer;
end);
else
table.sort(displayed_buffs, function(left, right)
return left.timer < right.timer;
end);
end
else
if cached_config.sorting.reversed_order then
table.sort(displayed_buffs, function(left, right)
return left.duration > right.duration;
end);
else
table.sort(displayed_buffs, function(left, right)
return left.duration < right.duration;
end);
end
end
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
-- draw
for _, buff in ipairs(displayed_buffs) do
if not buff.is_active then
goto continue2
end
buffs.draw(buff, buff.buff_UI, position_on_screen, 1);
if cached_config.settings.orientation == "Horizontal" then
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
else
position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier;
end
::continue2::
end
end
function this.init_module()
config = require("MHR_Overlay.Misc.config");
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
buffs = require("MHR_Overlay.Buffs.buffs");
--singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config");
--customization_menu = require("MHR_Overlay.UI.customization_menu");
--players = require("MHR_Overlay.Damage_Meter.players");
--non_players = require("MHR_Overlay.Damage_Meter.non_players");
--quest_status = require("MHR_Overlay.Game_Handler.quest_status");
screen = require("MHR_Overlay.Game_Handler.screen");
--drawing = require("MHR_Overlay.UI.drawing");
end
return this;

View File

@@ -1,17 +1,50 @@
local damage_meter_UI = {};
local this = {};
local singletons;
local config;
local customization_menu;
local player;
local players;
local non_players;
local quest_status;
local screen;
local drawing;
local language;
local table_helpers;
local utils;
damage_meter_UI.last_displayed_players = {};
damage_meter_UI.freeze_displayed_players = false;
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;
this.last_displayed_players = {};
this.freeze_displayed_players = false;
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
@@ -24,130 +57,33 @@ local get_item_method = quest_hunter_info_type_def:get_method("get_Item");
local hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterInfo");
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
function damage_meter_UI.get_players(player_info_list)
local cached_config = config.current_config.damage_meter_UI;
-- other players
if player_info_list == nil then
customization_menu.status = "No player info list";
return {};
end
local quest_players = {};
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return {};
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local player_id = member_index_field:get_data(player_info);
if player_id == nil then
goto continue
end
local _player = player.get_player(player_id);
if _player ~= nil then
if _player == player.myself and cached_config.settings.my_damage_bar_location ~= "Normal" then
goto continue
end
table.insert(quest_players, _player);
end
::continue::
end
if cached_config.settings.show_followers_separately then
for id, non_player in pairs(non_players.servant_list) do
table.insert(quest_players, non_player);
end
end
return quest_players;
end
function damage_meter_UI.draw()
function this.draw()
local cached_config = config.current_config.damage_meter_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
if player.total.display.total_damage == 0 and cached_config.settings.hide_module_if_total_damage_is_zero then
if players.total.display.total_damage == 0 and cached_config.settings.hide_module_if_total_damage_is_zero then
return;
end
local quest_players = {};
if damage_meter_UI.freeze_displayed_players and not table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
quest_players = damage_meter_UI.last_displayed_players;
elseif quest_status.flow_state == quest_status.flow_states.IN_LOBBY or quest_status.flow_state == quest_status.flow_states.IN_TRAINING_AREA then
local player_info_list = hunter_info_field:get_data(singletons.lobby_manager);
quest_players = damage_meter_UI.get_players(player_info_list);
if this.freeze_displayed_players and not utils.table.is_empty(this.last_displayed_players) then
quest_players = this.last_displayed_players;
else
local player_info_list = quest_hunter_info_field:get_data(singletons.lobby_manager);
quest_players = damage_meter_UI.get_players(player_info_list);
quest_players = players.display_list;
end
if not damage_meter_UI.freeze_displayed_players or table_helpers.is_empty(damage_meter_UI.last_displayed_players) then
if #quest_players ~= 0 then
-- sort here
if cached_config.sorting.type == "Normal" then
if cached_config.sorting.reversed_order then
local reversed_quest_players = {};
for i = #quest_players, 1, -1 do
table.insert(reversed_quest_players, quest_players[i]);
end
quest_players = reversed_quest_players;
end
elseif cached_config.sorting.type == "DPS" then
if cached_config.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.dps < right.dps;
end);
else
table.sort(quest_players, function(left, right)
return left.dps > right.dps;
end);
end
else
if cached_config.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.display.total_damage < right.display.total_damage;
end);
else
table.sort(quest_players, function(left, right)
return left.display.total_damage > right.display.total_damage;
end);
end
end
end
if cached_config.settings.my_damage_bar_location == "First" then
table.insert(quest_players, 1, player.myself);
elseif cached_config.settings.my_damage_bar_location == "Last" then
table.insert(quest_players, #quest_players + 1, player.myself);
elseif #player.list == 0 then
table.insert(quest_players, player.myself);
end
damage_meter_UI.last_displayed_players = quest_players;
end
this.last_displayed_players = quest_players;
local top_damage = 0;
local top_dps = 0;
for _, _player in ipairs(quest_players) do
if _player.display.total_damage > top_damage then
top_damage = _player.display.total_damage;
for _, player in ipairs(quest_players) do
if player.display.total_damage > top_damage then
top_damage = player.display.total_damage;
end
if _player.dps > top_dps then
top_dps = _player.dps;
if player.dps > top_dps then
top_dps = player.dps;
end
end
@@ -159,11 +95,11 @@ function damage_meter_UI.draw()
return;
end
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
if cached_config.settings.hide_total_if_total_damage_is_zero and players.total.display.total_damage == 0 then
return;
end
player.draw_total(position_on_screen, 1);
players.draw(players.total, position_on_screen, 1, top_damage, top_dps);
if cached_config.settings.orientation == "Horizontal" then
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
@@ -176,27 +112,41 @@ function damage_meter_UI.draw()
if not cached_config.settings.total_damage_offset_is_relative then
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
end
for _, _player in ipairs(quest_players) do
if _player.display.total_damage == 0 and cached_config.settings.hide_player_if_player_damage_is_zero then
for _, player in ipairs(quest_players) do
if player.display.total_damage == 0 and cached_config.settings.hide_player_if_player_damage_is_zero then
goto continue
end
if _player == player.myself then
if player.type == players.types.myself then
if cached_config.settings.hide_myself then
goto continue
end
elseif cached_config.settings.hide_other_players then
goto continue
elseif player.type == players.types.servant then
if cached_config.settings.hide_servants then
goto continue
end
elseif player.type == players.types.other_player then
if cached_config.settings.hide_other_players then
goto continue
end
elseif player.type == players.types.my_otomo then
if not cached_config.settings.show_my_otomos_separately then
goto continue
end
elseif player.type == players.types.other_player_otomo then
if not cached_config.settings.show_other_player_otomos_separately then
goto continue
end
elseif player.type == players.types.servant_otomo then
if not cached_config.settings.show_servant_otomos_separately then
goto continue
end
end
if _player.is_player then
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
else
non_players.draw(_player, position_on_screen, 1, top_damage, top_dps);
end
players.draw(player, position_on_screen, 1, top_damage, top_dps);
if cached_config.settings.orientation == "Horizontal" then
position_on_screen.x = position_on_screen.x + cached_config.spacing.x * global_scale_modifier;
else
@@ -213,7 +163,7 @@ function damage_meter_UI.draw()
return;
end
if cached_config.settings.hide_total_if_total_damage_is_zero and player.total.display.total_damage == 0 then
if cached_config.settings.hide_total_if_total_damage_is_zero and players.total.display.total_damage == 0 then
return;
end
@@ -221,21 +171,21 @@ function damage_meter_UI.draw()
position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
end
player.draw_total(position_on_screen, 1);
players.draw(players.total, position_on_screen, 1);
end
end
function damage_meter_UI.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config");
customization_menu = require("MHR_Overlay.UI.customization_menu");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
non_players = require("MHR_Overlay.Damage_Meter.non_players");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
screen = require("MHR_Overlay.Game_Handler.screen");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
end
return damage_meter_UI;
return this;

View File

@@ -1,20 +1,52 @@
local env_creature_UI = {};
local this = {};
local singletons;
local config;
local customization_menu;
local large_monster;
local screen;
local player;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
local env_creature;
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 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
return;
end
@@ -46,7 +78,7 @@ function env_creature_UI.draw()
position_on_screen.x = position_on_screen.x + cached_config.viewport_offset.x * global_scale_modifier;
position_on_screen.y = position_on_screen.y + cached_config.viewport_offset.y * global_scale_modifier;
creature.distance = (player.myself_position - creature.position):length();
creature.distance = (players.myself_position - creature.position):length();
local opacity_scale = 1;
if creature.distance > cached_config.settings.max_distance then
@@ -62,19 +94,18 @@ function env_creature_UI.draw()
end
end
function env_creature_UI.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config");
customization_menu = require("MHR_Overlay.UI.customization_menu");
large_monster = require("MHR_Overlay.Monsters.large_monster");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
env_creature = require("MHR_Overlay.Endemic_Life.env_creature");
end
return env_creature_UI;
return this;

View File

@@ -1,16 +1,48 @@
local large_monster_UI = {};
local this = {};
local singletons;
local config;
local customization_menu;
local large_monster;
local screen;
local player;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
local rage_UI_entity;
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 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_method = enemy_manager_type_def:get_method("getBossEnemy");
@@ -21,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 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;
if singletons.enemy_manager == nil then
@@ -70,7 +102,7 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
end
if update_distance then
monster.distance = (player.myself_position - monster.position):length();
monster.distance = (players.myself_position - monster.position):length();
end
if cached_config.highlighted.auto_highlight.enabled then
@@ -121,19 +153,27 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
end
if dynamic_enabled then
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
customization_menu.status = string.format("[%s] Dynamic Large Monster drawing function threw an exception");
end
end
if highlighted_enabled then
large_monster_UI.draw_highlighted(highlighted_monster, cached_config);
local success = pcall(this.draw_highlighted, highlighted_monster, cached_config);
if not success then
customization_menu.status = string.format("[%s] Highlighted Large Monster drawing function threw an exception");
end
end
if static_enabled then
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
customization_menu.status = string.format("[%s] Static Large Monster drawing function threw an exception");
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;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -163,8 +203,7 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster,
local position_on_screen = {};
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y,
cached_config.world_offset.z);
local world_offset = Vector3f.new(cached_config.world_offset.x, cached_config.world_offset.y, cached_config.world_offset.z);
position_on_screen = draw.world_to_screen(monster.position + world_offset);
@@ -191,7 +230,7 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster,
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;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -272,7 +311,7 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster, c
end
end
function large_monster_UI.draw_highlighted(monster, cached_config)
function this.draw_highlighted(monster, cached_config)
cached_config = cached_config.highlighted;
if monster == nil then
@@ -281,25 +320,24 @@ function large_monster_UI.draw_highlighted(monster, cached_config)
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
if monster.dead_or_captured then
return;
end
large_monster.draw(monster, "highlighted", cached_config, position_on_screen, 1);
end
function large_monster_UI.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config");
customization_menu = require("MHR_Overlay.UI.customization_menu");
large_monster = require("MHR_Overlay.Monsters.large_monster");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
end
return large_monster_UI;
return this;

View File

@@ -1,20 +1,52 @@
local small_monster_UI = {};
local this = {};
local singletons;
local config;
local small_monster;
local customization_menu;
local screen;
local player;
local players;
local drawing;
local table_helpers;
local health_UI_entity;
local stamina_UI_entity;
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 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_method = enemy_manager_type_def:get_method("getZakoEnemy");
function small_monster_UI.draw()
function this.draw()
if singletons.enemy_manager == nil then
return;
end
@@ -53,7 +85,7 @@ function small_monster_UI.draw()
if cached_config.dynamic_positioning.enabled
or (not cached_config.dynamic_positioning.enabled and cached_config.static_sorting.type == "Distance") then
for _, monster in ipairs(displayed_monsters) do
monster.distance = (player.myself_position - monster.position):length();
monster.distance = (players.myself_position - monster.position):length();
end
end
@@ -154,17 +186,16 @@ function small_monster_UI.draw()
end
end
function small_monster_UI.init_module()
function this.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
config = require("MHR_Overlay.Misc.config");
customization_menu = require("MHR_Overlay.UI.customization_menu");
small_monster = require("MHR_Overlay.Monsters.small_monster");
screen = require("MHR_Overlay.Game_Handler.screen");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
health_UI_entity = require("MHR_Overlay.UI.UI_Entities.health_UI_entity");
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
end
return small_monster_UI;
return this;

View File

@@ -1,13 +1,46 @@
local time_UI = {};
local this = {};
local time;
local screen;
local config;
local drawing;
local table_helpers;
local utils;
time_UI.label = nil;
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;
function time_UI.draw()
this.label = nil;
function this.draw()
local elapsed_minutes = time.elapsed_minutes;
local elapsed_seconds = time.elapsed_seconds;
@@ -17,26 +50,26 @@ function time_UI.draw()
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
function time_UI.init_UI()
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
function this.init_UI()
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;
time_UI.label.offset.x = time_UI.label.offset.x * global_scale_modifier;
time_UI.label.offset.y = time_UI.label.offset.y * global_scale_modifier;
this.label.offset.x = this.label.offset.x * global_scale_modifier;
this.label.offset.y = this.label.offset.y * global_scale_modifier;
end
function time_UI.init_module()
function this.init_module()
time = require("MHR_Overlay.Game_Handler.time");
screen = require("MHR_Overlay.Game_Handler.screen");
config = require("MHR_Overlay.Misc.config");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
utils = require("MHR_Overlay.Misc.utils");
time_UI.init_UI()
this.init_UI()
end
return time_UI;
return this;

View File

@@ -1,21 +1,54 @@
local ailment_UI_entity = {};
local this = {};
local config;
local table_helpers;
local utils;
local drawing;
local language;
function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label)
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;
function this.new(visibility, bar, name_label, text_label, value_label, percentage_label, timer_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.name_label = table_helpers.deep_copy(name_label);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.name_label = utils.table.deep_copy(name_label);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -42,7 +75,7 @@ function ailment_UI_entity.new(visibility, bar, name_label, text_label, value_la
return entity;
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
return;
end
@@ -55,29 +88,41 @@ function ailment_UI_entity.draw(ailment, ailment_UI, cached_config, position_on_
ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count);
end
local total_buildup_string = "";
if not ailment.is_active then
local include_current_value = ailment_UI.value_label.include.current_value;
local include_max_value = ailment_UI.value_label.include.max_value;
if include_current_value and include_max_value then
total_buildup_string = string.format("%.0f/%.0f", ailment.total_buildup, ailment.buildup_limit);
elseif include_current_value then
total_buildup_string = string.format("%.0f", ailment.total_buildup);
elseif include_max_value then
total_buildup_string = string.format("%.0f", ailment.buildup_limit);
end
end
if ailment.is_active then
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.timer_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left,
ailment.seconds_left);
drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left);
else
drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage);
drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name);
drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup,
ailment.buildup_limit);
drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, total_buildup_string);
drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage);
end
end
function ailment_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
language = require("MHR_Overlay.Misc.language");
end
return ailment_UI_entity;
return this;

View File

@@ -1,11 +1,44 @@
local ailment_buildup_UI_entity = {};
local table_helpers;
local this = {};
local utils;
local drawing;
local config;
local player;
local players;
local language;
function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label,
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;
function this.new(buildup_bar, highlighted_buildup_bar, ailment_name_label, player_name_label,
buildup_value_label, buildup_percentage_label, total_buildup_label,
total_buildup_value_label)
local entity = {};
@@ -13,14 +46,14 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.buildup_bar = table_helpers.deep_copy(buildup_bar);
entity.highlighted_buildup_bar = table_helpers.deep_copy(highlighted_buildup_bar);
entity.ailment_name_label = table_helpers.deep_copy(ailment_name_label);
entity.player_name_label = table_helpers.deep_copy(player_name_label);
entity.buildup_value_label = table_helpers.deep_copy(buildup_value_label);
entity.buildup_percentage_label = table_helpers.deep_copy(buildup_percentage_label);
entity.total_buildup_label = table_helpers.deep_copy(total_buildup_label);
entity.total_buildup_value_label = table_helpers.deep_copy(total_buildup_value_label);
entity.buildup_bar = utils.table.deep_copy(buildup_bar);
entity.highlighted_buildup_bar = utils.table.deep_copy(highlighted_buildup_bar);
entity.ailment_name_label = utils.table.deep_copy(ailment_name_label);
entity.player_name_label = utils.table.deep_copy(player_name_label);
entity.buildup_value_label = utils.table.deep_copy(buildup_value_label);
entity.buildup_percentage_label = utils.table.deep_copy(buildup_percentage_label);
entity.total_buildup_label = utils.table.deep_copy(total_buildup_label);
entity.total_buildup_value_label = utils.table.deep_copy(total_buildup_value_label);
entity.buildup_bar.offset.x = entity.buildup_bar.offset.x * global_scale_modifier;
entity.buildup_bar.offset.y = entity.buildup_bar.offset.y * global_scale_modifier;
@@ -55,42 +88,41 @@ function ailment_buildup_UI_entity.new(buildup_bar, highlighted_buildup_bar, ail
return entity;
end
function ailment_buildup_UI_entity.draw(_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;
if cached_config.settings.buildup_bar_relative_to == "Total Buildup" then
player_buildup_bar_percentage = _player_buildup.buildup_share;
player_buildup_bar_percentage = player_buildup.buildup_share;
else
if top_buildup ~= 0 then
player_buildup_bar_percentage = _player_buildup.buildup / top_buildup;
player_buildup_bar_percentage = player_buildup.buildup / top_buildup;
end
end
if _player_buildup.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
if player.type == players.types.myself and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Buildup" and _player_buildup.buildup == top_buildup then
elseif cached_config.settings.highlighted_bar == "Top Buildup" and player_buildup.buildup == top_buildup then
drawing.draw_bar(ailment_buildup_UI.highlighted_buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
else
drawing.draw_bar(ailment_buildup_UI.buildup_bar, position_on_screen, opacity_scale, player_buildup_bar_percentage);
end
local _player = player.get_player(_player_buildup.id);
local player_name = "Player " .. tostring(_player_buildup.id);
if _player ~= nil then
player_name = _player.name;
local player_name = tostring(player_buildup.id);
if player ~= nil then
player_name = player.name;
end
drawing.draw_label(ailment_buildup_UI.player_name_label, position_on_screen, opacity_scale, player_name);
drawing.draw_label(ailment_buildup_UI.buildup_value_label, position_on_screen, opacity_scale, _player_buildup.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_value_label, position_on_screen, opacity_scale, player_buildup.buildup);
drawing.draw_label(ailment_buildup_UI.buildup_percentage_label, position_on_screen, opacity_scale, 100 * player_buildup.buildup_share);
end
function ailment_buildup_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
player = require("MHR_Overlay.Damage_Meter.player");
players = require("MHR_Overlay.Damage_Meter.players");
language = require("MHR_Overlay.Misc.language");
end
return ailment_buildup_UI_entity;
return this;

View File

@@ -1,9 +1,42 @@
local body_part_UI_entity = {};
local this = {};
local config;
local table_helpers;
local utils;
local drawing;
function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibility, flinch_bar, flinch_text_label,
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;
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,
break_percentage_label, loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
@@ -16,15 +49,15 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.break_visibility = break_visibility;
entity.loss_visibility = loss_visibility;
entity.part_name_label = table_helpers.deep_copy(part_name_label);
entity.part_name_label = utils.table.deep_copy(part_name_label);
entity.part_name_label.offset.x = entity.part_name_label.offset.x * global_scale_modifier;
entity.part_name_label.offset.y = entity.part_name_label.offset.y * global_scale_modifier;
entity.flinch_bar = table_helpers.deep_copy(flinch_bar);
entity.flinch_text_label = table_helpers.deep_copy(flinch_text_label);
entity.flinch_value_label = table_helpers.deep_copy(flinch_value_label);
entity.flinch_percentage_label = table_helpers.deep_copy(flinch_percentage_label);
entity.flinch_bar = utils.table.deep_copy(flinch_bar);
entity.flinch_text_label = utils.table.deep_copy(flinch_text_label);
entity.flinch_value_label = utils.table.deep_copy(flinch_value_label);
entity.flinch_percentage_label = utils.table.deep_copy(flinch_percentage_label);
entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * global_scale_modifier;
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * global_scale_modifier;
@@ -42,10 +75,10 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * global_scale_modifier;
entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * global_scale_modifier;
entity.break_bar = table_helpers.deep_copy(break_bar);
entity.break_text_label = table_helpers.deep_copy(break_text_label);
entity.break_value_label = table_helpers.deep_copy(break_value_label);
entity.break_percentage_label = table_helpers.deep_copy(break_percentage_label);
entity.break_bar = utils.table.deep_copy(break_bar);
entity.break_text_label = utils.table.deep_copy(break_text_label);
entity.break_value_label = utils.table.deep_copy(break_value_label);
entity.break_percentage_label = utils.table.deep_copy(break_percentage_label);
entity.break_bar.offset.x = entity.break_bar.offset.x * global_scale_modifier;
entity.break_bar.offset.y = entity.break_bar.offset.y * global_scale_modifier;
@@ -63,10 +96,10 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * global_scale_modifier;
entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * global_scale_modifier;
entity.loss_bar = table_helpers.deep_copy(loss_bar);
entity.loss_text_label = table_helpers.deep_copy(loss_text_label);
entity.loss_value_label = table_helpers.deep_copy(loss_value_label);
entity.loss_health_percentage_label = table_helpers.deep_copy(loss_health_percentage_label);
entity.loss_bar = utils.table.deep_copy(loss_bar);
entity.loss_text_label = utils.table.deep_copy(loss_text_label);
entity.loss_value_label = utils.table.deep_copy(loss_value_label);
entity.loss_health_percentage_label = utils.table.deep_copy(loss_health_percentage_label);
entity.loss_bar.offset.x = entity.loss_bar.offset.x * global_scale_modifier;
entity.loss_bar.offset.y = entity.loss_bar.offset.y * global_scale_modifier;
@@ -87,7 +120,7 @@ function body_part_UI_entity.new(part_visibility, part_name_label, flinch_visibi
return entity;
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
return;
end
@@ -121,9 +154,50 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre
end
end
local health_string = string.format("%.0f/%.0f", part.health, part.max_health);
local break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health);
local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
-- health value string
local health_string = "";
if draw_health then
local include_health_current_value = part_UI.flinch_value_label.include.current_value;
local include_health_max_value = part_UI.flinch_value_label.include.max_value;
if include_health_current_value and include_health_max_value then
health_string = string.format("%.0f/%.0f", part.health, part.max_health);
elseif include_health_current_value then
health_string = string.format("%.0f", part.health);
elseif include_health_max_value then
health_string = string.format("%.0f", part.max_health);
end
end
-- break health value string
local break_health_string = "";
if draw_break then
local include_break_health_current_value = part_UI.break_value_label.include.current_value;
local include_break_health_max_value = part_UI.break_value_label.include.max_value;
if include_break_health_current_value and include_break_health_max_value then
break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health);
elseif include_break_health_current_value then
break_health_string = string.format("%.0f", part.break_health);
elseif include_break_health_max_value then
break_health_string = string.format("%.0f", part.break_max_health);
end
end
-- loss health value string
local loss_health_string = "";
if draw_severe then
local include_loss_health_current_value = part_UI.loss_value_label.include.current_value;
local include_loss_health_max_value = part_UI.loss_value_label.include.max_value;
if include_loss_health_current_value and include_loss_health_max_value then
loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health);
elseif include_loss_health_current_value then
loss_health_string = string.format("%.0f", part.loss_health);
elseif include_loss_health_max_value then
loss_health_string = string.format("%.0f", part.loss_max_health);
end
end
local flinch_position_on_screen = {
x = position_on_screen.x + cached_config.part_health.offset.x,
@@ -147,7 +221,7 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre
drawing.draw_bar(part_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
end
if draw_break then
if draw_break then
drawing.draw_bar(part_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
end
@@ -176,10 +250,10 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre
end
end
function body_part_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
end
return body_part_UI_entity;
return this;

View File

@@ -0,0 +1,91 @@
local this = {};
local config;
local utils;
local drawing;
local language;
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;
function this.new(bar, name_label, timer_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.bar = utils.table.deep_copy(bar);
entity.name_label = utils.table.deep_copy(name_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.name_label.offset.x = entity.name_label.offset.x * global_scale_modifier;
entity.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier;
entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier;
entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier;
return entity;
end
function this.draw(buff, buff_UI, position_on_screen, opacity_scale)
local cached_config = config.current_config.buff_UI;
if not buff.is_infinite then
drawing.draw_bar(buff_UI.bar, position_on_screen, opacity_scale, buff.timer_percentage);
elseif not cached_config.settings.hide_bar_for_infinite_buffs then
drawing.draw_bar(buff_UI.bar, position_on_screen, opacity_scale, 1);
end
drawing.draw_label(buff_UI.name_label, position_on_screen, opacity_scale, buff.name);
if not buff.is_infinite then
drawing.draw_label(buff_UI.timer_label, position_on_screen, opacity_scale, buff.minutes_left, buff.seconds_left);
elseif not cached_config.settings.hide_timer_for_infinite_buffs then
drawing.draw_label(buff_UI.timer_label, position_on_screen, opacity_scale, 0, 0);
end
end
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
language = require("MHR_Overlay.Misc.language");
end
return this;

View File

@@ -0,0 +1,246 @@
local this = {};
local utils;
local drawing;
local config;
local players;
local language;
local quest_status;
local non_players;
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;
function this.new(damage_meter_UI_elements, type)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar = utils.table.deep_copy(damage_meter_UI_elements.damage_bar);
entity.name_label = utils.table.deep_copy(damage_meter_UI_elements.name_label);
entity.hunter_rank_label = utils.table.deep_copy(damage_meter_UI_elements.hunter_rank_label);
entity.cart_count_label = utils.table.deep_copy(damage_meter_UI_elements.cart_count_label);
entity.dps_label = utils.table.deep_copy(damage_meter_UI_elements.dps_label);
entity.value_label = utils.table.deep_copy(damage_meter_UI_elements.damage_value_label);
entity.percentage_label = utils.table.deep_copy(damage_meter_UI_elements.damage_percentage_label);
entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit;
if type == players.types.total then
entity.total_name = language.current_language.UI.total_damage;
elseif type == players.types.myself or type == players.types.other_players then
entity.type_name = language.current_language.UI.player;
elseif type == players.types.servant then
entity.type_name = language.current_language.UI.servant;
else
entity.type_name = language.current_language.UI.otomo;
end
if entity.bar ~= nil then
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
end
if entity.name_label ~= nil then
entity.name_label.offset.x = entity.name_label.offset.x * global_scale_modifier;
entity.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier;
end
if entity.player_name_size_limit ~= nil then
entity.player_name_size_limit = entity.player_name_size_limit * global_scale_modifier;
end
if entity.hunter_rank_label ~= nil then
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * global_scale_modifier;
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * global_scale_modifier;
end
if entity.cart_count_label ~= nil then
entity.cart_count_label.offset.x = entity.cart_count_label.offset.x * global_scale_modifier;
entity.cart_count_label.offset.y = entity.cart_count_label.offset.y * global_scale_modifier;
end
if entity.dps_label ~= nil then
entity.dps_label.offset.x = entity.dps_label.offset.x * global_scale_modifier;
entity.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier;
end
if entity.value_label ~= nil then
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
end
if entity.percentage_label ~= nil then
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
end
return entity;
end
function this.draw(player, position_on_screen, opacity_scale, top_damage, top_dps)
local cached_config = config.current_config.damage_meter_UI;
local name_include = nil;
if player.damage_UI.name_label ~= nil then
name_include = player.damage_UI.name_label.include;
end
local hunter_rank_include = nil;
if player.damage_UI.hunter_rank_label ~= nil then
hunter_rank_include = player.damage_UI.hunter_rank_label.include;
end
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 player_damage_percentage = 0;
if players.total.display.total_damage ~= 0 then
player_damage_percentage = player.display.total_damage / players.total.display.total_damage;
end
local player_damage_bar_percentage = 0;
if player.type ~= players.types.total then
if cached_config.settings.damage_bar_relative_to == "Total Damage" then
if players.total.display.total_damage ~= 0 then
player_damage_bar_percentage = player.display.total_damage / players.total.display.total_damage;
end
else
if top_damage ~= 0 then
player_damage_bar_percentage = player.display.total_damage / top_damage;
end
end
end
local name_text = "";
if player.type == players.types.total then
name_text = player.damage_UI.total_name;
elseif name_include ~= nil then
if name_include.master_rank and name_include.hunter_rank then
name_text = string.format("[%d:%d] ", player.master_rank, player.hunter_rank);
elseif name_include.master_rank then
name_text = string.format("[%d] ", player.master_rank);
elseif name_include.hunter_rank then
name_text = string.format("[%d] ", player.hunter_rank);
elseif name_include.level then
name_text = string.format("[%d] ", player.level);
end
if name_include.cart_count and is_on_quest then
name_text = name_text .. string.format("x%d ", player.cart_count);
end
if name_include.type then
name_text = name_text .. player.damage_UI.type_name .. " ";
end
if name_include.id then
name_text = name_text .. string.format("%d ", player.id);
end
if name_include.name then
name_text = name_text .. player.name;
end
end
local hunter_rank_string = "";
if player.damage_UI.hunter_rank_label ~= nil then
if hunter_rank_include == nil then
hunter_rank_string = string.format("%d", player.level);
elseif hunter_rank_include.master_rank and hunter_rank_include.hunter_rank then
hunter_rank_string = string.format("%d:%d", player.master_rank, player.hunter_rank);
elseif hunter_rank_include.master_rank then
hunter_rank_string = string.format("%d", player.master_rank);
elseif hunter_rank_include.hunter_rank then
hunter_rank_string = string.format("%d", player.hunter_rank);
end
end
local bar = player.damage_UI.bar;
local name_label = player.damage_UI.name_label;
local hunter_rank_label = player.damage_UI.hunter_rank_label;
local value_label = player.damage_UI.value_label;
local percentage_label = player.damage_UI.percentage_label;
local dps_label = player.damage_UI.dps_label;
if player.type ~= players.types.total then
if (cached_config.settings.highlighted_bar == "Top Damage" and player.display.total_damage == top_damage and top_damage ~= 0) or
(cached_config.settings.highlighted_bar == "Top DPS" and player.dps == top_dps and top_dps ~= 0) then
bar = players.highlighted_damage_UI.bar;
name_label = players.highlighted_damage_UI.name_label;
hunter_rank_label = players.highlighted_damage_UI.hunter_rank_label;
value_label = players.highlighted_damage_UI.value_label;
percentage_label = players.highlighted_damage_UI.percentage_label;
dps_label = players.highlighted_damage_UI.dps_label;
end
end
drawing.draw_bar(bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
name_text = drawing.limit_text_size(name_text, player.damage_UI.player_name_size_limit);
drawing.draw_label(name_label, position_on_screen, opacity_scale, name_text);
drawing.draw_label(hunter_rank_label, position_on_screen, opacity_scale, hunter_rank_string);
drawing.draw_label(value_label, position_on_screen, opacity_scale, player.display.total_damage);
drawing.draw_label(percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage);
drawing.draw_label(dps_label, position_on_screen, opacity_scale, player.dps);
if is_on_quest then
if player.type == players.types.total then
drawing.draw_label(player.damage_UI.cart_count_label, position_on_screen, opacity_scale, quest_status.cart_count, quest_status.max_cart_count);
else
drawing.draw_label(player.damage_UI.cart_count_label, position_on_screen, opacity_scale, player.cart_count);
end
end
end
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
players = require("MHR_Overlay.Damage_Meter.players");
language = require("MHR_Overlay.Misc.language");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
non_players = require("MHR_Overlay.Damage_Meter.non_players");
end
return this;

View File

@@ -1,19 +1,52 @@
local health_UI_entity = {};
local table_helpers;
local this = {};
local utils;
local drawing;
local language;
local config;
function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
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;
function this.new(visibility, bar, text_label, value_label, percentage_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -34,23 +67,35 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
return entity;
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
return;
end
local include_current_value = health_UI.value_label.include.current_value;
local include_max_value = health_UI.value_label.include.max_value;
local health_string;
if include_current_value and include_max_value then
health_string = string.format("%.0f/%.0f", monster.health, monster.max_health);
elseif include_current_value then
health_string = string.format("%.0f", monster.health);
elseif include_max_value then
health_string = string.format("%.0f", monster.max_health);
end
drawing.draw_bar(health_UI.bar, position_on_screen, opacity_scale, monster.health_percentage);
drawing.draw_label(health_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.HP);
drawing.draw_label(health_UI.value_label, position_on_screen, opacity_scale, monster.health, monster.max_health);
drawing.draw_label(health_UI.value_label, position_on_screen, opacity_scale, health_string);
drawing.draw_label(health_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.health_percentage);
end
function health_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return health_UI_entity;
return this;

View File

@@ -1,116 +0,0 @@
local non_player_damage_UI_entity = {};
local table_helpers;
local drawing;
local config;
local player;
local language;
function non_player_damage_UI_entity.new(bar, highlighted_bar, name_label, dps_label, value_label, percentage_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.highlighted_bar = table_helpers.deep_copy(highlighted_bar);
entity.name_label = table_helpers.deep_copy(name_label);
entity.dps_label = table_helpers.deep_copy(dps_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * global_scale_modifier;
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * global_scale_modifier;
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * global_scale_modifier;
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier;
entity.highlighted_bar.outline.thickness = entity.highlighted_bar.outline.thickness * global_scale_modifier;
entity.highlighted_bar.outline.offset = entity.highlighted_bar.outline.offset * global_scale_modifier;
entity.name_label.offset.x = entity.name_label.offset.x * global_scale_modifier;
entity.name_label.offset.y = entity.name_label.offset.y * global_scale_modifier;
entity.name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit * global_scale_modifier;
entity.dps_label.offset.x = entity.dps_label.offset.x * global_scale_modifier;
entity.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
return entity;
end
function non_player_damage_UI_entity.draw(non_player, position_on_screen, opacity_scale, top_damage, top_dps)
local cached_config = config.current_config.damage_meter_UI;
local include = cached_config.player_name_label.include.others;
local name_text = "";
if include.type then
if non_player.is_otomo then
name_text = name_text .. language.current_language.UI.otomo .. " ";
else
name_text = name_text .. language.current_language.UI.servant .. " ";
end
end
if include.id then
name_text = name_text .. string.format("%d ", non_player.id);
end
if include.name then
name_text = name_text .. non_player.name;
end
local player_damage_percentage = 0;
if player.total.display.total_damage ~= 0 then
player_damage_percentage = non_player.display.total_damage / player.total.display.total_damage;
end
local player_damage_bar_percentage = 0;
if cached_config.settings.damage_bar_relative_to == "Total Damage" then
if player.total.display.total_damage ~= 0 then
player_damage_bar_percentage = non_player.display.total_damage / player.total.display.total_damage;
end
else
if top_damage ~= 0 then
player_damage_bar_percentage = non_player.display.total_damage / top_damage;
end
end
if cached_config.settings.highlighted_bar == "Top Damage" and non_player.display.total_damage == top_damage then
drawing.draw_bar(non_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top DPS" and non_player.dps == top_dps then
drawing.draw_bar(non_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
else
drawing.draw_bar(non_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
end
name_text = drawing.limit_text_size(name_text, non_player.damage_UI.name_size_limit);
drawing.draw_label(non_player.damage_UI.name_label, position_on_screen, opacity_scale, name_text);
drawing.draw_label(non_player.damage_UI.value_label, position_on_screen, opacity_scale, non_player.display.total_damage);
drawing.draw_label(non_player.damage_UI.percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage);
drawing.draw_label(non_player.damage_UI.dps_label, position_on_screen, opacity_scale, non_player.dps);
end
function non_player_damage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
player = require("MHR_Overlay.Damage_Meter.player");
language = require("MHR_Overlay.Misc.language");
end
return non_player_damage_UI_entity;

View File

@@ -1,172 +0,0 @@
local player_damage_UI_entity = {};
local table_helpers;
local drawing;
local config;
local player;
local language;
local quest_status;
function player_damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label, hunter_rank_label, value_label,
percentage_label, cart_count_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
--entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.highlighted_bar = table_helpers.deep_copy(highlighted_bar);
entity.player_name_label = table_helpers.deep_copy(player_name_label);
entity.dps_label = table_helpers.deep_copy(dps_label);
entity.hunter_rank_label = table_helpers.deep_copy(hunter_rank_label);
entity.cart_count_label = table_helpers.deep_copy(cart_count_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * global_scale_modifier;
entity.bar.outline.thickness = entity.bar.outline.thickness * global_scale_modifier;
entity.bar.outline.offset = entity.bar.outline.offset * global_scale_modifier;
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * global_scale_modifier;
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * global_scale_modifier;
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * global_scale_modifier;
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * global_scale_modifier;
entity.highlighted_bar.outline.thickness = entity.highlighted_bar.outline.thickness * global_scale_modifier;
entity.highlighted_bar.outline.offset = entity.highlighted_bar.outline.offset * global_scale_modifier;
entity.player_name_label.offset.x = entity.player_name_label.offset.x * global_scale_modifier;
entity.player_name_label.offset.y = entity.player_name_label.offset.y * global_scale_modifier;
entity.player_name_size_limit = config.current_config.damage_meter_UI.settings.player_name_size_limit *
global_scale_modifier;
entity.dps_label.offset.x = entity.dps_label.offset.x * global_scale_modifier;
entity.dps_label.offset.y = entity.dps_label.offset.y * global_scale_modifier;
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * global_scale_modifier;
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * global_scale_modifier;
entity.cart_count_label.offset.x = entity.cart_count_label.offset.x * global_scale_modifier;
entity.cart_count_label.offset.y = entity.cart_count_label.offset.y * global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
return entity;
end
function player_damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
local cached_config = config.current_config.damage_meter_UI;
local player_include = cached_config.player_name_label.include.others;
if _player.id == player.myself.id then
player_include = cached_config.player_name_label.include.myself;
end
local player_name_text = "";
if player_include.master_rank and player_include.hunter_rank then
player_name_text = string.format("[%d:%d] ", _player.master_rank, _player.hunter_rank);
elseif player_include.master_rank then
player_name_text = string.format("[%d] ", _player.master_rank);
elseif player_include.hunter_rank then
player_name_text = string.format("[%d] ", _player.hunter_rank);
end
if player_include.cart_count and quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
player_name_text = player_name_text .. string.format("x%d ", _player.cart_count);
end
if player_include.type then
player_name_text = player_name_text .. language.current_language.UI.player .. " ";
end
if player_include.id then
player_name_text = player_name_text .. string.format("%d ", _player.id);
end
if player_include.name then
player_name_text = player_name_text .. _player.name;
end
local player_damage_percentage = 0;
if player.total.display.total_damage ~= 0 then
player_damage_percentage = _player.display.total_damage / player.total.display.total_damage;
end
local player_damage_bar_percentage = 0;
if cached_config.settings.damage_bar_relative_to == "Total Damage" then
if player.total.display.total_damage ~= 0 then
player_damage_bar_percentage = _player.display.total_damage / player.total.display.total_damage;
end
else
if top_damage ~= 0 then
player_damage_bar_percentage = _player.display.total_damage / top_damage;
end
end
if _player.id == player.myself.id and cached_config.settings.highlighted_bar == "Me" then
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
elseif cached_config.settings.highlighted_bar == "Top DPS" and _player.dps == top_dps then
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
else
drawing.draw_bar(_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
end
if _player.id == player.myself.id then
if _player.damage_UI.hunter_rank_label.include.myself.master_rank and
_player.damage_UI.hunter_rank_label.include.myself.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d:%d", _player.master_rank, _player.hunter_rank));
elseif _player.damage_UI.hunter_rank_label.include.myself.master_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.master_rank));
elseif _player.damage_UI.hunter_rank_label.include.myself.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.hunter_rank));
end
else
if _player.damage_UI.hunter_rank_label.include.others.master_rank and
_player.damage_UI.hunter_rank_label.include.others.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d:%d", _player.master_rank, _player.hunter_rank));
elseif _player.damage_UI.hunter_rank_label.include.others.master_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.master_rank));
elseif _player.damage_UI.hunter_rank_label.include.others.hunter_rank then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale,
string.format("%d", _player.hunter_rank));
end
end
player_name_text = drawing.limit_text_size(player_name_text, _player.damage_UI.player_name_size_limit);
drawing.draw_label(_player.damage_UI.player_name_label, position_on_screen, opacity_scale, player_name_text);
drawing.draw_label(_player.damage_UI.value_label, position_on_screen, opacity_scale, _player.display.total_damage);
drawing.draw_label(_player.damage_UI.percentage_label, position_on_screen, opacity_scale, 100 * player_damage_percentage);
drawing.draw_label(_player.damage_UI.dps_label, position_on_screen, opacity_scale, _player.dps);
if quest_status.flow_state ~= quest_status.flow_states.IN_LOBBY and quest_status.flow_state ~= quest_status.flow_states.IN_TRAINING_AREA then
drawing.draw_label(_player.damage_UI.cart_count_label, position_on_screen, opacity_scale, _player.cart_count);
end
end
function player_damage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
config = require("MHR_Overlay.Misc.config");
player = require("MHR_Overlay.Damage_Meter.player");
language = require("MHR_Overlay.Misc.language");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
end
return player_damage_UI_entity;

View File

@@ -1,20 +1,53 @@
local rage_UI_entity = {};
local table_helpers;
local this = {};
local utils;
local drawing;
local language;
local config;
function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
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;
function this.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -38,11 +71,25 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
return entity;
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
return;
end
local rage_string = "";
if not monster.is_in_rage then
local include_current_value = rage_UI.value_label.include.current_value;
local include_max_value = rage_UI.value_label.include.max_value;
if include_current_value and include_max_value then
rage_string = string.format("%.0f/%.0f", monster.rage_point, monster.rage_limit);
elseif include_current_value then
rage_string = string.format("%.0f", monster.rage_point);
elseif include_max_value then
rage_string = string.format("%.0f", monster.rage_limit);
end
end
if monster.is_in_rage then
drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_timer_percentage);
@@ -53,16 +100,16 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale
drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_percentage);
drawing.draw_label(rage_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.rage);
drawing.draw_label(rage_UI.value_label, position_on_screen, opacity_scale, monster.rage_point, monster.rage_limit);
drawing.draw_label(rage_UI.value_label, position_on_screen, opacity_scale, rage_string);
drawing.draw_label(rage_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.rage_percentage);
end
end
function rage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return rage_UI_entity;
return this;

View File

@@ -1,20 +1,53 @@
local stamina_UI_entity = {};
local table_helpers;
local this = {};
local utils;
local drawing;
local language;
local config;
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
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;
function this.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
entity.visibility = visibility;
entity.bar = table_helpers.deep_copy(bar);
entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar = utils.table.deep_copy(bar);
entity.text_label = utils.table.deep_copy(text_label);
entity.value_label = utils.table.deep_copy(value_label);
entity.percentage_label = utils.table.deep_copy(percentage_label);
entity.timer_label = utils.table.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -36,31 +69,44 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
return entity;
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
return;
end
local stamina_string = "";
if not monster.is_tired then
local include_current_value = stamina_UI.value_label.include.current_value;
local include_max_value = stamina_UI.value_label.include.max_value;
if include_current_value and include_max_value then
stamina_string = string.format("%.0f/%.0f", monster.stamina, monster.max_stamina);
elseif include_current_value then
stamina_string = string.format("%.0f", monster.stamina);
elseif include_max_value then
stamina_string = string.format("%.0f", monster.max_stamina);
end
end
drawing.draw_label(stamina_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.stamina);
if monster.is_tired then
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.tired_timer_percentage);
drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left,
monster.tired_seconds_left);
drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left, monster.tired_seconds_left);
else
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage);
drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, monster.stamina, monster.max_stamina);
drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, stamina_string);
drawing.draw_label(stamina_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.stamina_percentage);
end
end
function stamina_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
function this.init_module()
utils = require("MHR_Overlay.Misc.utils");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return stamina_UI_entity;
return this;

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,48 @@
local drawing = {};
local this = {};
local config;
local table_helpers;
local unicode_helpers;
local utils;
drawing.font = nil;
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;
function drawing.init_font()
this.font = nil;
function this.init_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
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 red = (argb_color >> 16) & 0xFF;
local green = (argb_color >> 8) & 0xFF;
@@ -21,7 +53,7 @@ function drawing.argb_color_to_abgr_color(argb_color)
return abgr_color;
end
function drawing.color_to_argb(color)
function this.color_to_argb(color)
local alpha = (color >> 24) & 0xFF;
local red = (color >> 16) & 0xFF;
local green = (color >> 8) & 0xFF;
@@ -30,24 +62,24 @@ function drawing.color_to_argb(color)
return alpha, red, green, blue;
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;
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
return text;
end
local limited_text = text;
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
break
else
local old_limited_text = limited_text;
limited_text = unicode_helpers.sub(limited_text, 1, -5) .. "...";
limited_text = utils.unicode.sub(limited_text, 1, -5) .. "...";
if limited_text == old_limited_text then
break
@@ -58,8 +90,8 @@ function drawing.limit_text_size(text, size_limit)
return limited_text;
end
function drawing.scale_color_opacity(color, scale)
local alpha, red, green, blue = drawing.color_to_argb(color);
function this.scale_color_opacity(color, scale)
local alpha, red, green, blue = this.color_to_argb(color);
local new_alpha = math.floor(alpha * scale);
if new_alpha < 0 then
new_alpha = 0;
@@ -68,33 +100,38 @@ function drawing.scale_color_opacity(color, scale)
new_alpha = 255;
end
return drawing.argb_to_color(new_alpha, red, green, blue);
return this.argb_to_color(new_alpha, red, green, blue);
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
return;
end
bar.colors.foreground = drawing.scale_color_opacity(bar.colors.foreground, scale);
bar.colors.background = drawing.scale_color_opacity(bar.colors.background, scale);
bar.colors.foreground = this.scale_color_opacity(bar.colors.foreground, scale);
bar.colors.background = this.scale_color_opacity(bar.colors.background, scale);
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
return;
end
label.color = drawing.scale_color_opacity(label.color, scale);
label.shadow.color = drawing.scale_color_opacity(label.shadow.color, scale);
label.color = this.scale_color_opacity(label.color, scale);
label.shadow.color = this.scale_color_opacity(label.shadow.color, scale);
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
return;
end
local text = string.format(label.text, table.unpack({...}));
local text = string.format(label.text_format, table.unpack({...}));
if text == "" then
return;
end
local position_x = position.x + label.offset.x;
local position_y = position.y + label.offset.y;
@@ -104,32 +141,32 @@ function drawing.draw_label(label, position, opacity_scale, ...)
local new_shadow_color = label.shadow.color;
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
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
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);
end
end
local new_color = label.color;
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
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
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);
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
return;
@@ -227,9 +264,9 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
local outline_color = bar.colors.outline;
if opacity_scale < 1 then
foreground_color = drawing.scale_color_opacity(foreground_color, opacity_scale);
background_color = drawing.scale_color_opacity(background_color, opacity_scale);
outline_color = drawing.scale_color_opacity(outline_color, opacity_scale);
foreground_color = this.scale_color_opacity(foreground_color, opacity_scale);
background_color = this.scale_color_opacity(background_color, opacity_scale);
outline_color = this.scale_color_opacity(outline_color, opacity_scale);
end
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
@@ -240,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,
outline_color);
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);
end
end
@@ -251,7 +288,7 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
d2d.fill_rect(position_x, position_y, foreground_width, height, foreground_color);
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)
end
end
@@ -261,13 +298,13 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
if use_d2d then
d2d.fill_rect(position_x + foreground_width, position_y, background_width, height, background_color);
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)
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
health_UI.bar.capture_line == nil or not health_UI.bar.capture_line.visibility or percentage >= 1 or percentage <= 0 then
return;
@@ -280,7 +317,7 @@ function drawing.draw_capture_line(health_UI, position, opacity_scale, percentag
local color = health_UI.bar.capture_line.color;
if opacity_scale < 1 then
color = drawing.scale_color_opacity(color, opacity_scale);
color = this.scale_color_opacity(color, opacity_scale);
end
local use_d2d = d2d ~= nil and config.current_config.global_settings.renderer.use_d2d_if_available;
@@ -289,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,
color);
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,
health_UI.bar.capture_line.size.height, color)
end
end
function drawing.init_module()
function this.init_module()
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
unicode_helpers = require("MHR_Overlay.Misc.unicode_helpers");
utils = require("MHR_Overlay.Misc.utils");
end
return drawing;
return this;

View File

@@ -65,6 +65,7 @@
"break_health_percentage": "Break Health Percentage",
"break_max_count": "Break Max Count",
"break_severe_filter": "Break + Severe",
"buff_UI": "Buff UI",
"buildup": "Buildup",
"buildup_bar": "Buildup Bar",
"buildup_bars_are_relative_to": "Buildup Bars are relative to",
@@ -78,9 +79,12 @@
"closest": "Closest",
"color": "Color",
"colors": "Colors",
"config": "Config",
"creature_name_label": "Creature Name Label",
"crown": "Crown",
"crown_thresholds": "Crown Thresholds",
"current_state": "Current State",
"current_value": "Current Value",
"cutscene": "Cutscene",
"damage": "Damage",
"damage_bar": "Damage Bar",
@@ -88,10 +92,14 @@
"damage_meter_UI": "Damage Meter UI",
"damage_percentage_label": "Damage Percentage Label",
"damage_value_label": "Damage Value Label",
"default_state": "Default State",
"delete": "Delete",
"distance": "Distance",
"dps": "DPS",
"dps_label": "DPS Label",
"dps_mode": "DPS Mode",
"duplicate": "Duplicate",
"duration": "Duration",
"dynamic_positioning": "Dynamic Positioning",
"dynamically_positioned": "Dynamically Positioned",
"enable_for": "Enable for",
@@ -102,6 +110,7 @@
"farthest": "Farthest",
"fight_time": "Fight Time",
"filter": "Filter",
"filter_mode": "Filter Mode",
"first": "First",
"first_hit": "First Hit",
"flinch_count": "Flinch Count",
@@ -120,6 +129,7 @@
"hide_ailments_with_zero_buildup": "Hide Ailments when Buildup is 0",
"hide_all_active_ailments": "Hide All Active Ailments",
"hide_all_inactive_ailments": "Hide All Inactive Ailments",
"hide_bar_for_infinite_buffs": "Hide Bar for infinite Buffs",
"hide_dead_or_captured": "Hide Dead or Captured",
"hide_disabled_ailments": "Hide Disabled Ailments by Game",
"hide_inactive_ailments_with_no_buildup_support": "Hide Inactive Ailments with no Buildup Support",
@@ -128,15 +138,18 @@
"hide_myself": "Hide Myself",
"hide_other_players": "Hide Other Players",
"hide_player_if_player_damage_is_zero": "Hide Player if Player Damage is 0",
"hide_servants": "Hide Followers",
"hide_timer_for_infinite_buffs": "Hide Timer for infinite Buffs",
"hide_total_damage": "Hide Total Damage",
"hide_total_if_total_damage_is_zero": "Hide Total if Total Damage is 0",
"hide_undamaged_parts": "Hide Undamaged Parts",
"highest_health": "Highest Health",
"highest_health_percentage": "Highest Health Percentage",
"highlighted": "Highlighted (targeted)",
"highlighted": "Highlighted",
"highlighted_bar": "Highlighted Bar",
"highlighted_buildup_bar": "Highlighted Buildup Bar",
"highlighted_damage_bar": "Highlighted Damage Bar",
"highlighted_targeted": "Highlighted (targeted)",
"horizontal": "Horizontal",
"hotkeys": "Hotkeys",
"hunter_rank": "Hunter Rank",
@@ -158,6 +171,8 @@
"large_monster_static_UI": "Large Monster Static UI",
"large_monsters": "Large Monsters",
"last": "Last",
"level": "Level",
"level_label": "Level Label",
"loading_quest": "Loading Quest",
"loss_health": "Sever Health",
"loss_health_percentage": "Sever Health Percentage",
@@ -166,6 +181,7 @@
"master_rank": "Master Rank",
"max_distance": "Max Distance",
"max_monster_updates_per_tick": "Max Monster Updates per Tick",
"max_value": "Max Value",
"me": "Me",
"menu_font": "Menu Font",
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
@@ -180,7 +196,11 @@
"monster_name": "Monster Name",
"monster_name_label": "Monster Name Label",
"my_damage_bar_location": "My Damage Bar Location",
"my_otomos": "My Buddies",
"myself": "Myself",
"name": "Name",
"name_label": "Name Label",
"new": "New",
"none": "None",
"normal": "Normal",
"offset": "Offset",
@@ -188,6 +208,7 @@
"opacity_falloff": "Opacity Falloff",
"orientation": "Orientation",
"other_damage": "Other Damage",
"other_player_otomos": "Other Player Buddies",
"other_players": "Other Players",
"otomo_damage": "Buddy Damage",
"outline": "Outline",
@@ -214,17 +235,21 @@
"rage": "Rage",
"reframework_outdated": "Installed REFramework version is outdated. Please, update. Otherwise, MHR Overlay won't work correctly.",
"relative_offset": "Relative Offset",
"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 Buddies",
"servants": "Followers",
"settings": "Settings",
"severe_filter": "Severe",
"shadow": "Shadow",
"show_followers_separately": "Show Followers separately",
"show_my_otomos_separately": "Show my Buddies separately",
"show_other_otomos_separately": "Show other Buddies separately",
"show_my_otomos_separately": "Show My Buddies separately",
"show_other_player_otomos_separately": "Show Other Player Buddies separately",
"show_servant_otomos_separately": "Show Follower Buddies separately",
"size": "Size",
"small_monster_UI": "Small Monster UI",
"small_monsters": "Small Monsters",
@@ -244,12 +269,14 @@
"time_UI": "Time UI",
"time_label": "Time Label",
"time_limit": "Time Limit (seconds)",
"timer": "Timer",
"timer_label": "Timer Label",
"top_buildup": "Top Buildup",
"top_damage": "Top Damage",
"top_dps": "Top DPS",
"top_left": "Top-Left",
"top_right": "Top-Right",
"total": "Total",
"total_buildup": "Total Buildup",
"total_buildup_label": "Total Buildup Label",
"total_buildup_value_label": "Total Buildup Value Label",
@@ -279,6 +306,7 @@
"font_name": "NotoSansKR-Bold.otf",
"parts": {
"abdomen": "Abdomen",
"amatsu_unknown": "?",
"antenna": "Antenna",
"arms": "Arms",
"arms_mud": "Arms (Mud)",

View File

@@ -65,6 +65,7 @@
"break_health_percentage": "部位破壊までのダメージ状況()",
"break_max_count": "最大破壊数",
"break_severe_filter": "Break + Severe",
"buff_UI": "Buff UI",
"buildup": "蓄積値",
"buildup_bar": "蓄積値バー",
"buildup_bars_are_relative_to": "相対的な蓄積バー",
@@ -78,9 +79,12 @@
"closest": "Closest",
"color": "カラー",
"colors": "カラー",
"config": "Config",
"creature_name_label": "モンスターの名前ラベル",
"crown": "王冠",
"crown_thresholds": "王冠の閾値",
"current_state": "Current State",
"current_value": "Current Value",
"cutscene": "Cutscene",
"damage": "ダメージ",
"damage_bar": "ダメージバー",
@@ -88,10 +92,14 @@
"damage_meter_UI": "ダメージメーターUI",
"damage_percentage_label": "ダメージ割合()ラベル",
"damage_value_label": "ダメージラベル",
"default_state": "Default State",
"delete": "Delete",
"distance": "距離",
"dps": "DPS",
"dps_label": "DPSラベル",
"dps_mode": "DPS モード",
"duplicate": "Duplicate",
"duration": "Duration",
"dynamic_positioning": "動的な場所",
"dynamically_positioned": "モンスターに追随して表示",
"enable_for": "有効にする",
@@ -102,6 +110,7 @@
"farthest": "Farthest",
"fight_time": "戦闘時間",
"filter": "フィルター",
"filter_mode": "Filter Mode",
"first": "最初",
"first_hit": "初撃",
"flinch_count": "ひるみ回数",
@@ -120,6 +129,7 @@
"hide_ailments_with_zero_buildup": "蓄積値がゼロの時に状態異常の表示を隠す",
"hide_all_active_ailments": "全ての有効な状態異常を隠す",
"hide_all_inactive_ailments": "全ての無効な状態異常を隠す",
"hide_bar_for_infinite_buffs": "Hide Bar for infinite Buffs",
"hide_dead_or_captured": "討伐済み、または捕獲済みも表示する",
"hide_disabled_ailments": "無効な状態異常を隠す",
"hide_inactive_ailments_with_no_buildup_support": "累積値がなく、非活性な異常状態を隠す",
@@ -128,15 +138,18 @@
"hide_myself": "自分自身の表示を隠す",
"hide_other_players": "ほかのプレイヤーの表示を隠す",
"hide_player_if_player_damage_is_zero": "プレイヤーのダメージが0の場合、プレイヤーの表示を隠す",
"hide_servants": "Hide Followers",
"hide_timer_for_infinite_buffs": "Hide Timer for infinite Buffs",
"hide_total_damage": "合計ダメージの表示を隠す",
"hide_total_if_total_damage_is_zero": "合計ダメージが0の場合、合計の表示を隠す",
"hide_undamaged_parts": "攻撃していない部位の表示を隠す",
"highest_health": "Highest Health",
"highest_health_percentage": "Highest Health Percentage",
"highlighted": "詳細表示 (ターゲット)",
"highlighted": "詳細表示",
"highlighted_bar": "ハイライトされたバー",
"highlighted_buildup_bar": "ハイライトされた蓄積値バー",
"highlighted_damage_bar": "ハイライトされたダメージバー",
"highlighted_targeted": "詳細表示 (ターゲット)",
"horizontal": "水平",
"hotkeys": "ホットキー",
"hunter_rank": "ハンターランク",
@@ -158,6 +171,8 @@
"large_monster_static_UI": "大型モンスターのスタティック表示UI",
"large_monsters": "大型モンスター",
"last": "最後",
"level": "Level",
"level_label": "Level Label",
"loading_quest": "Loading Quest",
"loss_health": "尻尾切断までの体力",
"loss_health_percentage": "尻尾切断までの体力()",
@@ -166,6 +181,7 @@
"master_rank": "マスターランク",
"max_distance": "最大距離",
"max_monster_updates_per_tick": "モンスター情報をアップデートする間隔",
"max_value": "Max Value",
"me": "自分",
"menu_font": "メニューで使うフォント",
"menu_font_change_disclaimer": "言語とメニューのフォントサイズを何度も変更すると、クラッシュが発生します。",
@@ -180,7 +196,11 @@
"monster_name": "モンスター名",
"monster_name_label": "モンスター名ラベル",
"my_damage_bar_location": "自身のダメージバーの場所",
"my_otomos": "My Buddies",
"myself": "Myself",
"name": "Name",
"name_label": "Name Label",
"new": "New",
"none": "設定なし",
"normal": "標準",
"offset": "基準点からの位置",
@@ -188,6 +208,7 @@
"opacity_falloff": "透明度を上げる",
"orientation": "並べ方",
"other_damage": "その他のダメージ",
"other_player_otomos": "Other Player Buddies",
"other_players": "他のプレイヤー",
"otomo_damage": "オトモのダメージ",
"outline": "Outline",
@@ -214,17 +235,21 @@
"rage": "怒り値",
"reframework_outdated": "Installed REFramework version is outdated. Please, update. Otherwise, MHR Overlay won't work correctly.",
"relative_offset": "相対的な表示位置",
"rename": "Rename",
"render_highlighted_monster": "ハイライトされたモンスターをレンダリング(表示)する",
"render_not_highlighted_monsters": "ハイライトされていないモンスターをレンダリング(表示)する",
"renderer": "Renderer",
"reset": "Reset",
"reversed_order": "逆順",
"reward_screen": "Reward Screen",
"servant_otomos": "Servant Buddies",
"servants": "Followers",
"settings": "設定",
"severe_filter": "Severe",
"shadow": "影",
"show_followers_separately": "Show Followers separately",
"show_my_otomos_separately": "Show my Buddies separately",
"show_other_otomos_separately": "Show other Buddies separately",
"show_other_player_otomos_separately": "Show Other Player Buddies separately",
"show_servant_otomos_separately": "Show Follower Buddies separately",
"size": "サイズ",
"small_monster_UI": "小型モンスターUI",
"small_monsters": "小型モンスター",
@@ -244,12 +269,14 @@
"time_UI": "タイムUI",
"time_label": "タイムラベル",
"time_limit": "タイムリミット(s.)",
"timer": "Timer",
"timer_label": "タイマーラベル",
"top_buildup": "最高蓄積値",
"top_damage": "最高ダメージ",
"top_dps": "最高DPS",
"top_left": "左上",
"top_right": "右上",
"total": "Total",
"total_buildup": "蓄積合計",
"total_buildup_label": "合計蓄積ラベル",
"total_buildup_value_label": "合計蓄積値ラベル",
@@ -279,6 +306,7 @@
"font_name": "NotoSansJP-Bold.otf",
"parts": {
"abdomen": "腹部",
"amatsu_unknown": "?",
"antenna": "触角",
"arms": "腕",
"arms_mud": "腕(泥)",

View File

@@ -4,12 +4,12 @@
"buildup": "누적치:",
"gold": "금관",
"mini": "최소",
"otomo": "Buddy",
"otomo": "동반자",
"part_break": "파괴",
"part_sever": "절단",
"player": "헌터",
"rage": "분노:",
"servant": "Follower",
"servant": "맹우",
"silver": "은관",
"stamina": "스태미나:",
"total_buildup": "총 누적치",
@@ -52,7 +52,7 @@
"assign_new_key": "새 키를 할당",
"auto_highlight": "자동 타겟 설정",
"background": "배경색",
"bar": "",
"bar": "막대",
"blast_damage": "폭파 대미지",
"body_parts": "부위",
"bold": "굵게",
@@ -65,9 +65,10 @@
"break_health_percentage": "파괴 수치 비율",
"break_max_count": "최대 파괴 횟수",
"break_severe_filter": "파괴 + 절단",
"buff_UI": "버프 UI",
"buildup": "누적치",
"buildup_bar": "누적치 ",
"buildup_bars_are_relative_to": "기준으로 누적치 ",
"buildup_bar": "누적치 막대",
"buildup_bars_are_relative_to": "기준으로 누적치 막대",
"buildup_percentage": "누적치 비율",
"buildup_percentage_label": "누적치 비율 정보",
"buildup_value_label": "누적치 값 정보",
@@ -78,20 +79,27 @@
"closest": "가장 가까운",
"color": "색상",
"colors": "색상",
"config": "설정",
"creature_name_label": "환경생물 이름 정보",
"crown": "금관",
"crown_thresholds": "금관 판정값",
"cutscene": "Cutscene",
"current_state": "Current State",
"current_value": "Current Value",
"cutscene": "컷신",
"damage": "대미지",
"damage_bar": "대미지 ",
"damage_bars_are_relative_to": "기준으로 대미지 바",
"damage_bar": "대미지 막대",
"damage_bars_are_relative_to": "대미지 막대 순서",
"damage_meter_UI": "대미지 미터 UI",
"damage_percentage_label": "대미지 비율 정보",
"damage_value_label": "대미지 값 정보",
"distance": "거리",
"default_state": "Default State",
"delete": "삭제하기",
"distance": "간격",
"dps": "DPS",
"dps_label": "DPS 정보",
"dps_mode": "DPS 모드",
"duplicate": "복제하기",
"duration": "지속시간",
"dynamic_positioning": "유동 위치",
"dynamically_positioned": "유동 위치 UI",
"enable_for": "표시 대상",
@@ -102,11 +110,12 @@
"farthest": "가장 멀리있는",
"fight_time": "전투 시간",
"filter": "필터",
"first": "처음",
"filter_mode": "Filter Mode",
"first": "맨 앞",
"first_hit": "첫 공격",
"flinch_count": "경직 횟수",
"foreground": "전경색",
"freeze_dps_on_quest_end": "Freeze DPS on Quest End",
"freeze_dps_on_quest_end": "퀘스트 종료시 DPS 멈춤",
"global_position_modifier": "전역 위치 배율",
"global_scale_modifier": "전역 크기 배율",
"global_settings": "전역 설정",
@@ -117,48 +126,54 @@
"health_percentage": "체력 비율",
"health_severe_filter": "체력 + 절단",
"height": "높이",
"hide_ailments_with_zero_buildup": "누적치가 0이면 상태이상 숨김",
"hide_all_active_ailments": "걸린 상태이상 모두 숨김",
"hide_all_inactive_ailments": "걸리지 않은 상태이상 모두 숨김",
"hide_dead_or_captured": "토벌되거나 포획되면 숨김",
"hide_disabled_ailments": "비활성화된 상태이상 숨김",
"hide_inactive_ailments_with_no_buildup_support": "누적치가 없고 걸리지 않은 상태이상 숨김",
"hide_inactive_creatures": "쿨타임인 환경생물 숨김",
"hide_module_if_total_damage_is_zero": "총 대미지가 0이면 UI 숨김",
"hide_myself": "내 정보 숨김",
"hide_other_players": "다른 헌터 정보 숨김",
"hide_player_if_player_damage_is_zero": "헌터 대미지가 0이면 헌터 숨김",
"hide_total_damage": "모든 대미지 숨김",
"hide_total_if_total_damage_is_zero": "총 대미지가 0이면 모두 숨김이 높은",
"hide_undamaged_parts": "피해를 입히지 않은 부위 숨김",
"hide_ailments_with_zero_buildup": "누적치가 0이면 상태이상 표시 안 함",
"hide_all_active_ailments": "걸린 상태이상 모두 표시 안 함",
"hide_all_inactive_ailments": "걸리지 않은 상태이상 모두 표시 안 함",
"hide_bar_for_infinite_buffs": "무한 버프의 막대는 표시 안 함",
"hide_dead_or_captured": "토벌되거나 포획되면 표시 안 함",
"hide_disabled_ailments": "비활성화된 상태이상 표시 안 함",
"hide_inactive_ailments_with_no_buildup_support": "누적치가 없고 걸리지 않은 상태이상 표시 안 함",
"hide_inactive_creatures": "쿨타임인 환경생물 표시 안 함",
"hide_module_if_total_damage_is_zero": "총 대미지가 0이면 UI 표시 안 함",
"hide_myself": "내 정보 표시 안 함",
"hide_other_players": "다른 헌터 정보 표시 안 함",
"hide_player_if_player_damage_is_zero": "헌터 대미지가 0이면 헌터 표시 안 함",
"hide_servants": "맹우 표시 안 함",
"hide_timer_for_infinite_buffs": "무한 버프는 표시 안 함",
"hide_total_damage": "모든 대미지 표시 안 함",
"hide_total_if_total_damage_is_zero": "총 대미지가 0이면 모두 표시 안 함",
"hide_undamaged_parts": "피해를 입히지 않은 부위 표시 안 함",
"highest_health": "가장 체력이 높은",
"highest_health_percentage": "가장 체력 비율이 높은",
"highlighted": "타겟이 된 몬스터 표시",
"highlighted_bar": "타겟이 된 몬스터 ",
"highlighted_buildup_bar": "타겟이 된 몬스터 누적치 ",
"highlighted_damage_bar": "타겟이 된 몬스터 대미지 ",
"highlighted": "주시대상",
"highlighted_bar": "주시대상 몬스터 막대",
"highlighted_buildup_bar": "주시대상 몬스터 누적치 막대",
"highlighted_damage_bar": "주시대상 몬스터 대미지 막대",
"highlighted_targeted": "주시대상 몬스터 표시",
"horizontal": "가로",
"hotkeys": "단축키",
"hunter_rank": "헌터 랭크",
"hunter_rank_label": "헌터 랭크 정보",
"id": "ID",
"in_lobby": "In Lobby",
"in_training_area": "In Training Area",
"in_lobby": "로비 내",
"in_training_area": "훈련구역 내",
"include": "포함",
"inside": "내부",
"installation_damage": "설비 대미지",
"italic": "기울임",
"join_time": "참가 시간",
"killcam": "Killcam",
"killcam": "처치 영상",
"kunai_damage": "쿠나이 대미지",
"language": "언어",
"large_monster_UI": "대형 몬스터 UI",
"large_monster_dynamic_UI": "대형 몬스터 유동 UI",
"large_monster_highlighted_UI": "타겟이 된 대형 몬스터 UI",
"large_monster_highlighted_UI": "주시대상 대형 몬스터 UI",
"large_monster_static_UI": "대형 몬스터 고정 UI",
"large_monsters": "대형 몬스터",
"last": "마지막",
"loading_quest": "Loading Quest",
"last": "맨 뒤",
"level": "레벨",
"level_label": "레벨 정보",
"loading_quest": "퀘스트 로딩 중",
"loss_health": "절단 수치",
"loss_health_percentage": "절단 수치 비율",
"lowest_health": "가장 체력이 낮은",
@@ -166,28 +181,34 @@
"master_rank": "마스터 랭크",
"max_distance": "최대 거리",
"max_monster_updates_per_tick": "틱당 최대 몬스터 갱신 횟수",
"max_value": "Max Value",
"me": "나",
"menu_font": "메뉴 글꼴",
"menu_font_change_disclaimer": "언어 및 메뉴 글꼴 크기를 여러 번 변경하면 비정상 종료가 될 수 있습니다!",
"mod_name": "MHR Overlay",
"mode": "모드",
"modifiers": "설정 배율",
"module_visibility_based_on_game_state": "Module Visibility based on Game State",
"module_visibility_based_on_game_state": "게임 상태에 따라 모듈 표시",
"modules": "UI",
"monster_can_be_captured": "몬스터 포획 가능",
"monster_damage": "몬스터 대미지",
"monster_id": "Monster ID",
"monster_id": "몬스터 ID",
"monster_name": "몬스터명",
"monster_name_label": "몬스터명 정보",
"my_damage_bar_location": "내 대미지 위치",
"name": "Name",
"my_damage_bar_location": "내 대미지 막대 위치",
"my_otomos": "내 동반자",
"myself": "나",
"name": "이름",
"name_label": "이름 정보",
"new": "새",
"none": "없음",
"normal": "보통",
"offset": "거리",
"offset_is_relative_to_parts": "거리를 부위 기준으로",
"normal": "기본",
"offset": "오프셋",
"offset_is_relative_to_parts": "오프셋을 부위 기준으로",
"opacity_falloff": "투명도 감소",
"orientation": "방향",
"other_damage": "기타 대미지",
"other_player_otomos": "다른 플레이어 동반자",
"other_players": "다른 헌터",
"otomo_damage": "동반자 대미지",
"outline": "외곽선",
@@ -201,30 +222,34 @@
"player_name_label": "헌터명 정보",
"player_name_size_limit": "헌터명 크기 제한",
"player_spacing": "플레이어 간격",
"playing_quest": "Playing Quest",
"playing_quest": "퀘스트 중",
"poison_damage": "독 대미지",
"position": "위치",
"press_any_key": "설정할 키를 누르세요...",
"prioritize_large_monsters": "대형 몬스터를 우선적으로",
"quest_end_animation": "Quest End Animation",
"quest_end_screen": "Quest End Screen",
"quest_end_timer": "Quest End Timer",
"quest_start_animation": "Quest Start Animation",
"quest_end_animation": "퀘스트 종료 영상",
"quest_end_screen": "퀘스트 종료 화면",
"quest_end_timer": "퀘스트 종료 타이머",
"quest_start_animation": "퀘스트 시작 영상",
"quest_time": "퀘스트 시간",
"rage": "분노",
"reframework_outdated": "설치된 REFramework가 구버전입니다. 업데이트 하지 않으면 MHR Overlay가 제대로 동작하지 않을 수 있습니다.",
"relative_offset": "상대적 위치 거리",
"render_highlighted_monster": "타겟이 된 몬스터 표시",
"render_not_highlighted_monsters": "타겟이 아닌 몬스터 표시",
"renderer": "Renderer",
"relative_offset": "상대적 위치 오프셋",
"rename": "이름 변경",
"render_highlighted_monster": "주시대상 몬스터 표시",
"render_not_highlighted_monsters": "주시대상이 아닌 아닌 몬스터 표시",
"renderer": "렌더링",
"reset": "리셋",
"reversed_order": "역순",
"reward_screen": "Reward Screen",
"reward_screen": "보상 화면",
"servant_otomos": "맹우 동반자",
"servants": "맹우",
"settings": "설정",
"severe_filter": "절단",
"shadow": "그림자",
"show_followers_separately": "Show Followers separately",
"show_my_otomos_separately": "Show my Buddies separately",
"show_other_otomos_separately": "Show other Buddies separately",
"show_my_otomos_separately": "내 동반자를 따로",
"show_other_player_otomos_separately": "다른 플레이어의 동반자를 따로",
"show_servant_otomos_separately": "맹우의 동반자를 따로",
"size": "크기",
"small_monster_UI": "소형 몬스터 UI",
"small_monsters": "소형 몬스터",
@@ -238,39 +263,41 @@
"statically_positioned": "고정 위치 UI",
"status": "상태",
"style": "스타일",
"summary_screen": "Summary Screen",
"summary_screen": "결과 요약 화면",
"text_label": "텍스트 정보",
"thickness": "두께",
"time_UI": "시간 UI",
"time_label": "시간 정보",
"time_limit": "시간 제한 (단위: 초)",
"timer": "타이머",
"timer_label": "타이머 정보",
"top_buildup": "총 누적치",
"top_damage": "최고 대미지",
"top_dps": "최고 DPS",
"top_left": "좌상단",
"top_right": "우상단",
"total": "전체",
"total_buildup": "총 누적치",
"total_buildup_label": "총 누적치 정보",
"total_buildup_value_label": "총 누적치 값 정보",
"total_cart_count_label": "Total Cart Count Label",
"total_cart_count_label": "총 수레 횟수 정보",
"total_damage": "총 대미지",
"total_damage_label": "총 대미지 정보",
"total_damage_location": "Total Damage Bar Location",
"total_damage_offset_is_relative": "총 대미지 거리를 상대적 값으로",
"total_damage_location": "총 대미지 막대 위치",
"total_damage_offset_is_relative": "총 대미지 오프셋을 상대적 값으로",
"total_damage_value_label": "총 대미지 값 정보",
"total_dps": "총 DPS",
"total_dps_label": "총 DPS 정보",
"tracked_damage_types": "추적할 대미지 종류",
"tracked_monster_types": "추적할 몬스터 타입",
"type": "순으로",
"use_d2d_if_available": "Use Direct2D if available",
"type": "종류",
"use_d2d_if_available": "가능한 Direct2D를 사용함",
"value_label": "값 정보",
"vertical": "세로",
"viewport_offset": "뷰포트 거리",
"viewport_offset": "뷰포트 오프셋",
"visible": "표시함",
"width": "너비",
"world_offset": "전역 거리",
"world_offset": "전역 오프셋",
"wyvern_riding_damage": "용조종 대미지",
"x": "X",
"y": "Y",
@@ -279,6 +306,7 @@
"font_name": "NotoSansKR-Bold.otf",
"parts": {
"abdomen": "배",
"amatsu_unknown": "?",
"antenna": "더듬이",
"arms": "팔",
"arms_mud": "팔(진흙)",
@@ -335,7 +363,7 @@
"tail_mud": "꼬리(진흙)",
"tail_tip": "꼬리끝",
"tail_windsac": "꼬리(바람주머니)",
"thundersacs": "Thundersacs",
"thundersacs": "번개주머니",
"torso": "몸통",
"torso_mud": "몸통(진흙)",
"unknown": "?",

View File

@@ -65,6 +65,7 @@
"break_health_percentage": "Повреждение части в процентах",
"break_max_count": "Максимальное кол-во повреждений",
"break_severe_filter": "Повреждение + Отсечение",
"buff_UI": "Интерфейс баффов",
"buildup": "Накопление",
"buildup_bar": "Шкала накопления",
"buildup_bars_are_relative_to": "Шкалы накопления расположены относительно к",
@@ -78,9 +79,12 @@
"closest": "Ближайший",
"color": "Цвет",
"colors": "Цвета",
"config": "Файл конфигурации",
"creature_name_label": "Метка имени существа",
"crown": "Корона",
"crown_thresholds": "Лимиты корон",
"current_state": "Текущее состояние",
"current_value": "Текущее значение",
"cutscene": "Катсцена",
"damage": "Урон",
"damage_bar": "Шкала урона",
@@ -88,10 +92,14 @@
"damage_meter_UI": "Интерфейс модуля урона",
"damage_percentage_label": "Метка урона в процентах",
"damage_value_label": "Метка значений урона",
"default_state": "Состояние по умолчанию",
"delete": "Удалить",
"distance": "Расстояние",
"dps": "Урон в секунду",
"dps_label": "Метка урона в секунду",
"dps_mode": "Режим урона в секунду",
"duplicate": "Дублировать",
"duration": "Продолжительность",
"dynamic_positioning": "Динамическое позиционирование",
"dynamically_positioned": "Рассположенный динамично",
"enable_for": "Показывать для",
@@ -102,6 +110,7 @@
"farthest": "Самый дальний",
"fight_time": "Время в бою",
"filter": "Фильтр",
"filter_mode": "Режим Фильтра",
"first": "Первый",
"first_hit": "Первый удар",
"flinch_count": "Кол-во вздрагиваний",
@@ -120,6 +129,7 @@
"hide_ailments_with_zero_buildup": "Скрыть аномальный статус, если накопление равно 0",
"hide_all_active_ailments": "Скрыть все активные аномальные статусы",
"hide_all_inactive_ailments": "Скрыть все неактивные аномальные статусы",
"hide_bar_for_infinite_buffs": "Скрыть шкалу у бесконечных баффов",
"hide_dead_or_captured": "Скрыть мёртвых и захваченных монстров",
"hide_disabled_ailments": "Скрыть отключенные аномальные статусы",
"hide_inactive_ailments_with_no_buildup_support": "Скрыть неактивные аномальные статусы без поддержки накопления",
@@ -128,6 +138,8 @@
"hide_myself": "Скрыть себя",
"hide_other_players": "Скрыть остальных игроков",
"hide_player_if_player_damage_is_zero": "Скрыть игрока, если его урон равен 0",
"hide_servants": "Скрыть последователей",
"hide_timer_for_infinite_buffs": "Скрыть таймер у бесконечных баффов",
"hide_total_damage": "Скрыть общий урон",
"hide_total_if_total_damage_is_zero": "Скрыть общий урон, если он равен 0",
"hide_undamaged_parts": "Скрыть неповреждённые части тела",
@@ -137,6 +149,7 @@
"highlighted_bar": "Помеченная шкала",
"highlighted_buildup_bar": "Помеченная шкала накопления",
"highlighted_damage_bar": "Помеченная шкала урона",
"highlighted_targeted": "Помеченный",
"horizontal": "Горизонтально",
"hotkeys": "Горячие клавиши",
"hunter_rank": "Ранг охотника",
@@ -158,6 +171,8 @@
"large_monster_static_UI": "Статический интерфейс больших монстров",
"large_monsters": "Большие монстры",
"last": "Последний",
"level": "Уровень",
"level_label": "Метка уровня",
"loading_quest": "Загрузка квеста",
"loss_health": "Отсечение части",
"loss_health_percentage": "Отсечение части в процентах",
@@ -166,6 +181,7 @@
"master_rank": "Ранг мастера",
"max_distance": "Макс. расстояние",
"max_monster_updates_per_tick": "Макс. кол-во обновлений за тик",
"max_value": "Максимальное значение",
"me": "Я",
"menu_font": "Шрифт меню",
"menu_font_change_disclaimer": "Изменение языка и размера шрифта меню несколько раз приведёт к вылету!",
@@ -180,7 +196,11 @@
"monster_name": "Имя монстра",
"monster_name_label": "Метка имени монстра",
"my_damage_bar_location": "Позиция моей шкалы урона",
"name": "Name",
"my_otomos": "Мои спутники",
"myself": "Я",
"name": "Имя",
"name_label": "Метка имени",
"new": "Создать",
"none": "Нет",
"normal": "Обычный",
"offset": "Сдвиг",
@@ -188,6 +208,7 @@
"opacity_falloff": "Увеличение прозрачности от расстояния",
"orientation": "Ориентация",
"other_damage": "Другой урон",
"other_player_otomos": "Спутники других игроков",
"other_players": "Другие игроки",
"otomo_damage": "Урон от спутников",
"outline": "Обводка",
@@ -214,17 +235,21 @@
"rage": "Ярость",
"reframework_outdated": "Установленная версия REFramework устарела. Пожалуйста, обновитесь, иначе MHR Overlay будет работать некорректно.",
"relative_offset": "Относительный сдвиг",
"rename": "Переименовать",
"render_highlighted_monster": "Показывать помеченного монстра",
"render_not_highlighted_monsters": "Показывать непомеченных монстров",
"renderer": "Renderer",
"renderer": "Рендерер",
"reset": "Сбросить",
"reversed_order": "Обратный порядок",
"reward_screen": "Экран наград",
"servant_otomos": "Спутники последователей",
"servants": "Последователи",
"settings": "Настройки",
"severe_filter": "Отсечение",
"shadow": "Тень",
"show_followers_separately": "Показывать последователей отдельно",
"show_my_otomos_separately": "Показывать моих спутников отдельно",
"show_other_otomos_separately": "Показывать спутников других игроков отдельно",
"show_other_player_otomos_separately": "Показывать спутников других игроков отдельно",
"show_servant_otomos_separately": "Показывать спутников последователей отдельно",
"size": "Размер",
"small_monster_UI": "Интерфейс малых монстров",
"small_monsters": "Малые монстры",
@@ -244,12 +269,14 @@
"time_UI": "Интерфейс времени",
"time_label": "Метка времени",
"time_limit": "Ограничение по времени (cек.)",
"timer": "Таймер",
"timer_label": "Метка таймера",
"top_buildup": "Наибольшее накопление",
"top_damage": "Наибольший урон",
"top_dps": "Наибольший урон в секунду",
"top_left": "Левый верхний угол",
"top_right": "Правый верхний угол",
"total": "Всего",
"total_buildup": "Общее накопление",
"total_buildup_label": "Метка общего накопления",
"total_buildup_value_label": "Метка значения общего накопления",
@@ -279,6 +306,7 @@
"font_name": "NotoSansKR-Bold.otf",
"parts": {
"abdomen": "Брюхо",
"amatsu_unknown": "?",
"antenna": "Антернна",
"arms": "Передние лапы",
"arms_mud": "Передние лапы (в грязи)",

View File

@@ -4,12 +4,12 @@
"buildup": "积累值:",
"gold": "金冠",
"mini": "小型",
"otomo": "Buddy",
"part_break": "Break",
"part_sever": "Sever",
"otomo": "随从",
"part_break": "部位破坏",
"part_sever": "部位切断",
"player": "玩家",
"rage": "愤怒值:",
"servant": "Follower",
"servant": "盟友",
"silver": "银冠",
"stamina": "耐力:",
"total_buildup": "总积累值",
@@ -48,23 +48,24 @@
"ailments": "状态异常",
"all_UI": "所有UI",
"anchor": "锚点",
"apply": "Apply",
"apply": "应用",
"assign_new_key": "指定新按键",
"auto_highlight": "Auto-highlight",
"auto_highlight": "自动高亮",
"background": "背景",
"bar": "状态条",
"blast_damage": "爆破伤害",
"body_parts": "身体部位",
"bold": "粗体",
"bomb_damage": "炸弹伤害",
"bomb_damage": "爆弹桶伤害",
"bottom_left": "左下",
"bottom_right": "右下",
"break_count": "破坏次数",
"break_filter": "Break",
"break_health": "Break Health",
"break_health_percentage": "Break Health Percentage",
"break_max_count": "Break Max Count",
"break_severe_filter": "Break + Severe",
"break_filter": "破坏",
"break_health": "破坏值",
"break_health_percentage": "破坏值百分比",
"break_max_count": "最大破坏次数",
"break_severe_filter": "破坏+切断",
"buff_UI": "Buff UI",
"buildup": "积累值",
"buildup_bar": "积累值条",
"buildup_bars_are_relative_to": "积累值条基于",
@@ -72,84 +73,96 @@
"buildup_percentage_label": "积累值百分比标签",
"buildup_value_label": "积累值标签",
"capture_line": "可捕捉线",
"cart_count": "Cart Count",
"cart_count_label": "Cart Count Label",
"center": "Center",
"closest": "Closest",
"cart_count": "猫车数",
"cart_count_label": "猫车数标签",
"center": "中央",
"closest": "最近的",
"color": "颜色",
"colors": "颜色",
"config": "设置",
"creature_name_label": "生物名标签",
"crown": "皇冠",
"crown_thresholds": "皇冠阈值",
"cutscene": "Cutscene",
"current_state": "当前阶段",
"current_value": "当前值",
"cutscene": "过场动画",
"damage": "伤害",
"damage_bar": "伤害条",
"damage_bars_are_relative_to": "伤害条基于",
"damage_meter_UI": "伤害统计UI",
"damage_percentage_label": "伤害百分比标签",
"damage_value_label": "伤害量标签",
"default_state": "默认阶段",
"delete": "删除",
"distance": "距离",
"dps": "DPS",
"dps_label": "DPS标签",
"dps_mode": "DPS模式",
"duplicate": "复制",
"duration": "持续时间",
"dynamic_positioning": "动态位置",
"dynamically_positioned": "动态位置",
"enable_for": "开启",
"enabled": "开启",
"endemic_life_UI": "环境生物UI",
"endemic_life_damage": "Endemic Life Damage",
"endemic_life_damage": "环境生物伤害",
"family": "字体",
"farthest": "Farthest",
"farthest": "最远",
"fight_time": "战斗时间",
"filter": "筛选器",
"filter_mode": "筛选方式",
"first": "第一",
"first_hit": "第一击",
"flinch_count": "胆怯次数",
"foreground": "前景",
"freeze_dps_on_quest_end": "Freeze DPS on Quest End",
"freeze_dps_on_quest_end": "任务结束时冻结DPS",
"global_position_modifier": "全局位置更改",
"global_scale_modifier": "全局比例更改",
"global_settings": "全局设定",
"health": "生命",
"health_break_filter": "Health + Break",
"health_break_severe_filter": "Health + Break + Severe",
"health_filter": "Health",
"health_break_filter": "生命+破坏",
"health_break_severe_filter": "生命+破坏+切断",
"health_filter": "生命",
"health_percentage": "生命百分比",
"health_severe_filter": "Health + Severe",
"health_severe_filter": "生命+切断",
"height": "高度",
"hide_ailments_with_zero_buildup": "当积累值为0时隐藏该状态异常",
"hide_all_active_ailments": "隐藏所有激活的状态异常",
"hide_all_inactive_ailments": "隐藏所有没有激活的状态异常",
"hide_bar_for_infinite_buffs": "隐藏无限Buff的状态条",
"hide_dead_or_captured": "隐藏死亡或被捕获的怪物",
"hide_disabled_ailments": "隐藏禁用的状态异常",
"hide_inactive_ailments_with_no_buildup_support": "隐藏无积累值的非激活状态异常",
"hide_inactive_creatures": "隐藏没有激活的生物",
"hide_module_if_total_damage_is_zero": "当总伤害为0时隐藏该模块",
"hide_myself": "Hide Myself",
"hide_other_players": "Hide Other Players",
"hide_myself": "隐藏我自己",
"hide_other_players": "隐藏其他玩家",
"hide_player_if_player_damage_is_zero": "当玩家伤害为0时隐藏该玩家",
"hide_total_damage": "Hide Total Damage",
"hide_servants": "隐藏盟友",
"hide_timer_for_infinite_buffs": "隐藏无限Buff的计时器",
"hide_total_damage": "隐藏总伤害",
"hide_total_if_total_damage_is_zero": "当总伤害为0时隐藏总伤害",
"hide_undamaged_parts": "隐藏没有受到伤害的部位",
"highest_health": "Highest Health",
"highest_health_percentage": "Highest Health Percentage",
"highlighted": "高亮(目标)",
"highest_health": "最高生命值",
"highest_health_percentage": "最高生命百分比",
"highlighted": "高亮",
"highlighted_bar": "高亮条",
"highlighted_buildup_bar": "高亮积累值条",
"highlighted_damage_bar": "高亮伤害条",
"highlighted_targeted": "高亮目标[锁定目标的UI]",
"horizontal": "水平",
"hotkeys": "热键",
"hunter_rank": "猎人等",
"hunter_rank": "猎人等",
"hunter_rank_label": "猎人等级标签",
"id": "ID",
"in_lobby": "In Lobby",
"in_training_area": "In Training Area",
"in_lobby": "在大厅",
"in_training_area": "在修炼场",
"include": "包含",
"inside": "Inside",
"installation_damage": "设伤害",
"inside": "里面",
"installation_damage": "设伤害",
"italic": "斜体",
"join_time": "加入时间",
"killcam": "Killcam",
"killcam": "击杀镜头",
"kunai_damage": "苦无伤害",
"language": "语言",
"large_monster_UI": "大型怪物UI",
@@ -158,73 +171,85 @@
"large_monster_static_UI": "大型怪物固定UI",
"large_monsters": "大型怪物群",
"last": "最后",
"loading_quest": "Loading Quest",
"loss_health": "Sever Health",
"loss_health_percentage": "Sever Health Percentage",
"lowest_health": "Lowest Health",
"lowest_health_percentage": "Lowest Health Percentage",
"master_rank": "Master Rank",
"level": "等级",
"level_label": "等级标签",
"loading_quest": "任务加载中",
"loss_health": "切断值",
"loss_health_percentage": "切断值百分比",
"lowest_health": "最低生命值",
"lowest_health_percentage": "最低生命百分比",
"master_rank": "大师等级",
"max_distance": "最大距离",
"max_monster_updates_per_tick": "每次更新的最大怪物数量",
"max_value": "最大值",
"me": "我",
"menu_font": "菜单字体",
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
"menu_font_change_disclaimer": "多次改变字体或语言会导致崩溃!",
"mod_name": "MHR Overlay",
"mode": "Mode",
"mode": "模式",
"modifiers": "更改项",
"module_visibility_based_on_game_state": "Module Visibility based on Game State",
"module_visibility_based_on_game_state": "基于游戏状态的模组可视化设置",
"modules": "模块",
"monster_can_be_captured": "可捕获的怪物",
"monster_damage": "怪物伤害",
"monster_id": "Monster ID",
"monster_id": "怪物ID",
"monster_name": "怪物名",
"monster_name_label": "怪物名标签",
"my_damage_bar_location": "我的伤害条位置",
"name": "Name",
"my_otomos": "我的随从",
"myself": "我自己",
"name": "名称",
"name_label": "名字标签",
"new": "新建",
"none": "空",
"normal": "正常",
"offset": "偏移",
"offset_is_relative_to_parts": "根据部位偏移",
"opacity_falloff": "透明度增加",
"orientation": "方向",
"other_damage": "Other Damage",
"other_damage": "其他伤害",
"other_player_otomos": "其他玩家的随从",
"other_players": "其他玩家",
"otomo_damage": "随从伤害",
"outline": "Outline",
"outside": "Outside",
"part_health": "Part Health",
"outline": "轮廓",
"outside": "外面",
"part_health": "部位生命值",
"part_name": "部位名",
"part_name_label": "部位名标签",
"percentage_label": "百分比标签",
"performance": "性能",
"player_damage": "玩家伤害",
"player_name_label": "玩家名标签",
"player_name_size_limit": "Player Name Size Limit",
"player_name_size_limit": "玩家名长度限制",
"player_spacing": "玩家间距",
"playing_quest": "Playing Quest",
"playing_quest": "操作界面/正常游玩时",
"poison_damage": "中毒伤害",
"position": "位置",
"press_any_key": "按任意键...",
"prioritize_large_monsters": "大型怪物优先",
"quest_end_animation": "Quest End Animation",
"quest_end_screen": "Quest End Screen",
"quest_end_timer": "Quest End Timer",
"quest_start_animation": "Quest Start Animation",
"quest_end_animation": "任务结束动画",
"quest_end_screen": "任务结束界面",
"quest_end_timer": "任务结束计时器",
"quest_start_animation": "任务开始动画",
"quest_time": "任务时间",
"rage": "愤怒",
"reframework_outdated": "Installed REFramework version is outdated. Please, update. Otherwise, MHR Overlay won't work correctly.",
"reframework_outdated": "已安装的REFramework版本过低请更新。否则MHR Overlay不能正常工作。",
"relative_offset": "相对偏移",
"rename": "重命名",
"render_highlighted_monster": "渲染高亮怪物",
"render_not_highlighted_monsters": "渲染非高亮怪物",
"renderer": "Renderer",
"renderer": "渲染器",
"reset": "重置",
"reversed_order": "逆向排序",
"reward_screen": "Reward Screen",
"reward_screen": "奖励界面",
"servant_otomos": "盟友随从",
"servants": "盟友",
"settings": "设定",
"severe_filter": "Severe",
"severe_filter": "切断",
"shadow": "阴影",
"show_followers_separately": "Show Followers separately",
"show_my_otomos_separately": "Show my Buddies separately",
"show_other_otomos_separately": "Show other Buddies separately",
"show_my_otomos_separately": "分开显示我的随从",
"show_other_player_otomos_separately": "分开显示其他玩家的随从",
"show_servant_otomos_separately": "分开显示盟友的随从",
"size": "大小",
"small_monster_UI": "小型怪物UI",
"small_monsters": "小型怪物群",
@@ -237,26 +262,28 @@
"static_spacing": "固定间距",
"statically_positioned": "固定位置",
"status": "状态",
"style": "Style",
"summary_screen": "Summary Screen",
"style": "样式",
"summary_screen": "总结界面",
"text_label": "文字标签",
"thickness": "Thickness",
"thickness": "粗细度",
"time_UI": "时间UI",
"time_label": "时间标签",
"time_limit": "时间限制(秒)",
"timer": "计时器",
"timer_label": "计时器标签",
"top_buildup": "最高积累值",
"top_damage": "最高伤害",
"top_dps": "最高DPS",
"top_left": "左上",
"top_right": "右上",
"total": "总计",
"total_buildup": "总积累值",
"total_buildup_label": "总积累值标签",
"total_buildup_value_label": "总积累值标签",
"total_cart_count_label": "Total Cart Count Label",
"total_cart_count_label": "总猫车数标签",
"total_damage": "总伤害",
"total_damage_label": "总伤害标签",
"total_damage_location": "Total Damage Bar Location",
"total_damage_location": "总伤害条位置",
"total_damage_offset_is_relative": "总伤害相对偏移",
"total_damage_value_label": "总伤害量标签",
"total_dps": "总DPS",
@@ -264,14 +291,14 @@
"tracked_damage_types": "跟踪的伤害类型",
"tracked_monster_types": "跟踪的怪物类型",
"type": "类型",
"use_d2d_if_available": "Use Direct2D if available",
"use_d2d_if_available": "可用时使用Direct2D",
"value_label": "数字",
"vertical": "垂直",
"viewport_offset": "窗口偏移",
"visible": "可见",
"width": "宽度",
"world_offset": "整体偏移",
"wyvern_riding_damage": "Wyvern Riding Damage",
"wyvern_riding_damage": "御龙伤害",
"x": "X轴",
"y": "Y轴",
"z": "Z轴"
@@ -279,70 +306,71 @@
"font_name": "NotoSansSC-Bold.otf",
"parts": {
"abdomen": "腹部",
"antenna": "Antenna",
"amatsu_unknown": "?",
"antenna": "触角",
"arms": "手臂",
"arms_mud": "Arms (Mud)",
"arms_mud": "手臂(泥)",
"back": "背部",
"back_windsac": "背部(风袋)",
"body": "本体",
"body_mud": "Body (Mud)",
"body_mud": "身体(泥)",
"carapace": "甲壳",
"chest": "Chest",
"chest": "胸部",
"chest_windsac": "胸部(风袋)",
"claw": "爪",
"crest": "Crest",
"crest": "头冠",
"dorsal_fin": "背鳍",
"foreleg": "Foreleg",
"forelegs": "Forelegs",
"foreleg": "前腿",
"forelegs": "前腿",
"head": "头部",
"head_mud": "头部(泥)",
"hind_leg": "Hind Leg",
"hind_legs": "Hind Legs",
"hind_leg": "后腿",
"hind_legs": "后腿",
"large_mudbulb": "大泥球",
"left_arm": "左臂",
"left_arm_ice": "左臂(冰)",
"left_claw": "Left Claw",
"left_claw": "左爪",
"left_cutwing": "左刃翼",
"left_foreleg": "Foreleg L",
"left_hind_leg": "Hind Leg L",
"left_foreleg": "左前腿",
"left_hind_leg": "左后腿",
"left_leg": "左腿",
"left_leg_mud": "Leg L (Mud)",
"left_legs": "左腿",
"left_leg_mud": "左腿(泥)",
"left_legs": "左腿",
"left_wing": "左翼",
"left_wingclaw": "Wingclaw L",
"left_wingclaw": "左翼爪",
"legs": "四肢",
"lower_back": "下背部",
"lower_body": "下半身",
"mane": "鬃毛",
"mudbulb": "Mudbulb",
"mudbulb": "泥球",
"neck": "颈部",
"rear": "臀部",
"right_arm": "右臂",
"right_arm_ice": "右臂(冰)",
"right_claw": "Right Claw",
"right_claw": "右爪",
"right_cutwing": "右刃翼",
"right_foreleg": "Foreleg R",
"right_hind_leg": "Hind Leg R",
"right_foreleg": "右前腿",
"right_hind_leg": "右后腿",
"right_leg": "右腿",
"right_leg_mud": "Leg R (Mud)",
"right_legs": "右腿",
"right_leg_mud": "右腿(泥)",
"right_legs": "右腿",
"right_wing": "右翼",
"right_wingclaw": "Wingclaw R",
"right_wingclaw": "右翼爪",
"rock": "岩石",
"shell": "Shell",
"shell": "",
"spinning": "旋转中",
"tail": "尾巴",
"tail_mud": "尾巴(泥)",
"tail_tip": "Tail Tip",
"tail_tip": "尾尖",
"tail_windsac": "尾巴(风袋)",
"thundersacs": "Thundersacs",
"thundersacs": "雷袋",
"torso": "躯干",
"torso_mud": "Torso (Mud)",
"unknown": "?",
"upper_back": "上背",
"torso_mud": "躯干(泥)",
"unknown": "未知【等待更新】",
"upper_back": "上背",
"upper_body": "上半身",
"wingclaw": "Wingclaw",
"wingclaws": "Wingclaws",
"wingclaw": "翼爪",
"wingclaws": "翼爪",
"wings": "翼"
}
}

View File

@@ -65,6 +65,7 @@
"break_health_percentage": "Break Health Percentage",
"break_max_count": "Break Max Count",
"break_severe_filter": "Break + Severe",
"buff_UI": "Buff UI",
"buildup": "累積值",
"buildup_bar": "累積值條",
"buildup_bars_are_relative_to": "累積值條顯示位置調整",
@@ -78,9 +79,12 @@
"closest": "最近的",
"color": "調色盤",
"colors": "調色盤",
"config": "Config",
"creature_name_label": "環境生物名稱",
"crown": "皇冠",
"crown_thresholds": "皇冠的大小判定範圍",
"current_state": "Current State",
"current_value": "Current Value",
"cutscene": "Cutscene",
"damage": "傷害",
"damage_bar": "傷害條",
@@ -88,10 +92,14 @@
"damage_meter_UI": "傷害量計算 UI",
"damage_percentage_label": "傷害量百分比",
"damage_value_label": "傷害量",
"default_state": "Default State",
"delete": "Delete",
"distance": "距離",
"dps": "DPS",
"dps_label": "DPS文字",
"dps_mode": "DPS模式",
"duplicate": "Duplicate",
"duration": "Duration",
"dynamic_positioning": "浮動的資訊位置",
"dynamically_positioned": "浮動的魔物資訊",
"enable_for": "啟用對象",
@@ -102,6 +110,7 @@
"farthest": "最遠的",
"fight_time": "戰鬥時間",
"filter": "篩選器",
"filter_mode": "Filter Mode",
"first": "第一",
"first_hit": "第一擊",
"flinch_count": "膽怯次數",
@@ -120,6 +129,7 @@
"hide_ailments_with_zero_buildup": "當累積值為0時,隱藏該異常狀態",
"hide_all_active_ailments": "隱藏觸發中的異常狀態",
"hide_all_inactive_ailments": "隱藏尚未被觸發的異常狀態",
"hide_bar_for_infinite_buffs": "Hide Bar for infinite Buffs",
"hide_dead_or_captured": "隱藏死亡或被捕獲的魔物",
"hide_disabled_ailments": "隱藏並停用所有異常狀態",
"hide_inactive_ailments_with_no_buildup_support": "隱藏無累積值的非觸發下異常狀態",
@@ -128,15 +138,18 @@
"hide_myself": "隱藏自己",
"hide_other_players": "隱藏其他玩家",
"hide_player_if_player_damage_is_zero": "當玩家傷害為0時,隱藏玩家傷害",
"hide_servants": "Hide Followers",
"hide_timer_for_infinite_buffs": "Hide Timer for infinite Buffs",
"hide_total_damage": "隱藏總傷害",
"hide_total_if_total_damage_is_zero": "當總傷害為0時,隱藏總傷害",
"hide_undamaged_parts": "隱藏沒受到傷害的部位",
"highest_health": "最高血量",
"highest_health_percentage": "最高血量百分比",
"highlighted": "鎖定的魔物資訊(目標)",
"highlighted": "鎖定的魔物資訊",
"highlighted_bar": "重點條",
"highlighted_buildup_bar": "重點累積條",
"highlighted_damage_bar": "重點傷害條",
"highlighted_targeted": "鎖定的魔物資訊(目標)",
"horizontal": "水平",
"hotkeys": "快捷鍵",
"hunter_rank": "獵人等級",
@@ -158,6 +171,8 @@
"large_monster_static_UI": "大型魔物固定 UI",
"large_monsters": "大型魔物群",
"last": "最後",
"level": "Level",
"level_label": "Level Label",
"loading_quest": "Loading Quest",
"loss_health": "Sever Health",
"loss_health_percentage": "Sever Health Percentage",
@@ -166,6 +181,7 @@
"master_rank": "大師等級",
"max_distance": "最大距離",
"max_monster_updates_per_tick": "每次更新的最大魔物數量",
"max_value": "Max Value",
"me": "我",
"menu_font": "選單字體大小",
"menu_font_change_disclaimer": "重複變更語言和選單字型大小有可能會當機!",
@@ -180,7 +196,11 @@
"monster_name": "魔物名稱",
"monster_name_label": "魔物名稱",
"my_damage_bar_location": "我的傷害條",
"my_otomos": "My Buddies",
"myself": "Myself",
"name": "Name",
"name_label": "Name Label",
"new": "New",
"none": "空",
"normal": "正常",
"offset": "位置",
@@ -188,6 +208,7 @@
"opacity_falloff": "透明度提高",
"orientation": "對齊方式",
"other_damage": "其他傷害",
"other_player_otomos": "Other Player Buddies",
"other_players": "其他玩家",
"otomo_damage": "隨從傷害",
"outline": "描邊",
@@ -214,17 +235,21 @@
"rage": "憤怒度",
"reframework_outdated": "已安裝的 REFramework 版本已過期. 麻煩請更新版本, 否則 MHR Overlay 無法正確作用.",
"relative_offset": "相對偏移",
"rename": "Rename",
"render_highlighted_monster": "渲染目標魔物",
"render_not_highlighted_monsters": "渲染非目標魔物",
"renderer": "Renderer",
"reset": "Reset",
"reversed_order": "反向排序",
"reward_screen": "Reward Screen",
"servant_otomos": "Servant Buddies",
"servants": "Followers",
"settings": "設定",
"severe_filter": "Severe",
"shadow": "陰影",
"show_followers_separately": "Show Followers separately",
"show_my_otomos_separately": "Show my Buddies separately",
"show_other_otomos_separately": "Show other Buddies separately",
"show_other_player_otomos_separately": "Show Other Player Buddies separately",
"show_servant_otomos_separately": "Show Follower Buddies separately",
"size": "大小",
"small_monster_UI": "小型魔物 UI",
"small_monsters": "小型魔物群",
@@ -244,12 +269,14 @@
"time_UI": "時間 UI",
"time_label": "時間",
"time_limit": "時限 (秒)",
"timer": "Timer",
"timer_label": "計時器",
"top_buildup": "最高累積值",
"top_damage": "最高傷害",
"top_dps": "最高 DPS",
"top_left": "左上",
"top_right": "右上",
"total": "Total",
"total_buildup": "總累積值",
"total_buildup_label": "總累積值文字",
"total_buildup_value_label": "總累積值數值文字",
@@ -279,6 +306,7 @@
"font_name": "NotoSansTC-Bold.otf",
"parts": {
"abdomen": "腹部",
"amatsu_unknown": "?",
"antenna": "觸角",
"arms": "手臂",
"arms_mud": "手臂 (泥)",