diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 2f93975..709a7cd 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -37,14 +37,10 @@ jobs: RID=$(curl -sf -X POST -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ "$API/repos/$REPO/releases" \ - -d "$(jq -nc --arg t "$TAG" '{tag_name:$t,name:$t,draft:false,prerelease:false,hide_archive_links:true}')" \ + -d "$(jq -nc --arg t "$TAG" '{tag_name:$t,name:$t,draft:false,prerelease:false}')" \ | jq -r '.id') fi echo "release id: $RID" - # Gitea honors hide_archive_links only on edit, not create — PATCH it - # so the auto-generated Source Code (zip/tar.gz) links stay hidden. - curl -sf -X PATCH -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" \ - "$API/repos/$REPO/releases/$RID" -d '{"hide_archive_links":true}' >/dev/null || true # Upload every dist/*.zip. Per-asset failures don't fail the job — # we want partial releases to still publish rather than block the # whole pipeline on one big file. diff --git a/RatingBuster/CoAClassSpecData.lua b/RatingBuster/CoAClassSpecData.lua deleted file mode 100644 index 5057aeb..0000000 --- a/RatingBuster/CoAClassSpecData.lua +++ /dev/null @@ -1,143 +0,0 @@ --- CoAClassSpecData.lua — GENERATED by coa-db/tools/gen_coa_class_spec_lua.py --- Source of truth: coa-db/data/class_spec_meta.json (class.file_string tokens + wiki specs). --- Do not hand-edit; regenerate from coa-db. Neutral stat keys; each addon maps them. --- Keyed by the in-game class token (2nd return of UnitClass), e.g. Templar=MONK. -CoAClassSpec = { - ["BARBARIAN"] = { name="Barbarian", classId=12, specs={ - { name="Headhunting", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Brutality", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Ancestry", roles={"MELEE","SUPPORT"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - }}, - ["WITCHDOCTOR"] = { name="Witch Doctor", classId=13, specs={ - { name="Shadowhunting", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Voodoo", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Brewing", roles={"HEALER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Intellect=0.55 } }, - }}, - ["DEMONHUNTER"] = { name="Felsworn", classId=14, specs={ - { name="Slayer", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Infernal", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Tyrant", roles={"TANK"}, primaryStat="Agility", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Agility=0.4 } }, - }}, - ["WITCHHUNTER"] = { name="Witch Hunter", classId=15, specs={ - { name="Boltslinger", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Darkness", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Inquisition", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Black Knight", roles={"TANK"}, primaryStat="Agility", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Agility=0.4 } }, - }}, - ["STORMBRINGER"] = { name="Stormbringer", classId=16, specs={ - { name="Maelstrom", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Lightning", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Wind", roles={"CASTER","SUPPORT"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - }}, - ["FLESHWARDEN"] = { name="Knight of Xoroth", classId=17, specs={ - { name="Hellfire", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Defiance", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - { name="War", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - }}, - ["GUARDIAN"] = { name="Guardian", classId=18, specs={ - { name="Gladiator", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Inspiration", roles={"MELEE","SUPPORT"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Vanguard", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - }}, - ["MONK"] = { name="Templar", classId=19, specs={ - { name="Oathkeeper", roles={"TANK"}, primaryStat="Agility", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Agility=0.4 } }, - { name="Zealot", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Crusader", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - }}, - ["SONOFARUGAL"] = { name="Bloodmage", classId=20, specs={ - { name="Fleshweaver", roles={"SUPPORT"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Sanguine", roles={"CASTER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Accursed", roles={"MELEE","CASTER"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Eternal", roles={"TANK"}, primaryStat="Agility", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Agility=0.4 } }, - }}, - ["RANGER"] = { name="Ranger", classId=21, specs={ - { name="Archery", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Farstrider", roles={"RANGED","SUPPORT"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Brigand", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - }}, - ["CHRONOMANCER"] = { name="Chronomancer", classId=22, specs={ - { name="Infinite", roles={"CASTER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Time", roles={"HEALER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Intellect=0.55 } }, - { name="Artificer", roles={"RANGED"}, primaryStat="Spirit", weights={ Spirit=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - }}, - ["NECROMANCER"] = { name="Necromancer", classId=23, specs={ - { name="Death", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Animation", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Rime", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - }}, - ["PYROMANCER"] = { name="Pyromancer", classId=24, specs={ - { name="Incineration", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Flameweaving", roles={"HEALER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Intellect=0.55 } }, - { name="Draconic", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - }}, - ["CULTIST"] = { name="Cultist", classId=25, specs={ - { name="Heretic", roles={"HEALER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Spirit=0.55 } }, - { name="Corruption", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Godblade", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Dreadnought", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - }}, - ["STARCALLER"] = { name="Starcaller", classId=26, specs={ - { name="Sentinel", roles={"RANGED"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Warden", roles={"MELEE"}, primaryStat="Intellect", weights={ Intellect=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Moon Priest", roles={"HEALER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Spirit=0.55 } }, - { name="Moon Guard", roles={"TANK"}, primaryStat="Intellect", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Intellect=0.4 } }, - }}, - ["SUNCLERIC"] = { name="Sun Cleric", classId=27, specs={ - { name="Piety", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Valkyrie", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Seraphim", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - { name="Blessings", roles={"HEALER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Spirit=0.55 } }, - }}, - ["TINKER"] = { name="Tinker", classId=28, specs={ - { name="Demolition", roles={"RANGED"}, primaryStat="Agility", weights={ Agility=1, RangedAttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5 } }, - { name="Mechanics", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Invention", roles={"HEALER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Spirit=0.55 } }, - }}, - ["PROPHET"] = { name="Venomancer", classId=29, specs={ - { name="Fortitude", roles={"TANK"}, primaryStat="Intellect", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Intellect=0.4 } }, - { name="Stalking", roles={"MELEE"}, primaryStat="Intellect", weights={ Intellect=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Rot", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Vizier", roles={"HEALER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, CritRating=0.5, HasteRating=0.5, Mp5=0.5, Spirit=0.55 } }, - }}, - ["REAPER"] = { name="Reaper", classId=30, specs={ - { name="Soul", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Harvest", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Domination", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - }}, - ["WILDWALKER"] = { name="Primalist", classId=31, specs={ - { name="Grovekeeper", roles={"SUPPORT"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Wildwalker", roles={"MELEE"}, primaryStat="Strength", weights={ Strength=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Mountain King", roles={"TANK"}, primaryStat="Strength", weights={ Stamina=1, Armor=0.6, Dodge=0.55, Parry=0.55, Defense=0.6, Strength=0.4 } }, - { name="Geomancy", roles={"CASTER"}, primaryStat="Intellect", weights={ Intellect=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - }}, - ["SPIRITMAGE"] = { name="Runemaster", classId=32, specs={ - { name="Engravement", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - { name="Glyphic", roles={"CASTER"}, primaryStat="Spirit", weights={ Spirit=1, SpellPower=0.8, HitRating=0.7, CritRating=0.55, HasteRating=0.55 } }, - { name="Riftblade", roles={"MELEE"}, primaryStat="Agility", weights={ Agility=1, AttackPower=0.5, CritRating=0.55, HitRating=0.6, HasteRating=0.5, ArmorPenetration=0.5 } }, - }}, -} - -CoAClassPrimaryStats = { - ["BARBARIAN"] = { "Agility" }, - ["WITCHDOCTOR"] = { "Agility", "Intellect", "Spirit" }, - ["DEMONHUNTER"] = { "Agility", "Intellect", "Stamina" }, - ["WITCHHUNTER"] = { "Agility", "Intellect", "Stamina" }, - ["STORMBRINGER"] = { "Intellect" }, - ["FLESHWARDEN"] = { "Strength", "Intellect", "Stamina" }, - ["GUARDIAN"] = { "Strength", "Stamina" }, - ["MONK"] = { "Agility", "Stamina" }, - ["SONOFARUGAL"] = { "Spirit", "Stamina", "Agility" }, - ["RANGER"] = { "Agility" }, - ["CHRONOMANCER"] = { "Spirit" }, - ["NECROMANCER"] = { "Intellect" }, - ["PYROMANCER"] = { "Intellect", "Spirit" }, - ["CULTIST"] = { "Intellect", "Strength", "Stamina" }, - ["STARCALLER"] = { "Intellect", "Stamina" }, - ["SUNCLERIC"] = { "Intellect", "Strength", "Stamina" }, - ["TINKER"] = { "Agility", "Intellect" }, - ["PROPHET"] = { "Intellect", "Stamina" }, - ["REAPER"] = { "Strength", "Stamina" }, - ["WILDWALKER"] = { "Strength", "Intellect", "Stamina" }, - ["SPIRITMAGE"] = { "Agility", "Spirit" }, -} - diff --git a/RatingBuster/RatingBuster.lua b/RatingBuster/RatingBuster.lua index 8ec59a9..49eb4f7 100644 --- a/RatingBuster/RatingBuster.lua +++ b/RatingBuster/RatingBuster.lua @@ -352,11 +352,7 @@ Spi -> MP5, MP5NC, HP5, SpellDmg, Healing } -- Class specific defaults --- Applied at OnInitialize after UnitClass("player") is available. --- CoA custom classes (not in the vanilla if/elseif ladder) fall through --- to no block, which is the correct generic fallback for classless chars. -local function applyClassProfileDefaults(cls) -if cls == "DRUID" then +if class == "DRUID" then profileDefault.ratingSpell = true profileDefault.ratingPhysical = true profileDefault.sumHP = true @@ -385,7 +381,7 @@ if cls == "DRUID" then profileDefault.showHealingFromSpi = true profileDefault.sumIgnoreCloth = false profileDefault.sumIgnoreLeather = false -elseif cls == "HUNTER" then +elseif class == "HUNTER" then profileDefault.ratingPhysical = true profileDefault.sumHP = true profileDefault.sumMP = true @@ -403,7 +399,7 @@ elseif cls == "HUNTER" then profileDefault.showAPFromSta = true profileDefault.sumIgnoreLeather = false profileDefault.sumIgnoreMail = false -elseif cls == "MAGE" then +elseif class == "MAGE" then profileDefault.ratingSpell = true profileDefault.sumHP = true profileDefault.sumMP = true @@ -421,7 +417,7 @@ elseif cls == "MAGE" then profileDefault.showMP5FromSpi = true profileDefault.showSpellCritFromSpi = true -- Molten Armor profileDefault.sumIgnoreCloth = false -elseif cls == "PALADIN" then +elseif class == "PALADIN" then profileDefault.ratingSpell = true profileDefault.ratingPhysical = true profileDefault.sumHP = true @@ -452,7 +448,7 @@ elseif cls == "PALADIN" then profileDefault.sumIgnoreLeather = false profileDefault.sumIgnoreMail = false profileDefault.sumIgnorePlate = false -elseif cls == "PRIEST" then +elseif class == "PRIEST" then profileDefault.ratingSpell = true profileDefault.sumHP = true profileDefault.sumMP = true @@ -470,7 +466,7 @@ elseif cls == "PRIEST" then profileDefault.showSpellDmgFromSpi = true profileDefault.showHealingFromSpi = true profileDefault.sumIgnoreCloth = false -elseif cls == "ROGUE" then +elseif class == "ROGUE" then profileDefault.ratingPhysical = true profileDefault.sumHP = true profileDefault.sumResilience = true @@ -482,7 +478,7 @@ elseif cls == "ROGUE" then profileDefault.sumArmorPenetration = true profileDefault.showSpellCritFromInt = false profileDefault.sumIgnoreLeather = false -elseif cls == "SHAMAN" then +elseif class == "SHAMAN" then profileDefault.ratingSpell = true profileDefault.ratingPhysical = true profileDefault.sumHP = true @@ -503,7 +499,7 @@ elseif cls == "SHAMAN" then profileDefault.sumIgnoreCloth = false profileDefault.sumIgnoreLeather = false profileDefault.sumIgnoreMail = false -elseif cls == "WARLOCK" then +elseif class == "WARLOCK" then profileDefault.ratingSpell = true profileDefault.sumHP = true profileDefault.sumMP = true @@ -519,7 +515,7 @@ elseif cls == "WARLOCK" then profileDefault.showMP5FromSpi = true profileDefault.showSpellDmgFromSpi = true profileDefault.sumIgnoreCloth = false -elseif cls == "WARRIOR" then +elseif class == "WARRIOR" then profileDefault.ratingPhysical = true profileDefault.sumHP = true profileDefault.sumResilience = true @@ -540,7 +536,7 @@ elseif cls == "WARRIOR" then profileDefault.sumIgnoreMail = false end profileDefault.sumIgnorePlate = false -elseif cls == "DEATHKNIGHT" then +elseif class == "DEATHKNIGHT" then profileDefault.ratingPhysical = true profileDefault.sumHP = true profileDefault.sumResilience = true @@ -559,69 +555,6 @@ elseif cls == "DEATHKNIGHT" then profileDefault.sumIgnorePlate = false end --- CoA custom classes: enable stat-summary defaults based on primary stats. --- CoAClassPrimaryStats is defined in CoAClassSpecData.lua (loaded before this file). -if CoAClassPrimaryStats and CoAClassPrimaryStats[cls] then - local stats = CoAClassPrimaryStats[cls] - local hasAgi, hasStr, hasInt, hasSpi, hasSta = false, false, false, false, false - for _, stat in ipairs(stats) do - if stat == "Agility" then hasAgi = true end - if stat == "Strength" then hasStr = true end - if stat == "Intellect" then hasInt = true end - if stat == "Spirit" then hasSpi = true end - if stat == "Stamina" then hasSta = true end - end - -- Always: HP and resilience - profileDefault.sumHP = true - profileDefault.sumResilience = true - if hasAgi then - profileDefault.ratingPhysical = true - profileDefault.sumAgi = true - profileDefault.sumAP = true - profileDefault.sumHit = true - profileDefault.sumCrit = true - profileDefault.sumHaste = true - profileDefault.sumExpertise = true - profileDefault.sumArmorPenetration = true - end - if hasStr then - profileDefault.ratingPhysical = true - profileDefault.sumStr = true - profileDefault.sumAP = true - profileDefault.sumHit = true - profileDefault.sumCrit = true - profileDefault.sumHaste = true - profileDefault.sumExpertise = true - profileDefault.sumArmorPenetration = true - end - if hasInt then - profileDefault.ratingSpell = true - profileDefault.sumMP = true - profileDefault.sumInt = true - profileDefault.sumSpellDmg = true - profileDefault.sumSpellHit = true - profileDefault.sumSpellCrit = true - profileDefault.sumSpellHaste = true - profileDefault.sumHealing = true - profileDefault.sumMP5 = true - profileDefault.showSpellDmgFromInt = true - profileDefault.showMP5FromInt = true - end - if hasSpi then - profileDefault.ratingSpell = true - profileDefault.sumMP = true - profileDefault.sumSpi = true - profileDefault.sumHealing = true - profileDefault.sumMP5 = true - profileDefault.showMP5FromSpi = true - profileDefault.showHealingFromSpi = true - end - if hasSta then - profileDefault.sumSta = true - end -end -end -- applyClassProfileDefaults - local defaults = {} defaults.profile = profileDefault @@ -2319,10 +2252,7 @@ end -- Class specific options --- Applied at OnInitialize (before SetupOptions) after UnitClass("player") is available. --- CoA custom classes fall through to no block: no class-specific UI entries shown. -local function applyClassOptions(cls) -if cls == "DRUID" then +if class == "DRUID" then options.args.stat.args.agi.args.heal = { -- Nurturing Instinct (Rank 2) - 2,14 type = 'toggle', width = "full", @@ -2377,7 +2307,7 @@ if cls == "DRUID" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "HUNTER" then +elseif class == "HUNTER" then options.args.stat.args.int.args.rap = { -- Careful Aim type = 'toggle', width = "full", @@ -2396,7 +2326,7 @@ elseif cls == "HUNTER" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "MAGE" then +elseif class == "MAGE" then options.args.stat.args.int.args.dmg = { -- Mind Mastery (Rank 5) - 1,22 type = 'toggle', width = "full", @@ -2433,7 +2363,7 @@ elseif cls == "MAGE" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "PALADIN" then +elseif class == "PALADIN" then options.args.stat.args.int.args.dmg = { -- Paladin: Holy Guidance (Rank 5) - 1,19 type = 'toggle', width = "full", @@ -2470,7 +2400,7 @@ elseif cls == "PALADIN" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "PRIEST" then +elseif class == "PRIEST" then options.args.stat.args.spi.args.mp5 = { -- Meditation (Rank 3) - 1,9 type = 'toggle', width = "full", @@ -2498,8 +2428,8 @@ elseif cls == "PRIEST" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "ROGUE" then -elseif cls == "SHAMAN" then +elseif class == "ROGUE" then +elseif class == "SHAMAN" then options.args.stat.args.str.args.dmg = { -- Mental Quickness (Rank 3) - 2,15 type = 'toggle', width = "full", @@ -2545,7 +2475,7 @@ elseif cls == "SHAMAN" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "WARLOCK" then +elseif class == "WARLOCK" then options.args.stat.args.sta.args.dmg = { -- Demonic Knowledge (Rank 3) - 2,20 - UnitExists("pet") type = 'toggle', width = "full", @@ -2582,7 +2512,7 @@ elseif cls == "WARLOCK" then get = getProfileOption, set = setProfileOptionAndClearCache, } -elseif cls == "WARRIOR" then +elseif class == "WARRIOR" then options.args.stat.args.armor = { -- Armored to the Teeth (Rank 3) - 2,1 type = 'group', order = 7, @@ -2600,7 +2530,7 @@ elseif cls == "WARRIOR" then }, }, } -elseif cls == "DEATHKNIGHT" then +elseif class == "DEATHKNIGHT" then options.args.stat.args.str.args.parry = { -- Death Knight: Forceful Deflection - Passive type = 'toggle', width = "full", @@ -2628,7 +2558,6 @@ elseif cls == "DEATHKNIGHT" then }, } end -end -- applyClassOptions function RatingBuster:SetupOptions() -- Inject profile options @@ -2731,16 +2660,6 @@ end -- OnInitialize(name) called at ADDON_LOADED function RatingBuster:OnInitialize() - -- Resolve player class as early as possible (ADDON_LOADED). - -- UnitClass("player") is nil at file-load time on this client (CoA 3.3.5a) - -- but is populated by ADDON_LOADED. Apply class-specific profileDefault - -- mutations BEFORE AceDB:New() so that first-install defaults are correct, - -- and apply class-specific options mutations BEFORE SetupOptions/RegisterOptionsTable. - local _, resolvedClass = UnitClass("player") - if resolvedClass then - class = resolvedClass - end - applyClassProfileDefaults(class) -- Create DB self.db = AceDB:New("RatingBusterDB", defaults) self.db.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged") @@ -2749,7 +2668,6 @@ function RatingBuster:OnInitialize() profileDB = self.db.profile - applyClassOptions(class) self:SetupOptions() -- Hook ShoppingTooltips to enable options to Hide Blizzard Item Comparisons @@ -2762,13 +2680,6 @@ end function RatingBuster:OnEnable() -- Hook item tooltips TipHooker:Hook(self.ProcessTooltip, "item") - -- Ensure class is resolved at PLAYER_LOGIN in case ADDON_LOADED fired too early. - -- This guards the runtime stat-conversion paths (class is used throughout - -- ProcessTooltip and StatLogic calls). - local _, resolvedClass = UnitClass("player") - if resolvedClass then - class = resolvedClass - end -- Initialize playerLevel playerLevel = UnitLevel("player") -- for setting a new level diff --git a/RatingBuster/RatingBuster.toc b/RatingBuster/RatingBuster.toc index 9aa18dd..b72b283 100644 --- a/RatingBuster/RatingBuster.toc +++ b/RatingBuster/RatingBuster.toc @@ -1,4 +1,4 @@ -## Interface: 30300 +## Interface: 30301 ## Title: RatingBuster ## Notes: Item stat breakdown, analysis and comparison ## Notes-zhTW: 裝備數值解析與比較 @@ -36,8 +36,5 @@ RatingBuster-Locale-frFR.lua RatingBuster-Locale-koKR.lua RatingBuster-Locale-esES.lua -# CoA class/spec data (must load before RatingBuster.lua) # -CoAClassSpecData.lua - # Core # RatingBuster.lua \ No newline at end of file diff --git a/RatingBuster/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua b/RatingBuster/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua index 07c8f76..ee5a83b 100644 --- a/RatingBuster/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua +++ b/RatingBuster/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua @@ -199,7 +199,7 @@ local function Constructor() button:SetScript("OnKeyDown", Keybinding_OnKeyDown) button:SetScript("OnMouseDown", Keybinding_OnMouseDown) button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel) - pcall(button.SetScript, button, "OnGamePadButtonDown", Keybinding_OnKeyDown) + button:SetScript("OnGamePadButtonDown", Keybinding_OnKeyDown) button:SetPoint("BOTTOMLEFT") button:SetPoint("BOTTOMRIGHT") button:SetHeight(24)