mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-08 17:50:00 +00:00
zAmmo: bottom-counter total toggle + capacity-based counter colouring
This commit is contained in:
+40
-22
@@ -309,6 +309,10 @@ local function MTH_ZB_EnsureButtonOptionDefaults(buttonName)
|
||||
saved["showtotalgauge"] = false
|
||||
end
|
||||
saved["showtotalgauge"] = saved["showtotalgauge"] and true or false
|
||||
if saved["counttotal"] == nil then
|
||||
saved["counttotal"] = false
|
||||
end
|
||||
saved["counttotal"] = saved["counttotal"] and true or false
|
||||
end
|
||||
|
||||
if buttonName == "zButtonTrap" then
|
||||
@@ -474,6 +478,42 @@ local function MTH_SetupButtonOptions(containerName, buttonName, displayName, ma
|
||||
parentBox:Note(containerName.."AQFilterDesc", MTH_ZB_L("ZB_DESC_AQ_FILTER", "Hide Qiraji mounts outside AQ40. Show only Qiraji inside."))
|
||||
end
|
||||
|
||||
if buttonName == "zButtonAmmo" then
|
||||
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,
|
||||
})
|
||||
parentBox:Checkbox(containerName.."CounterTotal", MTH_ZB_L("ZB_LABEL_COUNTER_TOTAL", "Counter shows total ammo"), {
|
||||
checked = saved["counttotal"],
|
||||
onClick = function()
|
||||
if not this then return end
|
||||
local checked = this:GetChecked() == 1
|
||||
ZHunterMod_Saved[buttonName]["counttotal"] = checked
|
||||
if buttonObj and buttonObj.ammoname and not buttonObj.isspell then
|
||||
zButtonAmmo_UpdateButton(buttonObj)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
local childrenBox = panel:Box("left", containerName.."ChildrenSection", MTH_ZB_L("ZB_SECTION_CHILDREN_BUTTONS", "Children Buttons"))
|
||||
childrenBox:Slider(containerName.."ButtonSize", {
|
||||
label = MTH_ZB_L("ZB_LABEL_BUTTON_SIZE", "Button Size"),
|
||||
@@ -604,28 +644,6 @@ 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