Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function TogglePacksWindow()
- if packsWindow == nil then
- -- BIG WINDOW
- local hSize = 1200
- local vSize = 600
- packsWindow = CreateEmptyWindow("packsWindow", "UIParent")
- packsWindow:SetExtent(hSize, vSize)
- packsWindow:AddAnchor("TOPLEFT", "UIParent", 0, 0)
- -- packsWindow.colorTexture = packsWindow:CreateDrawable(thisAddonPath .. "black_carbon_fiber_texture.dds", "window","background")
- -- packsWindow.colorTexture:AddAnchor("TOPLEFT", packsWindow, 0, 0)
- -- packsWindow.colorTexture:AddAnchor("BOTTOMRIGHT", packsWindow, 0, 0)
- local function OnShow()
- if packsWindow.ShowProc ~= nil then
- packsWindow:ShowProc()
- end
- SettingWindowSkin(packsWindow)
- packsWindow:SetStartAnimation(true, true)
- end
- packsWindow:SetHandler("OnShow", OnShow)
- local someTitle = packsWindow:CreateChildWidget("label", "someTitle", 0, false)
- someTitle:SetHeight(20)
- someTitle:SetText("My BOX")
- someTitle:AddAnchor("TOPLEFT", packsWindow, (hSize/2), 0)
- someTitle.style:SetAlign(ALIGN_LEFT)
- someTitle.style:SetColorByKey("black")
- someTitle.style:SetFontSize(20)
- --local aged_cheese_pack
- local arrDescription = read_file(thisAddonPath .. "yny.csv");
- local accHeight = 40
- local accWidth = 200
- local fontSize = 15
- --for i, name in ipairs(arrChildrenCol) do
- for col = 1, #arrDescription[1] do
- --X2Chat:DispatchChatMessage(CMF_RAID, string.format("%s", arrDescription[1][col]))
- local someInfo = packsWindow:CreateChildWidget("label", "someInfo", col-1, false)
- someInfo:SetHeight(accHeight)
- --pack zone is longest
- if (col == 1) then
- someInfo:AddAnchor("TOPLEFT", packsWindow, accWidth, accHeight)
- else
- accWidth = accWidth + 70
- someInfo:AddAnchor("TOPLEFT", packsWindow, accWidth, accHeight)
- end
- someInfo:SetText(string.format("%s", arrDescription[1][col]))
- --someInfo.style:SetAlign(ALIGN_LEFT)
- someInfo.style:SetColorByKey("black")
- someInfo.style:SetFontSize(fontSize)
- col = col + 1
- end
- --[[
- local info = X2Achievement:GetAchievementInfo(9)
- local someTitle = packsWindow:CreateChildWidget("label", "someTitle", 0, false)
- someTitle:SetHeight(20)
- someTitle:SetText(info.name)
- someTitle:AddAnchor("TOPLEFT", packsWindow, 150, 10)
- someTitle.style:SetAlign(ALIGN_LEFT)
- someTitle.style:SetColorByKey("brown")
- local button = packsWindow:CreateChildWidget("button", "iconButton", 0, true)
- button:AddAnchor("TOPLEFT", someTitle, 5, 20)
- button:SetExtent(42, 42)
- local icon = button:CreateIconDrawable("background")
- icon:AddAnchor("TOPLEFT", button, 1, 1)
- icon:AddAnchor("BOTTOMRIGHT", button, -1, -1)
- icon:ClearAllTextures()
- icon:AddTexture(info.iconPath)
- button:Show(true)
- local someInfo = packsWindow:CreateChildWidget("label", "someInfo", 0, false)
- someInfo:SetHeight(20)
- someInfo:SetText(info.summary)
- someInfo:AddAnchor("TOPLEFT", packsWindow, 20, 60)
- someInfo.style:SetAlign(ALIGN_LEFT)
- someInfo.style:SetColorByKey("brown")
- ]]--
- --bottom button
- local closeButton = packsWindow:CreateChildWidget("button", "closeButton", 0, true)
- closeButton:SetText(X2Locale:LocalizeUiText(COMMON_TEXT, "ok"))
- local color = {}
- color.normal = UIParent:GetFontColor("btn_df")
- color.highlight = UIParent:GetFontColor("btn_ov")
- color.pushed = UIParent:GetFontColor("btn_on")
- color.disabled = UIParent:GetFontColor("btn_dis")
- local buttonskin = {
- drawableType = "ninePart",
- path = "ui/common/default.dds",
- coordsKey = "btn",
- autoResize = true,
- fontColor = color,
- fontInset = {
- left = 11,
- right = 11,
- top = 0,
- bottom = 0,
- },
- }
- ApplyButtonSkin(closeButton, buttonskin)
- closeButton:AddAnchor("BOTTOMLEFT", packsWindow, (hSize/2), 0)
- closeButton:Show(true)
- function closeButton:OnClick()
- packsWindow:Show(false)
- end
- closeButton:SetHandler("OnClick", closeButton.OnClick)
- packsWindow:Enable(true)
- packsWindow:EnableDrag(true)
- function packsWindow:OnDragStart()
- self:StartMoving()
- self.moving = true
- end
- packsWindow:SetHandler("OnDragStart", packsWindow.OnDragStart)
- function packsWindow:OnDragStop()
- self:StopMovingOrSizing()
- self.moving = false
- end
- packsWindow:SetHandler("OnDragStop", packsWindow.OnDragStop)
- end
- packsWindow:Show(not packsWindow:IsVisible())
- end
Add Comment
Please, Sign In to add comment