WoWInterface SVN ProgressionPre-Alpha

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

faction.lua
84,10 → 84,15
if not isHeader or (isHeader and hasRep) then
id = 'rep_' .. factionname
t = LookupFaction(factionname, true)
if not t.gain then t.gain = 0 end
if t.rawValue and t.rawValue ~= barValue then
t.gain = barValue - t.rawValue
end
t.rawValue = barValue
t.state = standingId
t.value = barValue - barMin
t.max = barMax - barMin
if t.gain ~= 0 then t:Notify(true) end
end
end
PXP.Menu.Resort()
141,8 → 146,11
 
if not PXP.events["COMBAT_TEXT_UPDATE"] then PXP.events["COMBAT_TEXT_UPDATE"] = {} end
PXP.events["COMBAT_TEXT_UPDATE"]['faction'] = function(event, type, faction, gain, ...)
-- We no longer update faction this way, we just do a Notify and let UPDATE_FACTION sort it all out.
if type ~= 'FACTION' then return end
local m = LookupFaction(faction)
if m and gain > 0 then m:Notify() end
end
 
local m = PXP.ModifyFactionRep(faction, gain)
m:Notify()
end
if not PXP.events["UPDATE_FACTION"] then PXP.events["UPDATE_FACTION"] = {} end
PXP.events["UPDATE_FACTION"]['faction'] = function(...) PXP.ReloadFactionData() end
bar.lua
191,10 → 191,10
if self.modes then
for k, v in pairs(self.modes) do
if v.next then
if not first or k.id < first then first = k end
if not last or k.id > last then last = k end
if k.id < mode.id and (n.prev == nil or k.id > n.prev) then n.prev = k end
if k.id > modeId and (n.next == nil or k.id < n.next) then n.next = k end
if not first or k.id < first.id then first = k end
if not last or k.id > last.id then last = k end
if k.id < mode.id and (n.prev == nil or k.id > n.prev.id) then n.prev = k end
if k.id > mode.id and (n.next == nil or k.id < n.next.id) then n.next = k end
end
end
end
219,6 → 219,25
return true
end
 
function PXP.Bar.Delete(self)
if self.parent then
self.parent:Remove(self)
end
 
self.baseFrame:Hide()
self.baseFrame:SetScript("OnEnter", nil)
self.baseFrame:SetScript("OnLeave", nil)
self.baseFrame:SetScript("OnMouseDown", nil)
self.baseFrame:SetScript("OnMouseUp", nil)
self.baseFrame:SetScript("OnUpdate", nil)
 
self.parent = nil
self.next = nil
self.prev = nil
self.baseFrame = nil
self.overlayFrame = nil
end
 
-- Remove a mode from our interest list, and make another mode active.
function PXP.Bar.RemoveMode(self, mode, isInherit)
assert(mode)
245,15 → 264,15
if not mode.virtual then
self.modes[n.prev].next = n.next
self.modes[n.next].prev = n.prev
if self.currentMode == modeId then
if n.next ~= modeId then
if self.currentMode == mode then
if n.next ~= mode then
self:SetMode(n.next)
else
self:SetMode(nil)
end
end
end
self.modes[modeId] = nil
self.modes[mode] = nil
end
 
mode.watchers.primary[self] = nil
280,15 → 299,6
end
end
 
-- Toggle automatic mode switching
function PXP.Bar.SetautoUpdate(self, v)
if v then v = true else v = nil end
 
self.autoUpdate = v
local modeId, mode
return v
end
 
-- Maximum bar value.. Minimum is always 0.
function PXP.Bar.SetMax(self, v)
 
menu.lua
69,7 → 69,8
 
function PXP.Menu.ActionDeleteBar(self, bar)
CloseDropDownMenus()
bar.parent:Remove(bar)
bar:Delete()
--bar.parent:Remove(bar)
end
 
function PXP.Menu.ActionCreateBar(self, base, clone)
103,8 → 104,7
local rootMenu = {}
 
if bar.currentMode then
assert(PXP.modes[bar.currentMode])
table.insert(rootMenu, {text = PXP.modes[bar.currentMode].name, isTitle = true})
table.insert(rootMenu, {text = bar.currentMode.name, isTitle = true})
else
table.insert(rootMenu, {text = TR.NOT_CONFIGURED, isTitle = true})
end
229,8 → 229,8
table.insert(rootMenu, MenuSep)
 
table.insert(rootMenu, {
text = TR.AUTOUPDATE,
tooltipText = TR.AUTOUPDATE_TT,
text = TR.EDITMODE,
tooltipText = TR.EDITMODE_TT,
func = function(...) bar.parent:SetForceVisible(not bar.parent.forceVisible) end,
checked = bar.parent.forceVisible,
})
255,8 → 255,8
table.insert(rootMenu, {
text = TR.AUTOUPDATE,
tooltipText = TR.AUTOUPDATE_TT,
func = function(...) CloseDropDownMenus(); bar.autoSwitchModes = not bar.autoSwitchModes end,
checked = bar.autoSwitchModes,
func = function(...) CloseDropDownMenus(); bar.autoUpdate = not bar.autoUpdate end,
checked = bar.autoUpdate,
})
 
