Big commit

- Add missing Tired Timer to Stamina UI;
- Replace per-tick updates of HP, Stamina and Rage to per-event;
-- Stamina UI on Small Monsters is now deprecated;
-
This commit is contained in:
GreenComfyTea
2022-07-10 20:00:56 +03:00
parent 9c1ba9ac4c
commit 06a29637bd
8 changed files with 662 additions and 470 deletions

View File

@@ -19,8 +19,16 @@ local is_marionette_attack_method = enemy_calc_damage_info_type_def:get_method("
local get_total_damage_method = enemy_calc_damage_info_type_def:get_method("get_TotalDamage"); local get_total_damage_method = enemy_calc_damage_info_type_def:get_method("get_TotalDamage");
local get_physical_damage_method = enemy_calc_damage_info_type_def:get_method("get_PhysicalDamage"); local get_physical_damage_method = enemy_calc_damage_info_type_def:get_method("get_PhysicalDamage");
local get_elemental_damage_method = enemy_calc_damage_info_type_def:get_method("get_ElementDamage"); local get_elemental_damage_method = enemy_calc_damage_info_type_def:get_method("get_ElementDamage");
local get_condition_damage_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage"); local get_condition_damage_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage");
local get_condition_type_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType"); local get_condition_type_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType");
local get_condition_damage2_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage2");
local get_condition_type2_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType2");
local get_condition_damage3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamage3");
local get_condition_type3_method = enemy_calc_damage_info_type_def:get_method("get_ConditionDamageType3");
local stock_mystery_core_break_damage_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase.stockMysteryCoreBreakDamage");
local types = { local types = {
[0] = "PlayerWeapon", [0] = "PlayerWeapon",
@@ -82,12 +90,8 @@ function damage_hook.get_damage_source_type(damage_source_type_id, is_marionette
return tostring(damage_source_type_id); return tostring(damage_source_type_id);
end end
function damage_hook.update_damage(args) -- snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide
local enemy = sdk.to_managed_object(args[2]); function damage_hook.update_damage(enemy, enemy_calc_damage_info)
if enemy == nil then
return;
end
local is_large_monster = is_boss_enemy_method:call(enemy); local is_large_monster = is_boss_enemy_method:call(enemy);
if is_large_monster == nil then if is_large_monster == nil then
@@ -103,7 +107,6 @@ function damage_hook.update_damage(args)
return; return;
end end
local enemy_calc_damage_info = sdk.to_managed_object(args[3]); -- snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide -- snow.hit.DamageFlowInfoBase calcDamageResult?
local attacker_id = get_attacker_id_method:call(enemy_calc_damage_info); local attacker_id = get_attacker_id_method:call(enemy_calc_damage_info);
local attacker_type = get_damage_attacker_type_method:call(enemy_calc_damage_info); local attacker_type = get_damage_attacker_type_method:call(enemy_calc_damage_info);
local is_marionette_attack = is_marionette_attack_method:call(enemy_calc_damage_info) local is_marionette_attack = is_marionette_attack_method:call(enemy_calc_damage_info)
@@ -123,7 +126,7 @@ function damage_hook.update_damage(args)
end end
end end
-- get_Em2EmDamageType() -- get_Em2EmDamageType();
local damage_object = {} local damage_object = {}
damage_object.total_damage = get_total_damage_method:call(enemy_calc_damage_info); damage_object.total_damage = get_total_damage_method:call(enemy_calc_damage_info);
@@ -132,7 +135,13 @@ function damage_hook.update_damage(args)
damage_object.ailment_damage = 0; damage_object.ailment_damage = 0;
local condition_damage = get_condition_damage_method:call(enemy_calc_damage_info); local condition_damage = get_condition_damage_method:call(enemy_calc_damage_info);
local condition_type = tonumber(get_condition_type_method:call(enemy_calc_damage_info)); local condition_type = tonumber(get_condition_type_method:call(enemy_calc_damage_info));
local condition_damage2 = get_condition_damage2_method:call(enemy_calc_damage_info);
local condition_type2 = tonumber(get_condition_type2_method:call(enemy_calc_damage_info));
local condition_damage3 = get_condition_damage3_method:call(enemy_calc_damage_info);
local condition_type3 = tonumber(get_condition_type3_method:call(enemy_calc_damage_info));
-- 0 - PlayerWeapon -- 0 - PlayerWeapon
-- 1 - BarrelBombLarge -- 1 - BarrelBombLarge
@@ -168,11 +177,17 @@ function damage_hook.update_damage(args)
-- 31 - EcSwampLeech -- 31 - EcSwampLeech
-- 32 - EcPenetrateFish -- 32 - EcPenetrateFish
--xy = xy .. "\nPlayer: " .. tostring(attacker_id) ..
--" Damage: " .. tostring(damage_object.total_damage) ..
--" Type: (" .. tostring(attacker_type) ..
--") " .. tostring(types[attacker_type]) ..
--" Condition Damage: " .. tostring(condition_damage) ..
--" Condition Type: (" .. tostring(attacker_type) ..
--") " .. tostring(condition_type);
xy = "\nPlayer: " .. tostring(attacker_id) .. if string.len(xy) > 2300 then
"\nDamage: " .. tostring(damage_object.total_damage) .. xy = "";
"\nType: (" .. tostring(attacker_type) .. end
") " .. tostring(types[attacker_type]);
local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack); local damage_source_type = damage_hook.get_damage_source_type(attacker_type, is_marionette_attack);
@@ -189,13 +204,19 @@ function damage_hook.update_damage(args)
if stun_damage ~= 0 and stun_damage ~= nil then if stun_damage ~= 0 and stun_damage ~= nil then
ailments.apply_ailment_buildup(monster, attacker_id, ailments.stun_id, stun_damage); ailments.apply_ailment_buildup(monster, attacker_id, ailments.stun_id, stun_damage);
end end
ailments.apply_ailment_buildup(monster, attacker_id, condition_type, condition_damage); ailments.apply_ailment_buildup(monster, attacker_id, condition_type, condition_damage);
ailments.apply_ailment_buildup(monster, attacker_id, condition_type2, condition_damage2);
ailments.apply_ailment_buildup(monster, attacker_id, condition_type3, condition_damage3);
player.update_damage(player.total, damage_source_type, is_large_monster, damage_object); player.update_damage(player.total, damage_source_type, is_large_monster, damage_object);
player.update_damage(attacking_player, damage_source_type, is_large_monster, damage_object); player.update_damage(attacking_player, damage_source_type, is_large_monster, damage_object);
end end
function damage_hook.on_mystery_core_break(enemy)
end
function damage_hook.init_module() function damage_hook.init_module()
quest_status = require("MHR_Overlay.Game_Handler.quest_status"); quest_status = require("MHR_Overlay.Game_Handler.quest_status");
player = require("MHR_Overlay.Damage_Meter.player"); player = require("MHR_Overlay.Damage_Meter.player");
@@ -204,7 +225,13 @@ function damage_hook.init_module()
ailments = require("MHR_Overlay.Monsters.ailments"); ailments = require("MHR_Overlay.Monsters.ailments");
sdk.hook(enemy_character_base_after_calc_damage_damage_side, function(args) sdk.hook(enemy_character_base_after_calc_damage_damage_side, function(args)
pcall(damage_hook.update_damage, args); pcall(damage_hook.update_damage, sdk.to_managed_object(args[2]), sdk.to_managed_object(args[3]));
end, function(retval)
return retval;
end);
sdk.hook(stock_mystery_core_break_damage_type_def, function(args)
pcall(damage_hook.on_mystery_core_break, sdk.to_managed_object(args[2]));
end, function(retval) end, function(retval)
return retval; return retval;
end); end);

View File

@@ -912,7 +912,27 @@ function config.init()
text = "%5.1f%%", text = "%5.1f%%",
offset = { offset = {
x = 145-10, x = 135,
y = 17
},
color = 0xFFFFFFFF,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
timer_label = {
visibility = true,
text = "%2.0f:%02.0f",
offset = {
x = 140,
y = 17 y = 17
}, },
color = 0xFFFFFFFF, color = 0xFFFFFFFF,
@@ -1935,6 +1955,26 @@ function config.init()
color = 0xFF000000 color = 0xFF000000
} }
}, },
timer_label = {
visibility = true,
text = "%2.0f:%02.0f",
offset = {
x = 140,
y = 17
},
color = 0xFFFFFFFF,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
bar = { bar = {
visibility = true, visibility = true,
@@ -2892,7 +2932,7 @@ function config.init()
visibility = true, visibility = true,
text = "%.0f/%.0f", -- current_health/max_health text = "%.0f/%.0f", -- current_health/max_health
offset = { offset = {
x = 55-10, x = 45,
y = 17 y = 17
}, },
color = 0xFFFFFFFF, color = 0xFFFFFFFF,
@@ -2912,7 +2952,27 @@ function config.init()
text = "%5.1f%%", text = "%5.1f%%",
offset = { offset = {
x = 145-10, x = 135,
y = 17
},
color = 0xFFFFFFFF,
shadow = {
visibility = true,
offset = {
x = 1,
y = 1
},
color = 0xFF000000
}
},
timer_label = {
visibility = true,
text = "%2.0f:%02.0f",
offset = {
x = 140,
y = 17 y = 17
}, },
color = 0xFFFFFFFF, color = 0xFFFFFFFF,

View File

@@ -39,26 +39,34 @@ function large_monster.new(enemy)
monster.dead_or_captured = false; monster.dead_or_captured = false;
monster.is_disp_icon_mini_map = true; monster.is_disp_icon_mini_map = true;
monster.is_tired = false;
monster.stamina = 0; monster.stamina = 0;
monster.max_stamina = 1000; monster.max_stamina = 1000;
monster.stamina_percentage = 0; monster.stamina_percentage = 0;
monster.missing_stamina = 0; monster.missing_stamina = 0;
monster.tired_timer = 0;
monster.tired_duration = 600;
monster.tired_total_seconds_left = 0;
monster.tired_minutes_left = 0;
monster.tired_seconds_left = 0;
monster.tired_timer_percentage = 0;
monster.is_in_rage = false; monster.is_in_rage = false;
monster.rage_point = 0; monster.rage_point = 0;
monster.rage_limit = 3000; monster.rage_limit = 3000;
monster.rage_timer = 0;
monster.rage_duration = 600;
monster.rage_count = 0; monster.rage_count = 0;
monster.rage_percentage = 0; monster.rage_percentage = 0;
monster.rage_timer = 0;
monster.rage_duration = 600;
monster.rage_total_seconds_left = 0; monster.rage_total_seconds_left = 0;
monster.rage_minutes_left = 0; monster.rage_minutes_left = 0;
monster.rage_seconds_left = 0; monster.rage_seconds_left = 0;
monster.rage_timer_percentage = 0; monster.rage_timer_percentage = 0;
monster.game_object = nil;
monster.transform = nil;
monster.position = Vector3f.new(0, 0, 0); monster.position = Vector3f.new(0, 0, 0);
monster.distance = 0; monster.distance = 0;
@@ -83,6 +91,17 @@ function large_monster.new(enemy)
if large_monster.list[enemy] == nil then if large_monster.list[enemy] == nil then
large_monster.list[enemy] = monster; large_monster.list[enemy] = monster;
end end
large_monster.update_position(enemy, monster);
large_monster.update(enemy, monster);
local physical_param = large_monster.update_health(enemy, monster);
large_monster.update_parts(enemy, monster, physical_param);
large_monster.update_stamina(enemy, monster, nil);
large_monster.update_stamina_timer(enemy, monster, nil);
large_monster.update_rage(enemy, monster, nil);
large_monster.update_rage_timer(enemy, monster, nil);
return monster; return monster;
end end
@@ -95,6 +114,7 @@ function large_monster.get_monster(enemy)
end end
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase"); local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
local enemy_type_field = enemy_character_base_type_def:get_field("<EnemyType>k__BackingField"); local enemy_type_field = enemy_character_base_type_def:get_field("<EnemyType>k__BackingField");
local get_monster_list_register_scale_method = enemy_character_base_type_def:get_method("get_MonsterListRegisterScale"); local get_monster_list_register_scale_method = enemy_character_base_type_def:get_method("get_MonsterListRegisterScale");
@@ -196,7 +216,8 @@ function large_monster.init_dynamic_UI(monster)
cached_config.stamina.bar, cached_config.stamina.bar,
cached_config.stamina.text_label, cached_config.stamina.text_label,
cached_config.stamina.value_label, cached_config.stamina.value_label,
cached_config.stamina.percentage_label cached_config.stamina.percentage_label,
cached_config.stamina.timer_label
); );
monster.rage_dynamic_UI = rage_UI_entity.new( monster.rage_dynamic_UI = rage_UI_entity.new(
@@ -254,7 +275,8 @@ function large_monster.init_static_UI(monster)
cached_config.stamina.bar, cached_config.stamina.bar,
cached_config.stamina.text_label, cached_config.stamina.text_label,
cached_config.stamina.value_label, cached_config.stamina.value_label,
cached_config.stamina.percentage_label cached_config.stamina.percentage_label,
cached_config.stamina.timer_label
); );
monster.rage_static_UI = rage_UI_entity.new( monster.rage_static_UI = rage_UI_entity.new(
@@ -309,7 +331,8 @@ function large_monster.init_highlighted_UI(monster)
cached_config.stamina.bar, cached_config.stamina.bar,
cached_config.stamina.text_label, cached_config.stamina.text_label,
cached_config.stamina.value_label, cached_config.stamina.value_label,
cached_config.stamina.percentage_label cached_config.stamina.percentage_label,
cached_config.stamina.timer_label
); );
monster.rage_highlighted_UI = rage_UI_entity.new( monster.rage_highlighted_UI = rage_UI_entity.new(
@@ -355,16 +378,20 @@ local get_current_method = vital_param_type:get_method("get_Current");
local get_max_method = vital_param_type:get_method("get_Max"); local get_max_method = vital_param_type:get_method("get_Max");
local stamina_param_type = stamina_param_field:get_type(); local stamina_param_type = stamina_param_field:get_type();
local is_tired_method = stamina_param_type:get_method("isTired");
local get_stamina_method = stamina_param_type:get_method("getStamina"); local get_stamina_method = stamina_param_type:get_method("getStamina");
local get_max_stamina_method = stamina_param_type:get_method("getMaxStamina"); local get_max_stamina_method = stamina_param_type:get_method("getMaxStamina");
local get_remaining_tired_time_method = stamina_param_type:get_method("getStaminaRemainingTime");
local get_total_tired_time_method = stamina_param_type:get_method("get_TiredSec");
local anger_param_type = anger_param_field:get_type(); local anger_param_type = anger_param_field:get_type();
local is_anger_method = anger_param_type:get_method("isAnger"); local is_anger_method = anger_param_type:get_method("isAnger");
local get_anger_point_method = anger_param_type:get_method("get_AngerPoint"); local get_anger_point_method = anger_param_type:get_method("get_AngerPoint");
local get_limit_anger_method = anger_param_type:get_method("get_LimitAnger"); local get_limit_anger_method = anger_param_type:get_method("get_LimitAnger");
local anger_param_get_timer_method = anger_param_type:get_method("get_Timer");
local get_timer_anger_method = anger_param_type:get_method("get_TimerAnger"); local get_remaining_anger_time_method = anger_param_type:get_method("getAngerRemainingTime");
local get_count_anger_method = anger_param_type:get_method("get_CountAnger"); local get_total_anger_time_method = anger_param_type:get_method("get_TimerAnger");
local mario_param_field = enemy_character_base_type_def:get_field("<MarioParam>k__BackingField"); local mario_param_field = enemy_character_base_type_def:get_field("<MarioParam>k__BackingField");
@@ -374,18 +401,15 @@ local get_mario_player_index_method = mario_param_type:get_method("get_MarioPlay
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos"); local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
function large_monster.update_position(enemy) function large_monster.update_position(enemy, monster)
if not config.current_config.large_monster_UI.dynamic.enabled then if not config.current_config.large_monster_UI.dynamic.enabled then
return; return;
end end
local monster = large_monster.get_monster(enemy); local position = get_pos_field:call(enemy);
if monster == nil then if position ~= nil then
return; monster.position = position;
end end
local position = get_pos_field:call(enemy) or monster.position;
monster.position = position;
end end
-- Code by coavins -- Code by coavins
@@ -406,7 +430,7 @@ function large_monster.update_all_riders()
end end
function large_monster.update(enemy) function large_monster.update(enemy, monster)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled if not cached_config.dynamic.enabled
@@ -419,25 +443,24 @@ function large_monster.update(enemy)
return; return;
end end
local monster = large_monster.get_monster(enemy);
local dead_or_captured = check_die_method:call(enemy); local dead_or_captured = check_die_method:call(enemy);
monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured; monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured;
local is_disp_icon_mini_map = is_disp_icon_mini_map_method:call(enemy) local is_disp_icon_mini_map = is_disp_icon_mini_map_method:call(enemy);
monster.is_disp_icon_mini_map = (is_disp_icon_mini_map == nil and false) or is_disp_icon_mini_map; monster.is_disp_icon_mini_map = (is_disp_icon_mini_map == nil and false) or is_disp_icon_mini_map;
local physical_param = large_monster.update_health(enemy, monster);
large_monster.update_stamina(enemy, monster);
large_monster.update_rage(enemy, monster);
large_monster.update_parts(enemy, monster, physical_param);
ailments.update_ailments(enemy, monster); ailments.update_ailments(enemy, monster);
end end
function large_monster.update_health(enemy, monster) function large_monster.update_health(enemy, monster)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.health.visibility if not cached_config.dynamic.health.visibility
and not cached_config.static.health.visibility and not cached_config.static.health.visibility
and not cached_config.highlighted.health.visibility then and not cached_config.highlighted.health.visibility then
@@ -469,61 +492,155 @@ function large_monster.update_health(enemy, monster)
return physical_param; return physical_param;
end end
function large_monster.update_stamina(enemy, monster) function large_monster.update_stamina(enemy, monster, stamina_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.stamina.visibility if not cached_config.dynamic.stamina.visibility
and not cached_config.static.stamina.visibility and not cached_config.static.stamina.visibility
and not cached_config.highlighted.stamina.visibility then and not cached_config.highlighted.stamina.visibility then
return; return;
end end
local stamina_param = stamina_param_field:get_data(enemy)
if stamina_param == nil then if stamina_param == nil then
customization_menu.status = "No stamina param"; stamina_param = stamina_param_field:get_data(enemy);
return; if stamina_param == nil then
customization_menu.status = "No stamina param";
return;
end
end
local is_tired = is_tired_method:call(stamina_param, false);
if is_tired ~= nil then
monster.is_tired = is_tired;
end end
monster.stamina = get_stamina_method:call(stamina_param) or monster.stamina; monster.stamina = get_stamina_method:call(stamina_param) or monster.stamina;
monster.max_stamina = get_max_stamina_method:call(stamina_param) or monster.max_stamina; monster.max_stamina = get_max_stamina_method:call(stamina_param) or monster.max_stamina;
monster.missing_stamina = monster.max_stamina - monster.stamina; monster.missing_stamina = monster.max_stamina - monster.stamina;
if monster.max_stamina ~= 0 then if monster.max_stamina ~= 0 then
monster.stamina_percentage = monster.stamina / monster.max_stamina; monster.stamina_percentage = monster.stamina / monster.max_stamina;
end end
end end
function large_monster.update_rage(enemy, monster) function large_monster.update_stamina_timer(enemy, monster, stamina_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.stamina.visibility
and not cached_config.static.stamina.visibility
and not cached_config.highlighted.stamina.visibility then
return;
end
if stamina_param == nil then
stamina_param = stamina_param_field:get_data(enemy);
if stamina_param == nil then
customization_menu.status = "No stamina param";
return;
end
end
local is_tired = is_tired_method:call(stamina_param, false);
if is_tired ~= nil then
monster.is_tired = is_tired;
end
monster.tired_timer = get_remaining_tired_time_method:call(stamina_param) or monster.tired_timer;
monster.tired_duration = get_total_tired_time_method:call(stamina_param) or monster.tired_duration;
if monster.is_tired then
monster.tired_total_seconds_left = monster.tired_timer;
if monster.tired_total_seconds_left < 0 then
monster.tired_total_seconds_left = 0;
end
monster.tired_minutes_left = math.floor(monster.tired_total_seconds_left / 60);
monster.tired_seconds_left = monster.tired_total_seconds_left - 60 * monster.tired_minutes_left;
if monster.tired_duration ~= 0 then
monster.tired_timer_percentage = monster.tired_total_seconds_left / monster.tired_duration;
end
end
end
function large_monster.update_rage(enemy, monster, anger_param)
local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.rage.visibility if not cached_config.dynamic.rage.visibility
and not cached_config.static.rage.visibility and not cached_config.static.rage.visibility
and not cached_config.highlighted.rage.visibility then and not cached_config.highlighted.rage.visibility then
return; return;
end end
local anger_param = anger_param_field:get_data(enemy);
if anger_param == nil then if anger_param == nil then
customization_menu.status = "No anger param"; anger_param = anger_param_field:get_data(enemy);
return; if anger_param == nil then
customization_menu.status = "No anger param";
return;
end
end end
local is_in_rage = is_anger_method:call(anger_param);
monster.is_in_rage = (is_in_rage == nil and false) or is_in_rage;
monster.rage_point = get_anger_point_method:call(anger_param) or monster.rage_point; monster.rage_point = get_anger_point_method:call(anger_param) or monster.rage_point;
monster.rage_limit = get_limit_anger_method:call(anger_param)or monster.rage_limit; monster.rage_limit = get_limit_anger_method:call(anger_param)or monster.rage_limit;
monster.rage_timer = anger_param_get_timer_method:call(anger_param) or monster.rage_timer;
monster.rage_duration = get_timer_anger_method:call(anger_param) or monster.rage_duration;
monster.rage_count = get_count_anger_method:call(anger_param) or monster.rage_count;
if monster.rage_limit ~= 0 then if monster.rage_limit ~= 0 then
monster.rage_percentage = monster.rage_point / monster.rage_limit; monster.rage_percentage = monster.rage_point / monster.rage_limit;
end end
end
function large_monster.update_rage_timer(enemy, monster, anger_param)
local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.rage.visibility
and not cached_config.static.rage.visibility
and not cached_config.highlighted.rage.visibility then
return;
end
if anger_param == nil then
anger_param = anger_param_field:get_data(enemy);
if anger_param == nil then
customization_menu.status = "No anger param";
return;
end
end
local is_in_rage = is_anger_method:call(anger_param);
if is_in_rage ~= nil then
monster.is_in_rage = is_in_rage;
end
monster.rage_timer = get_remaining_anger_time_method:call(anger_param) or monster.rage_timer;
monster.rage_duration = get_total_anger_time_method:call(anger_param) or monster.rage_duration;
if monster.is_in_rage then if monster.is_in_rage then
monster.rage_total_seconds_left = monster.rage_duration - monster.rage_timer; monster.rage_total_seconds_left = monster.rage_timer;
if monster.rage_total_seconds_left < 0 then if monster.rage_total_seconds_left < 0 then
monster.rage_total_seconds_left = 0; monster.rage_total_seconds_left = 0;
end end
@@ -540,6 +657,12 @@ end
function large_monster.update_parts(enemy, monster, physical_param) function large_monster.update_parts(enemy, monster, physical_param)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled
and not cached_config.static.enabled
and not cached_config.highlighted.enabled then
return;
end
if not cached_config.dynamic.body_parts.visibility if not cached_config.dynamic.body_parts.visibility
and not cached_config.static.body_parts.visibility and not cached_config.static.body_parts.visibility
and not cached_config.highlighted.body_parts.visibility then and not cached_config.highlighted.body_parts.visibility then
@@ -644,7 +767,9 @@ function large_monster.update_parts(enemy, monster, physical_param)
if enemy_parts_info ~= nil then if enemy_parts_info ~= nil then
local _is_severed = enemy_parts_info:call("get_PartsLossState"); local _is_severed = enemy_parts_info:call("get_PartsLossState");
is_severed = (_is_severed == nil and false) or is_severed; if _is_severed ~= nil then
is_severed = _is_severed;
end
end end
body_part.update_loss(part, part_loss_current, part_loss_max, is_severed) body_part.update_loss(part, part_loss_current, part_loss_max, is_severed)
@@ -908,7 +1033,7 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_screen, opacity_scale); ailment_buildup.draw_highlighted(monster, ailment_buildups_position_on_screen, opacity_scale);
end end
function large_monster.init_list() function large_monster.init_list()
large_monster.list = {}; large_monster.list = {};
end end

View File

@@ -4,11 +4,24 @@ local large_monster;
local config; local config;
local ailments; local ailments;
local character_base_type_def = sdk.find_type_definition("snow.CharacterBase");
local character_base_start_method = character_base_type_def:get_method("start");
local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase"); local enemy_character_base_type_def = sdk.find_type_definition("snow.enemy.EnemyCharacterBase");
local enemy_character_base_update_method = enemy_character_base_type_def:get_method("update"); local enemy_character_base_update_method = enemy_character_base_type_def:get_method("update");
local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy"); local is_boss_enemy_method = enemy_character_base_type_def:get_method("get_isBossEnemy");
local enemy_damage_check_type_def = sdk.find_type_definition("snow.enemy.EnemyDamageCheck");
local damage_check_update_param_update_method = enemy_damage_check_type_def:get_method("updateParam");
local anger_param_type_def = sdk.find_type_definition("snow.enemy.EnemyAngerParam");
local anger_add_method = anger_param_type_def:get_method("add");
local anger_update_method = anger_param_type_def:get_method("updateNormal");
local stamina_param_type_def = sdk.find_type_definition("snow.enemy.EnemyStaminaParam");
local stamina_sub_method = stamina_param_type_def:get_method("sub");
local stamina_update_method = stamina_param_type_def:get_method("updateParam");
local tick_count = 0; local tick_count = 0;
local last_update_tick = 0; local last_update_tick = 0;
local recorded_monsters = {}; local recorded_monsters = {};
@@ -41,6 +54,67 @@ re.on_pre_application_entry("UpdateBehavior", function()
end end
end) end)
--snow.enemy.EnemyDamageStockParam
function monster_hook.update_health(enemy_damage_stock_param)
local enemy = enemy_damage_stock_param:call("get_RefEnemy");
if enemy == nil then
return;
end
local is_large = is_boss_enemy_method:call(enemy);
if is_large == nil then
return;
end
if is_large then
local monster = large_monster.get_monster(enemy);
local physical_param = large_monster.update_health(enemy, monster);
large_monster.update_parts(enemy, monster, physical_param);
else
local monster = small_monster.get_monster(enemy);
small_monster.update_health(enemy, monster);
end
end
function monster_hook.update_stamina(stamina_param, stamina_sub)
if stamina_sub == 0 then
return;
end
local enemy = stamina_param:call("get_Em");
if enemy == nil then
return;
end
local monster = large_monster.get_monster(enemy);
large_monster.update_stamina(enemy, monster, stamina_param);
-- stamina sub gets called periodically at low rate for large monsters even without damage
large_monster.update(enemy, monster);
end
function monster_hook.update_stamina_timer(stamina_param, enemy)
local monster = large_monster.get_monster(enemy);
large_monster.update_stamina(enemy, monster, stamina_param);
end
function monster_hook.update_rage(anger_param, anger_add, enemy)
if anger_add == 0 then
return;
end
local monster = large_monster.get_monster(enemy);
large_monster.update_rage(enemy, monster, anger_param);
end
function monster_hook.update_rage_timer(anger_param, enemy)
local monster = large_monster.get_monster(enemy);
large_monster.update_rage_timer(enemy, monster, anger_param);
end
function monster_hook.update_monster(enemy) function monster_hook.update_monster(enemy)
if enemy == nil then if enemy == nil then
return; return;
@@ -72,37 +146,16 @@ end
function monster_hook.update_large_monster(enemy) function monster_hook.update_large_monster(enemy)
local cached_config = config.current_config.large_monster_UI; local cached_config = config.current_config.large_monster_UI;
if not cached_config.dynamic.enabled and if not cached_config.dynamic.enabled then
not cached_config.static.enabled and
not cached_config.highlighted.enabled then
return; return;
end end
local monster = large_monster.get_monster(enemy);
-- this is the VERY LEAST thing we should do all the time -- this is the VERY LEAST thing we should do all the time
-- so the position doesn't lag all over the place -- so the position doesn't lag all over the place
-- due to how infrequently we update the monster(s). -- due to how infrequently we update the monster(s).
large_monster.update_position(enemy); large_monster.update_position(enemy, monster);
if not config.current_config.global_settings.performance.prioritize_large_monsters and updated_monsters[enemy] then
return;
end
-- is it old tick?
-- is update limit reached?
if tick_count == last_update_tick and updates_this_tick >= config.current_config.global_settings.performance.max_monster_updates_per_tick then
return;
end
-- actually update the enemy now. we don't do this very often
-- due to how much CPU time it takes to update each monster.
if not config.current_config.global_settings.performance.prioritize_large_monsters then
updates_this_tick = updates_this_tick + 1;
last_update_tick = tick_count;
num_updated_monsters = num_updated_monsters + 1;
updated_monsters[enemy] = true;
end
large_monster.update(enemy);
end end
function monster_hook.update_small_monster(enemy) function monster_hook.update_small_monster(enemy)
@@ -110,10 +163,12 @@ function monster_hook.update_small_monster(enemy)
return; return;
end end
local monster = small_monster.get_monster(enemy);
-- this is the VERY LEAST thing we should do all the time -- this is the VERY LEAST thing we should do all the time
-- so the position doesn't lag all over the place -- so the position doesn't lag all over the place
-- due to how infrequently we update the monster(s). -- due to how infrequently we update the monster(s).
small_monster.update_position(enemy); small_monster.update_position(enemy, monster);
if updated_monsters[enemy] then if updated_monsters[enemy] then
return; return;
@@ -132,20 +187,51 @@ function monster_hook.update_small_monster(enemy)
num_updated_monsters = num_updated_monsters + 1; num_updated_monsters = num_updated_monsters + 1;
updated_monsters[enemy] = true; updated_monsters[enemy] = true;
small_monster.update(enemy); small_monster.update(enemy, monster);
end end
function monster_hook.init_module() function monster_hook.init_module()
small_monster = require("MHR_Overlay.Monsters.small_monster"); small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster"); large_monster = require("MHR_Overlay.Monsters.large_monster");
config = require("MHR_Overlay.Misc.config"); config = require("MHR_Overlay.Misc.config");
ailments = require("MHR_Overlay.Monsters.ailments");
sdk.hook(enemy_character_base_update_method, function(args) sdk.hook(enemy_character_base_update_method, function(args)
pcall(monster_hook.update_monster, sdk.to_managed_object(args[2])); pcall(monster_hook.update_monster, sdk.to_managed_object(args[2]));
end, function(retval) end, function(retval)
return retval; return retval;
end); end);
sdk.hook(damage_check_update_param_update_method, function(args)
pcall(monster_hook.update_health, sdk.to_managed_object(args[2]));
end, function(retval)
return retval;
end);
sdk.hook(stamina_sub_method, function(args)
pcall(monster_hook.update_stamina, sdk.to_managed_object(args[2]), sdk.to_float(args[3]));
end, function(retval)
return retval;
end);
sdk.hook(stamina_update_method, function(args)
pcall(monster_hook.update_stamina, sdk.to_managed_object(args[2]), -1, sdk.to_managed_object(args[3]));
end, function(retval)
return retval;
end);
sdk.hook(anger_add_method, function(args)
pcall(monster_hook.update_rage, sdk.to_managed_object(args[2]), sdk.to_float(args[3]), sdk.to_managed_object(args[4]));
end, function(retval)
return retval;
end);
sdk.hook(anger_update_method, function(args)
pcall(monster_hook.update_rage_timer, sdk.to_managed_object(args[2]), sdk.to_managed_object(args[3]));
end, function(retval)
return retval;
end);
end end
return monster_hook; return monster_hook;

View File

@@ -23,13 +23,6 @@ function small_monster.new(enemy)
monster.missing_health = 0; monster.missing_health = 0;
monster.capture_health = 0; monster.capture_health = 0;
monster.stamina = 0;
monster.max_stamina = 1000;
monster.stamina_percentage = 0;
monster.missing_stamina = 0;
monster.game_object = nil;
monster.transform = nil;
monster.position = Vector3f.new(0, 0, 0); monster.position = Vector3f.new(0, 0, 0);
monster.distance = 0; monster.distance = 0;
@@ -44,6 +37,10 @@ function small_monster.new(enemy)
small_monster.list[enemy] = monster; small_monster.list[enemy] = monster;
end end
small_monster.update_position(enemy, monster);
small_monster.update(enemy, monster);
small_monster.update_health(enemy, monster);
return monster; return monster;
end end
@@ -94,14 +91,6 @@ function small_monster.init_UI(monster)
cached_config.health.percentage_label cached_config.health.percentage_label
); );
monster.stamina_UI = stamina_UI_entity.new(
cached_config.stamina.visibility,
cached_config.stamina.bar,
cached_config.stamina.text_label,
cached_config.stamina.value_label,
cached_config.stamina.percentage_label
);
monster.ailment_UI = ailment_UI_entity.new( monster.ailment_UI = ailment_UI_entity.new(
cached_config.ailments.visibility, cached_config.ailments.visibility,
cached_config.ailments.bar, cached_config.ailments.bar,
@@ -116,7 +105,6 @@ function small_monster.init_UI(monster)
end end
local physical_param_field = enemy_character_base_type_def:get_field("<PhysicalParam>k__BackingField"); 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 check_die_method = enemy_character_base_type_def:get_method("checkDie"); local check_die_method = enemy_character_base_type_def:get_method("checkDie");
local physical_param_type = physical_param_field:get_type(); local physical_param_type = physical_param_field:get_type();
@@ -126,49 +114,33 @@ local vital_param_type = get_vital_method:get_return_type();
local get_current_method = vital_param_type:get_method("get_Current"); local get_current_method = vital_param_type:get_method("get_Current");
local get_max_method = vital_param_type:get_method("get_Max"); local get_max_method = vital_param_type:get_method("get_Max");
local stamina_param_type = stamina_param_field:get_type();
local get_stamina_method = stamina_param_type:get_method("getStamina");
local get_max_stamina_method = stamina_param_type:get_method("getMaxStamina");
local get_pos_field = enemy_character_base_type_def:get_method("get_Pos"); local get_pos_field = enemy_character_base_type_def:get_method("get_Pos");
function small_monster.update_position(enemy) function small_monster.update_position(enemy, monster)
local cached_config = config.current_config.small_monster_UI; local cached_config = config.current_config.small_monster_UI;
if not cached_config.enabled or not cached_config.dynamic_positioning.enabled then if not cached_config.enabled or not cached_config.dynamic_positioning.enabled then
return; return;
end end
local monster = small_monster.get_monster(enemy); local position = get_pos_field:call(enemy);
if monster == nil then if position ~= nil then
return; monster.position = position;
end end
local position = get_pos_field:call(enemy) or monster.position;
monster.position = position;
end end
function small_monster.update(enemy) function small_monster.update(enemy, monster)
if not config.current_config.small_monster_UI.enabled then if not config.current_config.small_monster_UI.enabled then
return; return;
end end
if enemy == nil then
return;
end
local monster = small_monster.get_monster(enemy);
local dead_or_captured = check_die_method:call(enemy); local dead_or_captured = check_die_method:call(enemy);
monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured; monster.dead_or_captured = (dead_or_captured == nil and false) or dead_or_captured;
small_monster.update_health(enemy, monster);
small_monster.update_stamina(enemy, monster);
ailments.update_ailments(enemy, monster); ailments.update_ailments(enemy, monster);
end end
function small_monster.update_health(enemy, monster) function small_monster.update_health(enemy, monster)
if not config.current_config.small_monster_UI.health.visibility then if not config.current_config.small_monster_UI.enabled or not config.current_config.small_monster_UI.health.visibility then
return; return;
end end
@@ -194,27 +166,6 @@ function small_monster.update_health(enemy, monster)
end end
end end
function small_monster.update_stamina(enemy, monster)
if not config.current_config.small_monster_UI.stamina.visibility then
return;
end
local stamina_param = stamina_param_field:get_data(enemy)
if stamina_param == nil then
customization_menu.status = "No stamina param";
return;
end
monster.stamina = get_stamina_method:call(stamina_param) or monster.stamina;
monster.max_stamina = get_max_stamina_method:call(stamina_param) or monster.max_stamina;
monster.missing_stamina = monster.max_stamina - monster.stamina;
if monster.max_stamina ~= 0 then
monster.stamina_percentage = monster.stamina / monster.max_stamina;
end
end
function small_monster.draw(monster, position_on_screen, opacity_scale) function small_monster.draw(monster, position_on_screen, opacity_scale)
local cached_config = config.current_config.small_monster_UI; local cached_config = config.current_config.small_monster_UI;
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -226,11 +177,6 @@ function small_monster.draw(monster, position_on_screen, opacity_scale)
y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier y = position_on_screen.y + cached_config.health.offset.y * global_scale_modifier
}; };
local stamina_position_on_screen = {
x = position_on_screen.x + cached_config.stamina.offset.x * global_scale_modifier,
y = position_on_screen.y + cached_config.stamina.offset.y * global_scale_modifier
};
local ailments_position_on_screen = { local ailments_position_on_screen = {
x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier, x = position_on_screen.x + cached_config.ailments.offset.x * global_scale_modifier,
y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier y = position_on_screen.y + cached_config.ailments.offset.y * global_scale_modifier
@@ -240,16 +186,13 @@ function small_monster.draw(monster, position_on_screen, opacity_scale)
x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier, x = position_on_screen.x + cached_config.ailment_buildups.offset.x * global_scale_modifier,
y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier y = position_on_screen.y + cached_config.ailment_buildups.offset.y * global_scale_modifier
}; };
health_UI_entity.draw(monster, monster.health_UI, health_position_on_screen, opacity_scale);
stamina_UI_entity.draw(monster, monster.stamina_UI, stamina_position_on_screen, opacity_scale);
health_UI_entity.draw(monster, monster.health_UI, health_position_on_screen, opacity_scale);
ailments.draw_small(monster, ailments_position_on_screen, opacity_scale); ailments.draw_small(monster, ailments_position_on_screen, opacity_scale);
ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen, opacity_scale); ailment_buildup.draw_small(monster, ailment_buildups_position_on_screen, opacity_scale);
end end
function small_monster.init_list() function small_monster.init_list()
small_monster.list = {}; small_monster.list = {};
end end

View File

@@ -125,6 +125,8 @@ function small_monster_UI.draw()
end end
end end
local opacity_scale = 1; local opacity_scale = 1;
if cached_config.dynamic_positioning.enabled then if cached_config.dynamic_positioning.enabled then
@@ -141,6 +143,8 @@ function small_monster_UI.draw()
end end
end end
small_monster.draw(monster, position_on_screen, opacity_scale); small_monster.draw(monster, position_on_screen, opacity_scale);
i = i + 1; i = i + 1;

View File

@@ -4,7 +4,7 @@ local drawing;
local language; local language;
local config; local config;
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label) function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {}; local entity = {};
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier; local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
@@ -14,6 +14,7 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
entity.text_label = table_helpers.deep_copy(text_label); entity.text_label = table_helpers.deep_copy(text_label);
entity.value_label = table_helpers.deep_copy(value_label); entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label); entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier; entity.bar.offset.x = entity.bar.offset.x * global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier; entity.bar.offset.y = entity.bar.offset.y * global_scale_modifier;
@@ -29,6 +30,9 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier; entity.percentage_label.offset.x = entity.percentage_label.offset.x * global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier; entity.percentage_label.offset.y = entity.percentage_label.offset.y * global_scale_modifier;
entity.timer_label.offset.x = entity.timer_label.offset.x * global_scale_modifier;
entity.timer_label.offset.y = entity.timer_label.offset.y * global_scale_modifier;
return entity; return entity;
end end
@@ -37,11 +41,18 @@ function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity
return; return;
end end
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage);
drawing.draw_label(stamina_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.stamina); drawing.draw_label(stamina_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.stamina);
drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, monster.stamina, monster.max_stamina);
drawing.draw_label(stamina_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.stamina_percentage); if monster.is_tired then
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.tired_timer_percentage);
drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left, monster.tired_seconds_left);
else
drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage);
drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, monster.stamina, monster.max_stamina);
drawing.draw_label(stamina_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.stamina_percentage);
end
end end
function stamina_UI_entity.init_module() function stamina_UI_entity.init_module()

