| /trunk/rBottomBarStyler/core.lua r364 | /trunk/rBottomBarStyler/core.lua r367 | ||
| 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 | 38 | local default_movable = 1 |
| 39 | local default_locked = 1 | 39 | local default_locked = 1 |
| 40 | rBottomBarStyler = rBottomBarStyler or {} | 40 | rBottomBarStyler = rBottomBarStyler or {} |
| 41 | local frame_to_scale | 41 | local frame_to_scale |
| 42 | local bar_to_show | 42 | local bar_to_show |
| 43 | local frame_to_drag | 43 | local frame_to_drag |
| 44 | 44 | ||
| 45 | |||
| 46 | ------------------------------------------------------ | 45 | ------------------------------------------------------ |
| 47 | -- / SET UP DEFAULT VALUES / -- | 46 | -- / SET UP DEFAULT VALUES / -- |
| 48 | ------------------------------------------------------ | 47 | ------------------------------------------------------ |
| 49 | 48 | ||
| 50 | local function load_default() | 49 | local function load_default() |
| 51 | if(not rBottomBarStyler.scalevalue) then | 50 | if(not rBottomBarStyler.scalevalue) then |
| 52 | rBottomBarStyler.scalevalue = default_scale | 51 | rBottomBarStyler.scalevalue = default_scale |
| 53 | end | 52 | end |
| 54 | if(not rBottomBarStyler.artvalue) then | 53 | if(not rBottomBarStyler.artvalue) then |
| 55 | rBottomBarStyler.artvalue = default_art | 54 | rBottomBarStyler.artvalue = default_art |
| 56 | end | 55 | end |
| 57 | if(not rBottomBarStyler.barvalue) then | 56 | if(not rBottomBarStyler.barvalue) then |
| 58 | rBottomBarStyler.barvalue = default_bar | 57 | rBottomBarStyler.barvalue = default_bar |
| 59 | end | 58 | end |
| 60 | if(not rBottomBarStyler.movable) then | 59 | if(not rBottomBarStyler.movable) then |
| 61 | rBottomBarStyler.movable = default_movable | 60 | rBottomBarStyler.movable = default_movable |
| 62 | end | 61 | end |
| 63 | if(not rBottomBarStyler.locked) then | 62 | if(not rBottomBarStyler.locked) then |
| 64 | rBottomBarStyler.locked = default_locked | 63 | rBottomBarStyler.locked = default_locked |
| 65 | end | 64 | end |
| 66 | end | 65 | end |
| 67 | 66 | ||
| 68 | ------------------------------------------------------ | 67 | ------------------------------------------------------ |
| 69 | -- / CHAT OUTPUT FUNC / -- | 68 | -- / CHAT OUTPUT FUNC / -- |
| 70 | ------------------------------------------------------ | 69 | ------------------------------------------------------ |
| 71 | 70 | ||
| 72 | local function am(text) | 71 | local function am(text) |
| 73 | DEFAULT_CHAT_FRAME:AddMessage(text) | 72 | DEFAULT_CHAT_FRAME:AddMessage(text) |
| 74 | end | 73 | end |
| 75 | 74 | ||
| 76 | ------------------------------------------------------ | 75 | ------------------------------------------------------ |
| 77 | -- / CHAT OUTPUT FUNC / -- | 76 | -- / SAVE POSXY FUNC / -- |
| 78 | ------------------------------------------------------ | 77 | ------------------------------------------------------ |
| 79 | 78 | ||
| 80 | local function save_posxy() | 79 | local function save_posxy() |
| 81 | local point, relativeTo, relativePoint, x, y = frame_to_scale:GetPoint() | 80 | local point, relativeTo, relativePoint, x, y = frame_to_scale:GetPoint() |
| 82 | --am(point) | ||
| 83 | --am(x) | ||
| 84 | --am(y) | ||
| 85 | rBottomBarStyler.point = point | 81 | rBottomBarStyler.point = point |
| 86 | rBottomBarStyler.posx = x | 82 | rBottomBarStyler.posx = x |
| 87 | rBottomBarStyler.posy = y | 83 | rBottomBarStyler.posy = y |
| 88 | end | 84 | end |
| 89 | 85 | ||
| 90 | ------------------------------------------------------ | 86 | ------------------------------------------------------ |
| 91 | -- / MOVE ME FUNC / -- | 87 | -- / MOVE ME FUNC / -- |
| 92 | ------------------------------------------------------ | 88 | ------------------------------------------------------ |
| 93 | 89 | ||
| 94 | local function move_my_frame() | 90 | local function move_my_frame() |
| 95 | if frame_to_drag then | 91 | if frame_to_drag then |
| 96 | frame_to_drag:Hide() | 92 | frame_to_drag:Hide() |
| 97 | end | 93 | end |
| 98 | if rBottomBarStyler.movable == 1 then | 94 | if rBottomBarStyler.movable == 1 then |
| 99 | frame_to_scale:SetMovable(true) | 95 | frame_to_scale:SetMovable(true) |
| 100 | if rBottomBarStyler.locked == 0 then | 96 | if rBottomBarStyler.locked == 0 then |
| 101 | if frame_to_drag then | 97 | if frame_to_drag then |
| 102 | frame_to_drag:Show() | 98 | frame_to_drag:Show() |
| 103 | end | 99 | end |
| 104 | frame_to_scale:EnableMouse(true) | 100 | frame_to_scale:EnableMouse(true) |
| 105 | frame_to_scale:RegisterForDrag("LeftButton","RightButton") | 101 | frame_to_scale:RegisterForDrag("LeftButton","RightButton") |
| 106 | frame_to_scale:SetScript("OnDragStart", function(self) | 102 | frame_to_scale:SetScript("OnDragStart", function(self) |
| 107 | if IsShiftKeyDown() and IsAltKeyDown() then | 103 | if IsShiftKeyDown() and IsAltKeyDown() then |
| 108 | self:StartMoving() | 104 | self:StartMoving() |
| 109 | end | 105 | end |
| 110 | end) | 106 | end) |
| 111 | frame_to_scale:SetScript("OnDragStop", function(self) | 107 | frame_to_scale:SetScript("OnDragStop", function(self) |
| 112 | if IsShiftKeyDown() and IsAltKeyDown() then | 108 | if IsShiftKeyDown() and IsAltKeyDown() then |
| 113 | self:StopMovingOrSizing() | 109 | self:StopMovingOrSizing() |
| 114 | save_posxy() | 110 | save_posxy() |
| 115 | end | 111 | end |
| 116 | end) | 112 | end) |
| 117 | end | 113 | end |
| 118 | else | 114 | else |
| 119 | rBottomBarStyler.point = nil | 115 | rBottomBarStyler.point = nil |
| 120 | rBottomBarStyler.posx = nil | 116 | rBottomBarStyler.posx = nil |
| 121 | rBottomBarStyler.posy = nil | 117 | rBottomBarStyler.posy = nil |
| 122 | frame_to_scale:ClearAllPoints() | 118 | frame_to_scale:ClearAllPoints() |
| 123 | frame_to_scale:SetPoint("BOTTOM",0,0) | 119 | frame_to_scale:SetPoint("BOTTOM",0,0) |
| 124 | end | 120 | end |
| 125 | end | 121 | end |
| 126 | 122 | ||
| 127 | ------------------------------------------------------ | 123 | ------------------------------------------------------ |
| 128 | -- / CREATE ME A FRAME FUNC / -- | 124 | -- / CREATE ME A FRAME FUNC / -- |
| 129 | ------------------------------------------------------ | 125 | ------------------------------------------------------ |
| 130 | 126 | ||
| 131 | local function create_me_a_frame(fart,fname,fparent,fstrata,fwidth,fheight,fanchor,fxpos,fypos,fscale,fdrag) | 127 | local function create_me_a_frame(fart,fname,fparent,fstrata,fwidth,fheight,fanchor,fxpos,fypos,fscale,fdrag) |
| 132 | local f = CreateFrame(fart,fname,fparent) | 128 | local f = CreateFrame(fart,fname,fparent) |
| 133 | f:SetFrameStrata(fstrata) | 129 | f:SetFrameStrata(fstrata) |
| 134 | f:SetWidth(fwidth) | 130 | f:SetWidth(fwidth) |
| 135 | f:SetHeight(fheight) | 131 | f:SetHeight(fheight) |
| 136 | if fname == "rBBS_Holder" then | 132 | if fname == "rBBS_Holder" then |
| 137 | if rBottomBarStyler.point and rBottomBarStyler.posx and rBottomBarStyler.posy then | 133 | if rBottomBarStyler.point and rBottomBarStyler.posx and rBottomBarStyler.posy then |
| 138 | f:SetPoint(rBottomBarStyler.point,rBottomBarStyler.posx,rBottomBarStyler.posy) | 134 | f:SetPoint(rBottomBarStyler.point,rBottomBarStyler.posx,rBottomBarStyler.posy) |
| 139 | else | 135 | else |
| 140 | f:SetPoint(fanchor,fxpos,fypos) | 136 | f:SetPoint(fanchor,fxpos,fypos) |
| 141 | end | 137 | end |
| 142 | else | 138 | else |
| 143 | f:SetPoint(fanchor,fxpos,fypos) | 139 | f:SetPoint(fanchor,fxpos,fypos) |
| 144 | end | 140 | end |
| 145 | f:SetScale(fscale) | 141 | f:SetScale(fscale) |
| 146 | if fdrag == true then | 142 | 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 }}) | 143 | 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 | 144 | end |
| 149 | return f | 145 | return f |
| 150 | end | 146 | end |
| 151 | 147 | ||
| 152 | ------------------------------------------------------ | 148 | ------------------------------------------------------ |
| 153 | -- / CREATE ME A TEXTURE FUNC / -- | 149 | -- / CREATE ME A TEXTURE FUNC / -- |
| 154 | ------------------------------------------------------ | 150 | ------------------------------------------------------ |
| 155 | 151 | ||
| 156 | local function create_me_a_texture(fhooked,tstrata,tfile,tspecial) | 152 | local function create_me_a_texture(fhooked,tstrata,tfile,tspecial) |
| 157 | local t = fhooked:CreateTexture(nil,tstrata) | 153 | local t = fhooked:CreateTexture(nil,tstrata) |
| 158 | t:SetTexture(tfile) | 154 | t:SetTexture(tfile) |
| 159 | if tspecial == "fill" then | 155 | if tspecial == "fill" then |
| 160 | t:SetPoint("BOTTOM",fhooked,"BOTTOM",0,0) | 156 | t:SetPoint("BOTTOM",fhooked,"BOTTOM",0,0) |
| 161 | t:SetWidth(fhooked:GetWidth()) | 157 | t:SetWidth(fhooked:GetWidth()) |
| 162 | t:SetHeight(fhooked:GetHeight()) | 158 | t:SetHeight(fhooked:GetHeight()) |
| 163 | else | 159 | else |
| 164 | t:SetAllPoints(fhooked) | 160 | t:SetAllPoints(fhooked) |
| 165 | end | 161 | end |
| 166 | return t | 162 | return t |
| 167 | end | 163 | end |
| 168 | 164 | ||
| 169 | ------------------------------------------------------ | 165 | ------------------------------------------------------ |
| 170 | -- / ORB HEALTH FUNC / -- | 166 | -- / ORB HEALTH FUNC / -- |
| 171 | ------------------------------------------------------ | 167 | ------------------------------------------------------ |
| 172 | 168 | ||
| 173 | local function orbhealth(orb1,orb1_fill) | 169 | local function orbhealth(orb1,orb1_fill) |
| 174 | orb1:SetScript("OnEvent", function(self, event, arg1, ...) | 170 | orb1:SetScript("OnEvent", function(self, event, arg1, ...) |
| 175 | if arg1 == "player" then | 171 | if arg1 == "player" then |
| 176 | local uh, uhm = UnitHealth("player"), UnitHealthMax("player") | 172 | local uh, uhm = UnitHealth("player"), UnitHealthMax("player") |
| 177 | orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth()) | 173 | orb1_fill:SetHeight((uh/uhm) * orb1_fill:GetWidth()) |
| 178 | orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1) | 174 | orb1_fill:SetTexCoord(0,1, math.abs(uh/uhm - 1),1) |
| 179 | end | 175 | end |
| 180 | end) | 176 | end) |
| 181 | orb1:RegisterEvent("UNIT_HEALTH") | 177 | orb1:RegisterEvent("UNIT_HEALTH") |
| 182 | end | 178 | end |
| 183 | 179 | ||
| 184 | ------------------------------------------------------ | 180 | ------------------------------------------------------ |
| 185 | -- / ORB MANA FUNC / -- | 181 | -- / ORB MANA FUNC / -- |
| 186 | ------------------------------------------------------ | 182 | ------------------------------------------------------ |
| 187 | 183 | ||
| 188 | local function orbmana(orb2,orb2_fill) | 184 | local function orbmana(orb2,orb2_fill) |
| 189 | orb2:SetScript("OnEvent", function(self, event, arg1, ...) | 185 | orb2:SetScript("OnEvent", function(self, event, arg1, ...) |
| 190 | if arg1 == "player" then | 186 | if arg1 == "player" then |
| 191 | local um, umm = UnitMana("player"), UnitManaMax("player") | 187 | local um, umm = UnitMana("player"), UnitManaMax("player") |
| 192 | orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth()) | 188 | orb2_fill:SetHeight((um/umm) * orb2_fill:GetWidth()) |
| 193 | orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1) | 189 | orb2_fill:SetTexCoord(0,1, math.abs(um/umm - 1),1) |
| 194 | end | 190 | end |
| 195 | end) | 191 | end) |
| 196 | orb2:RegisterEvent("UNIT_MANA") | 192 | orb2:RegisterEvent("UNIT_MANA") |
| 197 | orb2:RegisterEvent("UNIT_RAGE") | 193 | orb2:RegisterEvent("UNIT_RAGE") |
| 198 | orb2:RegisterEvent("UNIT_ENERGY") | 194 | orb2:RegisterEvent("UNIT_ENERGY") |
| 199 | orb2:RegisterEvent("UNIT_FOCUS") | 195 | orb2:RegisterEvent("UNIT_FOCUS") |
| 200 | orb2:RegisterEvent("UNIT_RUNIC_POWER") | 196 | orb2:RegisterEvent("UNIT_RUNIC_POWER") |
| 201 | end | 197 | end |
| 202 | 198 | ||
| 199 | ------------------------------------------------------ | ||
| 200 | -- / CREATE ORB FUNC / -- | ||
| 201 | ------------------------------------------------------ | ||
| 202 | |||
| 203 | local function create_orb(orbtype,orbsize,orbanchorframe,orbpoint,orbposx,orbposy,orbscale,orbfilltex,orbcolr,orbcolg,orbcolb) | ||
| 204 | --life orb | ||
| 205 | local orb1 = create_me_a_frame("Frame",nil,orbanchorframe,"LOW",orbsize,orbsize,orbpoint,orbposx,orbposy,orbscale) | ||
| 206 | local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 207 | local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\"..orbfilltex,"fill") | ||
| 208 | orb1_fill:SetVertexColor(orbcolr,orbcolg,orbcolb) | ||
| 209 | local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 210 | local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 211 | if orbtype == "life" then | ||
| 212 | orbhealth(orb1,orb1_fill) | ||
| 213 | else | ||
| 214 | orbmana(orb1,orb1_fill) | ||
| 215 | end | ||
| 216 | end | ||
| 217 | |||
| 203 | ------------------------------------------------------ | 218 | ------------------------------------------------------ |
| 204 | -- / SET ME A SCALE / -- | 219 | -- / SET ME A SCALE / -- |
| 205 | ------------------------------------------------------ | 220 | ------------------------------------------------------ |
| 206 | 221 | ||
| 207 | local function set_me_a_scale() | 222 | local function set_me_a_scale() |
| 208 | frame_to_scale:SetScale(rBottomBarStyler.scalevalue) | 223 | frame_to_scale:SetScale(rBottomBarStyler.scalevalue) |
| 209 | end | 224 | end |
| 210 | 225 | ||
| 211 | ------------------------------------------------------ | 226 | ------------------------------------------------------ |
| 212 | -- / SET ME A BAR / -- | 227 | -- / SET ME A BAR / -- |
| 213 | ------------------------------------------------------ | 228 | ------------------------------------------------------ |
| 214 | 229 | ||
| 215 | local function set_me_a_bar() | 230 | local function set_me_a_bar() |
| 216 | if rBottomBarStyler.artvalue == "roth" then | 231 | if rBottomBarStyler.artvalue == "roth" then |
| 217 | bar_to_show:SetTexture("Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) | 232 | bar_to_show:SetTexture("Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) |
| 218 | else | 233 | else |
| 219 | am("Does only work for roth layout") | 234 | am("Does only work for roth layout") |
| 220 | end | 235 | end |
| 221 | end | 236 | end |
| 222 | 237 | ||
| 223 | ------------------------------------------------------ | 238 | ------------------------------------------------------ |
| 224 | -- / CREATE D1 STYLE / -- | 239 | -- / CREATE D1 STYLE / -- |
| 225 | ------------------------------------------------------ | 240 | ------------------------------------------------------ |
| 226 | local function create_d1_style(scale) | 241 | local function create_d1_style(scale) |
| 227 | --am("c d1") | ||
| 228 | --holder | 242 | --holder |
| 229 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) | 243 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) |
| 230 | frame_to_scale = holder | 244 | frame_to_scale = holder |
| 231 | |||
| 232 | --bar texture | 245 | --bar texture |
| 233 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,256,"BOTTOM",0,0,1) | 246 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,256,"BOTTOM",0,0,1) |
| 234 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\bar") | 247 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\bar") |
| 235 | 248 | --orbs | |
| 236 | local orbsize = 160 | 249 | create_orb("life",160,holder,"BOTTOM",-290,120,1,"orb_filling4",0.8,0,0) |
| 237 | --life orb | 250 | create_orb("mana",160,holder,"BOTTOM",285,120,1,"orb_filling4",0,0.3,0.8) |
| 238 | local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-290,120,1) | ||
| 239 | local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 240 | local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 241 | orb1_fill:SetVertexColor(0.8,0,0) | ||
| 242 | local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 243 | local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 244 | orbhealth(orb1,orb1_fill) | ||
| 245 | |||
| 246 | --mana orb | ||
| 247 | local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",285,120,1) | ||
| 248 | local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 249 | local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 250 | orb2_fill:SetVertexColor(0,0.3,0.8) | ||
| 251 | local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 252 | local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 253 | orbmana(orb2,orb2_fill) | ||
| 254 | |||
| 255 | --left figure | 251 | --left figure |
| 256 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-320,35,0.9) | 252 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-320,35,0.9) |
| 257 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_left") | 253 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_left") |
| 258 | |||
| 259 | --right figure | 254 | --right figure |
| 260 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",320,35,0.9) | 255 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",320,35,0.9) |
| 261 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_right") | 256 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d1tex\\figure_right") |
| 262 | 257 | --dragframe | |
| 263 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) | 258 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) |
| 264 | frame_to_drag = dragframe | 259 | frame_to_drag = dragframe |
| 265 | |||
| 266 | end | 260 | end |
| 267 | 261 | ||
| 268 | ------------------------------------------------------ | 262 | ------------------------------------------------------ |
| 269 | -- / CREATE D2 STYLE / -- | 263 | -- / CREATE D2 STYLE / -- |
| 270 | ------------------------------------------------------ | 264 | ------------------------------------------------------ |
| 271 | local function create_d2_style(scale) | 265 | local function create_d2_style(scale) |
| 272 | --am("c d2") | ||
| 273 | --holder | 266 | --holder |
| 274 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale,true) | 267 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale,true) |
| 275 | frame_to_scale = holder | 268 | frame_to_scale = holder |
| 276 | |||
| 277 | --bar texture | 269 | --bar texture |
| 278 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,44,1) | 270 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,44,1) |
| 279 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\bar") | 271 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\bar") |
| 280 | 272 | --border | |
| 281 | local border_left = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMRIGHT",0,0,1) | 273 | local border_left = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMRIGHT",0,0,1) |
| 282 | local border_left_tex = create_me_a_texture(border_left,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_left") | 274 | local border_left_tex = create_me_a_texture(border_left,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_left") |
| 283 | |||
| 284 | local border_right = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMLEFT",0,0,1) | 275 | local border_right = create_me_a_frame("Frame",nil,holder,"LOW",1024,512,"BOTTOMLEFT",0,0,1) |
| 285 | local border_right_tex = create_me_a_texture(border_right,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_right") | 276 | local border_right_tex = create_me_a_texture(border_right,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\border_right") |
| 286 | 277 | --orbs | |
| 287 | local orbsize = 160 | 278 | create_orb("life",160,holder,"BOTTOM",-472,55,1,"orb_filling4",0.8,0,0) |
| 288 | --life orb | 279 | create_orb("mana",160,holder,"BOTTOM",465,55,1,"orb_filling4",0,0.3,0.8) |
| 289 | local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-472,55,1) | ||
| 290 | local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 291 | local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 292 | orb1_fill:SetVertexColor(0.8,0,0) | ||
| 293 | local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 294 | local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 295 | orbhealth(orb1,orb1_fill) | ||
| 296 | |||
| 297 | --mana orb | ||
| 298 | local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",465,55,1) | ||
| 299 | local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 300 | local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 301 | orb2_fill:SetVertexColor(0,0.3,0.8) | ||
| 302 | local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 303 | local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 304 | orbmana(orb2,orb2_fill) | ||
| 305 | |||
| 306 | --left figure | 280 | --left figure |
| 307 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-453,44,1) | 281 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-453,44,1) |
| 308 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_left") | 282 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_left") |
| 309 | |||
| 310 | --right figure | 283 | --right figure |
| 311 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",453,44,1) | 284 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",453,44,1) |
| 312 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_right") | 285 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d2tex\\figure_right") |
| 313 | 286 | --dragframe | |
| 314 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) | 287 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) |
| 315 | frame_to_drag = dragframe | 288 | frame_to_drag = dragframe |
| 316 | |||
| 317 | end | 289 | end |
| 318 | 290 | ||
| 319 | ------------------------------------------------------ | 291 | ------------------------------------------------------ |
| 320 | -- / CREATE D3 STYLE / -- | 292 | -- / CREATE D3 STYLE / -- |
| 321 | ------------------------------------------------------ | 293 | ------------------------------------------------------ |
| 322 | local function create_d3_style(scale) | 294 | local function create_d3_style(scale) |
| 323 | --am("c d3") | 295 | --holder |
| 324 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) | 296 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) |
| 325 | frame_to_scale = holder | 297 | frame_to_scale = holder |
| 326 | |||
| 327 | --bar texture | 298 | --bar texture |
| 328 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,0,1) | 299 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",1024,128,"BOTTOM",0,0,1) |
| 329 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\bar") | 300 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\bar") |
| 330 | 301 | --orbs | |
| 331 | local orbsize = 200 | 302 | create_orb("life",200,holder,"BOTTOM",-471,-3,1,"orb_filling4",0.8,0,0) |
| 332 | --life orb | 303 | create_orb("mana",200,holder,"BOTTOM",471,-3,1,"orb_filling4",0,0.3,0.8) |
| 333 | local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-471,-3,1) | ||
| 334 | local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 335 | local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 336 | orb1_fill:SetVertexColor(0.8,0,0) | ||
| 337 | local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 338 | local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 339 | orbhealth(orb1,orb1_fill) | ||
| 340 | |||
| 341 | --mana orb | ||
| 342 | local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",471,-3,1) | ||
| 343 | local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 344 | local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 345 | orb2_fill:SetVertexColor(0,0.3,0.8) | ||
| 346 | local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 347 | local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 348 | orbmana(orb2,orb2_fill) | ||
| 349 | |||
| 350 | --left figure | 304 | --left figure |
| 351 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",-455,0,1) | 305 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",-455,0,1) |
| 352 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_left") | 306 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_left") |
| 353 | |||
| 354 | --right figure | 307 | --right figure |
| 355 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",455,0,1) | 308 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",512,256,"BOTTOM",455,0,1) |
| 356 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_right") | 309 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\d3tex\\figure_right") |
| 357 | 310 | --dragframe | |
| 358 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) | 311 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) |
| 359 | frame_to_drag = dragframe | 312 | frame_to_drag = dragframe |
| 360 | |||
| 361 | end | 313 | end |
| 362 | 314 | ||
| 363 | ------------------------------------------------------ | 315 | ------------------------------------------------------ |
| 364 | -- / CREATE ROTH STYLE / -- | 316 | -- / CREATE ROTH STYLE / -- |
| 365 | ------------------------------------------------------ | 317 | ------------------------------------------------------ |
| 366 | local function create_roth_style(scale) | 318 | local function create_roth_style(scale) |
| 367 | --am("c roth") | 319 | --holder |
| 368 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) | 320 | local holder = create_me_a_frame("Frame","rBBS_Holder",UIParent,"BACKGROUND",100,100,"BOTTOM",0,0,scale) |
| 369 | frame_to_scale = holder | 321 | frame_to_scale = holder |
| 370 | 322 | --bar texture | |
| 371 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",512,256,"BOTTOM",0,0,1) | 323 | local bar = create_me_a_frame("Frame",nil,holder,"BACKGROUND",512,256,"BOTTOM",0,0,1) |
| 372 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) | 324 | local bar_tex = create_me_a_texture(bar,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\"..rBottomBarStyler.barvalue) |
| 373 | bar_to_show = bar_tex | 325 | bar_to_show = bar_tex |
| 374 | 326 | --bottom | |
| 375 | local bottom = create_me_a_frame("Frame",nil,holder,"HIGH",500,110,"BOTTOM",0,-10,1) | 327 | local bottom = create_me_a_frame("Frame",nil,holder,"HIGH",500,110,"BOTTOM",0,-10,1) |
| 376 | local bottom_tex = create_me_a_texture(bottom,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\bottom") | 328 | local bottom_tex = create_me_a_texture(bottom,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\bottom") |
| 377 | 329 | --orbs | |
| 378 | local orbsize = 120 | 330 | create_orb("life",120,holder,"BOTTOM",-250,-8,1,"orb_filling4",0.8,0,0) |
| 379 | --life orb | 331 | create_orb("mana",120,holder,"BOTTOM",250,-8,1,"orb_filling4",0,0.3,0.8) |
| 380 | local orb1 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",-250,-8,1) | ||
| 381 | local orb1_back = create_me_a_texture(orb1,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 382 | local orb1_fill = create_me_a_texture(orb1,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 383 | orb1_fill:SetVertexColor(0.8,0,0) | ||
| 384 | local orb1_glossholder = create_me_a_frame("Frame",nil,orb1,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 385 | local orb1_gloss = create_me_a_texture(orb1_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 386 | orbhealth(orb1,orb1_fill) | ||
| 387 | |||
| 388 | --mana orb | ||
| 389 | local orb2 = create_me_a_frame("Frame",nil,holder,"LOW",orbsize,orbsize,"BOTTOM",250,-8,1) | ||
| 390 | local orb2_back = create_me_a_texture(orb2,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_back2") | ||
| 391 | local orb2_fill = create_me_a_texture(orb2,"LOW","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_filling4","fill") | ||
| 392 | orb2_fill:SetVertexColor(0,0.3,0.8) | ||
| 393 | local orb2_glossholder = create_me_a_frame("Frame",nil,orb2,"MEDIUM",orbsize,orbsize,"BOTTOM",0,0,1) | ||
| 394 | local orb2_gloss = create_me_a_texture(orb2_glossholder,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\orbtex\\orb_gloss") | ||
| 395 | orbmana(orb2,orb2_fill) | ||
| 396 | |||
| 397 | --left figure | 332 | --left figure |
| 398 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-510,0,0.6) | 333 | local lefty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",-510,0,0.6) |
| 399 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_left") | 334 | local lefty_tex = create_me_a_texture(lefty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_left") |
| 400 | |||
| 401 | --right figure | 335 | --right figure |
| 402 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",510,0,0.6) | 336 | local righty = create_me_a_frame("Frame",nil,holder,"HIGH",256,256,"BOTTOM",510,0,0.6) |
| 403 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_right") | 337 | local righty_tex = create_me_a_texture(righty,"BACKGROUND","Interface\\AddOns\\rBottomBarStyler\\rothtex\\figure_right") |
| 404 | 338 | --dragframe | |
| 405 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) | 339 | local dragframe = create_me_a_frame("Frame",nil,holder,"TOOLTIP",100,100,"BOTTOM",0,0,scale,true) |
| 406 | frame_to_drag = dragframe | 340 | frame_to_drag = dragframe |
| 407 | |||
| 408 | end | 341 | end |
| 409 | 342 | ||
| 410 | ------------------------------------------------------ | 343 | ------------------------------------------------------ |
| 411 | -- / LOAD STYLE FUNC / -- | 344 | -- / LOAD STYLE FUNC / -- |
| 412 | ------------------------------------------------------ | 345 | ------------------------------------------------------ |
| 413 | 346 | ||
| 414 | local function load_style(style,scale) | 347 | local function load_style(style,scale) |
| 415 | if style == "roth" then | 348 | if style == "roth" then |
| 416 | create_roth_style(scale) | 349 | create_roth_style(scale) |
| 417 | elseif style == "d1" then | 350 | elseif style == "d1" then |
| 418 | create_d1_style(scale) | 351 | create_d1_style(scale) |
| 419 | elseif style == "d2" then | 352 | elseif style == "d2" then |
| 420 | create_d2_style(scale) | 353 | create_d2_style(scale) |
| 421 | else | 354 | else |
| 422 | create_d3_style(scale) | 355 | create_d3_style(scale) |
| 423 | end | 356 | end |
| 424 | end | 357 | end |
| 425 | 358 | ||
| 426 | ------------------------------------------------------ | 359 | ------------------------------------------------------ |
| 427 | -- / SLASH FUNC / -- | 360 | -- / SLASH FUNC / -- |
| 428 | ------------------------------------------------------ | 361 | ------------------------------------------------------ |
| 429 | 362 | ||
| 430 | local function SlashCmd(cmd) | 363 | local function SlashCmd(cmd) |
| 431 | --setscale | 364 | --setscale |
| 432 | if (cmd:match"setscale") then | 365 | if (cmd:match"setscale") then |
| 433 | local a,b = strfind(cmd, " "); | 366 | local a,b = strfind(cmd, " "); |
| 434 | if b then | 367 | if b then |
| 435 | local c = strsub(cmd, b+1) | 368 | local c = strsub(cmd, b+1) |
| 436 | if tonumber(c) then | 369 | if tonumber(c) then |
| 437 | am("Current scaling is set to: "..c) | 370 | am("Current scaling is set to: "..c) |
| 438 | rBottomBarStyler.scalevalue = tonumber(c) | 371 | rBottomBarStyler.scalevalue = tonumber(c) |
| 439 | set_me_a_scale() | 372 | set_me_a_scale() |
| 440 | else | 373 | else |
| 441 | am("No number value.") | 374 | am("No number value.") |
| 442 | end | 375 | end |
| 443 | else | 376 | else |
| 444 | am("No value found.") | 377 | am("No value found.") |
| 445 | end | 378 | end |
| 446 | --getscale | 379 | --getscale |
| 447 | elseif (cmd:match"getscale") then | 380 | elseif (cmd:match"getscale") then |
| 448 | am("Current scaling is set to: "..rBottomBarStyler.scalevalue) | 381 | am("Current scaling is set to: "..rBottomBarStyler.scalevalue) |
| 449 | --setart | 382 | --setart |
| 450 | elseif (cmd:match"setart") then | 383 | elseif (cmd:match"setart") then |
| 451 | local a,b = strfind(cmd, " "); | 384 | local a,b = strfind(cmd, " "); |
| 452 | if b then | 385 | if b then |
| 453 | local c = strsub(cmd, b+1) | 386 | local c = strsub(cmd, b+1) |
| 454 | if c == "d1" or c == "d2" or c == "d3" or c == "roth" then | 387 | if c == "d1" or c == "d2" or c == "d3" or c == "roth" then |
| 455 | am("You set the art to: "..c) | 388 | am("You set the art to: "..c) |
| 456 | rBottomBarStyler.artvalue = c | 389 | rBottomBarStyler.artvalue = c |
| 457 | am("You need to reoad the interface to see the changes.") | 390 | am("You need to reoad the interface to see the changes.") |
| 458 | am("Type in: \"/console reloadui\".") | 391 | am("Type in: \"/console reloadui\".") |
| 459 | else | 392 | else |
| 460 | am("Wrong value. (possible values: d1, d2, d3, roth)") | 393 | am("Wrong value. (possible values: d1, d2, d3, roth)") |
| 461 | end | 394 | end |
| 462 | else | 395 | else |
| 463 | am("No value found.") | 396 | am("No value found.") |
| 464 | end | 397 | end |
| 465 | --setbar | 398 | --setbar |
| 466 | elseif (cmd:match"setbar") then | 399 | elseif (cmd:match"setbar") then |
| 467 | local a,b = strfind(cmd, " "); | 400 | local a,b = strfind(cmd, " "); |
| 468 | if b then | 401 | if b then |
| 469 | local c = strsub(cmd, b+1) | 402 | local c = strsub(cmd, b+1) |
| 470 | if c == "bar1" or c == "bar2" or c == "bar3" then | 403 | if c == "bar1" or c == "bar2" or c == "bar3" then |
| 471 | am("You set the bar to: "..c) | 404 | am("You set the bar to: "..c) |
| 472 | rBottomBarStyler.barvalue = c | 405 | rBottomBarStyler.barvalue = c |
| 473 | set_me_a_bar() | 406 | set_me_a_bar() |
| 474 | else | 407 | else |
| 475 | am("Wrong value. (possible values: bar1, bar2, bar3)") | 408 | am("Wrong value. (possible values: bar1, bar2, bar3)") |
| 476 | end | 409 | end |
| 477 | else | 410 | else |
| 478 | am("No value found.") | 411 | am("No value found.") |
| 479 | end | 412 | end |
| 480 | --getart | 413 | --getart |
| 481 | elseif (cmd:match"getart") then | 414 | elseif (cmd:match"getart") then |
| 482 | am("Current art is set to: "..rBottomBarStyler.artvalue) | 415 | am("Current art is set to: "..rBottomBarStyler.artvalue) |
| 483 | --getmovable | 416 | --getmovable |
| 484 | elseif (cmd:match"getmovable") then | 417 | elseif (cmd:match"getmovable") then |
| 485 | am("Movable is set to: "..rBottomBarStyler.movable) | 418 | am("Movable is set to: "..rBottomBarStyler.movable) |
| 486 | --getlocked | 419 | --getlocked |
| 487 | elseif (cmd:match"getlocked") then | 420 | elseif (cmd:match"getlocked") then |
| 488 | am("Locked is set to: "..rBottomBarStyler.locked) | 421 | am("Locked is set to: "..rBottomBarStyler.locked) |
| 489 | --locked | 422 | --locked |
| 490 | elseif (cmd:match"locked") then | 423 | elseif (cmd:match"locked") then |
| 491 | local a,b = strfind(cmd, " "); | 424 | local a,b = strfind(cmd, " "); |
| 492 | if b then | 425 | if b then |
| 493 | local c = strsub(cmd, b+1) | 426 | local c = strsub(cmd, b+1) |
| 494 | if tonumber(c) then | 427 | if tonumber(c) then |
| 495 | am("Locked is set to: "..c) | 428 | am("Locked is set to: "..c) |
| 496 | rBottomBarStyler.locked = tonumber(c) | 429 | rBottomBarStyler.locked = tonumber(c) |
| 497 | move_my_frame() | 430 | move_my_frame() |
| 498 | else | 431 | else |
| 499 | am("No number value.") | 432 | am("No number value.") |
| 500 | end | 433 | end |
| 501 | else | 434 | else |
| 502 | am("No value found.") | 435 | am("No value found.") |
| 503 | end | 436 | end |
| 504 | --movable | 437 | --movable |
| 505 | elseif (cmd:match"movable") then | 438 | elseif (cmd:match"movable") then |
| 506 | local a,b = strfind(cmd, " "); | 439 | local a,b = strfind(cmd, " "); |
| 507 | if b then | 440 | if b then |
| 508 | local c = strsub(cmd, b+1) | 441 | local c = strsub(cmd, b+1) |
| 509 | if tonumber(c) then | 442 | if tonumber(c) then |
| 510 | am("Movable is set to: "..c) | 443 | am("Movable is set to: "..c) |
| 511 | rBottomBarStyler.movable = tonumber(c) | 444 | rBottomBarStyler.movable = tonumber(c) |
| 512 | move_my_frame() | 445 | move_my_frame() |
| 513 | else | 446 | else |
| 514 | am("No number value.") | 447 | am("No number value.") |
| 515 | end | 448 | end |
| 516 | else | 449 | else |
| 517 | am("No value found.") | 450 | am("No value found.") |
| 518 | end | 451 | end |
| 519 | else | 452 | else |
| 520 | am("rbbs commands...") | 453 | am("rbbs commands...") |
| 521 | am("\/rbbs getscale") | 454 | am("\/rbbs getscale") |
| 522 | am("\/rbbs getart") | 455 | am("\/rbbs getart") |
| 523 | am("\/rbbs getlocked") | 456 | am("\/rbbs getlocked") |
| 524 | am("\/rbbs getmovable") | 457 | am("\/rbbs getmovable") |
| 525 | am("\/rbbs setscale NUMBER") | 458 | am("\/rbbs setscale NUMBER") |
| 526 | am("\/rbbs setart STRING (possible values: d1, d2, d3, roth)") | 459 | 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)") | 460 | 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)") | 461 | 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)") | 462 | am("\/rbbs movable NUMBER (value of 1 makes bars movable if unlocked, value of 0 will reset position)") |
| 530 | end | 463 | end |
| 531 | end | 464 | end |
| 532 | 465 | ||
| 533 | ------------------------------------------------------ | 466 | ------------------------------------------------------ |
| 534 | -- / LOAD THE SHIT / -- | 467 | -- / LOAD THE SHIT / -- |
| 535 | ------------------------------------------------------ | 468 | ------------------------------------------------------ |
| 536 | 469 | ||
| 537 | local a = CreateFrame"Frame" | 470 | local a = CreateFrame"Frame" |
| 538 | a:RegisterEvent("VARIABLES_LOADED") | 471 | a:RegisterEvent("VARIABLES_LOADED") |
| 539 | a:SetScript("OnEvent", function(self) | 472 | a:SetScript("OnEvent", function(self) |
| 540 | self:UnregisterEvent("VARIABLES_LOADED") | 473 | self:UnregisterEvent("VARIABLES_LOADED") |
| 541 | self:SetScript("OnEvent", nil) | 474 | self:SetScript("OnEvent", nil) |
| 542 | --default values | 475 | --default values |
| 543 | load_default() | 476 | load_default() |
| 544 | --load the styles | 477 | --load the styles |
| 545 | load_style(rBottomBarStyler.artvalue,rBottomBarStyler.scalevalue) | 478 | load_style(rBottomBarStyler.artvalue,rBottomBarStyler.scalevalue) |
| 546 | move_my_frame() | 479 | move_my_frame() |
| 547 | --slash commands | 480 | --slash commands |
| 548 | SlashCmdList["whatever"] = SlashCmd; | 481 | SlashCmdList["whatever"] = SlashCmd; |
| 549 | SLASH_whatever1 = "/rbbs"; | 482 | SLASH_whatever1 = "/rbbs"; |
| 550 | --am("rbbs loaded...") | 483 | --am("rbbs loaded...") |
| 551 | end) | 484 | end) |