Mercurial > wow > askmrrobot
comparison ui/Components.lua @ 11:ece9167c0d1c v1.2.14.0
Localization support, combat log features (wipe command, aura/pet tracking, and realm detection).
| author | yellowfive |
|---|---|
| date | Thu, 10 Jul 2014 12:24:59 -0700 |
| parents | ec731d2fe6ba |
| children | e77e01abce98 |
comparison
equal
deleted
inserted
replaced
| 10:ef8b45e96b08 | 11:ece9167c0d1c |
|---|---|
| 6 function AskMrRobot.inheritsFrom( baseClass ) | 6 function AskMrRobot.inheritsFrom( baseClass ) |
| 7 | 7 |
| 8 -- The following lines are equivalent to the SimpleClass example: | 8 -- The following lines are equivalent to the SimpleClass example: |
| 9 | 9 |
| 10 -- Create the table and metatable representing the class. | 10 -- Create the table and metatable representing the class. |
| 11 local new_class = {} | 11 local new_class = { } |
| 12 | 12 |
| 13 -- Note that this function uses class_mt as an upvalue, so every instance | 13 -- Note that this function uses class_mt as an upvalue, so every instance |
| 14 -- of the class will share the same metatable. | 14 -- of the class will share the same metatable. |
| 15 -- | 15 -- |
| 16 -- function new_class:create(o) | 16 -- function new_class:create(o) |
| 129 if slotNum ~= MAINHAND and slotNum ~= OFFHAND then | 129 if slotNum ~= MAINHAND and slotNum ~= OFFHAND then |
| 130 AskMrRobot.sortedSlots[slotNum] = i | 130 AskMrRobot.sortedSlots[slotNum] = i |
| 131 i = i + 1 | 131 i = i + 1 |
| 132 end | 132 end |
| 133 end | 133 end |
| 134 | |
| 135 | |
| 136 -- initialize the Frame class (inherit from a dummy frame) | |
| 137 AskMrRobot.FontString = AskMrRobot.inheritsFrom(AskMrRobot.Frame:new():CreateFontString(nil, "ARTWORK", "GameFontNormal")) | |
| 138 | |
| 139 -- Frame contructor | |
| 140 function AskMrRobot.FontString:new(parentFrame, name, layer, style, fontSize) | |
| 141 | |
| 142 local o = parentFrame:CreateFontString(name, layer, style) -- create a new frame (if one isn't supplied) | |
| 143 | |
| 144 -- use the fontstring class | |
| 145 setmetatable(o, { __index = AskMrRobot.FontString }) | |
| 146 | |
| 147 if fontSize then | |
| 148 o:SetFontSize(fontSize) | |
| 149 end | |
| 150 | |
| 151 return o | |
| 152 end | |
| 153 | |
| 154 function AskMrRobot.FontString:SetFontSize(fontSize) | |
| 155 local file, _, flags = self:GetFont() | |
| 156 self:SetFont(file, fontSize, flags) | |
| 157 end | |
| 158 | |
| 159 function AskMrRobot.SetFontSize(fontString, fontSize) | |
| 160 local file, _, flags = fontString:GetFont() | |
| 161 fontString:SetFont(file, fontSize, flags) | |
| 162 end |
