Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78e50e9f5c | |||
| 14dd30e9a9 | |||
| 996a11dd0a |
@@ -338,7 +338,7 @@ function addon:OnEnable()
|
||||
-- CoA: use a Lua constant, not GetAddOnMetadata — TOC metadata is cached at game launch
|
||||
-- and does NOT refresh on /reload, so the .toc version looked stale ("still .18"). A Lua
|
||||
-- constant re-evaluates on every /reload, giving a truthful loaded-code version. Bump with the .toc.
|
||||
AltoholicFrameName:SetText("Altoholic |cFFFFFFFF3.3.002b-coa.22|r")
|
||||
AltoholicFrameName:SetText("Altoholic |cFFFFFFFF3.3.002b-coa.25|r")
|
||||
|
||||
local realm = GetRealmName()
|
||||
local player = UnitName("player")
|
||||
@@ -608,13 +608,17 @@ end
|
||||
-- Fresh alts have partial per-module data, so every field is guarded here once
|
||||
-- instead of being copy-pasted (and missed) across the frames.
|
||||
function Altoholic:AddCharacterTooltipHeader(character)
|
||||
local locClass, engClass = DS:GetCharacterClass(character)
|
||||
local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: current class name (PROPHET->Venomancer, …)
|
||||
AltoTooltip:AddDoubleLine(DS:GetColoredCharacterName(character) or "?", DS:GetColoredCharacterFaction(character) or "")
|
||||
AltoTooltip:AddLine(format("%s %s |r%s %s", L["Level"],
|
||||
GREEN..(DS:GetCharacterLevel(character) or 0), DS:GetCharacterRace(character) or "", DS:GetCharacterClass(character) or ""), 1, 1, 1)
|
||||
GREEN..(DS:GetCharacterLevel(character) or 0), DS:GetCharacterRace(character) or "", className), 1, 1, 1)
|
||||
end
|
||||
|
||||
function Altoholic:SetCharacterRowNameLevel(entry, i, icon, character)
|
||||
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character) or "?", DS:GetCharacterClass(character) or ""))
|
||||
local locClass, engClass = DS:GetCharacterClass(character)
|
||||
local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: current class name
|
||||
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character) or "?", className))
|
||||
_G[entry..i.."Level"]:SetText(GREEN .. (DS:GetCharacterLevel(character) or 0))
|
||||
end
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
## Author: Thaoky, Telkar-RG
|
||||
## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at
|
||||
## Version: 3.3.002b-coa.22
|
||||
## Version: 3.3.002b-coa.25
|
||||
## X-Category: Inventory, Tradeskill, Mail
|
||||
## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU
|
||||
## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx
|
||||
|
||||
@@ -98,6 +98,7 @@ local function AddRealm(AccountName, RealmName)
|
||||
professions[#professions + 1] = {
|
||||
name = p.name,
|
||||
rank = p.rank or 0,
|
||||
maxRank = p.maxRank or 0, -- CoA: needed for the "rank/max" display in the vertical Skills list
|
||||
spellID = DataStore:GetProfessionSpellID(p.name),
|
||||
}
|
||||
end
|
||||
|
||||
@@ -115,3 +115,23 @@ function Alto:GetCoAClassIcon(token)
|
||||
if not tc then return end
|
||||
return COA_CLASS_ICON_TEXTURE, tc[1], tc[2], tc[3], tc[4]
|
||||
end
|
||||
|
||||
-- CoA renamed its classes, but UnitClass()/DataStore still return the OLD tokens
|
||||
-- (PROPHET, MONK, …). Map them to the current display names. Source: coa-omen/README-CoA.md.
|
||||
-- Tokens not listed here keep their normal localized name (returns nil).
|
||||
local COA_CLASS_NAMES = {
|
||||
HERO = "Hero", BARBARIAN = "Barbarian", WITCHDOCTOR = "Witch Doctor",
|
||||
DEMONHUNTER = "Felsworn", WITCHHUNTER = "Witch Hunter", STORMBRINGER = "Stormbringer",
|
||||
FLESHWARDEN = "Knight of Xoroth", GUARDIAN = "Guardian", MONK = "Templar",
|
||||
SONOFARUGAL = "Bloodmage", RANGER = "Ranger", CHRONOMANCER = "Chronomancer",
|
||||
NECROMANCER = "Necromancer", PYROMANCER = "Pyromancer", CULTIST = "Cultist",
|
||||
STARCALLER = "Starcaller", SUNCLERIC = "Sun Cleric", TINKER = "Tinker",
|
||||
PROPHET = "Venomancer", REAPER = "Reaper", WILDWALKER = "Primalist",
|
||||
SPIRITMAGE = "Runemaster",
|
||||
}
|
||||
|
||||
-- Current CoA display name for a class token, or nil if unmapped (caller falls back).
|
||||
function Alto:GetCoAClassName(token)
|
||||
if type(token) ~= "string" then return end
|
||||
return COA_CLASS_NAMES[token]
|
||||
end
|
||||
|
||||
@@ -76,26 +76,37 @@ function ns:Update()
|
||||
local item = items[i + offset]
|
||||
if item then
|
||||
_G[e.."Collapse"]:Hide()
|
||||
_G[e.."Level"]:SetText("")
|
||||
_G[e.."Skill1NormalText"]:SetText("")
|
||||
_G[e.."CookingNormalText"]:SetText("")
|
||||
_G[e.."FirstAidNormalText"]:SetText("")
|
||||
_G[e.."FishingNormalText"]:SetText("")
|
||||
_G[e.."RidingNormalText"]:SetText("")
|
||||
_G[e.."Name"]:SetWidth(680)
|
||||
_G[e.."Name"]:SetPoint("TOPLEFT", 15, 0)
|
||||
_G[e.."NameNormalText"]:SetWidth(680)
|
||||
|
||||
if item.kind == "header" then
|
||||
local _, class = DS:GetCharacterClass(item.character)
|
||||
_G[e.."NameNormalText"]:SetText( (DS:GetColoredCharacterName(item.character) or "?") .. " " .. WHITE .. "(" .. (class or "") .. ")" )
|
||||
-- character header: colored name + (class) across the row, no rank column
|
||||
_G[e.."Name"]:SetPoint("TOPLEFT", 15, 0)
|
||||
_G[e.."Name"]:SetWidth(420)
|
||||
_G[e.."NameNormalText"]:SetWidth(420)
|
||||
local locClass, engClass = DS:GetCharacterClass(item.character)
|
||||
local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: PROPHET->Venomancer, MONK->Templar, …
|
||||
_G[e.."NameNormalText"]:SetText( (DS:GetColoredCharacterName(item.character) or "?") .. " " .. WHITE .. "(" .. className .. ")" )
|
||||
_G[e.."Level"]:SetText("")
|
||||
else
|
||||
-- profession row: [icon] name in the Name cell (indented), rank/max in its own column
|
||||
local iconEsc = ""
|
||||
if item.spellID then
|
||||
iconEsc = addon:TextureToFontstring2(addon:GetSpellIcon(item.spellID), size, size, inset, inset, inset, inset) .. " "
|
||||
end
|
||||
_G[e.."Name"]:SetPoint("TOPLEFT", 38, 0)
|
||||
_G[e.."Name"]:SetWidth(200)
|
||||
_G[e.."NameNormalText"]:SetWidth(200)
|
||||
_G[e.."NameNormalText"]:SetText( iconEsc .. WHITE .. item.name )
|
||||
|
||||
local cap = (item.maxRank > 0) and item.maxRank or 450
|
||||
_G[e.."NameNormalText"]:SetText( " " .. iconEsc .. WHITE .. item.name .. " " .. ns:GetColor(item.rank, cap) .. item.rank .. "/" .. item.maxRank .. "|r" )
|
||||
_G[e.."Level"]:SetPoint("TOPLEFT", 250, 0)
|
||||
_G[e.."Level"]:SetWidth(120)
|
||||
_G[e.."Level"]:SetJustifyH("LEFT")
|
||||
_G[e.."Level"]:SetText( ns:GetColor(item.rank, cap) .. item.rank .. " / " .. item.maxRank )
|
||||
end
|
||||
btn.coaItem = item
|
||||
btn:SetID(item.viewLine or 0)
|
||||
|
||||
@@ -245,8 +245,8 @@
|
||||
</Button>
|
||||
<Button name="$parent_Prof1" inherits="AltoViewIconTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="AltoholicTabCharacters" relativePoint="TOPLEFT" >
|
||||
<Offset x="30" y="-235" />
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_FirstAid" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
@@ -257,50 +257,6 @@
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<!-- CoA: characters can know many more than 2 primary professions. Extra slots;
|
||||
UpdateViewIcons fills/hides them dynamically and stops at the last one. -->
|
||||
<Button name="$parent_Prof3" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_Prof2" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent_Prof4" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_Prof3" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent_Prof5" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parent_Prof1" relativePoint="BOTTOMLEFT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent_Prof6" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_Prof5" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent_Prof7" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_Prof6" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent_Prof8" inherits="AltoViewIconTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="$parent_Prof7" relativePoint="BOTTOMRIGHT" >
|
||||
<Offset x="5" y="0" />
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
|
||||
<Button name="$parent_Sort1" inherits="AltoSortButtonTemplate" id="1">
|
||||
<Size>
|
||||
|
||||
Reference in New Issue
Block a user