Mercurial > wow > reaction
comparison State.lua @ 95:168cae4aa8bd
Fixes:
- brute-force fix for invalid snippets
- copying profile data now results in immediate changes
- fixed keybinding tooltip display for pet bar simple actions
Also did a little condensing of the state driver rule string generation
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 21:39:07 +0000 |
parents | 5f1d7a81317c |
children | aa9074c92f11 |
comparison
equal
deleted
inserted
replaced
94:39265b16d208 | 95:168cae4aa8bd |
---|---|
193 end | 193 end |
194 end | 194 end |
195 | 195 |
196 function RefreshState( bar ) | 196 function RefreshState( bar ) |
197 SetDefaultAnchor(bar) | 197 SetDefaultAnchor(bar) |
198 bar:GetFrame():Execute([[control:RunAttribute("reaction-refresh")]]) | 198 bar:GetFrame():Execute( |
199 [[ | |
200 if self:GetAttribute("reaction-refresh") then | |
201 control:RunAttribute("reaction-refresh") | |
202 end | |
203 ]]) | |
199 end | 204 end |
200 | 205 |
201 function SetStateDriver( bar, rule ) | 206 function SetStateDriver( bar, rule ) |
202 local f = bar:GetFrame() | 207 local f = bar:GetFrame() |
203 | 208 |
318 elseif type == "custom" then | 323 elseif type == "custom" then |
319 if c.custom then | 324 if c.custom then |
320 -- strip out all spaces from the custom rule | 325 -- strip out all spaces from the custom rule |
321 table.insert(rules, format("%s %s", c.custom:gsub("%s",""), state)) | 326 table.insert(rules, format("%s %s", c.custom:gsub("%s",""), state)) |
322 end | 327 end |
323 elseif type == "any" then | 328 elseif type == "any" or type == "all" then |
324 if c.values then | |
325 local clauses = { } | |
326 for key, value in pairs(c.values) do | |
327 table.insert(clauses, format("[%s]", ruleformats[key])) | |
328 end | |
329 if #clauses > 0 then | |
330 table.insert(rules, format("%s %s", table.concat(clauses), state)) | |
331 end | |
332 end | |
333 elseif type == "all" then | |
334 if c.values then | 329 if c.values then |
335 local clauses = { } | 330 local clauses = { } |
336 for key, value in pairs(c.values) do | 331 for key, value in pairs(c.values) do |
337 table.insert(clauses, ruleformats[key]) | 332 table.insert(clauses, ruleformats[key]) |
338 end | 333 end |
339 if #clauses > 0 then | 334 if #clauses > 0 then |
340 table.insert(rules, format("%s %s", format("[%s]", table.concat(clauses, ",")), state)) | 335 local sep = (type == "any") and "][" or "," |
336 table.insert(rules, format("[%s] %s", table.concat(clauses,sep), state)) | |
341 end | 337 end |
342 end | 338 end |
343 end | 339 end |
344 end | 340 end |
345 -- make sure that the default, if any, is last | 341 -- make sure that the default, if any, is last |