local addonName, addon = ... addon = LibStub("AceAddon-3.0"):GetAddon(addonName) local L = LibStub("AceLocale-3.0"):GetLocale(addonName) local UI = {} function addon.Init:BuildTransmogVendorUI() UI:CreateButtons() UI:CreateDropDown() --UI.OptionsDropDown_Initialize() UI.ExtendTransmogView() ---UpdateSlotButtons() ----Temp fix for reseting head slot position when sencondary slot is toggled function WardrobeTransmogFrame:CheckSecondarySlotButtons() local headButton = self.HeadButton; local mainShoulderButton = self.ShoulderButton; local secondaryShoulderButton = self.SecondaryShoulderButton; local secondaryShoulderTransmogged = TransmogUtil.IsSecondaryTransmoggedForItemLocation(secondaryShoulderButton.itemLocation); local pendingInfo = C_Transmog.GetPending(secondaryShoulderButton.transmogLocation); local showSecondaryShoulder = false; if not pendingInfo then showSecondaryShoulder = secondaryShoulderTransmogged; elseif pendingInfo.type == Enum.TransmogPendingType.ToggleOff then showSecondaryShoulder = false; else showSecondaryShoulder = true; end secondaryShoulderButton:SetShown(showSecondaryShoulder); self.ToggleSecondaryAppearanceCheckbox:SetChecked(showSecondaryShoulder); local point, relativeTo, relativePoint, xOfs, yOfs = headButton:GetPoint() if showSecondaryShoulder then headButton:SetPoint("TOP", xOfs, -15); secondaryShoulderButton:SetPoint("TOP", mainShoulderButton, "BOTTOM", 0, -10); else headButton:SetPoint("TOP", xOfs, -41); secondaryShoulderButton:SetPoint("TOP", mainShoulderButton, "TOP"); end if not showSecondaryShoulder and self.selectedSlotButton == secondaryShoulderButton then self:SelectSlotButton(mainShoulderButton); end end ----addon:SecureHook(WardrobeTransmogFrame,"CheckSecondarySlotButtons", function() C_Timer.After(0.1, function() print("SD"); UI.ExtendTransmogView() end) end) end function UI:CreateDropDown() WardrobeOutfitDropDown:Hide() -- BetterWardrobeOutfitDropDown:SetParent(WardrobeTransmogFrame) --BetterWardrobeOutfitDropDown:ClearAllPoints() --BetterWardrobeOutfitDropDown:SetPoint("TOPLEFT", -14, -28) addon:SecureHook(WardrobeTransmogFrame, "OnTransmogApplied", function() C_Timer.After(.5, function() if BetterWardrobeOutfitDropDown.selectedOutfitID and BetterWardrobeOutfitDropDown:IsOutfitDressed() then BetterWardrobeOutfitDropDown:OnOutfitApplied(BetterWardrobeOutfitDropDown.selectedOutfitID) end end) end, true) --Frame Mixin functionaly in SavedOutfits.lua file --BetterWardrobeOutfitDropDown = CreateFrame("Frame", "BetterWardrobeOutfitDropDown", WardrobeTransmogFrame, "BetterWardrobeOutfitDropDownTemplate") ----local f = CreateFrame("Frame", "BetterWardrobeOutfitDropDown", WardrobeTransmogFrame, "BW_UIDropDownMenuTemplate") --local f = BW_UIDropDownMenu_Create("BetterWardrobeOutfitDropDown", WardrobeTransmogFrame) --f:SetPoint("CENTER") --f:SetSize(100,22) --[[ f.width = 163 f.minMenuStringWidth = 127 f.maxMenuStringWidth = 190 f:SetPoint("TOPLEFT", -14, -28) --Mixin(f, WardrobeOutfitDropDownMixin) --Mixin(f, BW_WardrobeOutfitMixin) f.SaveButton = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") f.SaveButton:SetSize(88, 22) local button = _G[f:GetName().."Button"] f.SaveButton:SetPoint("LEFT", button, "RIGHT", 3, 0) f.SaveButton:SetScript("OnClick", function(self) PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); local dropDown = self:GetParent(); dropDown:CheckOutfitForSave(BW_UIDropDownMenu_GetText(dropDown)); end) f.SaveButton:SetText(SAVE) f:SetScript("OnLoad", f.OnLoad) -- f:OnLoad() f:SetScript("OnEvent", f.OnEvent) f:SetScript("OnShow", f.OnShow) f:SetScript("OnHide", f.OnHide)]] ---- BetterWardrobeOutfitDropDown = f ----local f = CreateFrame("Frame", "BW_WardrobeOutfitFrame", WardrobeTransmogFrame, "BW_WardrobeOutfitFrameTemplate") end --Creates the various buttons used on the Collection Journal function UI:CreateButtons() --Load Queue Button local BW_LoadQueueButton = CreateFrame("Button", "BW_LoadQueueButton", WardrobeTransmogFrame, "BetterWardrobeButtonTemplate") BW_LoadQueueButton.Icon:SetTexture("Interface\\Buttons\\UI-OptionsButton") BW_LoadQueueButton:SetPoint("TOPLEFT", WardrobeOutfitDropDown, "TOPRIGHT", 80 ,-5) BW_LoadQueueButton.buttonID = "Import" BW_LoadQueueButton:SetScript("OnClick", function(self) BW_TransmogVendorExportButton_OnClick(self) end) --BW_LoadQueueButton:SetScript("OnEnter", function(self) BW_DressingRoomButtonMixin:OnEnter(self) end) --Randomize Button, Mixin defined in Randomizer.lua local BW_RandomizeButton = CreateFrame("Button", "BW_RandomizeButton", WardrobeTransmogFrame, "BetterWardrobeButtonTemplate") BW_RandomizeButton.Icon:SetTexture("Interface\\Buttons\\UI-GroupLoot-Dice-Up") Mixin(BW_RandomizeButton, BW_RandomizeButtonMixin) BW_RandomizeButton:SetPoint("TOPLEFT", BW_LoadQueueButton, "TOPRIGHT" , 0, 0) BW_RandomizeButton:SetScript("OnMouseUp", BW_RandomizeButton.OnMouseUp) BW_RandomizeButton:SetScript("OnMouseDown", BW_RandomizeButton.OnMouseDown) BW_RandomizeButton:SetScript("OnEnter", BW_RandomizeButton.OnEnter) local BW_SlotHideButton = CreateFrame("Button", "BW_SlotHideButton", WardrobeTransmogFrame, "BetterWardrobeButtonTemplate") BW_SlotHideButton.buttonID = "HideSlot" BW_SlotHideButton:SetScript("OnEnter", function(self) BW_DressingRoomButtonMixin:OnEnter() end) BW_SlotHideButton.Icon:SetTexture("Interface\\PvPRankBadges\\PvPRank12") --Mixin(BW_SlotHideButton, BW_SlotHideButtonMixin) BW_SlotHideButton:SetPoint("TOPLEFT", BW_RandomizeButton, "TOPRIGHT" , 0, 0) BW_SlotHideButton:SetScript("OnClick", function(self) UI:HideSlotMenu_OnClick(self) end) --BW_SlotHideButton:SetScript("OnMouseUp", BW_SlotHideButton.OnMouseUp) --BW_SlotHideButton:SetScript("OnMouseDown", BW_SlotHideButton.OnMouseDown) --BW_SlotHideButton:SetScript("OnEnter", BW_SlotHideButton.OnEnter) local BW_TransmogOptionsDropDown= CreateFrame("Frame", "BW_TransmogOptionsDropDown", BetterWardrobeCollectionFrame, "BW_UIDropDownMenuTemplate") BW_TransmogOptionsDropDown = BW_TransmogOptionsDropDown ---- BetterWardrobeCollectionFrame.OptionsDropDown = BW_TransmogOptionsDropDown BetterWardrobeTransmogVendorOptionsDropDown_OnLoad(BW_TransmogOptionsDropDown) local f = CreateFrame("Frame", "BW_AltIcon1", WardrobeTransmogFrame.HeadButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon3", WardrobeTransmogFrame.ShoulderButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon15", WardrobeTransmogFrame.BackButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon5", WardrobeTransmogFrame.ChestButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon9", WardrobeTransmogFrame.WristButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon10", WardrobeTransmogFrame.HandsButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon6", WardrobeTransmogFrame.WaistButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon7", WardrobeTransmogFrame.LegsButton, "AltItemtemplate") local f = CreateFrame("Frame", "BW_AltIcon8", WardrobeTransmogFrame.FeetButton, "AltItemtemplate") end function UI:HideSlotMenu_OnClick(parent) local Profile = addon.Profile local armor = addon.Globals.EmptyArmor local name = addon.QueueList[3] local contextMenuData = {{ text = L["Select Slot to Hide"], isTitle = true, notCheckable = true},} local profile = addon.setdb.profile.autoHideSlot for i = 1, 19 do if armor[i] then local menu = { text = _G[addon.Globals.INVENTORY_SLOT_NAMES[i]], func = function (self, arg1, arg2, value) profile[i] = not profile[i] end, isNotRadio = true, notCheckable = false, checked = function() return profile[i] end, keepShownOnClick = true, } tinsert (contextMenuData, menu) end end --table.sort(contextMenuData, function(a,b) return a.index