mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 12:28:03 -08:00
Part Break/Sever implemented. Fallback to default renderer if d2d is not available.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
local debug = false;
|
||||
xy = "";
|
||||
|
||||
local keyboard = require("MHR_Overlay.Game_Handler.keyboard");
|
||||
@@ -92,6 +93,353 @@ log.info("[MHR Overlay] loaded");
|
||||
-- #endregion
|
||||
------------------------INIT MODULES-------------------------
|
||||
|
||||
----------------------------LOOP-----------------------------
|
||||
-- #region
|
||||
local function main_loop()
|
||||
customization_menu.status = "OK";
|
||||
singletons.init();
|
||||
screen.update_window_size();
|
||||
player.update_myself_position();
|
||||
quest_status.update_is_online();
|
||||
quest_status.update_is_result_screen();
|
||||
time.tick();
|
||||
|
||||
if quest_status.index < 2 then
|
||||
player.update_player_list_in_village();
|
||||
else
|
||||
player.update_player_list_on_quest();
|
||||
end
|
||||
|
||||
if quest_status.index < 2 then
|
||||
quest_status.update_is_training_area();
|
||||
|
||||
if quest_status.is_training_area then
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI;
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif quest_status.is_result_screen then
|
||||
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
|
||||
local success = pcall(small_monster_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Small monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then
|
||||
local success = pcall(time_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Time drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
elseif quest_status.index == 2 then
|
||||
|
||||
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
|
||||
local success = pcall(small_monster_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Small monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI;
|
||||
|
||||
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.time_UI then
|
||||
local success = pcall(time_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Time drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--snow.player.PlayerManager ->
|
||||
-- <PlayerData>k_BackingField -> [0]
|
||||
|
||||
--Demondrug _AtkUpAlive = 5 1
|
||||
--Mega Demondrug _AtkUpAlive = 7 1
|
||||
--Armorskin _DefUpAlive = 15 1
|
||||
--Mega Armorskin _DefUpAlive = 25 1
|
||||
--Might Seed _AtkUpBuffSecond and _AtkUpBuffSecondTimer 1
|
||||
--Demon Powder _AtkUpItemSecond and _AtkUpItemSecondTimer 1
|
||||
--Adamant Seed _DefUpBuffSecond and _DefUpBuffSecondTimer 1
|
||||
--Hardshell Powder _DefUpItemSecond and _DefUpItemSecondTimer 1
|
||||
--Dash Juice _StaminaUpBuffSecondTimer 1
|
||||
--Immunizer _VitalizerTimer 1
|
||||
|
||||
-- Attack Up
|
||||
-- Defense Up
|
||||
-- Affinity Up _AtkUpEcSecond and _AtkUpEcSecondTimer
|
||||
-- Sharpness Loss Reduced
|
||||
-- Elemental Attack Boost
|
||||
-- Divine Protection
|
||||
-- Health Regeneration
|
||||
-- Natural Healing Up
|
||||
-- Blight Negated
|
||||
-- Immunity
|
||||
-- Stamina Recovery Up
|
||||
-- Stamina Use Reduced
|
||||
-- Knockbacks Negated _DefUpEcSecond and _DefUpEcSecondTimer
|
||||
-- Sonic Barrier
|
||||
-- Earplugs (S)
|
||||
-- Earplugs (L)
|
||||
-- Tremor Negated
|
||||
-- Enviroment Damage Negated
|
||||
-- Stun Negated
|
||||
-- Wind Pressure Negated
|
||||
-- Gourmet Fish Effect
|
||||
-- Self Improvement
|
||||
-- Infernal Melody
|
||||
|
||||
--[[
|
||||
local player_data_array = singletons.player_manager:get_field("<PlayerData>k__BackingField");
|
||||
local player_data = player_data_array:get_element(0);
|
||||
|
||||
local _AtkUpAlive = player_data:get_field("_AtkUpAlive");
|
||||
local _DefUpAlive = player_data:get_field("_DefUpAlive");
|
||||
|
||||
xy = "AtkUpAlive: " .. tostring(_AtkUpAlive);
|
||||
xy = xy .. "\n_DefUpAlive: " .. tostring(_DefUpAlive);
|
||||
|
||||
local _AtkUpBuffSecond = player_data:get_field("_AtkUpBuffSecond");
|
||||
local _DefUpBuffSecond = player_data:get_field("_DefUpBuffSecond");
|
||||
local _DefUpBuffSecondRate = player_data:get_field("_DefUpBuffSecondRate");
|
||||
|
||||
xy = xy .. "\n_AtkUpBuffSecond: " .. tostring(_AtkUpBuffSecond);
|
||||
xy = xy .. "\n_DefUpBuffSecond: " .. tostring(_DefUpBuffSecond);
|
||||
xy = xy .. "\n_DefUpBuffSecondRate: " .. tostring(_DefUpBuffSecondRate);
|
||||
|
||||
local _AtkUpBuffSecondTimer = player_data:get_field("_AtkUpBuffSecondTimer");
|
||||
local _DefUpBuffSecondTimer = player_data:get_field("_DefUpBuffSecondTimer");
|
||||
local _DefUpBuffSecondRateTimer = player_data:get_field("_DefUpBuffSecondRateTimer");
|
||||
|
||||
xy = xy .. "\n_AtkUpBuffSecondTimer: " .. tostring(_AtkUpBuffSecondTimer);
|
||||
xy = xy .. "\n_DefUpBuffSecondTimer: " .. tostring(_DefUpBuffSecondTimer);
|
||||
xy = xy .. "\n_DefUpBuffSecondRateTimer: " .. tostring(_DefUpBuffSecondRateTimer);
|
||||
|
||||
local _StaminaUpBuffSecondTimer = player_data:get_field("_StaminaUpBuffSecondTimer");
|
||||
|
||||
xy = xy .. "\n_StaminaUpBuffSecondTimer: " .. tostring(_StaminaUpBuffSecondTimer);
|
||||
|
||||
local _AtkUpItemSecond = player_data:get_field("_AtkUpItemSecond");
|
||||
local _DefUpItemSecond = player_data:get_field("_DefUpItemSecond");
|
||||
|
||||
xy = xy .. "\n_AtkUpItemSecond: " .. tostring(_AtkUpItemSecond);
|
||||
xy = xy .. "\n_DefUpItemSecond: " .. tostring(_DefUpItemSecond);
|
||||
|
||||
local _AtkUpItemSecondTimer = player_data:get_field("_AtkUpItemSecondTimer");
|
||||
local _DefUpItemSecondTimer = player_data:get_field("_DefUpItemSecondTimer");
|
||||
|
||||
xy = xy .. "\n_AtkUpItemSecondTimer: " .. tostring(_AtkUpItemSecondTimer);
|
||||
xy = xy .. "\n_DefUpItemSecondTimer: " .. tostring(_DefUpItemSecondTimer);
|
||||
|
||||
local _SuperArmorItemTimer = player_data:get_field("_SuperArmorItemTimer");
|
||||
|
||||
xy = xy .. "\n_SuperArmorItemTimer: " .. tostring(_SuperArmorItemTimer);
|
||||
|
||||
local _AtkUpEcSecondTimer = player_data:get_field("_AtkUpEcSecondTimer");
|
||||
local _AtkUpEcSecond = player_data:get_field("_AtkUpEcSecond");
|
||||
|
||||
xy = xy .. "\n_AtkUpEcSecondTimer: " .. tostring(_AtkUpEcSecondTimer);
|
||||
xy = xy .. "\n_AtkUpEcSecond: " .. tostring(_AtkUpEcSecond);
|
||||
|
||||
local _DefUpEcSecondTimer = player_data:get_field("_DefUpEcSecondTimer");
|
||||
local _DefUpEcSecond = player_data:get_field("_DefUpEcSecond");
|
||||
|
||||
xy = xy .. "\n_DefUpEcSecondTimer: " .. tostring(_DefUpEcSecondTimer);
|
||||
xy = xy .. "\n_DefUpEcSecond: " .. tostring(_DefUpEcSecond);
|
||||
|
||||
local _CritUpEcSecondTimer = player_data:get_field("_CritUpEcSecondTimer");
|
||||
local _CritChanceUpBowTimer = player_data:get_field("_CritChanceUpBowTimer");
|
||||
local _CritChanceUpBow = player_data:get_field("_CritChanceUpBow");
|
||||
|
||||
xy = xy .. "\n_CritUpEcSecondTimer: " .. tostring(_CritUpEcSecondTimer);
|
||||
xy = xy .. "\n_CritChanceUpBowTimer: " .. tostring(_CritChanceUpBowTimer);
|
||||
xy = xy .. "\n_CritChanceUpBow: " .. tostring(_CritChanceUpBow);
|
||||
|
||||
local _MusicRegeneTimer = player_data:get_field("_MusicRegeneTimer");
|
||||
|
||||
xy = xy .. "\n_MusicRegeneTimer: " .. tostring(_MusicRegeneTimer);
|
||||
|
||||
local _LeadEnemyTimer = player_data:get_field("_LeadEnemyTimer");
|
||||
local _IsLeadEnemy = player_data:get_field("_IsLeadEnemy");
|
||||
|
||||
xy = xy .. "\n_LeadEnemyTimer: " .. tostring(_LeadEnemyTimer);
|
||||
xy = xy .. "\n_IsLeadEnemy: " .. tostring(_IsLeadEnemy);
|
||||
|
||||
local _DebuffPreventionTimer = player_data:get_field("_DebuffPreventionTimer");
|
||||
|
||||
xy = xy .. "\n_DebuffPreventionTimer: " .. tostring(_DebuffPreventionTimer);
|
||||
|
||||
local _FishRegeneTimer = player_data:get_field("_FishRegeneTimer");
|
||||
local _FishRegeneEnableTimer = player_data:get_field("_FishRegeneEnableTimer");
|
||||
|
||||
xy = xy .. "\n_FishRegeneTimer: " .. tostring(_FishRegeneTimer);
|
||||
xy = xy .. "\n_FishRegeneEnableTimer: " .. tostring(_FishRegeneEnableTimer);
|
||||
|
||||
local _VitalizerTimer = player_data:get_field("_VitalizerTimer");
|
||||
|
||||
xy = xy .. "\n_VitalizerTimer: " .. tostring(_VitalizerTimer);
|
||||
|
||||
local _RunhighOtomoTimer = player_data:get_field("_RunhighOtomoTimer");
|
||||
local _KijinBulletTimer = player_data:get_field("_KijinBulletTimer");
|
||||
local _KoukaBulletTimer = player_data:get_field("_KoukaBulletTimer");
|
||||
local _EquipSkill_036_Timer = player_data:get_field("_EquipSkill_036_Timer");
|
||||
|
||||
xy = xy .. "\n_RunhighOtomoTimer: " .. tostring(_RunhighOtomoTimer);
|
||||
xy = xy .. "\n_KijinBulletTimer: " .. tostring(_KijinBulletTimer);
|
||||
xy = xy .. "\n_KoukaBulletTimer: " .. tostring(_KoukaBulletTimer);
|
||||
xy = xy .. "\n_EquipSkill_036_Timer: " .. tostring(_EquipSkill_036_Timer);
|
||||
|
||||
local _HyperArmorItemTimer = player_data:get_field("_HyperArmorItemTimer");
|
||||
|
||||
xy = xy .. "\n_HyperArmorItemTimer: " .. tostring(_HyperArmorItemTimer);
|
||||
|
||||
local _KijinOtomoTimer = player_data:get_field("_KijinOtomoTimer");
|
||||
local _BeastRoarOtomoTimer = player_data:get_field("_BeastRoarOtomoTimer");
|
||||
local _ChallengeTimer = player_data:get_field("_ChallengeTimer");
|
||||
local _WholeBodyTimer = player_data:get_field("_WholeBodyTimer");
|
||||
|
||||
xy = xy .. "\n_KijinOtomoTimer: " .. tostring(_KijinOtomoTimer);
|
||||
xy = xy .. "\n_BeastRoarOtomoTimer: " .. tostring(_BeastRoarOtomoTimer);
|
||||
xy = xy .. "\n_ChallengeTimer: " .. tostring(_ChallengeTimer);
|
||||
xy = xy .. "\n_WholeBodyTimer: " .. tostring(_WholeBodyTimer);
|
||||
|
||||
local _SlidingTimer = player_data:get_field("_SlidingTimer");
|
||||
local _SlidingPowerupTimer = player_data:get_field("_SlidingPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_SlidingTimer: " .. tostring(_SlidingTimer);
|
||||
xy = xy .. "\n_SlidingPowerupTimer: " .. tostring(_SlidingPowerupTimer);
|
||||
|
||||
local _WallRunTimer = player_data:get_field("_WallRunTimer");
|
||||
local _WallRunPowerupTimer = player_data:get_field("_WallRunPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_WallRunTimer: " .. tostring(_WallRunTimer);
|
||||
xy = xy .. "\n_WallRunPowerupTimer: " .. tostring(_WallRunPowerupTimer);
|
||||
|
||||
local _CounterattackPowerupTimer = player_data:get_field("_CounterattackPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_CounterattackPowerupTimer: " .. tostring(_CounterattackPowerupTimer);
|
||||
|
||||
-- sic!
|
||||
local _OnibiPowerUpTiemr = player_data:get_field("_OnibiPowerUpTiemr");
|
||||
local _OnibiPowerUpInterval = player_data:get_field("_OnibiPowerUpInterval");
|
||||
|
||||
xy = xy .. "\n_OnibiPowerUpTiemr: " .. tostring(_OnibiPowerUpTiemr);
|
||||
xy = xy .. "\n_OnibiPowerUpInterval: " .. tostring(_OnibiPowerUpInterval);
|
||||
|
||||
local _HyakuryuDragonPowerUpTimer = player_data:get_field("_HyakuryuDragonPowerUpTimer");
|
||||
local _HyakuryuDragonPowerUpCnt = player_data:get_field("_HyakuryuDragonPowerUpCnt");
|
||||
local _HyakuryuHyakuryuOnazutiPowerUpInterval = player_data:get_field("_HyakuryuHyakuryuOnazutiPowerUpInterval");
|
||||
|
||||
xy = xy .. "\n_HyakuryuDragonPowerUpTimer: " .. tostring(_HyakuryuDragonPowerUpTimer);
|
||||
xy = xy .. "\n_HyakuryuDragonPowerUpCnt: " .. tostring(_HyakuryuDragonPowerUpCnt);
|
||||
xy = xy .. "\n_HyakuryuHyakuryuOnazutiPowerUpInterval: " .. tostring(_HyakuryuHyakuryuOnazutiPowerUpInterval);
|
||||
|
||||
local _KitchenSkill027Timer = player_data:get_field("_KitchenSkill027Timer");
|
||||
local _KitchenSkill045Timer = player_data:get_field("_KitchenSkill045Timer");
|
||||
|
||||
xy = xy .. "\n_KitchenSkill027Timer: " .. tostring(_KitchenSkill027Timer);
|
||||
xy = xy .. "\n_KitchenSkill045Timer: " .. tostring(_KitchenSkill045Timer);
|
||||
|
||||
-- sic!
|
||||
local _ReduseUseStaminaKichenSkillActive = player_data:get_field("_ReduseUseStaminaKichenSkillActive");
|
||||
|
||||
xy = xy .. "\n_ReduseUseStaminaKichenSkillActive: " .. tostring(_ReduseUseStaminaKichenSkillActive);
|
||||
|
||||
local _HeavyBowgunWyvernSnipeTimer = player_data:get_field("_HeavyBowgunWyvernSnipeTimer");
|
||||
local _HeavyBowgunWyvernMachineGunTimer = player_data:get_field("_HeavyBowgunWyvernMachineGunTimer");
|
||||
local _HeavyBowgunWyvernSnipeBullet = player_data:get_field("_HeavyBowgunWyvernSnipeBullet");
|
||||
local _HeavyBowgunWyvernMachineGunBullet = player_data:get_field("_HeavyBowgunWyvernMachineGunBullet");
|
||||
|
||||
xy = xy .. "\n_HeavyBowgunWyvernSnipeTimer: " .. tostring(_HeavyBowgunWyvernSnipeTimer);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernMachineGunTimer: " .. tostring(_HeavyBowgunWyvernMachineGunTimer);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernSnipeBullet: " .. tostring(_HeavyBowgunWyvernSnipeBullet);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernMachineGunBullet: " .. tostring(_HeavyBowgunWyvernMachineGunBullet);
|
||||
|
||||
local _ChargeDragonSlayCannonTime = player_data:get_field("_ChargeDragonSlayCannonTime");
|
||||
|
||||
xy = xy .. "\n_ChargeDragonSlayCannonTime: " .. tostring(_ChargeDragonSlayCannonTime);
|
||||
|
||||
local _WyvernBlastGauge = player_data:get_field("_WyvernBlastGauge");
|
||||
local _WyvernBlastReloadTimer = player_data:get_field("_WyvernBlastReloadTimer");
|
||||
|
||||
xy = xy .. "\n_WyvernBlastGauge: " .. tostring(_WyvernBlastGauge);
|
||||
xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer);
|
||||
--]]
|
||||
end
|
||||
-- #endregion
|
||||
----------------------------LOOP-----------------------------
|
||||
|
||||
--------------------------RE_IMGUI---------------------------
|
||||
-- #region
|
||||
re.on_draw_ui(function()
|
||||
@@ -112,357 +460,23 @@ re.on_frame(function()
|
||||
keyboard.update();
|
||||
end);
|
||||
|
||||
re.on_frame(function()
|
||||
draw.text("xy: " .. tostring(xy), 551, 11, 0xFF000000);
|
||||
draw.text("xy: " .. tostring(xy), 550, 10, 0xFFFFFFFF);
|
||||
end);
|
||||
if debug then
|
||||
re.on_frame(function()
|
||||
draw.text("xy: " .. tostring(xy), 551, 11, 0xFF000000);
|
||||
draw.text("xy: " .. tostring(xy), 550, 10, 0xFFFFFFFF);
|
||||
end);
|
||||
end
|
||||
-- #endregion
|
||||
--------------------------RE_IMGUI---------------------------
|
||||
|
||||
----------------------------D2D------------------------------
|
||||
|
||||
-- #region
|
||||
d2d.register(function()
|
||||
drawing.init_font();
|
||||
end, function()
|
||||
customization_menu.status = "OK";
|
||||
screen.update_window_size();
|
||||
singletons.init();
|
||||
player.update_myself_position();
|
||||
quest_status.update_is_online();
|
||||
quest_status.update_is_result_screen();
|
||||
time.tick();
|
||||
|
||||
if quest_status.index < 2 then
|
||||
player.update_player_list_in_village();
|
||||
else
|
||||
player.update_player_list_on_quest();
|
||||
end
|
||||
|
||||
if quest_status.index < 2 then
|
||||
quest_status.update_is_training_area();
|
||||
|
||||
if quest_status.is_training_area then
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.training_area.large_monster_highlighted_UI;
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.training_area.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.training_area.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif quest_status.is_result_screen then
|
||||
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
|
||||
local success = pcall(small_monster_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Small monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then
|
||||
local success = pcall(time_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Time drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
elseif quest_status.index == 2 then
|
||||
|
||||
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
|
||||
local success = pcall(small_monster_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Small monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_dynamic_UI;
|
||||
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_static_UI;
|
||||
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.during_quest.large_monster_highlighted_UI;
|
||||
|
||||
|
||||
|
||||
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 = "Large monster drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.time_UI then
|
||||
local success = pcall(time_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Time drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.damage_meter_UI then
|
||||
local success = pcall(damage_meter_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Damage meter drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
|
||||
if config.current_config.endemic_life_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.endemic_life_UI then
|
||||
local success = pcall(env_creature_UI.draw);
|
||||
if not success then
|
||||
customization_menu.status = "Endemic life drawing function threw an exception";
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--snow.player.PlayerManager ->
|
||||
-- <PlayerData>k_BackingField -> [0]
|
||||
|
||||
--Demondrug _AtkUpAlive = 5 1
|
||||
--Mega Demondrug _AtkUpAlive = 7 1
|
||||
--Armorskin _DefUpAlive = 15 1
|
||||
--Mega Armorskin _DefUpAlive = 25 1
|
||||
--Might Seed _AtkUpBuffSecond and _AtkUpBuffSecondTimer 1
|
||||
--Demon Powder _AtkUpItemSecond and _AtkUpItemSecondTimer 1
|
||||
--Adamant Seed _DefUpBuffSecond and _DefUpBuffSecondTimer 1
|
||||
--Hardshell Powder _DefUpItemSecond and _DefUpItemSecondTimer 1
|
||||
--Dash Juice _StaminaUpBuffSecondTimer 1
|
||||
--Immunizer _VitalizerTimer 1
|
||||
|
||||
-- Attack Up
|
||||
-- Defense Up
|
||||
-- Affinity Up _AtkUpEcSecond and _AtkUpEcSecondTimer
|
||||
-- Sharpness Loss Reduced
|
||||
-- Elemental Attack Boost
|
||||
-- Divine Protection
|
||||
-- Health Regeneration
|
||||
-- Natural Healing Up
|
||||
-- Blight Negated
|
||||
-- Immunity
|
||||
-- Stamina Recovery Up
|
||||
-- Stamina Use Reduced
|
||||
-- Knockbacks Negated _DefUpEcSecond and _DefUpEcSecondTimer
|
||||
-- Sonic Barrier
|
||||
-- Earplugs (S)
|
||||
-- Earplugs (L)
|
||||
-- Tremor Negated
|
||||
-- Enviroment Damage Negated
|
||||
-- Stun Negated
|
||||
-- Wind Pressure Negated
|
||||
-- Gourmet Fish Effect
|
||||
-- Self Improvement
|
||||
-- Infernal Melody
|
||||
|
||||
--[[
|
||||
local player_data_array = singletons.player_manager:get_field("<PlayerData>k__BackingField");
|
||||
local player_data = player_data_array:get_element(0);
|
||||
|
||||
local _AtkUpAlive = player_data:get_field("_AtkUpAlive");
|
||||
local _DefUpAlive = player_data:get_field("_DefUpAlive");
|
||||
|
||||
xy = "AtkUpAlive: " .. tostring(_AtkUpAlive);
|
||||
xy = xy .. "\n_DefUpAlive: " .. tostring(_DefUpAlive);
|
||||
|
||||
local _AtkUpBuffSecond = player_data:get_field("_AtkUpBuffSecond");
|
||||
local _DefUpBuffSecond = player_data:get_field("_DefUpBuffSecond");
|
||||
local _DefUpBuffSecondRate = player_data:get_field("_DefUpBuffSecondRate");
|
||||
|
||||
xy = xy .. "\n_AtkUpBuffSecond: " .. tostring(_AtkUpBuffSecond);
|
||||
xy = xy .. "\n_DefUpBuffSecond: " .. tostring(_DefUpBuffSecond);
|
||||
xy = xy .. "\n_DefUpBuffSecondRate: " .. tostring(_DefUpBuffSecondRate);
|
||||
|
||||
local _AtkUpBuffSecondTimer = player_data:get_field("_AtkUpBuffSecondTimer");
|
||||
local _DefUpBuffSecondTimer = player_data:get_field("_DefUpBuffSecondTimer");
|
||||
local _DefUpBuffSecondRateTimer = player_data:get_field("_DefUpBuffSecondRateTimer");
|
||||
|
||||
xy = xy .. "\n_AtkUpBuffSecondTimer: " .. tostring(_AtkUpBuffSecondTimer);
|
||||
xy = xy .. "\n_DefUpBuffSecondTimer: " .. tostring(_DefUpBuffSecondTimer);
|
||||
xy = xy .. "\n_DefUpBuffSecondRateTimer: " .. tostring(_DefUpBuffSecondRateTimer);
|
||||
|
||||
local _StaminaUpBuffSecondTimer = player_data:get_field("_StaminaUpBuffSecondTimer");
|
||||
|
||||
xy = xy .. "\n_StaminaUpBuffSecondTimer: " .. tostring(_StaminaUpBuffSecondTimer);
|
||||
|
||||
local _AtkUpItemSecond = player_data:get_field("_AtkUpItemSecond");
|
||||
local _DefUpItemSecond = player_data:get_field("_DefUpItemSecond");
|
||||
|
||||
xy = xy .. "\n_AtkUpItemSecond: " .. tostring(_AtkUpItemSecond);
|
||||
xy = xy .. "\n_DefUpItemSecond: " .. tostring(_DefUpItemSecond);
|
||||
|
||||
local _AtkUpItemSecondTimer = player_data:get_field("_AtkUpItemSecondTimer");
|
||||
local _DefUpItemSecondTimer = player_data:get_field("_DefUpItemSecondTimer");
|
||||
|
||||
xy = xy .. "\n_AtkUpItemSecondTimer: " .. tostring(_AtkUpItemSecondTimer);
|
||||
xy = xy .. "\n_DefUpItemSecondTimer: " .. tostring(_DefUpItemSecondTimer);
|
||||
|
||||
local _SuperArmorItemTimer = player_data:get_field("_SuperArmorItemTimer");
|
||||
|
||||
xy = xy .. "\n_SuperArmorItemTimer: " .. tostring(_SuperArmorItemTimer);
|
||||
|
||||
local _AtkUpEcSecondTimer = player_data:get_field("_AtkUpEcSecondTimer");
|
||||
local _AtkUpEcSecond = player_data:get_field("_AtkUpEcSecond");
|
||||
|
||||
xy = xy .. "\n_AtkUpEcSecondTimer: " .. tostring(_AtkUpEcSecondTimer);
|
||||
xy = xy .. "\n_AtkUpEcSecond: " .. tostring(_AtkUpEcSecond);
|
||||
|
||||
local _DefUpEcSecondTimer = player_data:get_field("_DefUpEcSecondTimer");
|
||||
local _DefUpEcSecond = player_data:get_field("_DefUpEcSecond");
|
||||
|
||||
xy = xy .. "\n_DefUpEcSecondTimer: " .. tostring(_DefUpEcSecondTimer);
|
||||
xy = xy .. "\n_DefUpEcSecond: " .. tostring(_DefUpEcSecond);
|
||||
|
||||
local _CritUpEcSecondTimer = player_data:get_field("_CritUpEcSecondTimer");
|
||||
local _CritChanceUpBowTimer = player_data:get_field("_CritChanceUpBowTimer");
|
||||
local _CritChanceUpBow = player_data:get_field("_CritChanceUpBow");
|
||||
|
||||
xy = xy .. "\n_CritUpEcSecondTimer: " .. tostring(_CritUpEcSecondTimer);
|
||||
xy = xy .. "\n_CritChanceUpBowTimer: " .. tostring(_CritChanceUpBowTimer);
|
||||
xy = xy .. "\n_CritChanceUpBow: " .. tostring(_CritChanceUpBow);
|
||||
|
||||
local _MusicRegeneTimer = player_data:get_field("_MusicRegeneTimer");
|
||||
|
||||
xy = xy .. "\n_MusicRegeneTimer: " .. tostring(_MusicRegeneTimer);
|
||||
|
||||
local _LeadEnemyTimer = player_data:get_field("_LeadEnemyTimer");
|
||||
local _IsLeadEnemy = player_data:get_field("_IsLeadEnemy");
|
||||
|
||||
xy = xy .. "\n_LeadEnemyTimer: " .. tostring(_LeadEnemyTimer);
|
||||
xy = xy .. "\n_IsLeadEnemy: " .. tostring(_IsLeadEnemy);
|
||||
|
||||
local _DebuffPreventionTimer = player_data:get_field("_DebuffPreventionTimer");
|
||||
|
||||
xy = xy .. "\n_DebuffPreventionTimer: " .. tostring(_DebuffPreventionTimer);
|
||||
|
||||
local _FishRegeneTimer = player_data:get_field("_FishRegeneTimer");
|
||||
local _FishRegeneEnableTimer = player_data:get_field("_FishRegeneEnableTimer");
|
||||
|
||||
xy = xy .. "\n_FishRegeneTimer: " .. tostring(_FishRegeneTimer);
|
||||
xy = xy .. "\n_FishRegeneEnableTimer: " .. tostring(_FishRegeneEnableTimer);
|
||||
|
||||
local _VitalizerTimer = player_data:get_field("_VitalizerTimer");
|
||||
|
||||
xy = xy .. "\n_VitalizerTimer: " .. tostring(_VitalizerTimer);
|
||||
|
||||
local _RunhighOtomoTimer = player_data:get_field("_RunhighOtomoTimer");
|
||||
local _KijinBulletTimer = player_data:get_field("_KijinBulletTimer");
|
||||
local _KoukaBulletTimer = player_data:get_field("_KoukaBulletTimer");
|
||||
local _EquipSkill_036_Timer = player_data:get_field("_EquipSkill_036_Timer");
|
||||
|
||||
xy = xy .. "\n_RunhighOtomoTimer: " .. tostring(_RunhighOtomoTimer);
|
||||
xy = xy .. "\n_KijinBulletTimer: " .. tostring(_KijinBulletTimer);
|
||||
xy = xy .. "\n_KoukaBulletTimer: " .. tostring(_KoukaBulletTimer);
|
||||
xy = xy .. "\n_EquipSkill_036_Timer: " .. tostring(_EquipSkill_036_Timer);
|
||||
|
||||
local _HyperArmorItemTimer = player_data:get_field("_HyperArmorItemTimer");
|
||||
|
||||
xy = xy .. "\n_HyperArmorItemTimer: " .. tostring(_HyperArmorItemTimer);
|
||||
|
||||
local _KijinOtomoTimer = player_data:get_field("_KijinOtomoTimer");
|
||||
local _BeastRoarOtomoTimer = player_data:get_field("_BeastRoarOtomoTimer");
|
||||
local _ChallengeTimer = player_data:get_field("_ChallengeTimer");
|
||||
local _WholeBodyTimer = player_data:get_field("_WholeBodyTimer");
|
||||
|
||||
xy = xy .. "\n_KijinOtomoTimer: " .. tostring(_KijinOtomoTimer);
|
||||
xy = xy .. "\n_BeastRoarOtomoTimer: " .. tostring(_BeastRoarOtomoTimer);
|
||||
xy = xy .. "\n_ChallengeTimer: " .. tostring(_ChallengeTimer);
|
||||
xy = xy .. "\n_WholeBodyTimer: " .. tostring(_WholeBodyTimer);
|
||||
|
||||
local _SlidingTimer = player_data:get_field("_SlidingTimer");
|
||||
local _SlidingPowerupTimer = player_data:get_field("_SlidingPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_SlidingTimer: " .. tostring(_SlidingTimer);
|
||||
xy = xy .. "\n_SlidingPowerupTimer: " .. tostring(_SlidingPowerupTimer);
|
||||
|
||||
local _WallRunTimer = player_data:get_field("_WallRunTimer");
|
||||
local _WallRunPowerupTimer = player_data:get_field("_WallRunPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_WallRunTimer: " .. tostring(_WallRunTimer);
|
||||
xy = xy .. "\n_WallRunPowerupTimer: " .. tostring(_WallRunPowerupTimer);
|
||||
|
||||
local _CounterattackPowerupTimer = player_data:get_field("_CounterattackPowerupTimer");
|
||||
|
||||
xy = xy .. "\n_CounterattackPowerupTimer: " .. tostring(_CounterattackPowerupTimer);
|
||||
|
||||
-- sic!
|
||||
local _OnibiPowerUpTiemr = player_data:get_field("_OnibiPowerUpTiemr");
|
||||
local _OnibiPowerUpInterval = player_data:get_field("_OnibiPowerUpInterval");
|
||||
|
||||
xy = xy .. "\n_OnibiPowerUpTiemr: " .. tostring(_OnibiPowerUpTiemr);
|
||||
xy = xy .. "\n_OnibiPowerUpInterval: " .. tostring(_OnibiPowerUpInterval);
|
||||
|
||||
local _HyakuryuDragonPowerUpTimer = player_data:get_field("_HyakuryuDragonPowerUpTimer");
|
||||
local _HyakuryuDragonPowerUpCnt = player_data:get_field("_HyakuryuDragonPowerUpCnt");
|
||||
local _HyakuryuHyakuryuOnazutiPowerUpInterval = player_data:get_field("_HyakuryuHyakuryuOnazutiPowerUpInterval");
|
||||
|
||||
xy = xy .. "\n_HyakuryuDragonPowerUpTimer: " .. tostring(_HyakuryuDragonPowerUpTimer);
|
||||
xy = xy .. "\n_HyakuryuDragonPowerUpCnt: " .. tostring(_HyakuryuDragonPowerUpCnt);
|
||||
xy = xy .. "\n_HyakuryuHyakuryuOnazutiPowerUpInterval: " .. tostring(_HyakuryuHyakuryuOnazutiPowerUpInterval);
|
||||
|
||||
local _KitchenSkill027Timer = player_data:get_field("_KitchenSkill027Timer");
|
||||
local _KitchenSkill045Timer = player_data:get_field("_KitchenSkill045Timer");
|
||||
|
||||
xy = xy .. "\n_KitchenSkill027Timer: " .. tostring(_KitchenSkill027Timer);
|
||||
xy = xy .. "\n_KitchenSkill045Timer: " .. tostring(_KitchenSkill045Timer);
|
||||
|
||||
-- sic!
|
||||
local _ReduseUseStaminaKichenSkillActive = player_data:get_field("_ReduseUseStaminaKichenSkillActive");
|
||||
|
||||
xy = xy .. "\n_ReduseUseStaminaKichenSkillActive: " .. tostring(_ReduseUseStaminaKichenSkillActive);
|
||||
|
||||
local _HeavyBowgunWyvernSnipeTimer = player_data:get_field("_HeavyBowgunWyvernSnipeTimer");
|
||||
local _HeavyBowgunWyvernMachineGunTimer = player_data:get_field("_HeavyBowgunWyvernMachineGunTimer");
|
||||
local _HeavyBowgunWyvernSnipeBullet = player_data:get_field("_HeavyBowgunWyvernSnipeBullet");
|
||||
local _HeavyBowgunWyvernMachineGunBullet = player_data:get_field("_HeavyBowgunWyvernMachineGunBullet");
|
||||
|
||||
xy = xy .. "\n_HeavyBowgunWyvernSnipeTimer: " .. tostring(_HeavyBowgunWyvernSnipeTimer);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernMachineGunTimer: " .. tostring(_HeavyBowgunWyvernMachineGunTimer);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernSnipeBullet: " .. tostring(_HeavyBowgunWyvernSnipeBullet);
|
||||
xy = xy .. "\n_HeavyBowgunWyvernMachineGunBullet: " .. tostring(_HeavyBowgunWyvernMachineGunBullet);
|
||||
|
||||
local _ChargeDragonSlayCannonTime = player_data:get_field("_ChargeDragonSlayCannonTime");
|
||||
|
||||
xy = xy .. "\n_ChargeDragonSlayCannonTime: " .. tostring(_ChargeDragonSlayCannonTime);
|
||||
|
||||
local _WyvernBlastGauge = player_data:get_field("_WyvernBlastGauge");
|
||||
local _WyvernBlastReloadTimer = player_data:get_field("_WyvernBlastReloadTimer");
|
||||
|
||||
xy = xy .. "\n_WyvernBlastGauge: " .. tostring(_WyvernBlastGauge);
|
||||
xy = xy .. "\n_WyvernBlastReloadTimer: " .. tostring(_WyvernBlastReloadTimer);
|
||||
--]]
|
||||
end);
|
||||
if d2d ~= nil then
|
||||
d2d.register(function()
|
||||
drawing.init_font();
|
||||
end, main_loop);
|
||||
else
|
||||
re.on_frame(main_loop);
|
||||
end
|
||||
-- #endregion
|
||||
----------------------------D2D------------------------------
|
||||
@@ -23,12 +23,6 @@ local check_current_area_training_area_method = village_area_manager_type_def:ge
|
||||
local lobby_manager_type_definition = sdk.find_type_definition("snow.LobbyManager");
|
||||
local is_quest_online_method = lobby_manager_type_definition:get_method("IsQuestOnline");
|
||||
|
||||
sdk.hook(on_changed_game_status, function(args)
|
||||
pcall(quest_status.update(args));
|
||||
end, function(retval)
|
||||
return retval;
|
||||
end);
|
||||
|
||||
function quest_status.update(args)
|
||||
local new_quest_status = sdk.to_int64(args[3]);
|
||||
if new_quest_status ~= nil then
|
||||
@@ -47,6 +41,10 @@ function quest_status.update(args)
|
||||
end
|
||||
end
|
||||
|
||||
sdk.hook(on_changed_game_status, function(args)
|
||||
pcall(quest_status.update, args);
|
||||
end, function(retval) return retval; end);
|
||||
|
||||
function quest_status.init()
|
||||
if singletons.quest_manager == nil then
|
||||
return;
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
local config = require "MHR_Overlay.Misc.config"
|
||||
local screen = {};
|
||||
|
||||
local config;
|
||||
local singletons;
|
||||
|
||||
screen.width = 1920;
|
||||
screen.height = 1080;
|
||||
|
||||
function screen.update_window_size()
|
||||
local width, height = d2d.surface_size();
|
||||
local width;
|
||||
local height;
|
||||
|
||||
if d2d ~= nil then
|
||||
width, height = d2d.surface_size();
|
||||
else
|
||||
width, height = screen.get_game_window_size();
|
||||
end
|
||||
|
||||
if width ~= nil then
|
||||
screen.width = width;
|
||||
@@ -17,6 +25,45 @@ function screen.update_window_size()
|
||||
end
|
||||
end
|
||||
|
||||
local scene_view;
|
||||
local scene_view_type = sdk.find_type_definition("via.SceneView");
|
||||
local get_size_method = scene_view_type:get_method("get_Size");
|
||||
|
||||
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()
|
||||
if scene_view == nil then
|
||||
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");
|
||||
return;
|
||||
end
|
||||
end
|
||||
|
||||
local size = get_size_method:call(scene_view);
|
||||
if size == nil then
|
||||
--log.error("[MHR_Overlay.lua] No scene view size");
|
||||
return;
|
||||
end
|
||||
|
||||
local screen_width = width_field:get_data(size);
|
||||
if screen_width == nil then
|
||||
--log.error("[MHR_Overlay.lua] No screen width");
|
||||
return;
|
||||
end
|
||||
|
||||
local screen_height = height_field:get_data(size);
|
||||
if screen_height == nil then
|
||||
--log.error("[MHR_Overlay.lua] No screen height");
|
||||
return;
|
||||
end
|
||||
|
||||
return screen_width, screen_height;
|
||||
end
|
||||
|
||||
function screen.calculate_absolute_coordinates(position)
|
||||
local _position = {
|
||||
x = position.x * config.current_config.global_settings.modifiers.global_position_modifier;
|
||||
@@ -52,6 +99,7 @@ end
|
||||
|
||||
function screen.init_module()
|
||||
config = require("MHR_Overlay.Misc.config");
|
||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||
end
|
||||
|
||||
return screen;
|
||||
|
||||
@@ -9,6 +9,7 @@ singletons.player_manager = nil;
|
||||
singletons.village_area_manager = nil;
|
||||
singletons.gui_manager = nil;
|
||||
singletons.game_keyboard = nil;
|
||||
singletons.scene_manager = nil;
|
||||
|
||||
function singletons.init()
|
||||
singletons.init_message_manager();
|
||||
@@ -19,7 +20,8 @@ function singletons.init()
|
||||
singletons.init_player_manager();
|
||||
singletons.init_village_area_manager();
|
||||
singletons.init_gui_manager();
|
||||
singletons.init_game_keyboard()
|
||||
singletons.init_game_keyboard();
|
||||
singletons.init_scene_manager();
|
||||
end
|
||||
|
||||
function singletons.init_message_manager()
|
||||
@@ -141,6 +143,19 @@ function singletons.init_game_keyboard()
|
||||
return singletons.ggame_keyboard;
|
||||
end
|
||||
|
||||
function singletons.init_scene_manager()
|
||||
if singletons.scene_manager ~= nil then
|
||||
return;
|
||||
end
|
||||
|
||||
singletons.scene_manager = sdk.get_native_singleton("via.SceneManager");
|
||||
if singletons.scene_manager == nil then
|
||||
--log.error("[MHR Overlay] No enemy manager");
|
||||
end
|
||||
|
||||
return singletons.scene_manager;
|
||||
end
|
||||
|
||||
function singletons.init_module()
|
||||
singletons.init();
|
||||
end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -91,7 +91,9 @@ language.default_language = {
|
||||
total_damage = "Total Damage",
|
||||
player = "Player",
|
||||
buildup = "Buildup:",
|
||||
total_buildup = "Total Buildup"
|
||||
total_buildup = "Total Buildup",
|
||||
part_break = "Break",
|
||||
part_sever = "Sever"
|
||||
},
|
||||
|
||||
customization_menu = {
|
||||
@@ -198,6 +200,8 @@ language.default_language = {
|
||||
hide_undamaged_parts = "Hide Undamaged Parts",
|
||||
part_name = "Part Name",
|
||||
flinch_count = "Flinch Count",
|
||||
break_count = "Break Count",
|
||||
break_max_count = "Break Max Count",
|
||||
|
||||
orientation = "Orientation",
|
||||
horizontal = "Horizontal",
|
||||
@@ -317,7 +321,13 @@ language.default_language = {
|
||||
filter = "Filter",
|
||||
top_buildup = "Top Buildup",
|
||||
total_buildup = "Total Buildup",
|
||||
buildup_bars_are_relative_to = "Buildup Bars are relative to"
|
||||
buildup_bars_are_relative_to = "Buildup Bars are relative to",
|
||||
|
||||
part_health = "Part Health",
|
||||
break_health = "Break Health",
|
||||
break_health_percentage = "Break Health Percentage",
|
||||
loss_health = "Sever Health",
|
||||
loss_health_percentage = "Sever Health Percentage"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -219,9 +219,11 @@ local damage_param_field = enemy_character_base_type_def:get_field("<DamageParam
|
||||
local damage_param_type = damage_param_field:get_type();
|
||||
local get_condition_param_method = damage_param_type:get_method("get_ConditionParam");
|
||||
|
||||
local stun_param_field = damage_param_type:get_field("_StunParam");
|
||||
local poison_param_field = damage_param_type:get_field("_PoisonParam");
|
||||
local blast_param_field = damage_param_type:get_field("_BlastParam");
|
||||
|
||||
|
||||
local poison_param_type = poison_param_field:get_type();
|
||||
local blast_param_type = blast_param_field:get_type();
|
||||
|
||||
@@ -250,6 +252,18 @@ function ailments.update_ailments(enemy, monster)
|
||||
return;
|
||||
end
|
||||
|
||||
ailments.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
|
||||
and not config.current_config.large_monster_UI.highlighted.ailments.visibility
|
||||
and not config.current_config.small_monster_UI.ailments.visibility
|
||||
and not config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility
|
||||
and not config.current_config.large_monster_UI.static.ailment_buildups.visibility
|
||||
and not config.current_config.small_monster_UI.ailment_buildups.visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
local condition_param = get_condition_param_method:call(damage_param);
|
||||
|
||||
if condition_param == nil then
|
||||
@@ -264,7 +278,34 @@ function ailments.update_ailments(enemy, monster)
|
||||
|
||||
for index, ailment_param in ipairs(condition_param_table) do
|
||||
local id = index - 1;
|
||||
if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
ailments.update_ailment(monster, ailment_param, id);
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
function ailments.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);
|
||||
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);
|
||||
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);
|
||||
end
|
||||
end
|
||||
|
||||
function ailments.update_ailment(monster, ailment_param, id)
|
||||
local is_enable = get_is_enable_method:call(ailment_param);
|
||||
local activate_count = get_activate_count_method:call(ailment_param):get_element(0):get_field("mValue");
|
||||
local buildup = get_stock_method:call(ailment_param):get_element(0):get_field("mValue");
|
||||
@@ -356,7 +397,6 @@ function ailments.update_ailments(enemy, monster)
|
||||
monster.ailments[id].minutes_left = minutes_left;
|
||||
monster.ailments[id].seconds_left = seconds_left;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ailments.update_last_change_time(monster, id)
|
||||
|
||||
@@ -14,25 +14,33 @@ local time;
|
||||
|
||||
body_part.list = {};
|
||||
|
||||
function body_part.new(REpart, name, id)
|
||||
function body_part.new(id, name)
|
||||
local part = {};
|
||||
|
||||
part.REpart = REpart;
|
||||
part.id = id;
|
||||
|
||||
part.health = 99999;
|
||||
part.health = 9999;
|
||||
part.max_health = 99999;
|
||||
part.health_percentage = 0;
|
||||
|
||||
part.break_health = 9999;
|
||||
part.break_max_health = 99999;
|
||||
part.break_health_percentage = 0;
|
||||
|
||||
part.lost_health = 9999;
|
||||
part.loss_max_health = 99999;
|
||||
part.loss_health_percentage = 0;
|
||||
|
||||
part.name = name;
|
||||
part.flinch_count = 0;
|
||||
part.break_count = 0;
|
||||
part.break_max_count = 0;
|
||||
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
|
||||
body_part.init_dynamic_UI(part);
|
||||
body_part.init_static_UI(part);
|
||||
body_part.init_highlighted_UI(part);
|
||||
|
||||
return part;
|
||||
end
|
||||
|
||||
@@ -40,62 +48,146 @@ end
|
||||
function body_part.init_dynamic_UI(part)
|
||||
part.body_part_dynamic_UI = body_part_UI_entity.new(
|
||||
config.current_config.large_monster_UI.dynamic.parts.visibility,
|
||||
config.current_config.large_monster_UI.dynamic.parts.bar,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_name_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.text_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.value_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.percentage_label
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_health.visibility,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_health.bar,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_health.text_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_health.value_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_health.percentage_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_break.visibility,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_break.bar,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_break.text_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_break.value_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_break.percentage_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_loss.visibility,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_loss.bar,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_loss.text_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_loss.value_label,
|
||||
config.current_config.large_monster_UI.dynamic.parts.part_loss.percentage_label
|
||||
);
|
||||
end
|
||||
|
||||
function body_part.init_static_UI(part)
|
||||
part.body_part_static_UI = body_part_UI_entity.new(
|
||||
config.current_config.large_monster_UI.static.parts.visibility,
|
||||
config.current_config.large_monster_UI.static.parts.bar,
|
||||
config.current_config.large_monster_UI.static.parts.part_name_label,
|
||||
config.current_config.large_monster_UI.static.parts.text_label,
|
||||
config.current_config.large_monster_UI.static.parts.value_label,
|
||||
config.current_config.large_monster_UI.static.parts.percentage_label
|
||||
config.current_config.large_monster_UI.static.parts.part_health.visibility,
|
||||
config.current_config.large_monster_UI.static.parts.part_health.bar,
|
||||
config.current_config.large_monster_UI.static.parts.part_health.text_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_health.value_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_health.percentage_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_break.visibility,
|
||||
config.current_config.large_monster_UI.static.parts.part_break.bar,
|
||||
config.current_config.large_monster_UI.static.parts.part_break.text_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_break.value_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_break.percentage_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_loss.visibility,
|
||||
config.current_config.large_monster_UI.static.parts.part_loss.bar,
|
||||
config.current_config.large_monster_UI.static.parts.part_loss.text_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_loss.value_label,
|
||||
config.current_config.large_monster_UI.static.parts.part_loss.percentage_label
|
||||
);
|
||||
end
|
||||
|
||||
function body_part.init_highlighted_UI(part)
|
||||
part.body_part_highlighted_UI = body_part_UI_entity.new(
|
||||
config.current_config.large_monster_UI.highlighted.parts.visibility,
|
||||
config.current_config.large_monster_UI.highlighted.parts.bar,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_name_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.text_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.value_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.percentage_label
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_health.visibility,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_health.bar,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_health.text_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_health.value_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_health.percentage_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_break.visibility,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_break.bar,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_break.text_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_break.value_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_break.percentage_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_loss.visibility,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_loss.bar,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_loss.text_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_loss.value_label,
|
||||
config.current_config.large_monster_UI.highlighted.parts.part_loss.percentage_label
|
||||
);
|
||||
end
|
||||
|
||||
function body_part.update(part, new_health, new_max_health)
|
||||
function body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed)
|
||||
if part == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
if new_health > part.health then
|
||||
if part_current > part.health then
|
||||
part.flinch_count = part.flinch_count + 1;
|
||||
end
|
||||
|
||||
if part.health ~= new_health then
|
||||
if part_break_current > part.break_health then
|
||||
part.break_count = part.break_count + 1;
|
||||
end
|
||||
|
||||
if part.health ~= part_current then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
if part.break_health ~= part_break_current then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
if part.loss_health ~= part_loss_current then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
if part.break_count ~= part_break_count then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
if part.break_max_count ~= part_break_max_count then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
if part.is_severed ~= is_severed then
|
||||
part.last_change_time = time.total_elapsed_seconds;
|
||||
end
|
||||
|
||||
part.health = new_health;
|
||||
part.max_health = new_max_health;
|
||||
part.health = part_current;
|
||||
part.max_health = part_max;
|
||||
|
||||
part.break_health = part_break_current;
|
||||
part.break_max_health = part_break_max;
|
||||
|
||||
part.loss_health = part_loss_current;
|
||||
part.loss_max_health = part_loss_max;
|
||||
|
||||
part.break_count = part_break_count;
|
||||
part.break_max_count = part_break_max_count;
|
||||
part.is_severed = is_severed;
|
||||
|
||||
if part.max_health ~= 0 then
|
||||
part.health_percentage = part.health / part.max_health;
|
||||
end
|
||||
|
||||
if part.break_max_health ~= 0 then
|
||||
part.break_health_percentage = part.break_health / part.break_max_health;
|
||||
end
|
||||
|
||||
if part.loss_max_health ~= 0 then
|
||||
part.loss_health_percentage = part.loss_health / part.loss_max_health;
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale)
|
||||
--sort parts here
|
||||
local displayed_parts = {};
|
||||
for REpart, part in pairs(monster.parts) do
|
||||
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts
|
||||
and part.health == part.max_health and part.flinch_count == 0
|
||||
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
|
||||
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if (not part.body_part_dynamic_UI.flinch_visibility)
|
||||
and (not part.body_part_dynamic_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
|
||||
and (not part.body_part_dynamic_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
@@ -137,6 +229,66 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
|
||||
return left.health_percentage < right.health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Flinch Count" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count > right.flinch_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count < right.flinch_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Health" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health > right.break_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health < right.break_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Health Percentage" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage > right.break_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage < right.break_health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Count" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count > right.break_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count < right.break_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Sever Health" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health > right.loss_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health < right.loss_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Sever Health Percentage" then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage > right.loss_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage < right.loss_health_percentage;
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
local last_part_position_on_screen;
|
||||
@@ -155,11 +307,19 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
|
||||
end
|
||||
|
||||
function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
|
||||
|
||||
--sort parts here
|
||||
|
||||
local displayed_parts = {};
|
||||
for REpart, part in pairs(monster.parts) do
|
||||
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
|
||||
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts
|
||||
and part.health == part.max_health and part.flinch_count == 0
|
||||
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
|
||||
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if (not part.body_part_static_UI.flinch_visibility)
|
||||
and (not part.body_part_static_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
|
||||
and (not part.body_part_static_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
@@ -201,6 +361,66 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
|
||||
return left.health_percentage < right.health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Flinch Count" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count > right.flinch_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count < right.flinch_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Health" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health > right.break_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health < right.break_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Health Percentage" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage > right.break_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage < right.break_health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Count" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count > right.break_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count < right.break_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Sever Health" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health > right.loss_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health < right.loss_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Sever Health Percentage" then
|
||||
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage > right.loss_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage < right.loss_health_percentage;
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
local last_part_position_on_screen;
|
||||
@@ -219,10 +439,18 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
|
||||
end
|
||||
|
||||
function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale)
|
||||
--sort parts here
|
||||
local displayed_parts = {};
|
||||
for REpart, part in pairs(monster.parts) do
|
||||
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts
|
||||
and part.health == part.max_health and part.flinch_count == 0
|
||||
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
|
||||
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
if (not part.body_part_highlighted_UI.flinch_visibility)
|
||||
and (not part.body_part_highlighted_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
|
||||
and (not part.body_part_highlighted_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
@@ -264,6 +492,66 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s
|
||||
return left.health_percentage < right.health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Flinch Count" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count > right.flinch_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.flinch_count < right.flinch_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Health" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health > right.break_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health < right.break_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Health Percentage" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage > right.break_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_health_percentage < right.break_health_percentage;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Count" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count > right.break_count;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.break_count < right.break_count;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Sever Health" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health > right.loss_health;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health < right.loss_health;
|
||||
end);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Sever Health Percentage" then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage > right.loss_health_percentage;
|
||||
end);
|
||||
else
|
||||
table.sort(displayed_parts, function(left, right)
|
||||
return left.loss_health_percentage < right.loss_health_percentage;
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
local last_part_position_on_screen;
|
||||
|
||||
@@ -22,6 +22,7 @@ large_monster.list = {};
|
||||
|
||||
function large_monster.new(enemy)
|
||||
local monster = {};
|
||||
monster.enemy = enemy;
|
||||
monster.is_large = true;
|
||||
|
||||
monster.id = 0;
|
||||
@@ -330,6 +331,8 @@ end
|
||||
local physical_param_field = enemy_character_base_type_def:get_field("<PhysicalParam>k__BackingField");
|
||||
local stamina_param_field = enemy_character_base_type_def:get_field("<StaminaParam>k__BackingField");
|
||||
local anger_param_field = enemy_character_base_type_def:get_field("<AngerParam>k__BackingField");
|
||||
local damage_param_field = enemy_character_base_type_def:get_field("<DamageParam>k__BackingField");
|
||||
|
||||
local check_die_method = enemy_character_base_type_def:get_method("checkDie");
|
||||
local is_disp_icon_mini_map_method = enemy_character_base_type_def:get_method("isDispIconMiniMap");
|
||||
|
||||
@@ -457,6 +460,12 @@ function large_monster.update(enemy)
|
||||
return;
|
||||
end
|
||||
|
||||
local damage_param = damage_param_field:get_data(enemy);
|
||||
if damage_param == nil then
|
||||
customization_menu.status = "No damage param";
|
||||
return;
|
||||
end
|
||||
|
||||
local health = get_current_method:call(vital_param);
|
||||
local max_health = get_max_method:call(vital_param);
|
||||
local capture_health = get_capture_hp_vital_method:call(physical_param);
|
||||
@@ -490,7 +499,7 @@ function large_monster.update(enemy)
|
||||
customization_menu.status = "No vital list";
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
local vital_list_count = vital_list:call("get_Count");
|
||||
if vital_list_count == nil or vital_list_count < 2 then
|
||||
customization_menu.status = "No vital list count";
|
||||
@@ -509,53 +518,79 @@ function large_monster.update(enemy)
|
||||
return;
|
||||
end
|
||||
|
||||
local last_REpart = part_list:call("get_Item", part_list_count - 1);
|
||||
local last_REpart_health = 9999999;
|
||||
if last_REpart ~= nil then
|
||||
local _last_REpart_health = last_REpart:call("get_Current");
|
||||
if last_REpart_health ~= nil then
|
||||
last_REpart_health = _last_REpart_health;
|
||||
end
|
||||
local enemy_parts_damage_info = damage_param:get_field("_EnemyPartsDamageInfo");
|
||||
local enemy_parts_info_array;
|
||||
if enemy_parts_damage_info ~= nil then
|
||||
enemy_parts_info_array = enemy_parts_damage_info:call("get_PartsInfo");
|
||||
end
|
||||
|
||||
|
||||
local part_id = 1;
|
||||
for i = 0, part_list_count - 1 do
|
||||
|
||||
local REpart = part_list:call("get_Item", i);
|
||||
if REpart == nil then
|
||||
goto continue;
|
||||
local enemy_parts_info;
|
||||
if enemy_parts_info_array ~= nil then
|
||||
enemy_parts_info = enemy_parts_info_array[i];
|
||||
end
|
||||
|
||||
local part_health = REpart:call("get_Current");
|
||||
if part_health == nil then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
local part_max_health = REpart:call("get_Max");
|
||||
if part_max_health == nil or part_max_health <= 0 then
|
||||
goto continue;
|
||||
end
|
||||
|
||||
local part = monster.parts[REpart];
|
||||
|
||||
local part = monster.parts[part_id];
|
||||
if part == nil then
|
||||
local part_name = part_names.get_part_name(monster.id, part_id);
|
||||
|
||||
if part_name ~= "" then
|
||||
part = body_part.new(REpart, part_name, part_id);
|
||||
monster.parts[REpart] = part;
|
||||
|
||||
if part_name == "" then
|
||||
goto continue;
|
||||
else
|
||||
part = body_part.new(part_id, part_name);
|
||||
monster.parts[part_id] = part;
|
||||
end
|
||||
end
|
||||
|
||||
local part_vital = physical_param:call("getVital", 1, i);
|
||||
local part_current = -1;
|
||||
local part_max = -1;
|
||||
|
||||
body_part.update(part, part_health, part_max_health);
|
||||
if part_vital ~= nil then
|
||||
part_current = part_vital:call("get_Current") or -1;
|
||||
part_max = part_vital:call("get_Max") or -1;
|
||||
end
|
||||
|
||||
local part_break_vital = physical_param:call("getVital", 2, i);
|
||||
local part_break_current = -1;
|
||||
local part_break_max = -1;
|
||||
|
||||
if part_break_vital ~= nil then
|
||||
part_break_current = part_break_vital:call("get_Current") or -1;
|
||||
part_break_max = part_break_vital:call("get_Max") or -1;
|
||||
|
||||
end
|
||||
|
||||
local part_loss_vital = physical_param:call("getVital", 3, i);
|
||||
local part_loss_current = -1;
|
||||
local part_loss_max = -1;
|
||||
|
||||
if part_loss_vital ~= nil then
|
||||
part_loss_current = part_loss_vital:call("get_Current") or -1;
|
||||
part_loss_max = part_loss_vital:call("get_Max") or -1;
|
||||
end
|
||||
|
||||
local part_break_count = -1;
|
||||
local part_break_max_count = -1;
|
||||
local is_severed = false;
|
||||
|
||||
if enemy_parts_info ~= nil then
|
||||
part_break_count = enemy_parts_info:call("get_PartsBreakDamageLevel") or -1;
|
||||
part_break_max_count = enemy_parts_info:call("get_PartsBreakDamageMaxLevel") or -1;
|
||||
is_severed = enemy_parts_info:call("get_PartsLossState") or false;
|
||||
end
|
||||
|
||||
body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed);
|
||||
|
||||
part_id = part_id + 1;
|
||||
::continue::
|
||||
end
|
||||
|
||||
|
||||
if health ~= nil then
|
||||
monster.health = health;
|
||||
end
|
||||
|
||||
if max_health ~= nil then
|
||||
monster.max_health = max_health;
|
||||
end
|
||||
@@ -747,7 +782,6 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
|
||||
monster.health_static_UI.bar.colors = config.current_config.large_monster_UI.static.health.bar.normal_colors;
|
||||
end
|
||||
|
||||
|
||||
drawing.draw_label(monster.static_name_label, position_on_screen, opacity_scale, monster_name_text);
|
||||
|
||||
local health_position_on_screen = {
|
||||
@@ -894,6 +928,7 @@ function large_monster.init_module()
|
||||
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
|
||||
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
|
||||
ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
|
||||
|
||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||
drawing = require("MHR_Overlay.UI.drawing");
|
||||
part_names = require("MHR_Overlay.Misc.part_names");
|
||||
|
||||
@@ -3,38 +3,84 @@ local config;
|
||||
local table_helpers;
|
||||
local drawing;
|
||||
|
||||
function body_part_UI_entity.new(visibility, bar, name_label, text_label, value_label, percentage_label)
|
||||
function body_part_UI_entity.new(part_visibility, part_name_label,
|
||||
flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label, flinch_percentage_label,
|
||||
break_visibility, break_bar, break_text_label, break_value_label, break_percentage_label,
|
||||
loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
|
||||
local entity = {};
|
||||
|
||||
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.part_visibility = part_visibility;
|
||||
entity.flinch_visibility = flinch_visibility;
|
||||
entity.break_visibility = break_visibility;
|
||||
entity.loss_visibility = loss_visibility;
|
||||
|
||||
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.part_name_label = table_helpers.deep_copy(part_name_label);
|
||||
|
||||
entity.name_label.offset.x = entity.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.name_label.offset.y = entity.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.part_name_label.offset.x = entity.part_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.part_name_label.offset.y = entity.part_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.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.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.offset.x = entity.flinch_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.offset.y = entity.flinch_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.size.width = entity.flinch_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_bar.size.height = entity.flinch_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_text_label.offset.x = entity.flinch_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_text_label.offset.y = entity.flinch_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.flinch_value_label.offset.x = entity.flinch_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_value_label.offset.y = entity.flinch_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.flinch_percentage_label.offset.x = entity.flinch_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.flinch_percentage_label.offset.y = entity.flinch_percentage_label.offset.y * config.current_config.global_settings.modifiers.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.offset.x = entity.break_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.offset.y = entity.break_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.size.width = entity.break_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_bar.size.height = entity.break_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.break_text_label.offset.x = entity.break_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_text_label.offset.y = entity.break_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.break_value_label.offset.x = entity.break_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_value_label.offset.y = entity.break_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.break_percentage_label.offset.x = entity.break_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.break_percentage_label.offset.y = entity.break_percentage_label.offset.y * config.current_config.global_settings.modifiers.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.offset.x = entity.loss_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.offset.y = entity.loss_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.size.width = entity.loss_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_bar.size.height = entity.loss_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.loss_text_label.offset.x = entity.loss_text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_text_label.offset.y = entity.loss_text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.loss_value_label.offset.x = entity.loss_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_value_label.offset.y = entity.loss_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scale)
|
||||
if not part.body_part_dynamic_UI.visibility then
|
||||
if not part.body_part_dynamic_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -43,19 +89,80 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
end
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_dynamic_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
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);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.part_health.offset.y,
|
||||
visibility = part.body_part_dynamic_UI.flinch_visibility
|
||||
};
|
||||
|
||||
drawing.draw_label(part.body_part_dynamic_UI.name_label, position_on_screen, opacity_scale, part_name);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.text_label, position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.value_label, position_on_screen, opacity_scale, part.health, part.max_health);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.percentage_label, position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.part_break.offset.y,
|
||||
visibility = part.body_part_dynamic_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
|
||||
if part.body_part_dynamic_UI.flinch_visibility then
|
||||
drawing.draw_bar(part.body_part_dynamic_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_bar(part.body_part_dynamic_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_bar(part.body_part_dynamic_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage);
|
||||
end
|
||||
|
||||
drawing.draw_label(part.body_part_dynamic_UI.part_name_label, position_on_screen, opacity_scale, part_name);
|
||||
|
||||
if part.body_part_dynamic_UI.flinch_visibility then
|
||||
drawing.draw_label(part.body_part_dynamic_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_dynamic_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_label(part.body_part_dynamic_UI.break_text_label, break_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_dynamic_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_label(part.body_part_dynamic_UI.loss_text_label, loss_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string);
|
||||
drawing.draw_label(part.body_part_dynamic_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage);
|
||||
end
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale)
|
||||
if not part.body_part_static_UI.visibility then
|
||||
if not part.body_part_static_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -64,19 +171,80 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_static_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
|
||||
drawing.draw_label(part.body_part_static_UI.name_label, position_on_screen, opacity_scale, part_name);
|
||||
drawing.draw_label(part.body_part_static_UI.text_label, position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_static_UI.value_label, position_on_screen, opacity_scale, part.health, part.max_health);
|
||||
drawing.draw_label(part.body_part_static_UI.percentage_label, position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.static.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.static.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
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);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.parts.part_health.offset.y,
|
||||
visibility = part.body_part_static_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.parts.part_break.offset.y,
|
||||
visibility = part.body_part_static_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.static.parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.static.parts.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
|
||||
if part.body_part_static_UI.flinch_visibility then
|
||||
drawing.draw_bar(part.body_part_static_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_bar(part.body_part_static_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_bar(part.body_part_static_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage);
|
||||
end
|
||||
|
||||
drawing.draw_label(part.body_part_static_UI.part_name_label, position_on_screen, opacity_scale, part_name);
|
||||
|
||||
if part.body_part_static_UI.flinch_visibility then
|
||||
drawing.draw_label(part.body_part_static_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_static_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string);
|
||||
drawing.draw_label(part.body_part_static_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_static_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_label(part.body_part_static_UI.break_text_label, break_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_static_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string);
|
||||
drawing.draw_label(part.body_part_static_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_static_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_label(part.body_part_static_UI.loss_text_label, loss_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_static_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string);
|
||||
drawing.draw_label(part.body_part_static_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage);
|
||||
end
|
||||
end
|
||||
|
||||
function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_scale)
|
||||
if not part.body_part_highlighted_UI.visibility then
|
||||
if not part.body_part_highlighted_UI.part_visibility then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -85,15 +253,76 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
|
||||
part_name = part.name .. " ";
|
||||
end
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count);
|
||||
part_name = part_name .. "x" .. tostring(part.flinch_count) .. " ";
|
||||
end
|
||||
|
||||
if part.break_max_count ~= 0 then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count then
|
||||
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. tostring(part.break_count) .. "/" .. tostring(part.break_max_count);
|
||||
|
||||
elseif part.flinch_count ~= 0 then
|
||||
part_name = part_name .. "x" .. tostring(part.break_count);
|
||||
end
|
||||
elseif config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_max_count then
|
||||
part_name = part_name .. "/" .. tostring(part.break_max_count);
|
||||
end
|
||||
end
|
||||
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
|
||||
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);
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.part_health.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.part_health.offset.y,
|
||||
visibility = part.body_part_highlighted_UI.flinch_visibility
|
||||
};
|
||||
|
||||
drawing.draw_label(part.body_part_highlighted_UI.name_label, position_on_screen, opacity_scale, part_name);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.text_label, position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.value_label, position_on_screen, opacity_scale, part.health, part.max_health);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.percentage_label, position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.part_break.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.part_break.offset.y,
|
||||
visibility = part.body_part_highlighted_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.part_loss.offset.x,
|
||||
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.part_loss.offset.y,
|
||||
|
||||
|
||||
};
|
||||
|
||||
if part.body_part_highlighted_UI.flinch_visibility then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_bar(part.body_part_highlighted_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage);
|
||||
end
|
||||
|
||||
drawing.draw_label(part.body_part_highlighted_UI.part_name_label, position_on_screen, opacity_scale, part_name);
|
||||
|
||||
if part.body_part_highlighted_UI.flinch_visibility then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_text_label, flinch_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_value_label, flinch_position_on_screen, opacity_scale, health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.flinch_percentage_label, flinch_position_on_screen, opacity_scale, 100 * part.health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.break_visibility and part.break_max_health ~= -1 and part.break_count < part.break_max_count then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_text_label, break_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_value_label, break_position_on_screen, opacity_scale, break_health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage);
|
||||
end
|
||||
|
||||
if part.body_part_highlighted_UI.loss_visibility and part.loss_max_health ~= -1 and not part.is_severed then
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_text_label, loss_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string);
|
||||
drawing.draw_label(part.body_part_highlighted_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage);
|
||||
end
|
||||
end
|
||||
|
||||
function body_part_UI_entity.init_module()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,17 @@ function drawing.init_font()
|
||||
drawing.font = d2d.Font.new(config.current_config.global_settings.UI_font.family, config.current_config.global_settings.UI_font.size, config.current_config.global_settings.UI_font.bold, config.current_config.global_settings.UI_font.italic);
|
||||
end
|
||||
|
||||
function drawing.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;
|
||||
local blue = argb_color & 0xFF;
|
||||
|
||||
local abgr_color = 0x1000000 * alpha + 0x10000 * blue + 0x100 * green + red;
|
||||
|
||||
return abgr_color;
|
||||
end
|
||||
|
||||
function drawing.color_to_argb(color)
|
||||
local alpha = (color >> 24) & 0xFF;
|
||||
local red = (color >> 16) & 0xFF;
|
||||
@@ -68,14 +79,26 @@ function drawing.draw_label(label, position, opacity_scale, ...)
|
||||
new_shadow_color = drawing.scale_color_opacity(new_shadow_color, opacity_scale);
|
||||
end
|
||||
|
||||
d2d.text(drawing.font, text, position_x + label.shadow.offset.x, position_y + label.shadow.offset.y, new_shadow_color);
|
||||
if d2d ~= nil then
|
||||
d2d.text(drawing.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);
|
||||
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);
|
||||
end
|
||||
d2d.text(drawing.font, text, position_x, position_y, new_color);
|
||||
|
||||
if d2d ~= nil then
|
||||
d2d.text(drawing.font, text, position_x, position_y, new_color);
|
||||
else
|
||||
new_color = drawing.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)
|
||||
@@ -106,9 +129,20 @@ function drawing.draw_bar(bar, position, opacity_scale, percentage)
|
||||
end
|
||||
|
||||
-- foreground
|
||||
d2d.fill_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color);
|
||||
if d2d ~= nil then
|
||||
d2d.fill_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color);
|
||||
else
|
||||
new_foreground_color = drawing.argb_color_to_abgr_color(new_foreground_color);
|
||||
draw.filled_rect(position_x, position_y, foreground_width, bar.size.height, new_foreground_color)
|
||||
end
|
||||
|
||||
-- background
|
||||
d2d.fill_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color);
|
||||
if d2d ~= nil then
|
||||
d2d.fill_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color);
|
||||
else
|
||||
new_background_color = drawing.argb_color_to_abgr_color(new_background_color);
|
||||
draw.filled_rect(position_x + foreground_width, position_y, background_width, bar.size.height, new_background_color)
|
||||
end
|
||||
end
|
||||
|
||||
function drawing.draw_capture_line(bar, position, opacity_scale, percentage)
|
||||
@@ -130,9 +164,13 @@ function drawing.draw_capture_line(bar, position, opacity_scale, percentage)
|
||||
if opacity_scale < 1 then
|
||||
color = drawing.scale_color_opacity(color, opacity_scale);
|
||||
end
|
||||
|
||||
d2d.fill_rect(position_x, position_y, bar.capture_line.size.width, bar.capture_line.size.height, color);
|
||||
|
||||
if d2d ~= nil then
|
||||
d2d.fill_rect(position_x, position_y, bar.capture_line.size.width, bar.capture_line.size.height, color);
|
||||
else
|
||||
color = drawing.argb_color_to_abgr_color(color);
|
||||
draw.filled_rect(position_x, position_y, bar.capture_line.size.width, bar.capture_line.size.height, color)
|
||||
end
|
||||
end
|
||||
|
||||
function drawing.init_module()
|
||||
|
||||
Reference in New Issue
Block a user