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,62 @@
<string_table>
<string id="ui_mcm_dynamic_cover_title">
<text>Dynamic Emission Cover Configuration</text>
</string>
<string id="ui_mcm_menu_dynamic_cover">
<text>Dynamic Emission Cover</text>
</string>
<string id="ui_mcm_dynamic_cover_distance_factor">
<text>Cover Required Factor</text>
</string>
<string id="ui_mcm_dynamic_cover_distance_factor_desc">
<text>Higher value makes it harder to find cover</text>
</string>
<string id="ui_mcm_dynamic_cover_north_cover_bonus">
<text>North-facing Cover Bonus</text>
</string>
<string id="ui_mcm_dynamic_cover_north_cover_bonus_desc">
<text>North-facing cover is more effective during emissions</text>
</string>
<string id="ui_mcm_dynamic_cover_show_cover_bar">
<text>Show Cover Indicator</text>
</string>
<string id="ui_mcm_dynamic_cover_show_cover_bar_desc">
<text>Shows a bar indicating how much cover you have during emissions\nHidden when sheltered</text>
</string>
<string id="ui_mcm_dynamic_cover_cover_range">
<text>Dynamic Cover Range</text>
</string>
<string id="ui_mcm_dynamic_cover_cover_range_desc">
<text>The range the mod checks for valid cover around you</text>
</string>
<string id="ui_mcm_dynamic_cover_rays_per_update">
<text>Cover Check Rays Per Frame</text>
</string>
<string id="ui_mcm_dynamic_cover_rays_per_update_desc">
<text>Reduce this if you have fps issues\nIncrease for faster and more consistent cover checking</text>
</string>
<string id="ui_mcm_dynamic_cover_debug_mode">
<text>Debug Mode</text>
</string>
<string id="ui_mcm_dynamic_cover_debug_mode_desc">
<text>For testing purposes!\nThis will enable cover checking out of emissions (including north facing cover bonus) and create particles at end points of the raycasts used for cover checking</text>
</string>
<string id="ui_mcm_dynamic_cover_protect_companions">
<text>Shelter Companions Range</text>
</string>
<string id="ui_mcm_dynamic_cover_protect_companions_desc">
<text>While in dynamic cover companions within this range (meters) are also sheltered\nSet to 0 to disable</text>
</string>
<string id="ui_mcm_dynamic_cover_grace_period">
<text>Cover Grace Period</text>
</string>
<string id="ui_mcm_dynamic_cover_grace_period_desc">
<text>Amount of seconds you are protected after leaving dynamic cover</text>
</string>
<string id="ui_mcm_dynamic_cover_hud_show_delay">
<text>Indicator Bar Delay</text>
</string>
<string id="ui_mcm_dynamic_cover_hud_show_delay_desc">
<text>Delays when the indicator bar is showed</text>
</string>
</string_table>
@@ -0,0 +1,62 @@
<string_table>
<string id="ui_mcm_dynamic_cover_title">
<text>Dynamic Emission Cover Configuration</text>
</string>
<string id="ui_mcm_menu_dynamic_cover">
<text>Dynamic Emission Cover</text>
</string>
<string id="ui_mcm_dynamic_cover_distance_factor">
<text>Cover Required Factor</text>
</string>
<string id="ui_mcm_dynamic_cover_distance_factor_desc">
<text>Higher value makes it harder to find cover</text>
</string>
<string id="ui_mcm_dynamic_cover_north_cover_bonus">
<text>North-facing Cover Bonus</text>
</string>
<string id="ui_mcm_dynamic_cover_north_cover_bonus_desc">
<text>North-facing cover is more effective during emissions</text>
</string>
<string id="ui_mcm_dynamic_cover_show_cover_bar">
<text>Show Cover Indicator</text>
</string>
<string id="ui_mcm_dynamic_cover_show_cover_bar_desc">
<text>Shows a bar indicating how much cover you have during emissions\nHidden when sheltered</text>
</string>
<string id="ui_mcm_dynamic_cover_cover_range">
<text>Dynamic Cover Range</text>
</string>
<string id="ui_mcm_dynamic_cover_cover_range_desc">
<text>The range the mod checks for valid cover around you</text>
</string>
<string id="ui_mcm_dynamic_cover_rays_per_update">
<text>Cover Check Rays Per Frame</text>
</string>
<string id="ui_mcm_dynamic_cover_rays_per_update_desc">
<text>Reduce this if you have fps issues\nIncrease for faster and more consistent cover checking</text>
</string>
<string id="ui_mcm_dynamic_cover_debug_mode">
<text>Debug Mode</text>
</string>
<string id="ui_mcm_dynamic_cover_debug_mode_desc">
<text>For testing purposes!\nThis will enable cover checking out of emissions (including north facing cover bonus) and create particles at end points of the raycasts used for cover checking</text>
</string>
<string id="ui_mcm_dynamic_cover_protect_companions">
<text>Shelter Companions Range</text>
</string>
<string id="ui_mcm_dynamic_cover_protect_companions_desc">
<text>While in dynamic cover companions within this range (meters) are also sheltered\nSet to 0 to disable</text>
</string>
<string id="ui_mcm_dynamic_cover_grace_period">
<text>Cover Grace Period</text>
</string>
<string id="ui_mcm_dynamic_cover_grace_period_desc">
<text>Amount of seconds you are protected after leaving dynamic cover</text>
</string>
<string id="ui_mcm_dynamic_cover_hud_show_delay">
<text>Indicator Bar Delay</text>
</string>
<string id="ui_mcm_dynamic_cover_hud_show_delay_desc">
<text>Delays when the indicator bar is showed</text>
</string>
</string_table>
@@ -0,0 +1,12 @@
<w>
<cover_hud x="0" y="0" width="1024" height="768">
<cover_bar x="443" y="744" width="138" height="8" horz="1" min="0" max="1" pos="0" stretch="1">
<progress>
<texture>ui_inGame2_Patroni_HUD_gold_bar</texture>
</progress>
</cover_bar>
<cover_bar_bg x="443" y="744" width="138" height="8">
<texture>ui_inGame2_Patroni_HUD_gold_bar</texture>
</cover_bar_bg>
</cover_hud>
</w>
@@ -0,0 +1,335 @@
local enable_debug = false
local print_tip = function(s, ...)
local f = print_tip or printf
if enable_debug then
return f("Geometry Ray: " .. s, ...)
end
end
local function throttle(func, tg_throttle)
local tg = 0
if not tg_throttle or tg_throttle == 0 then
return function(...)
local t = time_global()
if t ~= tg then
tg = t
return func(...)
end
end
else
return function(...)
local t = time_global()
if t < tg then return end
tg = t + tg_throttle
return func(...)
end
end
end
-- Check for material (engine edit required)
function lshift(x, by)
return x * 2 ^ by
end
function test(x, mask)
return bit_and(x, mask) == mask
end
local flags_test = {
["flBreakable"] = lshift(1, 0),
["flBounceable"] = lshift(1, 2),
["flSkidmark"] = lshift(1, 3),
["flBloodmark"] = lshift(1, 4),
["flClimable"] = lshift(1, 5),
["flPassable"] = lshift(1, 7),
["flDynamic"] = lshift(1, 8),
["flLiquid"] = lshift(1, 9),
["flSuppressShadows"] = lshift(1, 10),
["flSuppressWallmarks"] = lshift(1, 11),
["flActorObstacle"] = lshift(1, 12),
["flNoRicoshet"] = lshift(1, 13),
["flInjurious"] = lshift(1, 28),
["flShootable"] = lshift(1, 29),
["flTransparent"] = lshift(1, 30),
["flSlowDown"] = lshift(1, 31),
}
--[[
// material exports
.def_readonly( "material_name" , &script_rq_result::pMaterialName )
.def_readonly( "material_flags" , &script_rq_result::pMaterialFlags )
.def_readonly( "material_phfriction" , &script_rq_result::fPHFriction )
.def_readonly( "material_phdamping" , &script_rq_result::fPHDamping )
.def_readonly( "material_phspring" , &script_rq_result::fPHSpring )
.def_readonly( "material_phbounce_start_velocity" , &script_rq_result::fPHBounceStartVelocity )
.def_readonly( "material_phbouncing" , &script_rq_result::fPHBouncing )
.def_readonly( "material_flotation_factor" , &script_rq_result::fFlotationFactor )
.def_readonly( "material_shoot_factor" , &script_rq_result::fShootFactor )
.def_readonly( "material_shoot_factor_mp" , &script_rq_result::fShootFactorMP )
.def_readonly( "material_bounce_damage_factor" , &script_rq_result::fBounceDamageFactor )
.def_readonly( "material_injurious_speed" , &script_rq_result::fInjuriousSpeed )
.def_readonly( "material_vis_transparency_factor" , &script_rq_result::fVisTransparencyFactor )
.def_readonly( "material_snd_occlusion_factor" , &script_rq_result::fSndOcclusionFactor )
.def_readonly( "material_density_factor" , &script_rq_result::fDensityFactor )
]]
-- Geometry Ray class by Thial, edited by demonized
class "geometry_ray"
--[[
(At least one range parameter should be specified)
ray_range:
Defines the total range of the ray. If you want to attach the ray to
a fast moving object it is good to extend the ray so that you can reduce
the polling rate by using the get function.
contact_range:
Defines the distance at which the result will report being in contact.
You can skip it or set it to a value lower than the ray_range to
still be able to get the intersection position from the result while
marking the ray as not being in contact yet
distance_offset:
Defines how much the intersection position is offset.
You can use both positive and negative values or you can leave it blank.
flags (bit map = values can be added together for combined effect):
0 : None
1 : Objects
2 : Statics
4 : Shapes
8 : Obstacles
]]--
function geometry_ray:__init(args)
local args = args or {}
if args.ray_range == nil and args.contact_range == nil then
return nil
end
self.ray_range = args.ray_range or args.contact_range
self.contact_range = args.contact_range or args.ray_range
self.distance_offset = args.distance_offset ~= nil and args.distance_offset or 0
self.ray = ray_pick()
self.ray:set_flags(args.flags or 2)
self.ray:set_range(self.ray_range)
self.visualize = args.visualize
if args.ignore_object then
self.ray:set_ignore_object(args.ignore_object)
end
end
--[[
position:
position from which the ray will start
direction:
direction in which the ray will be fired
]]--
function geometry_ray:get(position, direction)
if position == nil or direction == nil then
return nil
end
local position = vector():set(position)
local direction = vector():set(direction)
self.ray:set_position(position)
self.ray:set_direction(direction)
local res = self.ray:query()
local distance = res and self.ray:get_distance() or self.ray_range
local result = {}
if self.visualize then
local init_pos = vector():set(position)
local end_pos = vector():mad(init_pos, direction, distance)
VisualizeRay(init_pos, end_pos)
end
result.in_contact = distance <= self.contact_range
result.position = position:add(direction:mul(distance + self.distance_offset))
result.distance = distance
result.raw_distance = self.ray:get_distance()
result.success = res
result.object = self.ray:get_object()
result.element = self.ray:get_element()
result.result = self.ray:get_result()
-- Cast to Lua table
-- if result.result then
-- local r = {}
-- r.material_name = result.result.material_name
-- r.material_flags = result.result.material_flags
-- r.material_phfriction = result.result.material_phfriction
-- r.material_phdamping = result.result.material_phdamping
-- r.material_phspring = result.result.material_phspring
-- r.material_phbounce_start_velocity = result.result.material_phbounce_start_velocity
-- r.material_phbouncing = result.result.material_phbouncing
-- r.material_flotation_factor = result.result.material_flotation_factor
-- r.material_shoot_factor = result.result.material_shoot_factor
-- r.material_shoot_factor_mp = result.result.material_shoot_factor_mp
-- r.material_bounce_damage_factor = result.result.material_bounce_damage_factor
-- r.material_injurious_speed = result.result.material_injurious_speed
-- r.material_vis_transparency_factor = result.result.material_vis_transparency_factor
-- r.material_snd_occlusion_factor = result.result.material_snd_occlusion_factor
-- r.material_density_factor = result.result.material_density_factor
-- result.result = r
-- end
return result
end
-- Engine edit required for testing materials
-- If not possible to get material - return nil
function geometry_ray:isMaterialFlag(flag)
local result = self.ray:get_result()
if not result then
return
end
if not result.material_flags then
return
end
if not flags_test[flag] then
return
end
return test(result.material_flags, flags_test[flag])
end
function geometry_ray:getMaterialFlags()
local result = self.ray:get_result()
if not result then
return
end
if not result.material_flags then
return
end
local res = {}
for k, v in pairs(flags_test) do
res[k] = test(result.material_flags, v)
end
return res
end
-- Utils
-- Check if values are similar to a precision
function similar(float1, float2, epsilon)
return math.abs(float1 - float2) <= (epsilon or 0.0001)
end
function vec_similar(vec1, vec2, epsilon)
return similar(vec1.x, vec2.x, epsilon) and similar(vec1.y, vec2.y, epsilon) and similar(vec1.z, vec2.z, epsilon)
end
-- Linear inter/extrapolation
function lerp(a, b, f)
if a and b and f then
return a + f * (b - a)
else
return a or b or 0
end
end
-- Visualize ray from one point to other with particles playing at setted step
class "VisualizeRay"
function VisualizeRay:__init(init_pos, end_pos, particle_step, visualize_time, force_stop)
self.init_pos = init_pos
self.end_pos = end_pos
self.visualize_time = visualize_time or 3000
self.particle_step = particle_step or 0.02
self.force_stop = force_stop
self.force_stop_default = force_stop
self.time = 0
self.start = function()
for i = 0, 1, self.particle_step do
local p = particles_object("amik\\hit_fx\\metal\\hit_sparks_glow")
local x = lerp(self.init_pos.x, self.end_pos.x, i)
local y = lerp(self.init_pos.y, self.end_pos.y, i)
local z = lerp(self.init_pos.z, self.end_pos.z, i)
p:play_at_pos(vector():set(x, y, z))
local time = 0
local stopped = false
AddUniqueCall(throttle(function()
if self.time > self.visualize_time then
if not stopped then
if self.force_stop then p:stop() else p:stop_deffered() end
stopped = true
end
if not p:playing() then
p = nil
return true
end
else
if not p:playing() then
p:play_at_pos(vector():set(x, y, z))
end
time = time + device().time_delta
self.time = time
end
end))
end
end
self.start()
self.reset_time = function()
self.time = 0
end
self.reset = function()
self.time = 0
self.force_stop = self.force_stop_default
self.start()
end
self.stop = function()
self.time = self.visualize_time + 1
self.force_stop = true
end
end
-- Get surface normals by Aoldri, edited by demonized
function get_surface_normal(pos, dir)
local ray = geometry_ray({
ray_range = 1000,
visualize = false,
})
-- Get player's camera position and direction in world space
local pos0 = pos and vector():set(pos) or device().cam_pos
local pos01 = vector():set(pos0):add(vector():set(0, 0.01, 0))
local pos02 = vector():set(pos0):add(vector():set(0.01, 0, 0))
local angle1 = dir and vector():set(dir) or device().cam_dir
-- Get positions of intersections of rays angled above and to the left of pos1
local res = ray:get(pos0, angle1)
local pos1 = res.position
local pos2 = ray:get(pos01, angle1).position
local pos3 = ray:get(pos02, angle1).position
if not res.success then
-- print_tip("cant get normal by pos %s, dir %s", pos0, angle1)
return
end
-- VisualizeRay(pos0, pos1, nil, 300)
-- VisualizeRay(pos01, pos2, nil, 300)
-- VisualizeRay(pos02, pos3, nil, 300)
-- Get vectors from intersection points from pos1
local vec2 = vec_sub(pos1, pos2)
local vec3 = vec_sub(pos1, pos3)
-- Find normal vector of surface by taking cross product of intersection vectors
local cross = (vector_cross(vec2, vec3)):normalize()
-- If the direction and normal vectors heading in similar direction - invert normal
local deg = angle1:dotproduct(cross)
if deg > 0 then
cross:invert()
end
-- VisualizeRay(pos1, vector():set(pos1):add(cross), nil, 300)
return cross
end
@@ -0,0 +1,380 @@
-- Script by Utjan
-- Uses raycasts to estimate cover during emissions and makes you sheltered if enough cover is found
function on_game_start()
RegisterScriptCallback("actor_on_update", actor_on_update)
RegisterScriptCallback("on_game_load", init)
RegisterScriptCallback("on_option_change", init)
-- Monkey patch for compatibiltiy with Coordinate Based Safe Zones
if tb_coordinate_based_safe_zones then
local base_tb_update = tb_coordinate_based_safe_zones.actor_on_update
function tb_coordinate_based_safe_zones.actor_on_update()
base_tb_update()
if dynamic_is_safe then
SetEvent("underground", true)
end
end
end
-- Monkey patch surge_manager to protect companions when in cover
local base_pos_in_cover = surge_manager.CSurgeManager.pos_in_cover
function surge_manager.CSurgeManager.pos_in_cover(self, pos, by_name)
local result = base_pos_in_cover(self, pos, by_name)
if result then
return result
end
if protect_companions_range == 0 or not dynamic_is_safe then
return false
end
local pos = vector():set(pos)
for id,squad in pairs(axr_companions.companion_squads) do
if (squad and squad.commander_id) then
for k in squad:squad_members() do
local member = db.storage[k.id] and db.storage[k.id].object or level.object_by_id(k.id)
if (member and member:alive()) then
local dist = pos:distance_to(vector():set(member:position()))
if dist == 0 then
local dist_to_actor = db.actor:position():distance_to(vector():set(pos))
if dist_to_actor <= protect_companions_range then
--printf("Sheltered companion")
return true
else
return false
end
end
end
end
end
end
return false
end
end
local ray_table = {}
ray_count_circle = 16
ray_count_vertical = 8
-- MCM options
rays_per_update = 10
ray_range = 8
north_facing_bonus = 0.01
cover_prcnt_needed = 0.85
show_cover_bar = true
debug_mode = false
protect_companions_range = 15
grace_period = 1
hud_delay = 0
function init()
-- Get options from MCM
rays_per_update = get_config("rays_per_update")
ray_range = get_config("cover_range")
north_facing_bonus = get_config("north_cover_bonus")
cover_prcnt_needed = get_config("distance_factor")
debug_mode = get_config("debug_mode")
show_cover_bar = get_config("show_cover_bar")
protect_companions_range = get_config("protect_companions")
grace_period = get_config("grace_period")
hud_delay = get_config("hud_show_delay")
-- Build a table of ray directions
ray_table = {}
local counter = 1
for i=1, ray_count_circle do
for ii=0, ray_count_vertical-1 do
if not (ii == ray_count_vertical-1 and i % 3 ~= 0) and not(ii == ray_count_vertical-2 and i % 2 == 0) then -- reduce rays at top angles
local ray_dir = vector():set(0,0,1)
local angle = (ii / (ray_count_vertical - 1)) * 82 -- 82 degrees to not shoot many rays straight up in the same direction
ray_dir.y = math.sin(angle * 0.017453292519943295769236907684886)
ray_dir.z = math.cos(angle * 0.017453292519943295769236907684886)
local rot_angle = (i/ray_count_circle) * 360
ray_dir = vector_rotate_y(ray_dir, rot_angle):normalize()
ray_table[counter] = vector():set(ray_dir)
counter = counter + 1
end
end
end
end
excluded_maps = {
["jupiter_underground"] = true,
["l03u_agr_underground"] = true,
["l04u_labx18"] = true,
["l08u_brainlab"] = true,
["l10u_bunker"] = true,
["l12u_control_monolith"] = true,
["l12u_sarcofag"] = true,
["l13u_warlab"] = true,
["labx8"] = true,
}
dynamic_is_safe = false
local HUD = nil
local ray_counter = 1
local points_table = {}
local emission_first_update = true
local hud_delay_hide = false
local grace_period_start_time = 0
function actor_on_update()
if excluded_maps[level.name()] or size_table(ray_table) == 0 then return end
local surge_state = GetEvent("surge", "state")
local psi_storm_state = GetEvent("psi_storm", "state")
if debug_mode then
surge_state = true
end
if (surge_state) or (psi_storm_state) then
if emission_first_update then
emission_first_update = false
if hud_delay > 0 then
hud_delay_hide = true
CreateTimeEvent("dynamic_cover", "hud_show_delay", hud_delay, function ()
--printf("-hud_delay_hide end")
hud_delay_hide = false
return true
end)
end
end
if show_cover_bar then
activate_hud()
else
deactivate_hud()
end
local pos = db.actor:position()
if IsMoveState("mcCrouch") and IsMoveState("mcAccel") then -- Prone
pos.y = pos.y + 0.25
elseif IsMoveState("mcCrouch") then
pos.y = pos.y + 0.5
else
pos.y = pos.y + 0.75
end
-- Do rays_per_update raycasts per update while cycling through the ray directions table
for i = 1, rays_per_update do
local ray_args = {
ray_range = ray_range,
contact_range = ray_range - 0.01,
flags = (1+2+4+8),
ignore_object = db.actor
}
local ray = demonized_geometry_ray.geometry_ray(ray_args)
local ray_dir = ray_table[ray_counter]
local result = ray:get(vector():set(pos), ray_dir)
-- This loop checks if the contact surface is a bush, and re-casts the ray just inside it if it is
while result.in_contact and result.result.material_name do
local name = result.result.material_name
if not (string.find(name, "bush") or string.find(name, "water")) then
break -- break out of the loop if contact is not a bush
end
ray_args.ray_range = ray_args.ray_range - result.distance
ray_args.contact_range = ray_args.contact_range - result.distance
ray = demonized_geometry_ray.geometry_ray(ray_args)
local new_pos = vector():set(result.position):add(vector():set(ray_dir):mul(0.01))
result = ray:get(new_pos, ray_dir)
end
if debug_mode then
local vis_end = vector():set(result.position):sub(vector():set(ray_dir):mul(0.2))
demonized_geometry_ray.VisualizeRay(vector():set(pos), vis_end, 1, 100)
end
if result.in_contact then
points_table[ray_counter] = 1
if surge_state and north_facing_bonus > 0 then
local pos_delta = vec_set(result.position:sub(pos)):normalize()
if pos_delta.z > 0 then
local cover_bonus = 1 * pos_delta.z * north_facing_bonus
--printf("north bonus " .. cover_bonus)
points_table[ray_counter] = points_table[ray_counter] + cover_bonus
end
end
else
points_table[ray_counter] = 0
end
if ray_counter + 1 > size_table(ray_table) then
ray_counter = 1
else
ray_counter = ray_counter + 1
end
end
local total_points = get_total_points(points_table)
local cover_percentage = total_points / size_table(ray_table)
local in_dynamic_cover = cover_percentage >= cover_prcnt_needed
--printf("points " .. total_points .. " max points " .. size_table(ray_table) .. " need points " .. size_table(ray_table) * get_config("distance_factor"))
if in_dynamic_cover and not dynamic_is_safe then
dynamic_is_safe = true
grace_period_start_time = 0
SetEvent("underground", true)
RemoveTimeEvent("dynamic_cover", "cover_remove_delay") -- Remove grace period time event
elseif dynamic_is_safe and not in_dynamic_cover then
-- Grace period of cover after leaving dynamic cover
if grace_period > 0 then
if grace_period_start_time == 0 then
grace_period_start_time = time_global()
elseif time_global() >= grace_period_start_time + (grace_period * 1000) then
--printf("-Grace period end")
dynamic_is_safe = false
if not tb_coordinate_based_safe_zones then
SetEvent("underground", false)
end
end
else
dynamic_is_safe = false
if not tb_coordinate_based_safe_zones then
SetEvent("underground", false)
end
end
end
if GetEvent("underground") or GetEvent("current_safe_cover") or hud_delay_hide then
hide_hud()
else
show_hud()
end
end
if not ((surge_state) or (psi_storm_state)) then
deactivate_hud()
emission_first_update = true
points_table = {}
if dynamic_is_safe then
dynamic_is_safe = false
SetEvent("underground", false)
end
end
end
function get_total_points(t)
local points = 0
for k, v in pairs(t) do
points = points + v
end
return points
end
-- MCM
local defaults = {
["distance_factor"] = 0.85,
["north_cover_bonus"] = 0.01,
["cover_range"] = 8,
["rays_per_update"] = 10,
["show_cover_bar"] = true,
["protect_companions"] = 15,
["grace_period"] = 1,
["hud_show_delay"] = 0,
["debug_mode"] = false,
}
function get_config(key)
local opt = ui_mcm and ui_mcm.get("dynamic_cover/"..key)
if opt ~= nil then return opt else return defaults[key] end
end
function on_mcm_load()
op = { id= "dynamic_cover",sh=true ,gr={
{id = "title",type= "slide",link= "ui_options_slider_gameplay_diff",text="ui_mcm_dynamic_cover_title",size= {512,50},spacing= 20 },
{id = "distance_factor", type = "track", val = 2, min=0.1,max=1,step=0.01, def = 0.85},
{id = "north_cover_bonus", type = "track", val = 2, min=0,max=0.5,step=0.01, def = 0.01},
{id = "cover_range", type = "track", val = 2, min=2,max=10,step=0.2, def = 8},
{id = "rays_per_update", type = "track", val = 2, min=1,max=30,step=1, def = 10},
{id = "show_cover_bar", type = "check", val = 1, def = true},
{id = "hud_show_delay", type = "track", val = 2, min=0,max=15,step=1, def = 0},
{id = "protect_companions", type = "track", val = 2, min=0,max=500,step=5, def = 15},
{id = "grace_period", type = "track", val = 2, min=0,max=5,step=0.2, def = 1},
{id = "debug_mode", type = "check", val = 1, def = false},
}
}
return op
end
----------------------------------------
-- HUD STUFF
function activate_hud()
if HUD == nil then
HUD = DynamicCoverUI()
get_hud():AddDialogToRender(HUD)
--RegisterScriptCallback("GUI_on_show",update_hud)
RegisterScriptCallback("GUI_on_hide",update_hud)
end
end
function deactivate_hud()
if HUD ~= nil then
get_hud():RemoveDialogToRender(HUD)
HUD = nil
--UnregisterScriptCallback("GUI_on_show",update_hud)
UnregisterScriptCallback("GUI_on_hide",update_hud)
end
end
function show_hud()
if HUD ~= nil then
HUD:ShowUI()
end
end
function hide_hud()
if HUD ~= nil then
HUD:HideUI()
end
end
function update_hud()
if HUD ~= nil then
HUD:Update()
end
end
-- COVER BAR UI CLASS
class "DynamicCoverUI" (CUIScriptWnd)
function DynamicCoverUI:__init() super()
local xml = CScriptXmlInit()
xml:ParseFile("ui_dynamic_cover.xml")
self.dialog = xml:InitStatic("cover_hud", self)
self.cover_bar_bg = xml:InitStatic("cover_hud:cover_bar_bg", self.dialog)
self.cover_bar = xml:InitProgressBar("cover_hud:cover_bar", self.dialog)
local bg_color = GetARGB(255,55,55,55)
self.cover_bar_bg:SetTextureColor(bg_color)
local bar_color = GetARGB(255,255,200,200)
self.cover_bar:SetColor(bar_color)
end
function DynamicCoverUI:Update()
CUIScriptWnd.Update(self)
if (not (main_hud_shown())) or (not db.actor:alive()) then
self.dialog:Show(false)
return
end
if size_table(ray_table) == 0 then return end
local bar_percentage = get_total_points(points_table) / (size_table(ray_table) * cover_prcnt_needed)
self.cover_bar:SetProgressPos(bar_percentage)
end
function DynamicCoverUI:ShowUI()
self.dialog:Show(true)
end
function DynamicCoverUI:HideUI()
self.dialog:Show(false)
end
+31
View File
@@ -0,0 +1,31 @@
[General]
gameName=stalkeranomaly
modid=0
version=d2024.12.3.0
newestVersion=
category="-1,"
nexusFileStatus=1
installationFile=Dynamic_Emission_Cover-v1.2.7z
repository=Nexus
ignoredVersion=
comments=
notes=
nexusDescription=
url=
hasCustomURL=true
lastNexusQuery=
lastNexusUpdate=
nexusLastModified=2024-12-04T00:15:50Z
nexusCategory=0
converted=false
validated=false
color=@Variant(\0\0\0\x43\0\xff\xff\0\0\0\0\0\0\0\0)
tracked=0
[installedFiles]
1\modid=0
size=1
1\fileid=0
[Plugins]
BAIN%20Installer\option0=00 Main