My favorites | Sign in
Project Logo
          
Changes to /trunk/rBottomBarStyler/core.lua
r363 vs. r364   Edit
  Compare: vs.   Format:
Revision r364
Go to: 
/trunk/rBottomBarStyler/core.lua   r363 /trunk/rBottomBarStyler/core.lua   r364
1 1
2 --[[---------------------------------------------------------------------------- 2 --[[----------------------------------------------------------------------------
3 Copyright (c) 2009, Erik Raetz 3 Copyright (c) 2009, Erik Raetz
4 All rights reserved. 4 All rights reserved.
5 5
6 Redistribution and use in source and binary forms, with or without 6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met: 7 modification, are permitted provided that the following conditions are met:
8 8
9 * Redistributions of source code must retain the above copyright notice, 9 * Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 10 this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright notice, 11 * Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation 12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution. 13 and/or other materials provided with the distribution.
14 * Neither the name of rBottomBarStyler nor the names of its contributors may be used 14 * Neither the name of rBottomBarStyler nor the names of its contributors may be used
15 to endorse or promote products derived from this software without specific 15 to endorse or promote products derived from this software without specific
16 prior written permission. 16 prior written permission.
17 17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 POSSIBILITY OF SUCH DAMAGE. 28 POSSIBILITY OF SUCH DAMAGE.
29 ------------------------------------------------------------------------------]] 29 ------------------------------------------------------------------------------]]
30 30
31 ------------------------------------------------------ 31 ------------------------------------------------------
32 -- / VARIABLES / -- 32 -- / VARIABLES / --
33 ------------------------------------------------------ 33 ------------------------------------------------------
34 34
35 local default_scale = 0.6 35 local default_scale = 0.6
36 local default_art = "d3" 36 local default_art = "d3"
37 local default_bar = "bar2" 37 local default_bar = "bar2"
38 local default_movable = 1
39 local default_locked = 1
38 rBottomBarStyler = rBottomBarStyler or {} 40 rBottomBarStyler = rBottomBarStyler or {}
39 local frame_to_scale 41 local frame_to_scale
40 local bar_to_show 42 local bar_to_show
43 local frame_to_drag
41 44
42 45
43 ------------------------------------------------------ 46 ------------------------------------------------------
44 -- / CHAT OUTPUT FUNC / -- 47 -- / SET UP DEFAULT VALUES / --
45 ------------------------------------------------------ 48 ------------------------------------------------------
46 49
47 local function load_default() 50 local function load_default()
48 if(not rBottomBarStyler.scalevalue) then 51 if(not rBottomBarStyler.scalevalue) then
49 rBottomBarStyler.scalevalue = default_scale 52 rBottomBarStyler.scalevalue = default_scale
50 end 53 end
51 if(not rBottomBarStyler.artvalue) then 54 if(not rBottomBarStyler.artvalue) then
52 rBottomBarStyler.artvalue = default_art 55 rBottomBarStyler.artvalue = default_art
53 end 56 end
54 if(not rBottomBarStyler.barvalue) then 57 if(not rBottomBarStyler.barvalue) then
55 rBottomBarStyler.barvalue = default_bar 58 rBottomBarStyler.barvalue = default_bar
56 end 59 end
60 if(not rBottomBarStyler.movable) then
61 rBottomBarStyler.movable = default_movable
62 end
63 if(not rBottomBarStyler.locked) then
64 rBottomBarStyler.locked = default_locked
65 end
57 end 66 end
58 67
59 ------------------------------------------------------ 68 ------------------------------------------------------
60 -- / CHAT OUTPUT FUNC / -- 69 -- / CHAT OUTPUT FUNC / --
61 ------------------------------------------------------ 70 ------------------------------------------------------
62 71
63 local function am(text) 72 local function am(text)
64 DEFAULT_CHAT_FRAME:AddMessage(text) 73 DEFAULT_CHAT_FRAME:AddMessage(text)
65 end 74 end
66 75
76 ------------------------------------------------------
77 -- / CHAT OUTPUT FUNC / --
78 ------------------------------------------------------
79
80 local function save_posxy()
81 local point, relativeTo, relativePoint, x, y = frame_to_scale:GetPoint()
82 --am(point)
83 --am(x)
84 --am(y)
85 rBottomBarStyler.point = point
86 rBottomBarStyler.posx = x
87 rBottomBarStyler.posy = y
88 end
89
90 ------------------------------------------------------
91 -- / MOVE ME FUNC / --
92 ------------------------------------------------------
93
94 local function move_my_frame()
95 if frame_to_drag then
96 frame_to_drag:Hide()
97 end
98 if rBottomBarStyler.movable == 1 then
99 frame_to_scale:SetMovable(true)
100 if rBottomBarStyler.locked == 0 then
101 if frame_to_drag then
102 frame_to_drag:Show()
103 end
104 frame_to_scale:EnableMouse(true)
105 frame_to_scale:RegisterForDrag("LeftButton","RightButton")
106 frame_to_scale:SetScript("OnDragStart", function(self)
107 if IsShiftKeyDown() and IsAltKeyDown() then
108 self:StartMoving()
109 end
110 end)
111 frame_to_scale:SetScript("OnDragStop", function(self)
112 if IsShiftKeyDown() and IsAltKeyDown() then
113 self:StopMovingOrSizing()
114 save_posxy()
115 end
116 end)
117 end
118 else
119 rBottomBarStyler.point = nil
120 rBottomBarStyler.posx = nil
121 rBottomBarStyler.posy = nil
122 frame_to_scale:ClearAllPoints()
123 frame_to_scale:SetPoint("BOTTOM",0,0)
124 end
125 end
126
67 ------------------------------------------------------ 127 ------------------------------------------------------
68 -- / CREATE ME A FRAME FUNC / -- 128 -- / CREATE ME A FRAME FUNC / --
69 ------------------------------------------------------ 129 ------------------------------------------------------
70 130
71 local function create_me_a_frame(fart,fname,fparent,fstrata,fwidth,fheight,fanchor,fxpos,fypos,fscale) 131 local function create_me_a_frame(fart,fname,fparent,fstrata,fwidth,fheight,fanchor,fxpos,fypos,fscale,fdrag)
72 local f = CreateFrame(fart,fname,fparent) 132 local f = CreateFrame(fart,fname,fparent)
73 f:SetFrameStrata(fstrata) 133 f:SetFrameStrata(fstrata)
74 f:SetWidth(fwidth) 134 f:SetWidth(fwidth)
75 f:SetHeight(fheight) 135 f:SetHeight(fheight)
76 f:SetPoint(fanchor,fxpos,fypos) 136 if fname == "rBBS_Holder" then
137 if rBottomBarStyler.point and rBottomBarStyler.posx and rBottomBarStyler.posy then
138 f:SetPoint(rBottomBarStyler.point,rBottomBarStyler.posx,rBottomBarStyler.posy)
139 else
140 f:SetPoint(fanchor,fxpos,fypos)
141 end
142 else
143 f:SetPoint(fanchor,fxpos,fypos)
144 end
77 f:SetScale(fscale) 145 f:SetScale(fscale)
78 --f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile = "", tile = true, tileSize = 16, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }}); 146 if fdrag == true then
147 f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile = "", tile = true, tileSize = 16, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
148 end
79 return f 149 return f
80 end 150 end
81 151
82 ------------------------------------------------------ 152 ------------------------------------------------------
83 -- / CREATE ME A TEXTURE FUNC / -- 153 -- / CREATE ME A TEXTURE FUNC / --
84 ------------------------------------------------------ 154 ------------------------------------------------------
85 155
86 local function create_me_a_texture(fhooked,tstrata,tfile,tspecial) 156 local function create_me_a_texture(fhooked,tstrata,tfile,tspecial)
87 local t = fhooked:CreateTexture(nil,tstrata) 157 local t = fhooked:CreateTexture(nil,tstrata)
88 t:SetTexture(tfile) 158 t:SetTexture(tfile)
89 if tspecial == "fill" then 159 if tspecial == "fill" then
90 t:SetPoint("BOTTOM",fhooked,"BOTTOM",0,0) 160 t:SetPoint("BOTTOM",fhooked,"BOTTOM",0,0)
91 t:SetWidth(fhooked:GetWidth()) 161 t:SetWidth(fhooked:GetWidth())
92 t:SetHeight(fhooked:GetHeight()) 162 t:SetHeight(fhooked:GetHeight())
93 else 163 else
94 t:SetAllPoints(fhooked) 164 t:SetAllPoints(fhooked)
95 end 165 end
96 return t 166 return t
97 end 167 end
98 168
169 ------------------------------------------------------
170 -- / ORB HEALTH FUNC / --
171 ------------------------------------------------------
172
173 local function orbhealth(orb1,orb1_fill)
174 orb1:SetScript("OnEvent", function(self, event, arg1, ...)
175 if arg1 == "player" then
176 local uh, uhm = UnitHealth("player"), UnitHealthMax("player")
177 orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth())
178 orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1)
179 end
180 end)
181 orb1:RegisterEvent("UNIT_HEALTH")
182 end
183
184 ------------------------------------------------------
185 -- / ORB MANA FUNC / --
186 ------------------------------------------------------
187
188 local function orbmana(orb2,orb2_fill)
189 orb2:SetScript("OnEvent", function(self, event, arg1, ...)
190 if arg1 == "player" then
191 local um, umm = UnitMana("player"), UnitManaMax("player")
192 orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth())
193 orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1)
194 end
195 end)
196 orb2:RegisterEvent("UNIT_MANA")
197 orb2:RegisterEvent("UNIT_RAGE")
198 orb2:RegisterEvent("UNIT_ENERGY")
199 orb2:RegisterEvent("UNIT_FOCUS")
200 orb2:RegisterEvent("UNIT_RUNIC_POWER")
201 end
202
99 ------------------------------------------------------ 203 ------------------------------------------------------
100 -- / SET ME A SCALE / -- 204 -- / SET ME A SCALE / --
101 ------------------------------------------------------ 205 ------------------------------------------------------
102 206
103 local function set_me_a_scale() 207 local function set_me_a_scale()
104 frame_to_scale:SetScale(rBottomBarStyler.scalevalue) 208 frame_to_scale:SetScale(rBottomBarStyler.scalevalue)
105 end 209 end
106 210
107 ------------------------------------------------------ 211 ------------------------------------------------------
108 -- / SET ME A BAR / -- 212 -- / SET ME A BAR / --
109 ------------------------------------------------------ 213 ------------------------------------------------------
110 214
111 local function set_me_a_bar() 215 local function set_me_a_bar()
112 if rBottomBarStyler.artvalue == "roth" then 216 if rBottomBarStyler.artvalue == "roth" then
113 bar_to_show:SetTexture("Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) 217 bar_to_show:SetTexture("Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue)
114 else 218 else
115 am("Does only work for roth layout") 219 am("Does only work for roth layout")
116 end 220 end
117 end 221 end
118 222
119 ------------------------------------------------------ 223 ------------------------------------------------------
120 -- / CREATE D1 STYLE / -- 224 -- / CREATE D1 STYLE / --
121 ------------------------------------------------------ 225 ------------------------------------------------------
122 local function create_d1_style(scale) 226 local function create_d1_style(scale)
123 --am("c d1") 227 --am("c d1")
124 --holder 228 --holder
125 local holder = create_me_a_frame("Frame","rBBS_holderolder",UIParent,"BACKGROUND",20,20,"BOTTOM",0,0,scale) 229 local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale)
126 frame_to_scale = holder 230 frame_to_scale = holder
127 231
128 --bar texture 232 --bar texture
129 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,256,"BOTTOM",0,0,1) 233 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,256,"BOTTOM",0,0,1)
130 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\bar") 234 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\bar")
131 235
132 local orbsize = 160 236 local orbsize = 160
133 --life orb 237 --life orb
134 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-290,120,1) 238 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-290,120,1)
135 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 239 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
136 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 240 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
137 orb1_fill:SetVertexColor(0.8,0,0) 241 orb1_fill:SetVertexColor(0.8,0,0)
138 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 242 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
139 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 243 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
140 orb1:SetScript("OnEvent", function(self, event, arg1, ...) 244 orbhealth(orb1,orb1_fill)
141 if arg1 == "player" then
142 local uh, uhm = UnitHealth("player"), UnitHealthMax("player")
143 orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth())
144 orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1)
145 end
146 end)
147 orb1:RegisterEvent("UNIT_HEALTH")
148 245
149 --mana orb 246 --mana orb
150 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",285,120,1) 247 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",285,120,1)
151 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 248 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
152 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 249 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
153 orb2_fill:SetVertexColor(0,0.3,0.8) 250 orb2_fill:SetVertexColor(0,0.3,0.8)
154 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 251 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
155 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 252 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
156 orb2:SetScript("OnEvent", function(self, event, arg1, ...) 253 orbmana(orb2,orb2_fill)
157 if arg1 == "player" then
158 local um, umm = UnitMana("player"), UnitManaMax("player")
159 orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth())
160 orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1)
161 end
162 end)
163 orb2:RegisterEvent("UNIT_MANA")
164 orb2:RegisterEvent("UNIT_RAGE")
165 orb2:RegisterEvent("UNIT_ENERGY")
166 orb2:RegisterEvent("UNIT_FOCUS")
167 orb2:RegisterEvent("UNIT_RUNIC_POWER")
168 254
169 --left figure 255 --left figure
170 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-320,35,0.9) 256 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-320,35,0.9)
171 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_left") 257 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_left")
172 258
173 --right figure 259 --right figure
174 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",320,35,0.9) 260 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",320,35,0.9)
175 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_right") 261 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_right")
176 262
263 local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true)
264 frame_to_drag = dragframe
265
177 end 266 end
178 267
179 ------------------------------------------------------ 268 ------------------------------------------------------
180 -- / CREATE D2 STYLE / -- 269 -- / CREATE D2 STYLE / --
181 ------------------------------------------------------ 270 ------------------------------------------------------
182 local function create_d2_style(scale) 271 local function create_d2_style(scale)
183 --am("c d2") 272 --am("c d2")
184 --holder 273 --holder
185 local holder = create_me_a_frame("Frame",nil,UIParent,"BACKGROUND",20,20,"BOTTOM",0,-5,scale) 274 local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale,true)
186 frame_to_scale = holder 275 frame_to_scale = holder
187 276
188 --bar texture 277 --bar texture
189 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,44,1) 278 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,44,1)
190 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\bar") 279 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\bar")
191 280
192 local border_left = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMRIGHT",0,0,1) 281 local border_left = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMRIGHT",0,0,1)
193 local border_left_tex = create_me_a_texture(border_left,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_left") 282 local border_left_tex = create_me_a_texture(border_left,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_left")
194 283
195 local border_right = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMLEFT",0,0,1) 284 local border_right = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMLEFT",0,0,1)
196 local border_right_tex = create_me_a_texture(border_right,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_right") 285 local border_right_tex = create_me_a_texture(border_right,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_right")
197 286
198
199 local orbsize = 160 287 local orbsize = 160
200 --life orb 288 --life orb
201 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-472,55,1) 289 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-472,55,1)
202 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 290 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
203 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 291 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
204 orb1_fill:SetVertexColor(0.8,0,0) 292 orb1_fill:SetVertexColor(0.8,0,0)
205 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 293 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
206 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 294 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
207 orb1:SetScript("OnEvent", function(self, event, arg1, ...) 295 orbhealth(orb1,orb1_fill)
208 if arg1 == "player" then
209 local uh, uhm = UnitHealth("player"), UnitHealthMax("player")
210 orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth())
211 orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1)
212 end
213 end)
214 orb1:RegisterEvent("UNIT_HEALTH")
215 296
216 --mana orb 297 --mana orb
217 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",465,55,1) 298 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",465,55,1)
218 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 299 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
219 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 300 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
220 orb2_fill:SetVertexColor(0,0.3,0.8) 301 orb2_fill:SetVertexColor(0,0.3,0.8)
221 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 302 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
222 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 303 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
223 orb2:SetScript("OnEvent", function(self, event, arg1, ...) 304 orbmana(orb2,orb2_fill)
224 if arg1 == "player" then
225 local um, umm = UnitMana("player"), UnitManaMax("player")
226 orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth())
227 orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1)
228 end
229 end)
230 orb2:RegisterEvent("UNIT_MANA")
231 orb2:RegisterEvent("UNIT_RAGE")
232 orb2:RegisterEvent("UNIT_ENERGY")
233 orb2:RegisterEvent("UNIT_FOCUS")
234 orb2:RegisterEvent("UNIT_RUNIC_POWER")
235
236 305
237 --left figure 306 --left figure
238 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-453,44,1) 307 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-453,44,1)
239 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_left") 308 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_left")
240 309
241 --right figure 310 --right figure
242 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",453,44,1) 311 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",453,44,1)
243 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_right") 312 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_right")
244 313
314 local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true)
315 frame_to_drag = dragframe
316
245 end 317 end
246 318
247 ------------------------------------------------------ 319 ------------------------------------------------------
248 -- / CREATE D3 STYLE / -- 320 -- / CREATE D3 STYLE / --
249 ------------------------------------------------------ 321 ------------------------------------------------------
250 local function create_d3_style(scale) 322 local function create_d3_style(scale)
251 --am("c d3") 323 --am("c d3")
252 local holder = create_me_a_frame("Frame",nil,UIParent,"BACKGROUND",20,20,"BOTTOM",0,0,scale) 324 local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale)
253 frame_to_scale = holder 325 frame_to_scale = holder
254 326
255 --bar texture 327 --bar texture
256 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,0,1) 328 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,0,1)
257 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\bar") 329 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\bar")
258 330
259 local orbsize = 200 331 local orbsize = 200
260 --life orb 332 --life orb
261 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-471,-3,1) 333 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-471,-3,1)
262 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 334 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
263 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 335 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
264 orb1_fill:SetVertexColor(0.8,0,0) 336 orb1_fill:SetVertexColor(0.8,0,0)
265 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 337 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
266 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 338 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
267 orb1:SetScript("OnEvent", function(self, event, arg1, ...) 339 orbhealth(orb1,orb1_fill)
268 if arg1 == "player" then
269 local uh, uhm = UnitHealth("player"), UnitHealthMax("player")
270 orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth())
271 orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1)
272 end
273 end)
274 orb1:RegisterEvent("UNIT_HEALTH")
275 340
276 --mana orb 341 --mana orb
277 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",471,-3,1) 342 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",471,-3,1)
278 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 343 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
279 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 344 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
280 orb2_fill:SetVertexColor(0,0.3,0.8) 345 orb2_fill:SetVertexColor(0,0.3,0.8)
281 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 346 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
282 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 347 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
283 orb2:SetScript("OnEvent", function(self, event, arg1, ...) 348 orbmana(orb2,orb2_fill)
284 if arg1 == "player" then
285 local um, umm = UnitMana("player"), UnitManaMax("player")
286 orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth())
287 orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1)
288 end
289 end)
290 orb2:RegisterEvent("UNIT_MANA")
291 orb2:RegisterEvent("UNIT_RAGE")
292 orb2:RegisterEvent("UNIT_ENERGY")
293 orb2:RegisterEvent("UNIT_FOCUS")
294 orb2:RegisterEvent("UNIT_RUNIC_POWER")
295
296 349
297 --left figure 350 --left figure
298 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",-455,0,1) 351 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",-455,0,1)
299 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_left") 352 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_left")
300 353
301 --right figure 354 --right figure
302 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",455,0,1) 355 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",455,0,1)
303 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_right") 356 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_right")
304 357
358 local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true)
359 frame_to_drag = dragframe
360
305 end 361 end
306 362
307 ------------------------------------------------------ 363 ------------------------------------------------------
308 -- / CREATE ROTH STYLE / -- 364 -- / CREATE ROTH STYLE / --
309 ------------------------------------------------------ 365 ------------------------------------------------------
310 local function create_roth_style(scale) 366 local function create_roth_style(scale)
311 --am("c roth") 367 --am("c roth")
312 local holder = create_me_a_frame("Frame",nil,UIParent,"BACKGROUND",20,20,"BOTTOM",0,0,scale) 368 local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale)
313 frame_to_scale = holder 369 frame_to_scale = holder
314 370
315 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",512,256,"BOTTOM",0,0,1) 371 local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",512,256,"BOTTOM",0,0,1)
316 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) 372 local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue)
317 bar_to_show = bar_tex 373 bar_to_show = bar_tex
318 374
319 local bottom = create_me_a_frame("Frame",nil,holder,"HIGH",500,110,"BOTTOM",0,-10,1) 375 local bottom = create_me_a_frame("Frame",nil,holder,"HIGH",500,110,"BOTTOM",0,-10,1)
320 local bottom_tex = create_me_a_texture(bottom,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\bottom") 376 local bottom_tex = create_me_a_texture(bottom,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\bottom")
321 377
322 local orbsize = 120 378 local orbsize = 120
323 --life orb 379 --life orb
324 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-250,-8,1) 380 local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-250,-8,1)
325 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 381 local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
326 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 382 local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
327 orb1_fill:SetVertexColor(0.8,0,0) 383 orb1_fill:SetVertexColor(0.8,0,0)
328 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 384 local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
329 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 385 local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
330 orb1:SetScript("OnEvent", function(self, event, arg1, ...) 386 orbhealth(orb1,orb1_fill)
331 if arg1 == "player" then
332 local uh, uhm = UnitHealth("player"), UnitHealthMax("player")
333 orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth())
334 orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1)
335 end
336 end)
337 orb1:RegisterEvent("UNIT_HEALTH")
338 387
339 --mana orb 388 --mana orb
340 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",250,-8,1) 389 local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",250,-8,1)
341 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") 390 local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2")
342 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") 391 local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill")
343 orb2_fill:SetVertexColor(0,0.3,0.8) 392 orb2_fill:SetVertexColor(0,0.3,0.8)
344 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) 393 local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1)
345 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") 394 local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss")
346 orb2:SetScript("OnEvent", function(self, event, arg1, ...) 395 orbmana(orb2,orb2_fill)
347 if arg1 == "player" then
348 local um, umm = UnitMana("player"), UnitManaMax("player")
349 orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth())
350 orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1)
351 end
352 end)
353 orb2:RegisterEvent("UNIT_MANA")
354 orb2:RegisterEvent("UNIT_RAGE")
355 orb2:RegisterEvent("UNIT_ENERGY")
356 orb2:RegisterEvent("UNIT_FOCUS")
357 orb2:RegisterEvent("UNIT_RUNIC_POWER")
358 396
359 --left figure 397 --left figure
360 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-510,0,0.6) 398 local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-510,0,0.6)
361 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_left") 399 local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_left")
362 400
363 --right figure 401 --right figure
364 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",510,0,0.6) 402 local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",510,0,0.6)
365 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_right") 403 local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_right")
366 404
405 local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true)
406 frame_to_drag = dragframe
367 407
368 end 408 end
369 409
370 ------------------------------------------------------ 410 ------------------------------------------------------
371 -- / SLASH LOAD STYLE FUNC / -- 411 -- / LOAD STYLE FUNC / --
372 ------------------------------------------------------ 412 ------------------------------------------------------
373 413
374 local function load_style(style,scale) 414 local function load_style(style,scale)
375 if style == "roth" then 415 if style == "roth" then
376 create_roth_style(scale) 416 create_roth_style(scale)
377 elseif style == "d1" then 417 elseif style == "d1" then
378 create_d1_style(scale) 418 create_d1_style(scale)
379 elseif style == "d2" then 419 elseif style == "d2" then
380 create_d2_style(scale) 420 create_d2_style(scale)
381 else 421 else
382 create_d3_style(scale) 422 create_d3_style(scale)
383 end 423 end
384 end 424 end
385 425
386 ------------------------------------------------------ 426 ------------------------------------------------------
387 -- / SLASH FUNC / -- 427 -- / SLASH FUNC / --
388 ------------------------------------------------------ 428 ------------------------------------------------------
389 429
390 local function SlashCmd(cmd) 430 local function SlashCmd(cmd)
391 --setscale 431 --setscale
392 if (cmd:match"setscale") then 432 if (cmd:match"setscale") then
393 local a,b = strfind(cmd, " "); 433 local a,b = strfind(cmd, " ");
394 if b then 434 if b then
395 local c = strsub(cmd, b+1) 435 local c = strsub(cmd, b+1)
396 if tonumber(c) then 436 if tonumber(c) then
397 am("Current scaling is set to: "..c) 437 am("Current scaling is set to: "..c)
398 rBottomBarStyler.scalevalue = c 438 rBottomBarStyler.scalevalue = tonumber(c)
399 set_me_a_scale() 439 set_me_a_scale()
400 else 440 else
401 am("No number value.") 441 am("No number value.")
402 end 442 end
403 else 443 else
404 am("No value found.") 444 am("No value found.")
405 end 445 end
406 --getscale 446 --getscale
407 elseif (cmd:match"getscale") then 447 elseif (cmd:match"getscale") then
408 am("Current scaling is set to: "..rBottomBarStyler.scalevalue) 448 am("Current scaling is set to: "..rBottomBarStyler.scalevalue)
409 --setart 449 --setart
410 elseif (cmd:match"setart") then 450 elseif (cmd:match"setart") then
411 local a,b = strfind(cmd, " "); 451 local a,b = strfind(cmd, " ");
412 if b then 452 if b then
413 local c = strsub(cmd, b+1) 453 local c = strsub(cmd, b+1)
414 if c == "d1" or c == "d2" or c == "d3" or c == "roth" then 454 if c == "d1" or c == "d2" or c == "d3" or c == "roth" then
415 am("You set the art to: "..c) 455 am("You set the art to: "..c)
416 rBottomBarStyler.artvalue = c 456 rBottomBarStyler.artvalue = c
417 am("You need to reoad the interface to see the changes.") 457 am("You need to reoad the interface to see the changes.")
418 am("Type in: \"/console reloadui\".") 458 am("Type in: \"/console reloadui\".")
419 else 459 else
420 am("Wrong value. (possible values: d1, d2, d3, roth)") 460 am("Wrong value. (possible values: d1, d2, d3, roth)")
421 end 461 end
422 else 462 else
423 am("No value found.") 463 am("No value found.")
424 end 464 end
425 --setbar 465 --setbar
426 elseif (cmd:match"setbar") then 466 elseif (cmd:match"setbar") then
427 local a,b = strfind(cmd, " "); 467 local a,b = strfind(cmd, " ");
428 if b then 468 if b then
429 local c = strsub(cmd, b+1) 469 local c = strsub(cmd, b+1)
430 if c == "bar1" or c == "bar2" or c == "bar3" then 470 if c == "bar1" or c == "bar2" or c == "bar3" then
431 am("You set the bar to: "..c) 471 am("You set the bar to: "..c)
432 rBottomBarStyler.barvalue = c 472 rBottomBarStyler.barvalue = c
433 set_me_a_bar() 473 set_me_a_bar()
434 else 474 else
435 am("Wrong value. (possible values: bar1, bar2, bar3)") 475 am("Wrong value. (possible values: bar1, bar2, bar3)")
436 end 476 end
437 else 477 else
438 am("No value found.") 478 am("No value found.")
439 end 479 end
440 --getart 480 --getart
441 elseif (cmd:match"getart") then 481 elseif (cmd:match"getart") then
442 am("Current art is set to: "..rBottomBarStyler.artvalue) 482 am("Current art is set to: "..rBottomBarStyler.artvalue)
483 --getmovable
484 elseif (cmd:match"getmovable") then
485 am("Movable is set to: "..rBottomBarStyler.movable)
486 --getlocked
487 elseif (cmd:match"getlocked") then
488 am("Locked is set to: "..rBottomBarStyler.locked)
489 --locked
490 elseif (cmd:match"locked") then
491 local a,b = strfind(cmd, " ");
492 if b then
493 local c = strsub(cmd, b+1)
494 if tonumber(c) then
495 am("Locked is set to: "..c)
496 rBottomBarStyler.locked = tonumber(c)
497 move_my_frame()
498 else
499 am("No number value.")
500 end
501 else
502 am("No value found.")
503 end
504 --movable
505 elseif (cmd:match"movable") then
506 local a,b = strfind(cmd, " ");
507 if b then
508 local c = strsub(cmd, b+1)
509 if tonumber(c) then
510 am("Movable is set to: "..c)
511 rBottomBarStyler.movable = tonumber(c)
512 move_my_frame()
513 else
514 am("No number value.")
515 end
516 else
517 am("No value found.")
518 end
443 else 519 else
444 am("rbbs commands...\n\/rbbs getscale\n\/rbbs setscale NUMBER\n\/rbbs getart\n\/rbbs setart STRING (possible values: d1, d2, d3, roth)\n\/rbbs setbar STRING (possible values: bar1, bar2, bar3 - only affects the roth layout)") 520 am("rbbs commands...")
521 am("\/rbbs getscale")
522 am("\/rbbs getart")
523 am("\/rbbs getlocked")
524 am("\/rbbs getmovable")
525 am("\/rbbs setscale NUMBER")
526 am("\/rbbs setart STRING (possible values: d1, d2, d3, roth)")
527 am("\/rbbs setbar STRING (possible values: bar1, bar2, bar3 - only affects the roth layout)")
528 am("\/rbbs locked NUMBER (value of 1 locks bars, 0 unlocks)")
529 am("\/rbbs movable NUMBER (value of 1 makes bars movable if unlocked, value of 0 will reset position)")
445 end 530 end
446 end 531 end
447 532
448 ------------------------------------------------------ 533 ------------------------------------------------------
449 -- / LOAD THE SHIT / -- 534 -- / LOAD THE SHIT / --
450 ------------------------------------------------------ 535 ------------------------------------------------------
451 536
452 local a = CreateFrame"Frame" 537 local a = CreateFrame"Frame"
453 a:RegisterEvent("VARIABLES_LOADED") 538 a:RegisterEvent("VARIABLES_LOADED")
454 a:SetScript("OnEvent", function(self) 539 a:SetScript("OnEvent", function(self)
455 self:UnregisterEvent("VARIABLES_LOADED") 540 self:UnregisterEvent("VARIABLES_LOADED")
456 self:SetScript("OnEvent", nil) 541 self:SetScript("OnEvent", nil)
457 --default values 542 --default values
458 load_default() 543 load_default()
459 --load the styles 544 --load the styles
460 load_style(rBottomBarStyler.artvalue,rBottomBarStyler.scalevalue) 545 load_style(rBottomBarStyler.artvalue,rBottomBarStyler.scalevalue)
546 move_my_frame()
461 --slash commands 547 --slash commands
462 SlashCmdList["whatever"] = SlashCmd; 548 SlashCmdList["whatever"] = SlashCmd;
463 SLASH_whatever1 = "/rbbs"; 549 SLASH_whatever1 = "/rbbs";
464 --am("rbbs loaded...") 550 --am("rbbs loaded...")
465 end) 551 end)
Hosted by Google Code