view Modules/FriendsFrame.lua @ 123:b3c0258b419d v7.3.0-1

ArtifactPower: - XP progress bar fixes Currency: - More argus stuff - Block dimensions are calculated more consistently TalkingHead - Aesthetic changes - Default right-click behaviour restored (hides the text box)
author Nenue
date Tue, 05 Sep 2017 02:56:33 -0400
parents 1f68c46bc4de
children
line wrap: on
line source
-- Veneer
-- FriendsFrame.lua
-- Created: 10/27/2016 8:50 PM
-- %file-revision%
--
local m = {}
VeneerLFGMixin = m
local _, db = ...
local print = DEVIAN_WORKSPACE and function(...) print('VnTweaks', ...) end or nop

print('tweaks')

local currentMerchButton
local positionsDirty
local FormatPopup = function(index)
  local popupName = 'StaticPopup'..index

  local frame = _G[popupName]
  frame:SetBackdrop(nil)
  frame.Backdrop = frame:CreateTexture('BACKGROUND')
  frame.Backdrop:SetAllPoints(frame)
  frame.Backdrop:SetColorTexture(0,0,0,.7)
  frame:EnableMouse(false)

  local edit = _G[popupName .. 'EditBox']
  edit.Backdrop = edit:CreateTexture('BACKGROUND')
  edit.Backdrop:SetAllPoints(edit)
  edit.Backdrop:SetColorTexture(0,0,0,1)

  local editLeft = _G[popupName .. 'EditBoxLeft']
  editLeft:Hide()
  local editRight = _G[popupName .. 'EditBoxRight']
  editRight:Hide()

  for i = 1, 3 do
    local button = frame['button'..i]
    button:GetNormalTexture():SetColorTexture(0.25,.25,.25,1)
    button:GetPushedTexture():SetColorTexture(0,.4,1,1)
    button:GetDisabledTexture():SetColorTexture(0.25,.25,.25,1)
    button:GetHighlightTexture():SetColorTexture(.25, 0,1,1)
  end

end

for i = 1, STATICPOPUP_NUMDIALOGS do
  print('setup', i)
  FormatPopup(i)
end

hooksecurefunc('StaticPopup_Show', function(which, text_arg1, text_arg2, data, insertedFrame)
  print(which, text_arg1, text_arg2, data)


  if which == 'CONFIRM_PURCHASE_TOKEN_ITEM' then
    local i = data.index
    while i > 10 do
      i = i - 10
    end
    print(i)


    currentMerchButton = _G['MerchantItem' .. i]
    StaticPopup1:ClearAllPoints()
    StaticPopup1:SetPoint('TOPLEFT', currentMerchButton, 'TOPRIGHT', 2, 0)
    print(StaticPopup1:GetSize())
    positionsDirty = true
  else
    if positionsDirty then
      StaticPopup1:ClearAllPoints()
      StaticPopup1:SetPoint('TOP', UIParent, 'TOP', 0, -135)
      end
  end

  StaticPopup1EditBox:SetWidth(StaticPopup1:GetWidth())



end)