Browse files

Code style changes

  • Loading branch information...
1 parent 23ea799 commit 7e962895dd8602e189e010d51d2557fdc437ee11 @Zariel committed Jul 4, 2010
Showing with 60 additions and 13 deletions.
  1. +1 −1 Fiend.toc
  2. +12 −9 core.lua
  3. +6 −3 display.lua
  4. +41 −0 slash.lua
View
2 Fiend.toc
@@ -6,7 +6,7 @@
## Notes-ruRU: Отслеживает урон, эффективное и избыточное исцеление.
## Author: Zariel
## Version: 3.3.3-5
-## OptionalDeps: LibDataBroker-1.1, LibStub, ZeeRoster-1.0
+## OptionalDeps: LibDataBroker-1.1, LibStub, ZeeRoster-1.0, IdHitThat
Locale-koKR.lua
locale-ruRU.lua
View
21 core.lua
@@ -20,7 +20,7 @@ local timer = 0
local OnUpdate = function(self, elapsed)
timer = timer + elapsed
- if timer > 0.5 then
+ if(timer > 0.5) then
for i, d in pairs(self.displays) do
d:OnUpdate(timer)
end
@@ -51,11 +51,11 @@ local lastAction = {}
addon.trackDPS = true
function addon:ADDON_LOADED(name)
- if name ~= "Fiend" then return end
+ if(name ~= "Fiend") then return end
ldb = LibStub and LibStub("LibDataBroker-1.1", true)
- if ldb then
+ if(ldb) then
self:initDropDown()
local obj = ldb:NewDataObject("Fiend", {
@@ -71,8 +71,6 @@ function addon:ADDON_LOADED(name)
self.dataObj = obj
end
- self:UnregisterEvent("ADDON_LOADED")
-
self.displays = {}
self.printNum = 10
@@ -108,6 +106,7 @@ function addon:ADDON_LOADED(name)
self:SetScript("OnUpdate", OnUpdate)
+ self:UnregisterEvent("ADDON_LOADED")
self.ADDON_LOADED = nil
end
@@ -127,7 +126,7 @@ function addon:COMBAT_LOG_EVENT_UNFILTERED(timeStamp, event, sourceGUID, sourceN
-- Bail, ususaly because the unit is in a vehicle and we dont have its
-- GUID mapping
local unit = R:GetUnit(sourceGUID)
- if not unit then return end
+ if(not unit) then return end
ammount = ammount or 0
resist = resist or 0
@@ -138,14 +137,18 @@ function addon:COMBAT_LOG_EVENT_UNFILTERED(timeStamp, event, sourceGUID, sourceN
--local damage = ammount
local overHeal
- if (event == "SPELL_HEAL" or event == "SPELL_PERIDOIC_HEAL") and over > 0 then
+ if(event == "SPELL_HEAL" or event == "SPELL_PERIDOIC_HEAL") and over > 0 then
overHeal = over
end
- if damage > 0 or overHeal then
+ if(ID) then
+ --print(sourceName, ID:InCombat(sourceGUID))
+ end
+
+ if(damage > 0 or overHeal) then
local pet = R:IsPet(sourceGUID)
- if pet then
+ if(pet) then
sourceGUID = pet
sourceName = UnitName(R:GetUnit(pet))
end
View
9 display.lua
@@ -1,10 +1,13 @@
local fiend = _G.Fiend
+if(not fiend) then
+ return
+end
+
local ADDON_NAME, Fiend = ...
-Fiend.L = Fiend.L or { }
-local L = setmetatable(Fiend.L, { __index = function(t, s) t[s] = s return s end })
+local L = setmetatable(Fiend.L or {}, { __index = function(t, s) t[s] = s return s end })
-local R = LibStub("ZeeRoster-1.0", 1)
+local R = LibStub("ZeeRoster-1.0")
local Display = {
}
View
41 slash.lua
@@ -0,0 +1,41 @@
+--[[ Take blizzard tooltip table and conver it into a slash menu, hm.
+--
+--2 Part process, parse the menu into tokens then generate a slash command
+--listing
+]]
+
+local slashHandler = function(str)
+ local t = { str.spit(" ") }
+
+ for k, v in pairs(t) do
+ print(v)
+ end
+end
+
+local recurse
+local recurse = function(table)
+ local t = {}
+
+ for k, v in pairs(table) do
+ if(v.title) then
+ if(v.menuList) then
+ t[v.title] = recurse(v.menuList)
+ elseif(v.func) then
+ t[v.title] = v.func
+ end
+ end
+ end
+
+ return t
+end
+
+local makeHelp = function(t)
+end
+
+function tooltip2slash(t, name)
+ local obj = {
+ name = name,
+ }
+
+
+end

0 comments on commit 7e96289

Please sign in to comment.