View File

@@ -708,15 +708,17 @@ function customization_menu.draw()
customization_menu.menu_font_changed = true; customization_menu.menu_font_changed = true;
part_names.init(); part_names.init();
large_monster.init_list(); -- FORGOT WHAT IS THIS
--small_monster.init_all();
--large_monster.init_all();
for _, monster in pairs(small_monster.list) do --for _, monster in pairs(small_monster.list) do
small_monster.init_UI(monster); -- small_monster.init_UI(monster);
end --end
for _, _player in pairs(player.list) do --for _, _player in pairs(player.list) do
player.init_UI(_player); -- player.init_UI(_player);
end --end
end end
if imgui.tree_node(language.current_language.customization_menu.menu_font) then if imgui.tree_node(language.current_language.customization_menu.menu_font) then
@@ -1449,303 +1451,6 @@ function customization_menu.draw()
imgui.tree_pop(); imgui.tree_pop();
end end
if imgui.tree_node(language.current_language.customization_menu.stamina) then
changed, config.current_config.small_monster_UI.stamina.visibility = imgui.checkbox(language.current_language.customization_menu
.visible, config.current_config.small_monster_UI.stamina.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.text_label) then
changed, config.current_config.small_monster_UI.stamina.text_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.small_monster_UI.stamina.text_label.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.text_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.small_monster_UI.stamina.text_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.text_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.small_monster_UI.stamina.text_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.text_label.color = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.text_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.small_monster_UI.stamina.text_label.shadow.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.small_monster_UI.stamina.text_label.shadow.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.text_label.shadow.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.small_monster_UI.stamina.text_label.shadow.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.text_label.shadow.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.small_monster_UI.stamina.text_label.shadow.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.text_label.shadow.color = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.text_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.value_label) then
changed, config.current_config.small_monster_UI.stamina.value_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.small_monster_UI.stamina.value_label.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.value_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.small_monster_UI.stamina.value_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.value_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.small_monster_UI.stamina.value_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.value_label.color = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.value_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.small_monster_UI.stamina.value_label.shadow.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.small_monster_UI.stamina.value_label.shadow.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.value_label.shadow.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.small_monster_UI.stamina.value_label.shadow.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.value_label.shadow.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.small_monster_UI.stamina.value_label.shadow.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.value_label.shadow.color = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.value_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.percentage_label) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.small_monster_UI.stamina.percentage_label.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.small_monster_UI.stamina.percentage_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.percentage_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.small_monster_UI.stamina.percentage_label.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.color = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.percentage_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible,
config.current_config.small_monster_UI.stamina.percentage_label.shadow.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.shadow.offset.x = imgui.drag_float(language
.current_language.customization_menu.x,
config.current_config.small_monster_UI.stamina.percentage_label.shadow.offset.x, 0.1, -screen.width,
screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.percentage_label.shadow.offset.y = imgui.drag_float(language
.current_language.customization_menu.y,
config.current_config.small_monster_UI.stamina.percentage_label.shadow.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.small_monster_UI.stamina.percentage_label.shadow.color = imgui.color_picker_argb(""
, config.current_config.small_monster_UI.stamina.percentage_label.shadow.color,
customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.bar) then
changed, config.current_config.small_monster_UI.stamina.bar.visibility = imgui.checkbox(language.current_language.customization_menu
.visible,
config.current_config.small_monster_UI.stamina.bar.visibility);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.small_monster_UI.stamina.bar.offset.x = imgui.drag_float(language.current_language.customization_menu
.x, config.current_config.small_monster_UI.stamina.bar.offset.x, 0.1, -screen.width,
screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.bar.offset.y = imgui.drag_float(language.current_language.customization_menu
.y, config.current_config.small_monster_UI.stamina.bar.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.size) then
changed, config.current_config.small_monster_UI.stamina.bar.size.width = imgui.drag_float(language.current_language
.customization_menu.width,
config.current_config.small_monster_UI.stamina.bar.size.width, 0.1, 0, screen.width, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
changed, config.current_config.small_monster_UI.stamina.bar.size.height = imgui.drag_float(language.current_language
.customization_menu.height,
config.current_config.small_monster_UI.stamina.bar.size.height, 0.1, 0, screen.height, "%.1f");
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.colors) then
if imgui.tree_node(language.current_language.customization_menu.foreground) then
changed, config.current_config.small_monster_UI.stamina.bar.colors.foreground = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.bar.colors.foreground, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.background) then
changed, config.current_config.small_monster_UI.stamina.bar.colors.background = imgui.color_picker_argb("",
config.current_config.small_monster_UI.stamina.bar.colors.background, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
small_monster_UI_changed = small_monster_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.ailments) then if imgui.tree_node(language.current_language.customization_menu.ailments) then
changed, config.current_config.small_monster_UI.ailments.visibility = imgui.checkbox(language.current_language.customization_menu changed, config.current_config.small_monster_UI.ailments.visibility = imgui.checkbox(language.current_language.customization_menu
.visible, .visible,
@@ -3926,6 +3631,83 @@ function customization_menu.draw()
imgui.tree_pop(); imgui.tree_pop();
end end
if imgui.tree_node(language.current_language.customization_menu.timer_label) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.visibility);
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.color = imgui.color_picker_argb("",
config.current_config.large_monster_UI.dynamic.stamina.timer_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.visibility);
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.offset.x, 0.1, -screen.width,
screen.width, "%.1f");
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y,
config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.color = imgui.color_picker_argb(""
, config.current_config.large_monster_UI.dynamic.stamina.timer_label.shadow.color,
customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.bar) then if imgui.tree_node(language.current_language.customization_menu.bar) then
changed, config.current_config.large_monster_UI.dynamic.stamina.bar.visibility = imgui.checkbox(language.current_language changed, config.current_config.large_monster_UI.dynamic.stamina.bar.visibility = imgui.checkbox(language.current_language
.customization_menu.visible, .customization_menu.visible,
@@ -7906,6 +7688,83 @@ function customization_menu.draw()
imgui.tree_pop(); imgui.tree_pop();
end end
if imgui.tree_node(language.current_language.customization_menu.timer_label) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.large_monster_UI.static.stamina.timer_label.visibility);
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.large_monster_UI.static.stamina.timer_label.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
changed, config.current_config.large_monster_UI.static.stamina.timer_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.large_monster_UI.static.stamina.timer_label.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.color = imgui.color_picker_argb("",
config.current_config.large_monster_UI.static.stamina.timer_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible,
config.current_config.large_monster_UI.static.stamina.timer_label.shadow.visibility);
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x,
config.current_config.large_monster_UI.static.stamina.timer_label.shadow.offset.x, 0.1, -screen.width,
screen.width, "%.1f");
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
changed, config.current_config.large_monster_UI.static.stamina.timer_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y,
config.current_config.large_monster_UI.static.stamina.timer_label.shadow.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.static.stamina.timer_label.shadow.color = imgui.color_picker_argb(""
, config.current_config.large_monster_UI.static.stamina.timer_label.shadow.color,
customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.bar) then if imgui.tree_node(language.current_language.customization_menu.bar) then
changed, config.current_config.large_monster_UI.static.stamina.bar.visibility = imgui.checkbox(language.current_language changed, config.current_config.large_monster_UI.static.stamina.bar.visibility = imgui.checkbox(language.current_language
.customization_menu.visible, .customization_menu.visible,
@@ -11784,6 +11643,83 @@ function customization_menu.draw()
imgui.tree_pop(); imgui.tree_pop();
end end
if imgui.tree_node(language.current_language.customization_menu.timer_label) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.visibility = imgui.checkbox(language.current_language
.customization_menu.visible,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.visibility);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
-- add text format
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.offset.x = imgui.drag_float(language.current_language
.customization_menu.x,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.offset.y = imgui.drag_float(language.current_language
.customization_menu.y,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.offset.y, 0.1, -screen.height, screen.height,
"%.1f");
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.color = imgui.color_picker_argb("",
config.current_config.large_monster_UI.highlighted.stamina.timer_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.shadow) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.visibility = imgui.checkbox(
language.current_language.customization_menu.visible,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.visibility);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.offset.x = imgui.drag_float(
language.current_language.customization_menu.x,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.offset.x, 0.1, -screen.width,
screen.width, "%.1f");
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.offset.y = imgui.drag_float(
language.current_language.customization_menu.y,
config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.color = imgui.color_picker_argb(""
, config.current_config.large_monster_UI.highlighted.stamina.timer_label.shadow.color,
customization_menu.color_picker_flags);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
imgui.tree_pop();
end
imgui.tree_pop();
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.bar) then if imgui.tree_node(language.current_language.customization_menu.bar) then
changed, config.current_config.large_monster_UI.highlighted.stamina.bar.visibility = imgui.checkbox(language.current_language changed, config.current_config.large_monster_UI.highlighted.stamina.bar.visibility = imgui.checkbox(language.current_language
.customization_menu.visible, .customization_menu.visible,