Skip to content

Commit

Permalink
Generate menu options for new mana regen stat layout
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed Dec 12, 2024
1 parent 24b17b3 commit 9cd67fb
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 57 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ Type `/rb` or `/ratingbuster` to open the options menu GUI, or add a slash comma
- `int` - Changes the display of Intellect
- `showSpellCritFromInt` - Show Spell Crit chance from Intellect
- `showManaFromInt` - Show Mana from Intellect
- `showMP5FromInt` - Show Mana Regen while casting from Intellect
- `showMP5NCFromInt` - Show Mana Regen while NOT casting from Intellect
- `showManaRegenFromInt` - Show Mana Regen Intellect
- `spi` - Changes the display of Spirit
- `showMP5NCFromSpi` - Show Mana Regen while NOT casting from Spirit
- `showManaRegenFromSpi` - Show Mana Regen from Spirit
- `showHP5FromSpi` - Show Health Regen from Spirit
- `sum` - Options for stat summary
- `showSum` - Show stat summary in tooltips
Expand All @@ -123,8 +122,9 @@ Type `/rb` or `/ratingbuster` to open the options menu GUI, or add a slash comma
- `basic` - Choose basic stats for summary
- `sumHP` - Health <- Health, Stamina
- `sumMP` - Mana <- Mana, Intellect
- `sumMP5` - Mana Regen <- Mana Regen, Spirit
- `sumMP5NC` - Mana Regen while not casting <- Spirit
- `sumManaRegen` - Mana Regen
- `sumManaRegenNotCasting` - Mana Regen while not casting
- `sumManaRegenOutOfCombat` - Mana Regen while out of combat
- `sumHP5` - Health Regen <- Health Regen
- `sumHP5OC` - Health Regen when out of combat <- Spirit
- `sumStr` - Strength Summary
Expand Down
112 changes: 60 additions & 52 deletions RatingBuster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,11 @@ local options = {
args = {},
hidden = true,
},
spell_crit = {
mastery = {
type = 'group',
name = L[StatLogic.Stats.SpellCrit],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.SpellCrit]),
width = "full",
order = 9,
name = L[StatLogic.Stats.MasteryRating],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.MasteryRating]),
order = 8,
args = {},
hidden = true,
},
Expand All @@ -316,26 +315,19 @@ local options = {
args = {},
hidden = true,
},
ap = {
mana_regen = {
type = 'group',
name = L[StatLogic.Stats.AttackPower],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.AttackPower]),
order = 10,
args = {},
hidden = true,
},
spell_dmg = {
type = 'group',
name = L[StatLogic.Stats.SpellDamage],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.SpellDamage]),
name = L[StatLogic.Stats.ManaRegen],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.ManaRegen]),
width = "full",
order = 10,
args = {},
hidden = true,
},
mastery = {
ap = {
type = 'group',
name = L[StatLogic.Stats.MasteryRating],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.MasteryRating]),
name = L[StatLogic.Stats.AttackPower],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.AttackPower]),
order = 11,
args = {},
hidden = true,
Expand Down Expand Up @@ -368,27 +360,44 @@ local options = {
hidden = true,
args = {},
},
defense = {
spell_dmg = {
type = 'group',
name = L[StatLogic.Stats.Defense],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.Defense]),
name = L[StatLogic.Stats.SpellDamage],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.SpellDamage]),
order = 14,
args = {},
hidden = true,
},
spell_crit = {
type = 'group',
name = L[StatLogic.Stats.SpellCrit],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.SpellCrit]),
width = "full",
order = 15,
args = {},
hidden = true,
},
armor = {
type = 'group',
name = L[StatLogic.Stats.Armor],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.Armor]),
order = 15,
order = 16,
args = {},
hidden = true,
},
defense = {
type = 'group',
name = L[StatLogic.Stats.Defense],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.Defense]),
order = 17,
hidden = true,
args = {},
},
resilience = {
type = 'group',
name = L[StatLogic.Stats.ResilienceRating],
desc = L["Changes the display of %s"]:format(L[StatLogic.Stats.ResilienceRating]),
order = 16,
order = 18,
args = {},
hidden = true,
},
Expand Down Expand Up @@ -587,17 +596,29 @@ local options = {
desc = L["Mana <- Mana, Intellect"],
order = 2,
},
sumMP5 = {
sumManaRegen = {
type = 'toggle',
name = L["Sum %s"]:format(L[StatLogic.Stats.ManaRegen]),
desc = L["Mana Regen <- Mana Regen, Spirit"],
order = 3,
},
sumMP5NC = {
sumManaRegenNotCasting = {
type = 'toggle',
name = L["Sum %s"]:format(L[StatLogic.Stats.ManaRegenNotCasting]),
desc = L["Mana Regen while not casting <- Spirit"],
order = 4,
hidden = function()
return StatLogic:GetStatMod("ADD_MANA_REGEN_NOT_CASTING_MOD_NORMAL_MANA_REGEN") == 0
end,
},
sumManaRegenOutOfCombat = {
type = 'toggle',
name = L["Sum %s"]:format(L[StatLogic.Stats.ManaRegenOutOfCombat]),
desc = L["Mana Regen while not casting <- Spirit"],
order = 4,
hidden = function()
return StatLogic:GetStatMod("ADD_MANA_REGEN_OUT_OF_COMBAT_MOD_NORMAL_MANA_REGEN") == 0
end,
},
sumHP5 = {
type = 'toggle',
Expand Down Expand Up @@ -1199,13 +1220,7 @@ local defaults = {
wpnBreakDown = false,
showStats = true,
sumAvoidWithBlock = false,
--[[
Str -> AP, Block
Agi -> Crit, Dodge, AP, RAP, Armor
Sta -> Health
Int -> Mana, SpellCrit, MP5NC
Spi -> MP5NC, HP5
--]]

-- Base stat conversions
showAPFromStr = false,
showBlockValueFromStr = false,
Expand All @@ -1219,11 +1234,9 @@ local defaults = {
showHealthFromSta = false,

showManaFromInt = false,
showManaRegenNotCastingFromManaRegen = false,
showManaRegenOutOfCombatFromManaRegen = false,
showSpellCritFromInt = true,
showMP5NCFromInt = false,

showMP5NCFromSpi = false,
showHP5NCFromSpi = false,

showModifiedRangedAttackPower = false,

Expand All @@ -1242,8 +1255,9 @@ local defaults = {
-- Basic
sumHP = true,
sumMP = true,
sumMP5 = true,
sumMP5NC = false,
sumManaRegen = true,
sumManaRegenNotCasting = false,
sumManaRegenOutOfCombat = false,
sumHP5 = false,
sumHP5OC = false,
sumStr = false,
Expand Down Expand Up @@ -1347,7 +1361,7 @@ if class == "DEATHKNIGHT" then
defaults.profile.sumAvoidance = true
defaults.profile.sumArmor = true
defaults.profile.sumMP = false
defaults.profile.sumMP5 = false
defaults.profile.sumManaRegen = false
defaults.profile.sumAP = true
defaults.profile.sumHit = true
defaults.profile.sumCrit = true
Expand Down Expand Up @@ -1424,7 +1438,7 @@ elseif class == "ROGUE" then
defaults.profile.sumWeaponAverageDamage = true
defaults.profile.sumWeaponSkill = true
defaults.profile.sumMP = false
defaults.profile.sumMP5 = false
defaults.profile.sumManaRegen = false
defaults.profile.sumAP = true
defaults.profile.sumHit = true
defaults.profile.sumCrit = true
Expand Down Expand Up @@ -1464,7 +1478,7 @@ elseif class == "WARRIOR" then
defaults.profile.sumAvoidance = true
defaults.profile.sumArmor = true
defaults.profile.sumMP = false
defaults.profile.sumMP5 = false
defaults.profile.sumManaRegen = false
defaults.profile.sumAP = true
defaults.profile.sumHit = true
defaults.profile.sumCrit = true
Expand Down Expand Up @@ -1499,8 +1513,6 @@ do
-- Backwards compatibility
local statToOptionKey = setmetatable({
["AP"] = "AP",
["MANA_REG"] = "MP5",
["NORMAL_MANA_REG"] = "MP5NC",
["HEALTH_REG"] = "HP5",
["NORMAL_HEALTH_REG"] = "HP5NC",
["RANGED_AP"] = "RAP",
Expand All @@ -1525,9 +1537,7 @@ do
["HEALING"] = StatLogic.Stats.HealingPower,
["HEALTH_REG"] = StatLogic.Stats.HealthRegen,
["INT"] = StatLogic.Stats.Intellect,
["MANA_REG"] = StatLogic.Stats.ManaRegen,
["NORMAL_HEALTH_REG"] = StatLogic.Stats.HealthRegenOutOfCombat,
["NORMAL_MANA_REG"] = StatLogic.Stats.ManaRegenNotCasting,
["PVP_DAMAGE_REDUCTION"] = StatLogic.Stats.PvPDamageReduction,
["RANGED_AP"] = StatLogic.Stats.RangedAttackPower,
["SPELL_DMG"] = StatLogic.Stats.SpellDamage,
Expand Down Expand Up @@ -1669,12 +1679,10 @@ do
add = "ARMOR"
end

if mod == "NORMAL_MANA_REG" then
mod = "SPI"
if statModContext("ADD_NORMAL_MANA_REG_MOD_INT") > 0 then
-- "Normal mana regen" is added from both int and spirit
addStatModOption(add, "INT", sources)
end
if add == "GENERIC_MANA_REGEN" or add == "NORMAL_MANA_REGEN" then
add = "MANA_REGEN"
elseif mod == "GENERIC_MANA_REGEN" or mod == "NORMAL_MANA_REGEN" then
mod = "MANA_REGEN"
elseif mod == "NORMAL_HEALTH_REG" then
if statModContext("ADD_NORMAL_HEALTH_REG_MOD_SPI") > 0 then
-- Vanilla through Wrath
Expand Down

0 comments on commit 9cd67fb

Please sign in to comment.