Mercurial > wow > devian
comparison Devian.lua @ 42:e95cccfcfeb7 v2.0-beta-r42
sorted out index typing issues with tag args
| author | Nenue |
|---|---|
| date | Sun, 27 Dec 2015 09:39:20 -0500 |
| parents | d432f49e340e |
| children | 5341e4d84622 |
comparison
equal
deleted
inserted
replaced
| 41:13433847ca76 | 42:e95cccfcfeb7 |
|---|---|
| 127 if D.sigID[dest] then | 127 if D.sigID[dest] then |
| 128 dest = db.channels[D.sigID[dest]].index | 128 dest = db.channels[D.sigID[dest]].index |
| 129 else | 129 else |
| 130 sig = dest | 130 sig = dest |
| 131 end | 131 end |
| 132 else | |
| 133 dest = tonumber(dest) | |
| 132 end | 134 end |
| 133 --@debug@ | 135 --@debug@ |
| 134 --print('2 tag,dest,sig', tag, dest, sig)--@end-debug@ | 136 --print('2 tag,dest,sig', tag, dest, sig)--@end-debug@ |
| 135 | 137 |
| 136 -- make a new channel? | 138 -- make a new channel? |
| 137 local channel | 139 local channel |
| 138 if not db.channels[dest] then | 140 if not D.db.channels[dest] then |
| 139 dest = D.max_channel + 1 | 141 dest = D.max_channel + 1 |
| 140 D:Print('Created channel |cFF88FFFF'.. (sig and (dest..':'..sig) or dest ) .. '|r') | 142 D:Print('Created channel |cFF88FFFF'.. (sig and (dest..':'..sig) or dest ) .. '|r') |
| 141 channel = D:SetChannel(sig or tag,dest) | 143 channel = D:SetChannel(sig or tag,dest) |
| 144 else | |
| 145 | |
| 146 channel = D.db.channels[dest] | |
| 142 end | 147 end |
| 143 --@debug@ | 148 --@debug@ |
| 144 --print('3',tag, dest)--@end-debug@ | 149 --print('3 tag,dest,channel.sig=',tag, dest, channel.signature)--@end-debug@ |
| 145 | 150 |
| 146 if db.tags[tag] and db.tags[tag][dest] then | 151 if not db.tags[tag] then -- no tag table? |
| 152 db.tags[tag] = {} | |
| 153 end | |
| 154 | |
| 155 if db.tags[tag][dest] then -- is tag set? | |
| 147 db.tags[tag][dest] = nil | 156 db.tags[tag][dest] = nil |
| 148 D:Print('Hiding |cFF88FFFF'..tag..'|r messages in |cFFFFFF00'..db.channels[dest].index ..':'.. db.channels[dest].signature) | 157 D:Print('Hiding |cFF88FFFF'..tag..'|r messages in |cFFFFFF00'..db.channels[dest].index ..':'.. db.channels[dest].signature) |
| 149 else | 158 else |
| 150 if not db.tags[tag] then | |
| 151 db.tags[tag] = {} | |
| 152 end | |
| 153 db.tags[tag][dest] = dest | 159 db.tags[tag][dest] = dest |
| 154 D:Print('Showing |cFF88FFFF'..tag..'|r messages in |cFFFFFF00'..db.channels[dest].index ..':'.. db.channels[dest].signature) | 160 D:Print('Showing |cFF88FFFF'..tag..'|r messages in |cFFFFFF00'..db.channels[dest].index ..':'.. db.channels[dest].signature) |
| 155 end | 161 end |
| 156 else | 162 else |
| 157 D:Print('Usage: /dvn tag <prefix> <console name or number>') | 163 D:Print('Usage: /dvn tag <prefix> <console name or number>') |
