mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-08 09:46:32 +00:00
zAmmo: total ammo meter (centered % + side gauge) with options
This commit is contained in:
@@ -301,6 +301,14 @@ local function MTH_ZB_EnsureButtonOptionDefaults(buttonName)
|
||||
saved["showammoname"] = true
|
||||
end
|
||||
saved["showammoname"] = saved["showammoname"] and true or false
|
||||
if saved["showtotalperc"] == nil then
|
||||
saved["showtotalperc"] = true
|
||||
end
|
||||
saved["showtotalperc"] = saved["showtotalperc"] and true or false
|
||||
if saved["showtotalgauge"] == nil then
|
||||
saved["showtotalgauge"] = false
|
||||
end
|
||||
saved["showtotalgauge"] = saved["showtotalgauge"] and true or false
|
||||
end
|
||||
|
||||
if buttonName == "zButtonTrap" then
|
||||
@@ -596,6 +604,28 @@ local function MTH_SetupButtonOptions(containerName, buttonName, displayName, ma
|
||||
end
|
||||
end,
|
||||
})
|
||||
parentBox:Checkbox(containerName.."ShowTotalPercent", MTH_ZB_L("ZB_LABEL_SHOW_TOTAL_PERCENT", "Show total % (center)"), {
|
||||
checked = saved["showtotalperc"],
|
||||
onClick = function()
|
||||
if not this then return end
|
||||
local checked = this:GetChecked() == 1
|
||||
ZHunterMod_Saved[buttonName]["showtotalperc"] = checked
|
||||
if buttonObj and buttonObj.ammoname and not buttonObj.isspell then
|
||||
zButtonAmmo_UpdateButton(buttonObj)
|
||||
end
|
||||
end,
|
||||
})
|
||||
parentBox:Checkbox(containerName.."ShowTotalGauge", MTH_ZB_L("ZB_LABEL_SHOW_TOTAL_GAUGE", "Show total gauge (side)"), {
|
||||
checked = saved["showtotalgauge"],
|
||||
onClick = function()
|
||||
if not this then return end
|
||||
local checked = this:GetChecked() == 1
|
||||
ZHunterMod_Saved[buttonName]["showtotalgauge"] = checked
|
||||
if buttonObj and buttonObj.ammoname and not buttonObj.isspell then
|
||||
zButtonAmmo_UpdateButton(buttonObj)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
MTH_SetButtonEnabledState(buttonName, buttonObj, saved["enabled"] and true or false)
|
||||
|
||||
Reference in New Issue
Block a user