Added New Mods and Profiles Folders

This is a complete rebuild of the modpack, with all new mods and updates for 1.5.3 of Anomaly.
This commit is contained in:
2025-01-14 05:07:53 -05:00
parent 85c665b107
commit 376b4b9689
21217 changed files with 546254 additions and 0 deletions
@@ -0,0 +1,5 @@
[helm_bandana]
[helm_cloth_mask]
[helm_rp_bala]
@@ -0,0 +1,11 @@
[helm_ach7]
[helm_bandana]
[helm_cloth_mask]
[helm_hardhat]
[helm_hardhat_snag]
[helm_rp_bala]
@@ -0,0 +1,161 @@
[gasmask_headgear_hud]
hands_position = 0, 0, 0
hands_orientation = 0, 0, 0
hands_position_16x9 = 0, 0, 0
hands_orientation_16x9 = 0, 0, 0
item_visual = dynamics\weapons\wpn_headgear\gasmask_hud.ogf
anm_equip = headgear_ppm88_hands_equip, headgear_ppm88_equip
anm_unequip = headgear_ppm88_hands_unequip, headgear_ppm88_unequip
cam_equip = itemuse_anm_effects\headgear_gasmask_equip_cam.anm
cam_unequip = itemuse_anm_effects\headgear_gasmask_unequip_cam.anm
fade_use = true
fade_equip_start = 1.5
fade_equip_end = 1.5
fade_unequip_start = 0
fade_unequip_end = 0
snd_equip = actor\headgear_hud\gasmask_equip
snd_unequip = actor\gasmask_off
[respirator_headgear_hud]
hands_position = 0, 0, 0
hands_orientation = 0, 0, 0
hands_position_16x9 = 0, 0, 0
hands_orientation_16x9 = 0, 0, 0
item_visual = dynamics\weapons\wpn_headgear\respirator_hud.ogf
anm_equip = respirator_hand_equip_anim, respirator_equip_anim
anm_unequip = respirator_hand_takeoff_anim, respirator_takeoff_anim
cam_equip = itemuse_anm_effects\headgear_respirator_equip_cam.anm
cam_unequip = itemuse_anm_effects\headgear_respirator_takeoff_cam.anm
fade_use = false
fade_equip_start = 0
fade_equip_end = 0
fade_unequip_start = 0
fade_unequip_end = 0
snd_equip = actor\headgear_hud\gasmask_equip
snd_unequip = actor\gasmask_off
[protector_headgear_hud]
hands_position = 0, 0, 0
hands_orientation = 0, 0, 0
hands_position_16x9 = 0, 0, 0
hands_orientation_16x9 = 0, 0, 0
item_visual = dynamics\weapons\wpn_headgear\protector_hud.ogf
anm_equip = headgear_protector_hands_equip, headgear_protector_equip
anm_unequip = headgear_protector_hands_unequip, headgear_protector_unequip
cam_equip = itemuse_anm_effects\headgear_protector_equip_cam.anm
cam_unequip = itemuse_anm_effects\headgear_protector_unequip_cam.anm
fade_use = true
fade_equip_start = 3.3
fade_equip_end = 3.5
fade_unequip_start = 0
fade_unequip_end = 0
snd_equip = actor\headgear_hud\helmet_protector_equip
snd_unequip = actor\headgear_hud\helmet_protector_unequip
[helmet_headgear_hud]
hands_position = 0, 0, 0.03
hands_orientation = 0, 0, 0
hands_position_16x9 = 0, 0, 0.03
hands_orientation_16x9 = 0, 0, 0
;headgear_fov = 0.7
item_visual = dynamics\weapons\wpn_headgear\hardhat_hud.ogf
anm_equip = headgear_helmet_hands_equip, headgear_helmet_equip
anm_unequip = headgear_helmet_hands_unequip, headgear_helmet_unequip
cam_equip = itemuse_anm_effects\headgear_helmet_equip_cam.anm
cam_unequip = itemuse_anm_effects\headgear_helmet_unequip_cam.anm
fade_use = true
fade_equip_start = 2.5
fade_equip_end = 3
fade_unequip_start = 0
fade_unequip_end = 0
snd_equip = actor\headgear_hud\helmet_equip
snd_unequip = actor\gasmask_off
[helmet_mask_headgear_hud]
hands_position = 0, 0, 0.03
hands_orientation = 0, 0, 0
hands_position_16x9 = 0, 0, 0.03
hands_orientation_16x9 = 0, 0, 0
;headgear_fov = 0.7
item_visual = dynamics\weapons\wpn_headgear\metro_hud.ogf
anm_equip = headgear_metro_hands_equip, headgear_metro_equip
anm_unequip = headgear_metro_hands_unequip, headgear_metro_unequip
cam_equip = itemuse_anm_effects\headgear_metro_equip_cam_new.anm
cam_unequip = itemuse_anm_effects\headgear_metro_uneqiup_cam.anm
fade_use = true
fade_equip_start = 3.5
fade_equip_end = 3.7
fade_unequip_start = 0
fade_unequip_end = 0
snd_equip = actor\headgear_hud\helmet_metro_equip
snd_unequip = actor\headgear_hud\helmet_metro_unequip
[helm_m40_headgear_hud]:gasmask_headgear_hud
[helm_m50_headgear_hud]:gasmask_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\m50_hud.ogf
anm_equip = headgear_gasmask_hands_equip, headgear_gasmask_equip
anm_unequip = headgear_gasmask_hands_unequip, headgear_gasmask_unequip
[helm_ppm88_headgear_hud]:gasmask_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\ppm88_hud.ogf
anm_equip = headgear_ppm88_hands_equip, headgear_ppm88_equip
anm_unequip = headgear_ppm88_hands_unequip, headgear_ppm88_unequip
[helm_ranger_headgear_hud]:gasmask_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\ranger_hud.ogf
anm_equip = headgear_ranger_hands_equip, headgear_ranger_equip
anm_unequip = headgear_ranger_hands_unequip, headgear_ranger_unequip
[helm_respirator_headgear_hud]:gasmask_headgear_hud
[helm_respirator_gp5_headgear_hud]:gasmask_headgear_hud
[helm_respirator_old_headgear_hud]:gasmask_headgear_hud
[helm_resp_headgear_hud]:respirator_headgear_hud
[helm_ach7_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\ach7_hud.ogf
[helm_hardhat_headgear_hud]:helmet_headgear_hud
[helm_hardhat_snag_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\hardhat_snag_hud.ogf
[helm_battle_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\battle_hud.ogf
[helm_exo_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\exo_hud.ogf
[helm_tactic_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\tactical_hud.ogf
[helm_ach7ex_headgear_hud]:helmet_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\ach7ex_hud.ogf
[helm_metro_headgear_hud]:helmet_mask_headgear_hud
[helm_protective_headgear_hud]:protector_headgear_hud
[helm_spartan_headgear_hud]:helmet_mask_headgear_hud
item_visual = dynamics\weapons\wpn_headgear\spartan_hud.ogf
anm_equip = headgear_spartan_hands_equip, headgear_metro_equip
anm_unequip = headgear_spartan_hands_unequip, headgear_metro_unequip
@@ -0,0 +1,27 @@
;[chocolate]:sausage
;[chocolate_p]:sausage
;[protein]:sausage
[mutant_part_boar_chop]:sausage
[mutant_part_chimera_meat]:sausage
[mutant_part_dog_meat]:sausage
[mutant_part_flesh_meat]:sausage
[mutant_part_krovosos_meat]:sausage
[mutant_part_lurker_meat]:sausage
[mutant_part_psevdodog_meat]:sausage
[mutant_part_psysucker_meat]:sausage
[mutant_part_snork_hand]:sausage
[mutant_part_tushkano_meat]:sausage
@[drink_crow]:vodka_quality
@@ -0,0 +1,2 @@
![settings_helm]
!helm_ach7
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="windows-1251"?>
<string_table>
<string id="ui_mcm_menu_liz_qht">
<text>Headgear Animations</text>
</string>
<string id="ui_mcm_liz_qht_keybind">
<text>Gasmask equip/unequip hotkey</text>
</string>
<string id="ui_mcm_liz_qht_keybind_desc">
<text>This key bind can be configured to require aditional modifier keys to mitigate conflicts.</text>
</string>
<string id="ui_mcm_liz_qht_update_mcm">
<text>Your version of MCM is outdated. Upgrade to newver version.</text>
</string>
<string id="ui_mcm_liz_qht_strict_helmets">
<text>Enable strict helmets mode</text>
</string>
<string id="ui_mcm_liz_qht_strict_helmets_desc">
<text>With this option enabled, you will not be able to eat, drink, take pills or smoke while your headgear is eqiupped. This includes armor with integrated helmets. There are few exceptions for headgear that don't cover your mouth</text>
</string>
<string id="ui_mcm_liz_qht_icon_state">
<text>Show headgear status icon</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_desc">
<text>Controls the display mode of the helmet status icon. This icon is displayed in the character status section and warns the player that headgear is equipped (or unequipped based on selected option).</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_none">
<text>None</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_enabled">
<text>Show when headgear equipped</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_inverted">
<text>Show when headgear unequipped</text>
</string>
</string_table>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="windows-1251"?>
<string_table>
<string id="liz_ha_text_cant_consume_item">
<text>Can't use this item with helmet on</text>
</string>
</string_table>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="windows-1251"?>
<string_table>
<string id="ui_mcm_menu_liz_qht">
<text>Àíèìàöèè ãîëîâíûõ óáîðîâ</text>
</string>
<string id="ui_mcm_liz_qht_keybind">
<text>Êëàâèøà ñíÿòü/îäåòü ïðîòèâîãàç</text>
</string>
<string id="ui_mcm_liz_qht_keybind_desc">
<text>Âû ìîæåòå äîáàâèòü ðàçëè÷íûå ìîäèôèêàòîðû äëÿ ýòîé êëàâèøè, äëÿ èçáåæàíèÿ êîíôëèêòîâ.</text>
</string>
<string id="ui_mcm_liz_qht_update_mcm">
<text>Âàøà âåðñèÿ MCM ñëèøêîì óñòàðåëà. Îáíîâèòåñü äî áîëåå ñâåæåé âåðñèè.</text>
</string>
<string id="ui_mcm_liz_qht_strict_helmets">
<text>Ðåæèì ñòðîãèõ øëåìîâ</text>
</string>
<string id="ui_mcm_liz_qht_strict_helmets_desc">
<text>Ïðè âêëþ÷åíèè äàííîé îïöèè, âû íå ñìîæåòå åñòü, ïèòü, ïðèíèìàòü òàáëåòêè èëè êóðèòü ïðè íàäåòîì ïðîòèâîãàçå. Ñþäà âõîäèò áðîíÿ ñ èíòåãðèðîâàííûìè øëåìàìè. Åñòü âñåãî íåñîëüêî èñêëþ÷åíèé äëÿ øëåìîâ, êîòîðûå íå ïîëíîñòüþ çàêðûâàþò ðîò.</text>
</string>
<string id="ui_mcm_liz_qht_icon_state">
<text>Ïîêàçàòü èêîíêó ñòàòóñà øëåìà/ïðîòèâîãàçà</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_desc">
<text>Óïðàâëÿåò ðåæèìîì îòîáðàæåíèÿ çíà÷êà ñîñòîÿíèÿ øëåìà. Ýòîò çíà÷îê îòîáðàæàåòñÿ â ðàçäåëå ñòàòóñà ïåðñîíàæà è ïðåäóïðåæäàåò èãðîêà î òîì, ÷òî ãîëîâíîé óáîð íàäåò (èëè ñíÿò â çàâèñèìîñòè îò âûáðàííîãî âàðèàíòà).</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_none">
<text>Ñêðûòü</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_enabled">
<text>Ïîêàçàòü êîãäà øëåì îäåò</text>
</string>
<string id="ui_mcm_liz_qht_icon_state_inverted">
<text>Ïîêàçàòü êîãäà øëåì ñíÿò</text>
</string>
</string_table>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="windows-1251"?>
<string_table>
<string id="liz_ha_text_cant_consume_item">
<text>Íåëüçÿ óïîòðåáèòü èç-çà øëåìà</text>
</string>
</string_table>
@@ -0,0 +1,55 @@
local icon_state = headgear_animations_mcm.get_config("icon_state")
function on_game_start()
actor_status.add_indicator("Gasmask", {
index = 0, --14,
typ="state",
functor={"actor_status_gasmask", "get_gasmask_status", true},
icon="ui\\headgear_indicator\\StatusGasmask.dds",
background="ui\\headgear_indicator\\bg1.dds",
anim_icon=false,
anim_bk=false,
})
RegisterScriptCallback("on_option_change", on_option_change)
end
function on_option_change()
icon_state = headgear_animations_mcm.get_config("icon_state")
end
function get_gasmask_status(visual)
if visual then
if icon_state == 0 then
return 0
elseif icon_state == 1 then
if not is_have_helmet() then
return 0
else
return 1
end
elseif icon_state == 2 then
if is_have_helmet() then
return 0
else
return 1
end
end
end
end
function is_have_helmet()
local o_helm = db.actor:item_in_slot(12)
if o_helm then return true end
local o_outfit = db.actor:item_in_slot(7) --:cast_CustomOutfit()
if o_outfit then
local c_outfit = o_outfit:cast_CustomOutfit()
if not c_outfit.bIsHelmetAvaliable then return true end
end
return false
end
@@ -0,0 +1,318 @@
------------------------------- VARIABLES -------------------------------
local helmet_slot_id = 12
local no_helmet = -1
local ini_blacklist = {}
local equipped_helmet = no_helmet
enable_animations = false
local headgear_hud_fov
local cur_slot
local det_active
local is_deleyed_logic_handler_running = false
local item_to_equip = nil
local item_to_unequip = nil
------------------------------- MONKEY PATCH TEST (plz don't blow up) -------------------------------
local originalPIF = actor_effects.play_item_fx
function actor_effects.play_item_fx(item)
if item == "helm" then return end
originalPIF(item)
end
------------------------------- CALLBACKS REGISTRATION -------------------------------
function on_game_start()
RegisterScriptCallback("on_game_load", on_game_load)
RegisterScriptCallback("actor_on_first_update", actor_on_first_update)
RegisterScriptCallback("actor_item_to_slot", on_item_to_slot)
RegisterScriptCallback("actor_item_to_ruck", on_item_to_ruck)
RegisterScriptCallback("actor_on_item_drop", on_item_drop)
end
------------------------------- CALLBACKS -------------------------------
function on_game_load()
ini_blacklist = ini_file("items\\items\\headgear_blacklist.ltx")
end
function actor_on_first_update()
local helm = db.actor:item_in_slot(helmet_slot_id)
equipped_helmet = helm and helm:id() or no_helmet
Invoke("actor_on_first_update_te", 3, function() enable_animations = true end)
end
function on_item_to_slot(obj)
if IsHeadgear(obj) and obj:id() ~= equipped_helmet then
equipped_helmet = obj:id()
if not db.actor:alive() then return end
if not enable_animations then return end
if ini_blacklist:section_exist(obj:section()) then return end
if has_alife_info("bar_arena_fight") then return end
item_to_equip = get_section_name(obj)
if not is_deleyed_logic_handler_running then
Invoke("on_item_to_slot_te", .1, deleyed_logic_handler)
is_deleyed_logic_handler_running = true
switch_mask_hud()
end
end
end
function on_item_to_ruck(obj)
if IsHeadgear(obj) and equipped_helmet == obj:id() then
equipped_helmet = no_helmet
if not db.actor:alive() then return end
if not enable_animations then return end
if ini_blacklist:section_exist(obj:section()) then return end
if has_alife_info("bar_arena_fight") then return end
item_to_unequip = get_section_name(obj)
if not is_deleyed_logic_handler_running then
Invoke("on_item_to_ruck_te", .1, deleyed_logic_handler)
is_deleyed_logic_handler_running = true
switch_mask_hud()
end
end
end
function on_item_drop(obj)
if IsHeadgear(obj) and equipped_helmet == obj:id() then
equipped_helmet = no_helmet
if not db.actor:alive() then return end
if not enable_animations then return end
if ini_blacklist:section_exist(obj:section()) then return end
if has_alife_info("bar_arena_fight") then return end
item_to_unequip = get_section_name(obj)
if not is_deleyed_logic_handler_running then
Invoke("on_item_drop_te", .1, deleyed_logic_handler)
is_deleyed_logic_handler_running = true
switch_mask_hud()
end
end
end
------------------------------- PUBLIC METHODS USED BY HOTKEY TOGGLE SCRIPT -------------------------------
-- boy I don't like this code. I need to refactor it somehow
function on_toggle_equip(obj)
if ini_blacklist:section_exist(obj:section()) then return end
if enable_animations then
play_mask_animation(get_section_name(obj), true, nil, function()
enable_animations = false
db.actor:move_to_slot(obj, 12)
Invoke("on_toggle_equip_te0", 0.1, function() enable_animations = true end)
end)
else
enable_animations = false
db.actor:move_to_slot(obj, 12)
Invoke("on_toggle_equip_te1", 0.1, function() enable_animations = true end)
end
end
function on_toggle_unequip(obj)
if ini_blacklist:section_exist(obj:section()) then return end
if enable_animations then
play_mask_animation(get_section_name(obj), false, switch_mask_hud, function()
enable_animations = false
db.actor:move_to_ruck(obj)
Invoke("on_toggle_unequip_te1", 0.1, function() enable_animations = true end)
Invoke("on_toggle_unequip_te2", 0.1, switch_mask_hud)
end)
else
enable_animations = false
db.actor:move_to_ruck(obj)
Invoke("on_toggle_unequip_te3", 0.1, function() enable_animations = true end)
end
end
------------------------------- MAIN -------------------------------
function deleyed_logic_handler()
if item_to_unequip and item_to_equip then
play_mask_animation(item_to_unequip, false, nil, function()
-- Invoke("deleyed_logic_handler_te", 0.01, function()
play_mask_animation(item_to_equip, true, nil, switch_mask_hud)
item_to_equip = nil
item_to_unequip = nil
is_deleyed_logic_handler_running = false
-- end)
end)
elseif item_to_unequip and not item_to_equip then
play_mask_animation(item_to_unequip, false, nil, switch_mask_hud)
item_to_equip = nil
item_to_unequip = nil
is_deleyed_logic_handler_running = false
elseif not item_to_unequip and item_to_equip then
play_mask_animation(item_to_equip, true, nil, switch_mask_hud)
item_to_equip = nil
item_to_unequip = nil
is_deleyed_logic_handler_running = false
end
end
function play_mask_animation(m_section, is_equip, on_start_callback, on_end_callback)
prepare_for_animation(m_section)
Invoke("play_mask_animation_te0", 0.1, function()
wait_for_free_hands(function()
local ini_params = get_ini_params(m_section, is_equip)
local anm_length = get_animation_length(ini_params.section_name, ini_params.anim_type)
if ini_params.fade_use then
Invoke("play_mask_animation_te1", ini_params.fade_start, function() level.add_pp_effector("deimos_short.ppe", 4288, false) end)
Invoke("play_mask_animation_te2", ini_params.fade_end, function() level.remove_pp_effector(4288) end)
end
Invoke("play_mask_animation_te3", ini_params.anim_delay, function()
if on_start_callback then on_start_callback() end
xr_effects.play_snd(db.actor, nil, {[1] = ini_params.snd})
level.add_cam_effector(ini_params.cam, 1300, false, "")
game.play_hud_motion(2, ini_params.section_name, ini_params.anim_type, false, 1)
end)
Invoke("play_mask_animation_te4", anm_length + ini_params.anim_delay + 0.25, function()
restore_after_animation()
if on_end_callback then on_end_callback() end
end)
end)
end)
end
------------------------------- HELPER FUNCTIONS -------------------------------
function prepare_for_animation(m_section)
enable_animations = false
hide_hud_inventory()
game.only_allow_movekeys(true)
set_hud_fov(m_section)
cur_slot = db.actor:active_slot()
det_active = db.actor:active_detector() or nil
if det_active then
if uni_anim_detectors then
uni_anim_detectors.force_quick = true
end
det_active:switch_state(2)
end
db.actor:activate_slot(0)
end
function restore_after_animation()
enable_animations = true
game.only_allow_movekeys(false)
restore_hud_fov()
db.actor:activate_slot(cur_slot or 0)
if det_active then det_active:switch_state(1) end
end
function set_hud_fov(m_section)
local m_hud_fov = ini_sys:r_float_ex(m_section, "headgear_fov")
if m_hud_fov == nil then
headgear_hud_fov = nil
else
headgear_hud_fov = ui_options.get("video/basic/hud_fov")
exec_console_cmd("hud_fov " .. m_hud_fov)
end
end
function restore_hud_fov()
if headgear_hud_fov == nil then return end
exec_console_cmd("hud_fov " .. headgear_hud_fov)
end
function wait_for_free_hands(action_to_perform)
local force_timer = 0
CreateTimeEvent("headgear_animations", "wait_for_free_hands_te", 0, function()
if
(
db.actor:active_slot() == 0
and not db.actor:active_detector()
and (not enhanced_animations or not enhanced_animations.used_item)
)
or (force_timer > 5)
then
Invoke("waint_for_free_hands_te", 0, action_to_perform) --i don understan y this works (ノへ ̄、)
-- action_to_perform()
return true
else
-- force_timer = force_timer + 0.25
force_timer = force_timer + (device().time_delta/1000)
--printf("LIZ: %s", force_timer)
end
return false
end)
end
function switch_mask_hud()
if ui_options.get("video/player/mask_hud") then
actor_effects.switch_helm()
actor_effects.Update_Mask(db.actor)
end
end
function get_animation_length(section, animation_name)
local length = 0
length = length + game.get_motion_length(section, animation_name, 1) / 1000
return length
end
function get_section_name(obj)
local m_section
m_section = obj:section() .. "_headgear_hud"
return m_section
end
function get_ini_params(section, is_equip)
local m_section = ini_sys:section_exist(section) and section or "gasmask_headgear_hud"
local ini_params
if is_equip then
ini_params = {
section_name = m_section,
anim_type = "anm_equip",
anim_delay = 0,
cam = ini_sys:r_string_ex(m_section, "cam_equip"),
fade_use = ini_sys:r_bool_ex(m_section, "fade_use"),
fade_start = ini_sys:r_float_ex(m_section, "fade_equip_start"),
fade_end = ini_sys:r_float_ex(m_section, "fade_equip_end"),
snd = ini_sys:r_string_ex(m_section, "snd_equip"),
}
else
ini_params = {
section_name = m_section,
anim_type = "anm_unequip",
anim_delay = 0.4,
cam = ini_sys:r_string_ex(m_section, "cam_unequip"),
fade_use = ini_sys:r_bool_ex(m_section, "fade_use"),
fade_start = ini_sys:r_float_ex(m_section, "fade_unequip_start"),
fade_end = ini_sys:r_float_ex(m_section, "fade_unequip_end"),
snd = ini_sys:r_string_ex(m_section, "snd_unequip"),
}
end
return ini_params
end
function Invoke(name, time, action)
CreateTimeEvent("headgear_animations", name, time, function()
action()
return true
end)
end
@@ -0,0 +1,149 @@
--[[ Script to take off/put on your helmet by holding hotkey. ]]--
local holdDelay = 0.5 --Delay in seconds while holding key before action for non MCM version
local lastHelmet
local lastHelmetId = nil
local KEY = headgear_animations_mcm.get_config("keybind") --change this if you don't use MCM or havn't updated to the curent version
local modifier = headgear_animations_mcm.get_config("modifier")
local mode = headgear_animations_mcm.get_config("mode")
local mcm_keybinds = ui_mcm and ui_mcm.key_hold --there will be a better way to test for MCM versions soon, but this will always be a solid way to check for keybind support
-----------------------------------------------------------------------------------------------------------------------
-- Callbacks
-----------------------------------------------------------------------------------------------------------------------
function on_game_start()
RegisterScriptCallback("on_option_change", on_option_change)
RegisterScriptCallback("on_key_hold", on_key_hold)
RegisterScriptCallback("on_key_press", on_key_press)
RegisterScriptCallback("on_key_release", on_key_release)
RegisterScriptCallback("load_state", on_load_state)
RegisterScriptCallback("save_state", on_save_state)
RegisterScriptCallback("actor_on_first_update", actor_on_first_update)
end
-----------------------------------------------------------------------------------------------------------------------
--
-----------------------------------------------------------------------------------------------------------------------
function on_option_change() --new in mcm 1.6.0 mcm passes true to the on_option_change callback
KEY = headgear_animations_mcm.get_config("keybind") -- if it can't find the option it will return nil this form insures that with old versions of mcm the key doesn't get reset
modifier = headgear_animations_mcm.get_config("modifier")
mode = headgear_animations_mcm.get_config("mode")
end
-----------------------------------------------------------------------------------------------------------------------
-- MCM Keybinding setup
-----------------------------------------------------------------------------------------------------------------------
function on_key_hold(key)
if mcm_keybinds and (key == KEY) and (mode == 2) and ui_mcm.get_mod_key(modifier) and ui_mcm.key_hold("liz_qht",key) then --repeating after 5 seconds for demo pourposes.
toggle_helmet()
end
end
function on_key_press(key)
if key ~= KEY then return end
if (not mcm_keybinds) then --No MCM case
CreateTimeEvent("quick_actions", "toggleHelmet", holdDelay, toggle_helmet)
return
end
if (mode == 0) and ui_mcm.get_mod_key(modifier) then
ui_mcm.simple_press("liz_qht", key, toggle_helmet)
end
if (mode == 1) and ui_mcm.get_mod_key(modifier) and ui_mcm.double_tap("liz_qht",key) then
toggle_helmet()
return
end
end
function on_key_release(key)
if mcm_keybinds then return end
if key == KEY then --if the released key matches, remove our event to stop it from firing if released earlier than holdDelay
RemoveTimeEvent("quick_actions","toggleHelmet")
end
end
-----------------------------------------------------------------------------------------------------------------------
-- Persistance
-----------------------------------------------------------------------------------------------------------------------
function on_save_state(m_data)
if lastHelmet then
m_data.lastHelmetId = lastHelmet:id()
end
end
function on_load_state(m_data)
lastHelmetId = m_data.lastHelmetId
end
function actor_on_first_update()
local function itr(actor, item)
if item:id() == lastHelmetId then
lastHelmet = item
return
end
end
if lastHelmetId ~= nil then
db.actor:iterate_ruck(itr, nil)
end
end
-----------------------------------------------------------------------------------------------------------------------
-- Main
-----------------------------------------------------------------------------------------------------------------------
function toggle_helmet()
if (not db.actor) and (not db.actor:alive()) then return end
if enhanced_animations and enhanced_animations.used_item ~= nil then return end
-- if enhanced_animations.used_item ~= nil then return end
local currentHelmet = db.actor:item_in_slot(12) --set currentHelmet to whatever player has equipped in helmet slot
if currentHelmet then --if it's a helmet, move it to inventory and save it for re-equipping later
headgear_animations.on_toggle_unequip(currentHelmet)
lastHelmet = currentHelmet
elseif lastHelmet then --if not, and lastHelmet is set, check player inventory for previously worn helmet
if not is_have_helmet() then --if helmet slot is empty and not blocked by armor
db.actor:iterate_ruck(function (actor, item)
if item:id() == lastHelmet:id() then
headgear_animations.on_toggle_equip(item)
end
end, nil)
end
end
end
function is_have_helmet()
--check if we have helmet in helmet slot
local o_helm = db.actor:item_in_slot(12)
if o_helm then
local m_headgear_is_in_whitelist = ini_whitelist:section_exist(o_helm:section())
if not m_headgear_is_in_whitelist then
return true
else
return false
end
end
--if not check if we have outfit that have integrated helmet
local o_outfit = db.actor:item_in_slot(7)
if o_outfit then
local c_outfit = o_outfit:cast_CustomOutfit()
if not c_outfit.bIsHelmetAvaliable then return true end
end
return false
end
@@ -0,0 +1,49 @@
local defaults = {
["keybind"] = bind_to_dik(key_bindings.kCAM_ZOOM_IN),
["modifier"] = 0,
["mode"] = 2,
["strict_helmets"] = false,
["icon_state"] = 0 --liz
}
--liz
--game.translate_string("liz_ha_text_cant_consume_item")
local table_icon_state = {
{ 0, "ui_mcm_liz_qht_icon_state_none" },
{ 1, "ui_mcm_liz_qht_icon_state_enabled" },
{ 2, "ui_mcm_liz_qht_icon_state_inverted" }
}
function on_game_start()
RegisterScriptCallback("on_option_change", on_option_change)
end
function on_mcm_load()
local options = {
id = "liz_qht",
sh = true,
gr = {
{ id = "liz_qht", type = "slide", link = "ui_options_slider_player", text = "ui_mcm_menu_liz_qht", size = { 512, 50 }, spacing = 20 },
{ id = "keybind", type = "key_bind", val = 2, def = defaults["keybind"] },
{ id = "modifier", type = ui_mcm.kb_mod_radio, val = 2, def = 0, hint = "mcm_kb_modifier", content = { { 0, "mcm_kb_mod_none" }, { 1, "mcm_kb_mod_shift" }, { 3, "mcm_kb_mod_alt" } } },
{ id = "mode", type = ui_mcm.kb_mod_radio, val = 2, def = 2, hint = "mcm_kb_mode", content = { { 0, "mcm_kb_mode_press" }, { 1, "mcm_kb_mode_dtap" }, { 2, "mcm_kb_mode_hold" } } },
{ id = "desc_mcm", type = "desc", text = "ui_mcm_liz_qht_update_mcm", clr = { 255, 175, 0, 0 }, precondition = { function() return not (ui_mcm and ui_mcm.key_hold) end } }, --warning message that will only show with pre 1.6.0 versions of mcm explaining why there seems to be no settings
{ id = "divider", type = "line"},
{ id = "strict_helmets", type = "check", val = 1, def = false},
{ id = "divider", type = "line", precondition = { function() return actor_status_gasmask end } }, --liz
{ id = "icon_state", type = "list", val = 2, def = 0, content = table_icon_state, no_str = true, precondition = { function() return actor_status_gasmask end } } --liz
}
}
return options
end
function on_option_change()
defaults["keybind"] = bind_to_dik(key_bindings.kCAM_ZOOM_IN)
end
function get_config(key)
if ui_mcm and ui_mcm.key_hold then return ui_mcm.get("liz_qht/" .. key) else return defaults[key] end
end
@@ -0,0 +1,56 @@
local ini_whitelist = {}
local ini_eff = {}
local strict_mode_enabled = headgear_animations_mcm.get_config("strict_helmets")
function on_game_start()
RegisterScriptCallback("on_game_load", on_game_load)
RegisterScriptCallback("on_option_change", on_option_change)
end
function on_game_load()
ini_whitelist = ini_file("items\\items\\headgear_item_use_whitelist.ltx")
ini_eff = ini_file("items\\items\\animations_settings.ltx")
end
function on_option_change()
strict_mode_enabled = headgear_animations_mcm.get_config("strict_helmets")
end
local originalAOIBU = itms_manager.actor_on_item_before_use
function itms_manager.actor_on_item_before_use(obj, flags)
if strict_mode_enabled then
if ini_eff:r_bool_ex(obj:section(), "helm") == false then
if is_have_helmet() then
actor_menu.set_msg(1, game.translate_string("liz_ha_text_cant_consume_item"), 3)
flags.ret_value = false
return
end
end
end
originalAOIBU(obj, flags)
end
function is_have_helmet()
--check if we have helmet in helmet slot
local o_helm = db.actor:item_in_slot(12)
if o_helm then
local m_headgear_is_in_whitelist = ini_whitelist:section_exist(o_helm:section())
if not m_headgear_is_in_whitelist then
return true
else
return false
end
end
--if not check if we have outfit that have integrated helmet
local o_outfit = db.actor:item_in_slot(7)
if o_outfit then
local c_outfit = o_outfit:cast_CustomOutfit()
if not c_outfit.bIsHelmetAvaliable then return true end
end
return false
end
@@ -0,0 +1,10 @@
if take_item_anim then
local originalAOIBP = take_item_anim.actor_on_item_before_pickup
function take_item_anim.actor_on_item_before_pickup(item, flags)
if not headgear_animations.enable_animations then
flags.ret_value = false
return
end
originalAOIBP(item, flags)
end
end

Some files were not shown because too many files have changed in this diff Show More