EasyMenu(rootMenu, PXP.Menu.Frame, UIParent, x/scale, y/scale, "MENU", 10)
mode.lua
6,12 → 6,10
max= 1,
type = nil,
name = 'NAME ME',
watchers = { primary={}, secondary={} },
state = 0,
 
}
 
function PXP.Mode.Notify(self)
function PXP.Mode.Notify(self, primaryOnly)
local handledPrimary = nil
 
for bar, _ in pairs(self.watchers.primary) do
19,7 → 17,7
bar:Update()
end
 
if handledPrimary then return true end
if handledPrimary or primaryOnly then return true end
 
local oldestbar = nil
-- No bar currently set to this mode would handle it.
base.lua
82,15 → 82,19
 
function PXP.LoadProfile(profile)
assert(PXP.globalData.profiles[profile], "Profile not found")
for group, _ in pairs(PXP.groups) do group:Delete() end
for _, group in pairs(PXP.groups) do group:Delete() end
PXP.groups = {}
 
PXP.profileName = profile
PXP.profile = PXP.globalData.profiles[profile]
local p = PXP.profile
 
for modename, initproc in pairs(PXP.profileLoadCallbacks) do initproc() end
 
local group, bar
for _, groupSettings in pairs(PXP.profile.groups) do
group = PXP.Group:New()
table.insert(PXP.groups, group)
group:SetOrigin(groupSettings.originX, groupSettings.originY)
group.width = groupSettings.width
group.height = groupSettings.height
115,8 → 119,6
end
end
end
 
for modename, initproc in pairs(PXP.profileLoadCallbacks) do initproc() end
end
 
function PXP.SaveProfile(profile)
127,9 → 129,9
 
p.groups = {}
local groupSettings, barSettings
local bar
for group, _ in pairs(PXP.groups) do
groupSettings = {}
local bar, group
for _, group in pairs(PXP.groups) do
groupSettings = { bars = {} }
table.insert(p.groups, groupSettings)
 
groupSettings.originX , groupSettings.originY = group:GetOrigin()
153,16 → 155,11
end
 
barSettings.modes = {}
for modeId, modeData in pairs(bar.modes) do
if modeData.explicit then
table.insert(barSettings.modes, modeId)
for mode, data in pairs(bar.modes) do
if data.explicit then
table.insert(barSettings.modes, mode.id)
 
if not PXP.globalData.modeCache[modeId] then
PXP.globalData.modeCache[modeId] = {
name = PXP.modes[modeId].name,
type = PXP.modes[modeId].type,
}
end
if not PXP.globalData.modeCache[mode.id] then PXP.globalData.modeCache[mode.id] = { name = mode.name, type = mode.type } end
end
end
bar = bar.next
220,3 → 217,8
PXP.events["PLAYER_LOGIN"]['core'] = function(...)
PXP.Initialize()
end
 
if not PXP.events["PLAYER_LOGOUT"] then PXP.events["PLAYER_LOGOUT"] = {} end
PXP.events["PLAYER_LOGOUT"]['core'] = function(...)
PXP.SaveProfile()
end
group.lua
70,6 → 70,13
return obj
end
 
function PXP.Group.Delete(self)
obj.StopMovingOrSizing()
obj.frame:Hide()
 
for bar, _ in pairs(self.bars) do bar:Delete() end
end
 
function PXP.Group.SetOrigin(self, x, y)
assert(x and y)
self.frame:ClearAllPoints()
Progression.toc
6,7 → 6,7
## SavedVariables: ProgressionGlobalData
## SavedVariablesPerCharacter: ProgressionCharacterData
## Dependencies:
## Version: 30000.1
## Version: 30000.2
## OptionalDeps:
## X-Embeds:
## X-Category:
petxp.lua
33,14 → 33,18
else
t.value = curXP
t.max = maxXP
 
if t.state == PXP.STATE_NOPET then
t.gain = 0
else
t.gain = gain or PXP.GetGain(oldxp, oldmax, oldlevel, t.value, t.level)
end
 
if t.level < UnitLevel("player") then
t.state = PXP.STATE_NORMAL
else
t.state = PXP.STATE_CAPPED
end
 
if gain == nil then gain = PXP.GetGain(oldxp, oldmax, oldlevel, t.value, t.level) end
t.gain = gain
end
t:Notify()
end
75,4 → 79,7
if not PXP.events["UNIT_PET_EXPERIENCE"] then PXP.events["UNIT_PET_EXPERIENCE"] = {} end
PXP.events["UNIT_PET_EXPERIENCE"]['petxp'] =UpdatePetXP
 
if not PXP.events["UNIT_PET"] then PXP.events["UNIT_PET"] = {} end
PXP.events["UNIT_PET"]['petxp'] =UpdatePetXP
 
PXP.Menu.Resort()