Mercurial > wow > devian
comparison UI.lua @ 87:e80723841888
- /dvn rc resets the current workspace channels and tags
- slash command arguments handled by string.find
- toggle command argument handling
| author | Nenue |
|---|---|
| date | Tue, 26 Jul 2016 09:21:37 -0400 |
| parents | 80ad43c94033 |
| children | 7ff0579e5a6e |
comparison
equal
deleted
inserted
replaced
| 86:6e27274da4d9 | 87:e80723841888 |
|---|---|
| 376 end | 376 end |
| 377 | 377 |
| 378 --- Console frame toggler | 378 --- Console frame toggler |
| 379 -- @paramsig [...] | 379 -- @paramsig [...] |
| 380 -- @param ... one or more space-seperated channel keys | 380 -- @param ... one or more space-seperated channel keys |
| 381 function D:Console_Toggle(input, force) | 381 function D:Console_Toggle(cmd, force) |
| 382 | |
| 383 | |
| 384 local args = {} | |
| 385 if cmd then | |
| 386 cmd = tostring(cmd) | |
| 387 local i, j = 0, 0 | |
| 388 repeat | |
| 389 i, j = cmd:find("%S+", j+1) | |
| 390 if i and j then | |
| 391 local key = cmd:sub(i, j) | |
| 392 if self.sig[key] then | |
| 393 --print(key, self.sigID[key]) | |
| 394 insert(search, self.sigID[key]) | |
| 395 elseif self.console[tonumber(key)] then | |
| 396 --print(key, tonumber(key)) | |
| 397 insert(search, tonumber(key)) | |
| 398 end | |
| 399 end | |
| 400 until not(i or j) | |
| 401 end | |
| 402 | |
| 382 local profile = D.currentProfile | 403 local profile = D.currentProfile |
| 383 local setAll | 404 local setAll |
| 384 local search = {} | 405 local search = {} |
| 385 local key | |
| 386 local n = 0 | |
| 387 | |
| 388 -- resolve key/sig values from args | 406 -- resolve key/sig values from args |
| 389 while self:GetArgs(input,1,n) and n < 255 do | 407 for i, key in ipairs(args) do |
| 390 key, n = self:GetArgs(input,1,n) | |
| 391 | |
| 392 if self.sig[key] then | |
| 393 --print(key, self.sigID[key]) | |
| 394 insert(search, self.sigID[key]) | |
| 395 elseif self.console[tonumber(key)] then | |
| 396 --print(key, tonumber(key)) | |
| 397 insert(search, tonumber(key)) | |
| 398 end | |
| 399 | 408 |
| 400 --oldprint(#search, key, n) | 409 --oldprint(#search, key, n) |
| 401 end | 410 end |
| 402 | 411 |
| 403 -- if nothing was found, then do an all toggle | 412 -- if nothing was found, then do an all toggle |
