zTrap: show trap arming cooldown (spiral + seconds) with a toggle

This commit is contained in:
DuvelCorp
2026-10-02 23:03:29 +02:00
parent ef8daaa568
commit f8d1aa8033
2 changed files with 99 additions and 0 deletions
+19
View File
@@ -303,6 +303,13 @@ local function MTH_ZB_EnsureButtonOptionDefaults(buttonName)
saved["showammoname"] = saved["showammoname"] and true or false
end
if buttonName == "zButtonTrap" then
if saved["cooldown"] == nil then
saved["cooldown"] = true
end
saved["cooldown"] = saved["cooldown"] and true or false
end
return saved
end
@@ -557,6 +564,18 @@ local function MTH_SetupButtonOptions(containerName, buttonName, displayName, ma
buttonObj.tooltip = saved["tooltip"] and true or false
end
if buttonName == "zButtonTrap" then
childrenBox:Checkbox(containerName.."ShowCooldown", MTH_ZB_L("ZB_LABEL_SHOW_TRAP_COOLDOWN", "Show cooldown"), {
checked = saved["cooldown"] and true or false,
onClick = function()
if not this then return end
local checked = this:GetChecked() == 1
if not (ZHunterMod_Saved and ZHunterMod_Saved[buttonName]) then return end
ZHunterMod_Saved[buttonName]["cooldown"] = checked
end,
})
end
if buttonName == "zButtonAmmo" then
childrenBox:Checkbox(containerName.."ShowAmmoName", MTH_ZB_L("ZB_LABEL_SHOW_AMMO_NAME", "Show ammo name"), {
checked = saved["showammoname"],