add prevent mounting when buff capped cvar, redo menu a bit

This commit is contained in:
avitasia
2025-12-23 10:44:45 -08:00
parent c5f5e4f736
commit 84a3b81607
3 changed files with 139 additions and 20 deletions
+20 -6
View File
@@ -4,7 +4,7 @@ L:RegisterTranslations("enUS", function()
return {
["|cffffcc00Nampower v2|cffffaaaa not present hiding settings."] = true,
["|cffffcc00Nampower update available.|cffffcc00 Some settings may be hidden until you update. Replace your existing nampower.dll with the latest from https://gitea.com/avitasia/nampower/releases"] = true,
["update available"] = "|cffffcc00Nampower update v2.20.0 available.|cffffcc00 Some settings may be hidden until you update. Replace your existing nampower.dll with the latest from https://gitea.com/avitasia/nampower/releases",
["Superwow required to display queued spells."] = true,
@@ -50,6 +50,9 @@ L:RegisterTranslations("enUS", function()
["Cast Options"] = true,
["Options for controlling casting behavior"] = true,
["QOL Options"] = true,
["Quality of life options to prevent common issues"] = true,
["Advanced options"] = true,
["Collection of various advanced options"] = true,
@@ -110,13 +113,17 @@ L:RegisterTranslations("enUS", function()
["Nameplate Distance"] = true,
["The distance in yards to show nameplates"] = true,
["|cffffcc00Nampower dll update available.|cffffcc00 Some settings may be hidden until you update."] = true,
["Spam Protection"] = true,
["Whether to enable spam protection functionality that blocks spamming spells while waiting for the server to respond to your initial cast due to issues spamming can cause"] = true,
["Prevent Right Click PvP Attack"] = true,
["Whether to prevent right-clicking on PvP flagged players to avoid accidental PvP attacks"] = true,
["Prevent Mounting When Buff Capped"] = true,
["Whether to prevent mounting when you have 32 buffs (buff capped) and are not already mounted. This prevents the issue where you mount but cannot dismount because the mount aura fails to apply due to the buff cap. When blocked, displays an error message."] = true,
["Enable Aura Cast Events"] = true,
["Whether to enable AURA_CAST_ON_SELF and AURA_CAST_ON_OTHER events."] = true,
}
end)
@@ -124,7 +131,7 @@ L:RegisterTranslations("zhCN", function()
return {
["|cffffcc00Nampower v2|cffffaaaa not present hiding settings."] = "|cffffcc00Nampower v2|cffffaaaa 未安装,隐藏设置项。",
["|cffffcc00Nampower update available.|cffffcc00 Some settings may be hidden until you update. Replace your existing nampower.dll with the latest from https://gitea.com/avitasia/nampower/releases"] = "|cffffcc00Nampower 更新可用。|cffffcc00 更新前部分设置可能隐藏。请从 https://gitea.com/avitasia/nampower/releases 下载最新 nampower.dll 替换当前版本。",
["update available"] = "|cffffcc00Nampower v2.20.0 更新可用。|cffffcc00 更新前部分设置可能隐藏。请从 https://gitea.com/avitasia/nampower/releases 下载最新 nampower.dll 替换当前版本。",
["Superwow required to display queued spells."] = "需 Superwow 插件显示队列中法术。",
@@ -170,6 +177,9 @@ L:RegisterTranslations("zhCN", function()
["Cast Options"] = "施法选项",
["Options for controlling casting behavior"] = "控制施法行为的选项",
["QOL Options"] = "便利性选项",
["Quality of life options to prevent common issues"] = "用于防止常见错误的便利性选项",
["Advanced options"] = "高级选项",
["Collection of various advanced options"] = "各类高级选项集合",
@@ -230,12 +240,16 @@ L:RegisterTranslations("zhCN", function()
["Nameplate Distance"] = "姓名板显示距离",
["The distance in yards to show nameplates"] = "显示姓名板的最大距离(码)",
["|cffffcc00Nampower dll update available.|cffffcc00 Some settings may be hidden until you update."] = "|cffffcc00Nampower dll 有更新可用。|cffffcc00 更新前部分设置可能隐藏。",
["Spam Protection"] = "防连点保护",
["Whether to enable spam protection functionality that blocks spamming spells while waiting for the server to respond to your initial cast due to issues spamming can cause"] = "是否启用防连点保护功能,避免在等待服务器响应期间连点施法导致的问题",
["Prevent Right Click PvP Attack"] = "阻止右键PvP攻击",
["Whether to prevent right-clicking on PvP flagged players to avoid accidental PvP attacks"] = "是否防止右键点击PvP标记玩家以避免误触发PvP攻击",
["Prevent Mounting When Buff Capped"] = "Buff满时阻止上坐骑",
["Whether to prevent mounting when you have 32 buffs (buff capped) and are not already mounted. This prevents the issue where you mount but cannot dismount because the mount aura fails to apply due to the buff cap. When blocked, displays an error message."] = "当已有32个增益(Buff已满)且未在坐骑状态时,是否阻止上坐骑,以避免坐骑光环因Buff上限无法施加导致无法下马的问题。被阻止时会显示错误提示。",
["Enable Aura Cast Events"] = "启用光环施放事件",
["Whether to enable AURA_CAST_ON_SELF and AURA_CAST_ON_OTHER events."] = "是否启用 AURA_CAST_ON_SELF 和 AURA_CAST_ON_OTHER 事件。",
}
end)
+39
View File
@@ -145,3 +145,42 @@ function LogBagItems()
local data = GetBagItems()
PrintTableToCombatLog(data)
end
if not Nampower:HasMinimumVersion(2, 17, 0) then
return
end
function PrintCastInfo()
local data = GetCastInfo()
if data then
PrintTable(data)
end
end
function PrintSpellCooldown(spellId)
local data = GetSpellIdCooldown(spellId)
if data then
PrintTable(data)
end
end
function PrintItemCooldown(itemId)
local data = GetItemIdCooldown(itemId)
if data then
PrintTable(data)
end
end
function PrintTrinketCooldown(trinketId)
local data = GetTrinketCooldown(trinketId)
if data then
PrintTable(data)
end
end
function PrintTrinkets()
local data = GetTrinkets(1)
if data then
PrintTable(data)
end
end
+80 -14
View File
@@ -35,8 +35,8 @@ function Nampower:HasMinimumVersion(major, minor, patch)
end
-- check if they have the latest nampower dll
if not Nampower:HasMinimumVersion(2, 8, 6) then
DEFAULT_CHAT_FRAME:AddMessage(L["|cffffcc00Nampower update available.|cffffcc00 Some settings may be hidden until you update. Replace your existing nampower.dll with the latest from https://gitea.com/avitasia/nampower/releases"])
if not Nampower:HasMinimumVersion(2, 20, 0) then
DEFAULT_CHAT_FRAME:AddMessage(L["update available"])
end
-- setup queued spell frame
@@ -118,6 +118,12 @@ function Nampower:SavePerCharacterSettings()
settingData.set(settingData.get()) -- trigger the set function for each setting with the current value
end
end
for settingKey, settingData in pairs(Nampower.cmdtable.args.qol_options.args) do
if string.find(settingKey, "NP_") == 1 then
settingData.set(settingData.get()) -- trigger the set function for each setting with the current value
end
end
end
function Nampower:ApplySavedSettings()
@@ -147,6 +153,15 @@ function Nampower:ApplySavedSettings()
end
end
end
for settingKey, settingData in pairs(Nampower.cmdtable.args.qol_options.args) do
-- only apply settings that are prefixed with NP_
if string.find(settingKey, "NP_") == 1 then
if Nampower.db.profile[settingKey]~= nil then
settingData.set(Nampower.db.profile[settingKey])
end
end
end
end
function Nampower:OnEnable()
@@ -440,11 +455,24 @@ Nampower.cmdtable = {
name = " ",
order = 58,
},
qol_options = {
type = "group",
name = L["QOL Options"],
desc = L["Quality of life options to prevent common issues"],
order = 59,
args = {
},
},
spacerc3 = {
type = "header",
name = " ",
order = 60,
},
advanced_options = {
type = "group",
name = L["Advanced options"],
desc = L["Collection of various advanced options"],
order = 60,
order = 65,
args = {
NP_InterruptChannelsOutsideQueueWindow = {
type = "toggle",
@@ -583,13 +611,13 @@ Nampower.cmdtable = {
spacerc = {
type = "header",
name = " ",
order = 70,
order = 75,
},
queued_spell_options = {
type = "group",
name = L["Queued Spell Display Options"],
desc = L["Options for displaying an icon for the queued spell"],
order = 80,
order = 85,
args = {
enabled = {
type = "toggle",
@@ -664,7 +692,7 @@ Nampower.cmdtable = {
spacerd = {
type = "header",
name = " ",
order = 90,
order = 95,
},
},
}
@@ -674,7 +702,7 @@ if Nampower:HasMinimumVersion(2, 8, 6) then
type = "range",
name = L["Nameplate Distance"],
desc = L["The distance in yards to show nameplates"],
order = 110,
order = 115,
min = 5,
max = 200,
step = 1,
@@ -688,11 +716,11 @@ if Nampower:HasMinimumVersion(2, 8, 6) then
}
end
Nampower.cmdtable.args.advanced_options.args.NP_PreventRightClickTargetChange = {
Nampower.cmdtable.args.qol_options.args.NP_PreventRightClickTargetChange = {
type = "toggle",
name = L["Prevent Right Click Target Change"],
desc = L["Whether to prevent right-clicking from changing your current target when in combat. If you don't have a target right click will still change your target even with this on. This is mainly to prevent accidentally changing targets in combat when trying to adjust your camera."],
order = 140,
order = 5,
get = function()
return GetCVar("NP_PreventRightClickTargetChange") == "1"
end,
@@ -707,11 +735,11 @@ Nampower.cmdtable.args.advanced_options.args.NP_PreventRightClickTargetChange =
}
if Nampower:HasMinimumVersion(2, 11, 0) then
Nampower.cmdtable.args.advanced_options.args.NP_SpamProtectionEnabled = {
Nampower.cmdtable.args.qol_options.args.NP_SpamProtectionEnabled = {
type = "toggle",
name = L["Spam Protection"],
desc = L["Whether to enable spam protection functionality that blocks spamming spells while waiting for the server to respond to your initial cast due to issues spamming can cause"],
order = 135,
order = 10,
get = function()
return GetCVar("NP_SpamProtectionEnabled") == "1"
end,
@@ -725,11 +753,11 @@ if Nampower:HasMinimumVersion(2, 11, 0) then
end,
}
Nampower.cmdtable.args.advanced_options.args.NP_PreventRightClickPvPAttack = {
Nampower.cmdtable.args.qol_options.args.NP_PreventRightClickPvPAttack = {
type = "toggle",
name = L["Prevent Right Click PvP Attack"],
desc = L["Whether to prevent right-clicking on PvP flagged players to avoid accidental PvP attacks"],
order = 145,
order = 15,
get = function()
return GetCVar("NP_PreventRightClickPvPAttack") == "1"
end,
@@ -743,7 +771,7 @@ if Nampower:HasMinimumVersion(2, 11, 0) then
end,
}
else
DEFAULT_CHAT_FRAME:AddMessage(L["|cffffcc00Nampower dll update available.|cffffcc00 Some settings may be hidden until you update."])
DEFAULT_CHAT_FRAME:AddMessage(L["update available"])
end
if Nampower:HasMinimumVersion(2, 15, 0) then
@@ -766,6 +794,44 @@ if Nampower:HasMinimumVersion(2, 15, 0) then
}
end
if Nampower:HasMinimumVersion(2, 20, 0) then
Nampower.cmdtable.args.qol_options.args.NP_PreventMountingWhenBuffCapped = {
type = "toggle",
name = L["Prevent Mounting When Buff Capped"],
desc = L["Whether to prevent mounting when you have 32 buffs (buff capped) and are not already mounted. This prevents the issue where you mount but cannot dismount because the mount aura fails to apply due to the buff cap. When blocked, displays an error message."],
order = 20,
get = function()
return GetCVar("NP_PreventMountingWhenBuffCapped") == "1"
end,
set = function(v)
Nampower.db.profile.NP_PreventMountingWhenBuffCapped = v
if v == true then
SetCVar("NP_PreventMountingWhenBuffCapped", "1")
else
SetCVar("NP_PreventMountingWhenBuffCapped", "0")
end
end,
}
Nampower.cmdtable.args.advanced_options.args.NP_EnableAuraCastEvents = {
type = "toggle",
name = L["Enable Aura Cast Events"],
desc = L["Whether to enable AURA_CAST_ON_SELF and AURA_CAST_ON_OTHER events."],
order = 155,
get = function()
return GetCVar("NP_EnableAuraCastEvents") == "1"
end,
set = function(v)
Nampower.db.profile.NP_EnableAuraCastEvents = v
if v == true then
SetCVar("NP_EnableAuraCastEvents", "1")
else
SetCVar("NP_EnableAuraCastEvents", "0")
end
end,
}
end
local deuce = Nampower:NewModule("Nampower Options Menu")
deuce.hasFuBar = IsAddOnLoaded("FuBar") and FuBar
deuce.consoleCmd = not deuce.hasFuBar