Mercurial > wow > reaction
comparison State.lua @ 71:3d2cef5dc459
Implemented state anchoring and scaling
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Wed, 04 Jun 2008 21:46:51 +0000 |
parents | 2c12e2b1752e |
children | aa88aed52124 |
comparison
equal
deleted
inserted
replaced
70:2c12e2b1752e | 71:3d2cef5dc459 |
---|---|
234 end | 234 end |
235 end | 235 end |
236 bar:SetStateKeybindOverrideMap(map) | 236 bar:SetStateKeybindOverrideMap(map) |
237 end | 237 end |
238 | 238 |
239 function propertyFuncs.enableanchor( bar, states ) | 239 local function updateAnchor(bar, states) |
240 | 240 local map = { } |
241 end | 241 for state, c in pairs(states) do |
242 | 242 if c.enableAnchor then |
243 function propertyFuncs.anchorPoint( bar, states ) | 243 map[state] = { point = c.anchorPoint, relpoint = c.anchorRelPoint, x = c.anchorX, y = c.anchorY } |
244 | 244 end |
245 end | 245 end |
246 | 246 bar:SetStateAnchorMap(map) |
247 function propertyFuncs.anchorRelPoint( bar, states ) | 247 end |
248 | 248 |
249 end | 249 propertyFuncs.enableAnchor = updateAnchor |
250 | 250 propertyFuncs.anchorPoint = updateAnchor |
251 function propertyFuncs.anchorX( bar, states ) | 251 propertyFuncs.anchorRelPoint = updateAnchor |
252 | 252 propertyFuncs.anchorX = updateAnchor |
253 end | 253 propertyFuncs.anchorY = updateAnchor |
254 | 254 |
255 function propertyFuncs.anchorY( bar, states ) | 255 local function updateScale( bar, states ) |
256 | 256 local map = { } |
257 end | 257 for state, c in pairs(states) do |
258 | 258 if c.enablescale then |
259 function propertyFuncs.enablescale( bar, states ) | 259 map[state] = c.scale |
260 | 260 end |
261 end | 261 end |
262 | 262 bar:SetStateScaleMap(map) |
263 function propertyFuncs.scale( bar, states ) | 263 end |
264 | 264 |
265 end | 265 propertyFuncs.enablescale = updateScale |
266 propertyFuncs.scale = updateScale | |
266 | 267 |
267 end | 268 end |
268 | 269 |
269 | 270 |
270 | 271 |
464 b = tbuild(states, b, "rule") | 465 b = tbuild(states, b, "rule") |
465 a.order, b.order = b.order, a.order | 466 a.order, b.order = b.order, a.order |
466 end | 467 end |
467 | 468 |
468 local function anchordisable() | 469 local function anchordisable() |
469 return not GetProperty(bar, opts.name, "enableanchor") | 470 return not GetProperty(bar, opts.name, "enableAnchor") |
470 end | 471 end |
471 | 472 |
472 tbuild(states, name) | 473 tbuild(states, name) |
473 | 474 |
474 opts.order = getrule("order") | 475 opts.order = getrule("order") |
614 name = L["Position"], | 615 name = L["Position"], |
615 order = 5, | 616 order = 5, |
616 type = "group", | 617 type = "group", |
617 inline = true, | 618 inline = true, |
618 args = { | 619 args = { |
619 enableanchor = { | 620 enableAnchor = { |
620 name = L["Set New Position"], | 621 name = L["Set New Position"], |
621 order = 1, | 622 order = 1, |
622 type = "toggle", | 623 type = "toggle", |
623 set = setprop, | 624 set = setprop, |
624 get = getprop, | 625 get = getprop, |