WoWInterface SVN pStats

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 18 to Rev 19
    Reverse comparison

Rev 18 → Rev 19

pStats/pStatsConfig.lua File deleted \ No newline at end of file
pStats/pStats.toc
3,13 → 3,10
## Version: 30000.wowi:revision
## Title: |cffff6000p|rStats
## Notes: Replaces the tooltip on MinimapTracking with a more informative one. Also supports LDB
## OptionalDeps: LibStub, CallbackHandler-1.0, LibSimpleOptions-1.0, LibDataBroker-1.1
## SavedVariablesPerCharacter: pStatsDB
 
Libs\LibSimpleOptions\LibStub\LibStub.lua
Libs\LibSimpleOptions\LibSimpleOptions-1.0.lua
Libs\CallbackHandler\CallbackHandler-1.0.lua
Libs\CallbackHandler\LibStub\LibStub.lua
Libs\CallbackHandler\CallBackHandler-1.0\CallbackHandler-1.0.lua
Libs\LibDataBroker\LibDataBroker-1.1.lua
 
pStats.lua
pStatsConfig.lua
\ No newline at end of file +pStats.lua \ No newline at end of file
pStats/pStats.lua
8,21 → 8,13
 
local dataobj, elapsed = LibStub:GetLibrary('LibDataBroker-1.1'):NewDataObject('Stats', {text = '2.0 MiB', icon = [=[Interface\AddOns\pStats\icon]=]}), 0.5
 
CreateFrame('Frame'):SetScript('OnUpdate', function(self, al)
elapsed = elapsed + al
if(elapsed > 0.5) then
dataobj.text = formats(gcinfo())
elapsed = 0
end
end)
 
function dataobj.OnLeave()
GameTooltip:SetClampedToScreen(true)
GameTooltip:Hide()
end
 
function dataobj.OnEnter(self)
local db = pStatsDB
local db = pStatsDB or {colors = {0, 1, 1}, sorted = true}
local r, g, b = unpack(db.colors)
local down, up, latency = GetNetStats()
local fps = format('%.1f fps', GetFramerate())
97,4 → 89,20
MiniMapTrackingButton:SetScript('OnMouseWheel', OnMouseWheel)
MiniMapTrackingButton:SetScript('OnClick', dataobj.OnClick)
MiniMapTrackingButton:SetScript('OnEnter', dataobj.OnEnter)
MiniMapTrackingButton:SetScript('OnLeave', dataobj.OnLeave)
\ No newline at end of file +MiniMapTrackingButton:SetScript('OnLeave', dataobj.OnLeave) + +CreateFrame('Frame'):SetScript('OnUpdate', function(self, al) + elapsed = elapsed + al + if(elapsed > 0.5) then + dataobj.text = formats(gcinfo()) + elapsed = 0 + end +end) + +SlashCmdList['PSTATS'] = function() + if(not IsAddOnLoaded('pStats_Config')) then + LoadAddOn('pStats_Config') + end + InterfaceOptionsFrame_OpenToCategory('pStats') +end +SLASH_PSTATS1 = '/pstats' \ No newline at end of file
pStats Property changes : Modified: svn:externals - Libs/LibSimpleOptions svn://svn.wowace.com/wow/libsimpleoptions-1-0/mainline/trunk/ Libs/CallbackHandler svn://svn.wowace.com/wow/callbackhandler/mainline/trunk/CallbackHandler-1.0/ + Libs/CallbackHandler svn://svn.wowace.com/wow/callbackhandler/mainline/trunk/
pStats_Config/pStats_Config.toc New file
0,0 → 1,12
## Interface: 30000
## Author: p3lim
## Version: 30000.wowi:revision
## Title: |cffff6000p|rStats_Config
## Notes: Options module for pStats
## RequiredDeps: pStats
## LoadOnDemand: 1
 
LibSimpleOptions\LibStub\LibStub.lua
LibSimpleOptions\LibSimpleOptions-1.0.lua
 
pStats_Config.lua
\ No newline at end of file
pStats_Config/pStats_Config.lua New file
0,0 → 1,41
local db = pStatsDB or {colors = {0, 1, 1}, sorted = true} + +LibStub('LibSimpleOptions-1.0').AddOptionsPanel('pStats', function(self) + local title, sub = self:MakeTitleTextAndSubText('pStats', 'These options allow you to customize the looks of pStats.') + + self:MakeButton( + 'name', 'Class Color', + 'description', 'Set text color based on player class', + 'func', function() + local l, class = UnitClass('player') + local c = RAID_CLASS_COLORS[class] + pStatsDB.colors[1] = c.r + pStatsDB.colors[2] = c.g + pStatsDB.colors[3] = c.b + self:Refresh() + end + ):SetPoint('TOPLEFT', sub, 'BOTTOMLEFT', 0, -16) + + self:MakeColorPicker( + 'name', 'Custom Color', + 'description', 'Set custom text colors with a palette', + 'hasAlpha', false, + 'defaultR', 0, 'defaultG', 1, 'defaultB', 1, + 'getFunc', function() return unpack(db.colors) end, + 'setFunc', function(r, g, b) + pStatsDB.colors[1] = r + pStatsDB.colors[2] = g + pStatsDB.colors[3] = b + end + ):SetPoint('TOPLEFT', sub, 'BOTTOMLEFT', 0, -46) + + self:MakeToggle( + 'name', 'Toggle sorting method', + 'description', 'Check to sort by memory.\nUn-check to sort by name', + 'default', true, + 'current', db.sorted, + 'setFunc', function(value) + pStatsDB.sorted = value + end + ):SetPoint('TOPLEFT', sub, 'BOTTOMLEFT', 0, -76) +end)
\ No newline at end of file
pStats_Config Property changes : Added: svn:externals + LibSimpleOptions svn://svn.wowace.com/wow/libsimpleoptions-1-0/mainline/trunk/