comparison UI.lua @ 38:d432f49e340e v2.0-beta-r38

remove prints
author Nenue
date Sun, 27 Dec 2015 08:35:28 -0500
parents bec37163b7fe
children 02e4a69afad5
comparison
equal deleted inserted replaced
37:e3206e85ca70 38:d432f49e340e
208 value = "OptClose", 208 value = "OptClose",
209 func = function () 209 func = function ()
210 f.enabled = nil 210 f.enabled = nil
211 f:Hide() 211 f:Hide()
212 f:Save() 212 f:Save()
213 end }, 213 end },--[[
214 { 214 {
215 text = "Dock", 215 text = "Dock",
216 value = "OptDock", 216 value = "OptDock",
217 func = function() print('Dvn', 'docking shenanary') end } 217 func = function() print('Dvn', 'docking shenanary') end }]]
218 } 218 }
219 for _, v in ipairs(info) do 219 for _, v in ipairs(info) do
220 UIDropDownMenu_AddButton(v) 220 UIDropDownMenu_AddButton(v)
221 end 221 end
222 end, 'MENU') 222 end, 'MENU')
245 function D:SetChannel(cinfo, key) 245 function D:SetChannel(cinfo, key)
246 local db = self.db 246 local db = self.db
247 local t_info = {} 247 local t_info = {}
248 local channel, isNew, id, sig, t_id 248 local channel, isNew, id, sig, t_id
249 --@debug@ 249 --@debug@
250 print('setchan(0) cinfo, key', cinfo, key)--@end-debug@ 250 --print('setchan(0) cinfo, key', cinfo, key)--@end-debug@
251 -- obtain source data 251 -- obtain source data
252 if tonumber(key) ~= nil and db.channels[key] then 252 if tonumber(key) ~= nil and db.channels[key] then
253 id = tonumber(key) 253 id = tonumber(key)
254 elseif D.sigID[tostring(key)] then 254 elseif D.sigID[tostring(key)] then
255 id = D.sigID[tostring(key)] 255 id = D.sigID[tostring(key)]
259 end 259 end
260 local dbvars = db.channels[id] 260 local dbvars = db.channels[id]
261 t_id = id -- overridden later if new 261 t_id = id -- overridden later if new
262 t_info.index = t_id -- 262 t_info.index = t_id --
263 --@debug@ 263 --@debug@
264 print('setchan(1) cinfo, key, id=', cinfo, key, id)--@end-debug@ 264 --print('setchan(1) cinfo, key, id=', cinfo, key, id)--@end-debug@
265 265
266 266
267 -- obtain config info 267 -- obtain config info
268 if type(cinfo) == 'string' then 268 if type(cinfo) == 'string' then
269 sig = cinfo 269 sig = cinfo
277 else -- old sig 277 else -- old sig
278 sig = db.channels[id].signature 278 sig = db.channels[id].signature
279 end 279 end
280 t_info.signature = sig 280 t_info.signature = sig
281 --@debug@ 281 --@debug@
282 print('setchan(2) sig,id,isNew=', sig, id, isNew)--@end-debug@ 282 --print('setchan(2) sig,id,isNew=', sig, id, isNew)--@end-debug@
283 283
284 for k,v in pairs(cinfo) do -- allow all cinfo to pass 284 for k,v in pairs(cinfo) do -- allow all cinfo to pass
285 t_info[k] = v 285 t_info[k] = v
286 end 286 end
287 287
305 t_info.signature = result 305 t_info.signature = result
306 end 306 end
307 t_id = self.max_channel + 1 307 t_id = self.max_channel + 1
308 t_info.index = t_id 308 t_info.index = t_id
309 --@debug@ 309 --@debug@
310 print('setchan(3a) t_id, isNew, sig, t_info.signature=', t_id, isNew, sig, t_info.signature)--@end-debug@ 310 --print('setchan(3a) t_id, isNew, sig, t_info.signature=', t_id, isNew, sig, t_info.signature)--@end-debug@
311 else 311 else
312 --@debug@ 312 --@debug@
313 print('setchan(3b) t_id, isNew, sig, t_info.signature=', t_id, isNew, sig, t_info.signature)--@end-debug@ 313 --print('setchan(3b) t_id, isNew, sig, t_info.signature=', t_id, isNew, sig, t_info.signature)--@end-debug@
314 end 314 end
315 315
316 local channel 316 local channel
317 if not self.console[t_id] then -- create a frame 317 if not self.console[t_id] then -- create a frame
318 if isNew then -- position the channel frame 318 if isNew then -- position the channel frame
320 db.max_channel = t_id 320 db.max_channel = t_id
321 t_info.x = t_info.x + 20 321 t_info.x = t_info.x + 20
322 t_info.y = t_info.y - 20 322 t_info.y = t_info.y - 20
323 db.channels[t_id] = t_info 323 db.channels[t_id] = t_info
324 --@debug@ 324 --@debug@
325 print('setchan(4a)', 't_id, x, y=', t_id, t_info.x, t_info.y)--@end-debug@ 325 --print('setchan(4a)', 't_id, x, y=', t_id, t_info.x, t_info.y)--@end-debug@
326 end 326 end
327 channel = CreateConsole(t_id, t_info) 327 channel = CreateConsole(t_id, t_info)
328 self.console[t_id] = channel 328 self.console[t_id] = channel
329 self.sig[t_info.signature] = channel 329 self.sig[t_info.signature] = channel
330 self.sigID[t_info.signature] = t_id 330 self.sigID[t_info.signature] = t_id
337 else 337 else
338 channel:Maximize() 338 channel:Maximize()
339 end 339 end
340 340
341 if channel.enabled and db.enabled then -- hide or show last since Min/Max mess with visibility 341 if channel.enabled and db.enabled then -- hide or show last since Min/Max mess with visibility
342 print('setchan(5a) enable') 342 --print('setchan(5a) enable')
343 channel:Show() 343 channel:Show()
344 else 344 else
345 print('setchan(5a) disable') 345 --print('setchan(5a) disable')
346 channel:Hide() 346 channel:Hide()
347 end 347 end
348 --@debug@ 348 --@debug@
349 --print('setchan(end); c:IsVisible(), c.enabled, db.enabled=', channel:IsVisible(), channel.enabled, db.enabled)--@end-debug@ 349 --print('setchan(end); c:IsVisible(), c.enabled, db.enabled=', channel:IsVisible(), channel.enabled, db.enabled)--@end-debug@
350 return channel 350 return channel