|
|
|
@ -12,6 +12,17 @@ local GUI = TSM:NewModule("GUI", "AceEvent-3.0", "AceHook-3.0") |
|
|
|
local AceGUI = LibStub("AceGUI-3.0") |
|
|
|
local AceGUI = LibStub("AceGUI-3.0") |
|
|
|
local private = {} |
|
|
|
local private = {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function private:SetSelectionButtonsEnabled(enabled) |
|
|
|
|
|
|
|
if not private.selectionFrame then return end |
|
|
|
|
|
|
|
local action = enabled and "Enable" or "Disable" |
|
|
|
|
|
|
|
if private.selectionFrame.postBtn then |
|
|
|
|
|
|
|
private.selectionFrame.postBtn[action](private.selectionFrame.postBtn) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
if private.selectionFrame.cancelBtn then |
|
|
|
|
|
|
|
private.selectionFrame.cancelBtn[action](private.selectionFrame.cancelBtn) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function private:CreateButtons(parent) |
|
|
|
function private:CreateButtons(parent) |
|
|
|
local height = 24 |
|
|
|
local height = 24 |
|
|
|
local frame = CreateFrame("Frame", nil, parent) |
|
|
|
local frame = CreateFrame("Frame", nil, parent) |
|
|
|
@ -62,6 +73,7 @@ function private:CreateButtons(parent) |
|
|
|
if self.which == "stop" and self.isDone then |
|
|
|
if self.which == "stop" and self.isDone then |
|
|
|
GUI:HideSelectionFrame() |
|
|
|
GUI:HideSelectionFrame() |
|
|
|
private.selectionFrame:Show() |
|
|
|
private.selectionFrame:Show() |
|
|
|
|
|
|
|
private:SetSelectionButtonsEnabled(true) |
|
|
|
elseif frame:IsVisible() and private.OnAction then |
|
|
|
elseif frame:IsVisible() and private.OnAction then |
|
|
|
private:OnAction(self.which) |
|
|
|
private:OnAction(self.which) |
|
|
|
end |
|
|
|
end |
|
|
|
@ -93,6 +105,7 @@ function private:CreateButtons(parent) |
|
|
|
button:SetText(L["Skip"]) |
|
|
|
button:SetText(L["Skip"]) |
|
|
|
button.which = "skip" |
|
|
|
button.which = "skip" |
|
|
|
button:SetScript("OnClick", OnClick) |
|
|
|
button:SetScript("OnClick", OnClick) |
|
|
|
|
|
|
|
_G["TSMAuctioningCancelSkipButton"] = button |
|
|
|
frame.skip = button |
|
|
|
frame.skip = button |
|
|
|
|
|
|
|
|
|
|
|
local button = TSMAPI.GUI:CreateButton(frame, 18) |
|
|
|
local button = TSMAPI.GUI:CreateButton(frame, 18) |
|
|
|
@ -752,7 +765,7 @@ function GUI:CreateSelectionFrame(parent) |
|
|
|
frame.helpText = helpText |
|
|
|
frame.helpText = helpText |
|
|
|
|
|
|
|
|
|
|
|
local btnWidth = floor((stContainer:GetWidth() - 10)/3) |
|
|
|
local btnWidth = floor((stContainer:GetWidth() - 10)/3) |
|
|
|
local postBtn = TSMAPI.GUI:CreateButton(frame, 16) |
|
|
|
local postBtn = TSMAPI.GUI:CreateButton(frame, 16, "TSMAuctioningPostScanButton") |
|
|
|
postBtn:SetPoint("BOTTOMLEFT", 5, 5) |
|
|
|
postBtn:SetPoint("BOTTOMLEFT", 5, 5) |
|
|
|
postBtn:SetHeight(20) |
|
|
|
postBtn:SetHeight(20) |
|
|
|
postBtn:SetWidth(btnWidth) |
|
|
|
postBtn:SetWidth(btnWidth) |
|
|
|
@ -764,7 +777,7 @@ function GUI:CreateSelectionFrame(parent) |
|
|
|
end) |
|
|
|
end) |
|
|
|
frame.postBtn = postBtn |
|
|
|
frame.postBtn = postBtn |
|
|
|
|
|
|
|
|
|
|
|
local cancelBtn = TSMAPI.GUI:CreateButton(frame, 16) |
|
|
|
local cancelBtn = TSMAPI.GUI:CreateButton(frame, 16, "TSMAuctioningCancelScanButton") |
|
|
|
cancelBtn:SetPoint("BOTTOMLEFT", postBtn, "BOTTOMRIGHT", 5, 0) |
|
|
|
cancelBtn:SetPoint("BOTTOMLEFT", postBtn, "BOTTOMRIGHT", 5, 0) |
|
|
|
cancelBtn:SetHeight(20) |
|
|
|
cancelBtn:SetHeight(20) |
|
|
|
cancelBtn:SetWidth(btnWidth) |
|
|
|
cancelBtn:SetWidth(btnWidth) |
|
|
|
@ -908,6 +921,7 @@ function GUI:CreateScanFrame(parent) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function GUI:StartScan(frame) |
|
|
|
function GUI:StartScan(frame) |
|
|
|
|
|
|
|
private:SetSelectionButtonsEnabled(false) |
|
|
|
private.selectionFrame:Hide() |
|
|
|
private.selectionFrame:Hide() |
|
|
|
private.scanFrame = private.scanFrame or GUI:CreateScanFrame(frame) |
|
|
|
private.scanFrame = private.scanFrame or GUI:CreateScanFrame(frame) |
|
|
|
private.scanFrame:Show() |
|
|
|
private.scanFrame:Show() |
|
|
|
@ -967,6 +981,7 @@ function GUI:ShowSelectionFrame(frame) |
|
|
|
if private.scanFrame then private.scanFrame:Hide() end |
|
|
|
if private.scanFrame then private.scanFrame:Hide() end |
|
|
|
private.selectionFrame = private.selectionFrame or GUI:CreateSelectionFrame(frame) |
|
|
|
private.selectionFrame = private.selectionFrame or GUI:CreateSelectionFrame(frame) |
|
|
|
private.selectionFrame:Show() |
|
|
|
private.selectionFrame:Show() |
|
|
|
|
|
|
|
private:SetSelectionButtonsEnabled(true) |
|
|
|
TSMAPI.AuctionScan:StopScan(false) |
|
|
|
TSMAPI.AuctionScan:StopScan(false) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|