comparison Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua @ 17:3000eccbf1a0 v7.3.0.017

- ToC Update.
author Tercio
date Sat, 02 Sep 2017 14:10:48 -0300
parents 371e14cd2feb
children
comparison
equal deleted inserted replaced
16:6c64dd7f16a2 17:3000eccbf1a0
1 --[[ $Id: AceGUIWidget-DropDown-Items.lua 1137 2016-05-15 10:57:36Z nevcairiel $ ]]-- 1 --[[ $Id: AceGUIWidget-DropDown-Items.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]--
2 2
3 local AceGUI = LibStub("AceGUI-3.0") 3 local AceGUI = LibStub("AceGUI-3.0")
4
5 local IsLegion = select(4, GetBuildInfo()) >= 70000
6 4
7 -- Lua APIs 5 -- Lua APIs
8 local select, assert = select, assert 6 local select, assert = select, assert
9 7
10 -- WoW APIs 8 -- WoW APIs
323 -- Item: Toggle 321 -- Item: Toggle
324 -- Some sort of checkbox for dropdown menus. 322 -- Some sort of checkbox for dropdown menus.
325 -- Does not close the pullout on click. 323 -- Does not close the pullout on click.
326 do 324 do
327 local widgetType = "Dropdown-Item-Toggle" 325 local widgetType = "Dropdown-Item-Toggle"
328 local widgetVersion = 3 326 local widgetVersion = 4
329 327
330 local function UpdateToggle(self) 328 local function UpdateToggle(self)
331 if self.value then 329 if self.value then
332 self.check:Show() 330 self.check:Show()
333 else 331 else
343 local function Frame_OnClick(this, button) 341 local function Frame_OnClick(this, button)
344 local self = this.obj 342 local self = this.obj
345 if self.disabled then return end 343 if self.disabled then return end
346 self.value = not self.value 344 self.value = not self.value
347 if self.value then 345 if self.value then
348 PlaySound("igMainMenuOptionCheckBoxOn") 346 PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
349 else 347 else
350 PlaySound("igMainMenuOptionCheckBoxOff") 348 PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF
351 end 349 end
352 UpdateToggle(self) 350 UpdateToggle(self)
353 self:Fire("OnValueChanged", self.value) 351 self:Fire("OnValueChanged", self.value)
354 end 352 end
355 353
455 453
456 self.SetDisabled = SetDisabled 454 self.SetDisabled = SetDisabled
457 455
458 local line = self.frame:CreateTexture(nil, "OVERLAY") 456 local line = self.frame:CreateTexture(nil, "OVERLAY")
459 line:SetHeight(1) 457 line:SetHeight(1)
460 if IsLegion then 458 line:SetColorTexture(.5, .5, .5)
461 line:SetColorTexture(.5, .5, .5)
462 else
463 line:SetTexture(.5, .5, .5)
464 end
465 line:SetPoint("LEFT", self.frame, "LEFT", 10, 0) 459 line:SetPoint("LEFT", self.frame, "LEFT", 10, 0)
466 line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0) 460 line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0)
467 461
468 self.text:Hide() 462 self.text:Hide()
469 463