From 6b761c9fceaa721038b092ce2c0569ca5d823f03 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 21 Oct 2015 23:31:06 +0200 Subject: [PATCH 1/6] beginnings of new UI --- .idea/misc.xml | 3 + .idea/workspace.xml | 105 ++++++++++++------------- buy.xml | 188 +++++++++++++++++++++++++++++--------------- core.lua | 16 ++-- 4 files changed, 185 insertions(+), 127 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fa5ca66..3551bb4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,8 @@ + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1b6c11c..8dae7d9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,12 +2,9 @@ - + - - - - + @@ -73,8 +70,8 @@ - - + + @@ -100,10 +97,10 @@ - + - + @@ -130,21 +127,21 @@ - - + + - - + + - - + + - - + + @@ -188,12 +185,12 @@ @@ -229,7 +226,6 @@ - @@ -251,6 +247,7 @@ + @@ -380,27 +377,27 @@ - - + + - - + + - - + + + - + - - + @@ -447,14 +444,6 @@ - - - - - - - - @@ -471,14 +460,6 @@ - - - - - - - - @@ -503,14 +484,6 @@ - - - - - - - - @@ -529,12 +502,36 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buy.xml b/buy.xml index 1cf44b4..626e122 100644 --- a/buy.xml +++ b/buy.xml @@ -40,65 +40,123 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + this:RegisterForDrag('LeftButton') + this:StartMoving() + this:StopMovingOrSizing() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + - local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].on_cell_click, Aux.buy.modes[1].on_cell_enter, Aux.buy.modes[1].on_cell_leave) + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + this:SetBackdropColor(0.15, 0.15, 0.15) + getglobal(this:GetName().."Title"):SetText('Search Results') + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].on_cell_click, Aux.buy.modes[1].on_cell_enter, Aux.buy.modes[1].on_cell_leave) + + + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].on_cell_click, Aux.buy.modes[2].on_cell_enter, Aux.buy.modes[2].on_cell_leave) + + + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].on_cell_click, Aux.buy.modes[3].on_cell_enter, Aux.buy.modes[3].on_cell_leave) + + + + - - - - - - local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].on_cell_click, Aux.buy.modes[2].on_cell_enter, Aux.buy.modes[2].on_cell_leave) - - - - - - - - - local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].on_cell_click, Aux.buy.modes[3].on_cell_enter, Aux.buy.modes[3].on_cell_leave) - - - - - - + + + + + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + this:SetBackdropColor(0.15, 0.15, 0.15) + getglobal(this:GetName().."Title"):SetText('Filters') + + - + UIDropDownMenu_SetWidth(140) @@ -120,7 +178,7 @@ - + @@ -159,7 +217,7 @@ - + @@ -170,7 +228,7 @@ - + @@ -190,7 +248,7 @@ - + UIDropDownMenu_SetWidth(140) @@ -212,7 +270,7 @@ - + @@ -245,7 +303,7 @@ - + @@ -257,7 +315,7 @@ - + @@ -307,7 +365,7 @@ diff --git a/core.lua b/core.lua index 8724c62..e482de9 100644 --- a/core.lua +++ b/core.lua @@ -83,7 +83,7 @@ function Aux_OnAddonLoaded() } Aux.tabs.buy.hiddenElements = { - AuctionFrameBrowse, +-- AuctionFrameBrowse, } Aux.tabs.sell.recommendationElements = { @@ -299,13 +299,13 @@ function Aux_AddPanels() relevel(sellFrame) sellFrame:Hide() - local buyFrame = CreateFrame("Frame", "AuxBuyPanel", AuctionFrame, "AuxBuyTemplate") - buyFrame:SetParent("AuctionFrame") - buyFrame:SetPoint("TOPLEFT", "AuctionFrame", "TOPLEFT") - AuxLogFrame:SetParent(buyFrame) - AuxLogFrame:SetPoint('TOP', buyFrame, 100, -43) - relevel(buyFrame) - buyFrame:Hide() + --local buyFrame = CreateFrame("Frame", "AuxBuyPanel", AuctionFrame, "AuxBuyTemplate") + --buyFrame:SetParent("AuctionFrame") + --buyFrame:SetPoint("TOPLEFT", "AuctionFrame", "TOPLEFT") + --AuxLogFrame:SetParent(buyFrame) + --AuxLogFrame:SetPoint('TOP', buyFrame, 100, -43) + --relevel(buyFrame) + --buyFrame:Hide() local optionsFrame = CreateFrame("Frame", "AuxOptionsButtonPanel", AuctionFrame, "AuxOptionsButtonTemplate") optionsFrame:SetParent("AuctionFrame") From df04b4ec286813642583db1c2c6903c6b8d48d34 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Thu, 22 Oct 2015 03:01:26 +0200 Subject: [PATCH 2/6] some progress on the new UI --- .idea/workspace.xml | 33 ++++--- buy.lua | 5 +- buy.xml | 213 +++++++++++++++++++++++--------------------- 3 files changed, 129 insertions(+), 122 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8dae7d9..a32c3aa 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,8 @@ + - - @@ -100,8 +99,8 @@ - - + + @@ -130,8 +129,8 @@ - - + + @@ -188,8 +187,8 @@ @@ -500,14 +499,6 @@ - - - - - - - - @@ -524,10 +515,18 @@ + + + + + + + + - - + + diff --git a/buy.lua b/buy.lua index 2c61194..ff41e1b 100644 --- a/buy.lua +++ b/buy.lua @@ -565,8 +565,8 @@ function show_dialog(buyout_mode, entry, amount) AuxBuyConfirmation.EnhTooltip_info = entry.EnhTooltip_info AuxBuyConfirmationActionButton:Disable() - AuxBuyConfirmationItem:SetNormalTexture(entry.texture) - AuxBuyConfirmationItemName:SetText(entry.name) + AuxBuyConfirmationItemIconTexture:SetTexture(entry.texture) + AuxBuyConfirmationItemName:SetText(entry.tooltip[1][1].text) local color = ITEM_QUALITY_COLORS[entry.quality] AuxBuyConfirmationItemName:SetTextColor(color.r, color.g, color.b) @@ -587,7 +587,6 @@ function show_dialog(buyout_mode, entry, amount) AuxBuyConfirmationBuyoutPrice:Hide() AuxBuyConfirmationBid:Show() end - hide_sheet() AuxBuyConfirmation:Show() end diff --git a/buy.xml b/buy.xml index 626e122..425865a 100644 --- a/buy.xml +++ b/buy.xml @@ -141,6 +141,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aux.info.set_game_tooltip(this, this:GetParent().tooltip, 'ANCHOR_LEFT', this:GetParent().EnhTooltip_info) + + + GameTooltip:Hide() + + + + + + + + + + + + + + + + + + + SmallMoneyFrame_OnLoad() + MoneyFrame_SetType("STATIC") + + + + + + + + + + + + + + @@ -456,108 +567,6 @@ - - - - - - - - - - - - - - - - - - - - - MoneyFrame_OnLoad() - MoneyFrame_SetType("STATIC") - - - - - - - - - - - - - - From 7c7b14c246af96aaba18f659d2b91082d4fd080c Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 23 Oct 2015 02:16:08 +0200 Subject: [PATCH 3/6] some progress with the new UI --- .idea/workspace.xml | 93 ++-- buy.xml | 1155 +++++++++++++++++++++++++------------------ core.lua | 26 +- core.xml | 68 +-- 4 files changed, 779 insertions(+), 563 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a32c3aa..1637d3d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,9 @@ - + + @@ -69,8 +70,8 @@ - - + + @@ -79,7 +80,7 @@ - + @@ -119,8 +120,8 @@ - - + + @@ -129,8 +130,8 @@ - - + + @@ -159,8 +160,8 @@ - - + + @@ -183,12 +184,12 @@ @@ -451,14 +452,6 @@ - - - - - - - - @@ -475,14 +468,6 @@ - - - - - - - - @@ -491,22 +476,6 @@ - - - - - - - - - - - - - - - - @@ -523,10 +492,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/buy.xml b/buy.xml index 425865a..c662710 100644 --- a/buy.xml +++ b/buy.xml @@ -39,38 +39,133 @@ - - - - - + + + + + + - this:RegisterForDrag('LeftButton') - this:StartMoving() - this:StopMovingOrSizing() + + this:RegisterForDrag('LeftButton') + + + this:StartMoving() + + + this:StopMovingOrSizing() + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -80,7 +175,7 @@ - + @@ -92,481 +187,603 @@ - - - - - - - - this:SetBackdropBorderColor(0.4, 0.4, 0.4) - this:SetBackdropColor(0.15, 0.15, 0.15) - getglobal(this:GetName().."Title"):SetText('Search Results') - - + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + - local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].on_cell_click, Aux.buy.modes[1].on_cell_enter, Aux.buy.modes[1].on_cell_leave) + Aux.log_frame_load() + + Aux.log_frame_update(arg1) + + + ChatFrame_OnHyperlinkShow(arg1) + + + if arg1 == 1 then + this:ScrollUp() + elseif arg1 == -1 then + this:ScrollDown() + end + - - - - - - - - - local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].on_cell_click, Aux.buy.modes[2].on_cell_enter, Aux.buy.modes[2].on_cell_leave) - - - - - - - - - - - local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) - this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].on_cell_click, Aux.buy.modes[3].on_cell_enter, Aux.buy.modes[3].on_cell_leave) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aux.info.set_game_tooltip(this, this:GetParent().tooltip, 'ANCHOR_LEFT', this:GetParent().EnhTooltip_info) - - - GameTooltip:Hide() - - - - - - - - - - - - - - - - - - - SmallMoneyFrame_OnLoad() - MoneyFrame_SetType("STATIC") - - - - - - - - - - - - - - + + - - - - - - - this:SetBackdropBorderColor(0.4, 0.4, 0.4) - this:SetBackdropColor(0.15, 0.15, 0.15) - getglobal(this:GetName().."Title"):SetText('Filters') - - - - - + + + + + + + + + + + + + + + + + + + + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + getglobal(this:GetName().."Title"):SetText('Filters') + + + + + + + + UIDropDownMenu_SetWidth(140) + UIDropDownMenu_Initialize(this, AuxBuyModeDropDown_Initialize) + UIDropDownMenu_SetSelectedValue(this, 1) + + + UIDropDownMenu_Initialize(this, AuxBuyModeDropDown_Initialize) + + + + + + + + + + + + + + + + + + + + + + + + this.completor = Aux.completion.completor(this) + + + this.completor.suggest() + + + if IsShiftKeyDown() then + this.completor.previous() + else + this.completor.next() + end + + + this.completor.close() + this:ClearFocus() + Aux.buy.SearchButton_onclick() + + + if this.completor.open() then + this.completor.close() + else + this:ClearFocus() + end + + + + + + + + + + + + + + + + + + + + + + + + + + + + UIDropDownMenu_SetWidth(140) + UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) + + + UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) + + + + + + + + + UIDropDownMenu_SetWidth(140) + UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) + + + UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this:ClearFocus() + + + + + + + + + + + this:ClearFocus() + + + + + + + + + + + + + + + + + + + + + + + + + + + + AuxBuyTooltipButton_OnClick(this) + + + + + + + + UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize) + + + + + + + + + + + + + + + + + + + + + this:EnableMouse(false) + this:SetAlpha(0.5) + + + this:ClearFocus() + + + + + + + + + + + + + + + + AuxBuyPageEditBox:EnableMouse(not this:GetChecked()) + AuxBuyPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1) + AuxBuyPageEditBox:ClearFocus() + + + + - - - - - - - - - - - - - this.completor = Aux.completion.completor(this) - - - this.completor.suggest() - - - if IsShiftKeyDown() then - this.completor.previous() - else - this.completor.next() - end - - - this.completor.close() - this:ClearFocus() - Aux.buy.SearchButton_onclick() - - - if this.completor.open() then - this.completor.close() - else - this:ClearFocus() - end - - - - - - - - - - - - - - - - - - - - - - - - - - - - UIDropDownMenu_SetWidth(140) - UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) - - - UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) - - - - - - - - - UIDropDownMenu_SetWidth(140) - UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) - - - UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this:ClearFocus() - - - - - - - - - - - this:ClearFocus() - - - - - - - - - - - - - - - - - - - - - - - - - - - - AuxBuyTooltipButton_OnClick(this) - - - - - - - - UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize) - - - - - - - - - - - - - - - - - - + + + + + - this:EnableMouse(false) - this:SetAlpha(0.5) + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + getglobal(this:GetName().."Title"):SetText('Search Results') - - this:ClearFocus() - - - - - - - - - - - - + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].on_cell_click, Aux.buy.modes[1].on_cell_enter, Aux.buy.modes[1].on_cell_leave) + + + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].on_cell_click, Aux.buy.modes[2].on_cell_enter, Aux.buy.modes[2].on_cell_leave) + + + + + + + + + + + local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end) + this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].on_cell_click, Aux.buy.modes[3].on_cell_enter, Aux.buy.modes[3].on_cell_leave) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aux.info.set_game_tooltip(this, this:GetParent().tooltip, 'ANCHOR_LEFT', this:GetParent().EnhTooltip_info) + + + GameTooltip:Hide() + + + + + + + + + + + + + + + + + + + SmallMoneyFrame_OnLoad() + MoneyFrame_SetType("STATIC") + + + + + + + + + + + + + + + + + + + + - - - - - - - + diff --git a/core.lua b/core.lua index e482de9..ab12b30 100644 --- a/core.lua +++ b/core.lua @@ -84,7 +84,12 @@ function Aux_OnAddonLoaded() Aux.tabs.buy.hiddenElements = { -- AuctionFrameBrowse, - } + } + + Aux.buy.elements = { + AuxBuyFilters, + AuxBuySheetFrame, + } Aux.tabs.sell.recommendationElements = { AuxRecommendText, @@ -99,6 +104,7 @@ function Aux_OnAddonLoaded() end function Aux.log_frame_load() + this:SetFading(false) this:EnableMouseWheel() -- this.flashTimer = 0 TODO remove end @@ -141,8 +147,8 @@ end function Aux.log(msg) local info = ChatTypeInfo["SYSTEM"] - AuxLogFrame:AddMessage(msg, 1, 1, 0) - if not AuxLogFrame:IsVisible() and DEFAULT_CHAT_FRAME then + AuxLogFrameMessageFrame:AddMessage(msg, 1, 1, 0) + if not AuxLogFrameMessageFrame:IsVisible() and DEFAULT_CHAT_FRAME then DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0) end end @@ -241,6 +247,20 @@ function Aux_OnAuctionHouseClosed() end +function Aux.on_tab_click(button) + + for i=1,4 do + getglobal('AuxTab'..i):SetAlpha(i == this:GetID() and 1 or 0.5) + end + + Aux_HideElems(Aux.buy.elements) + AuxSellPanel:Hide() + if this:GetID() == 1 then + Aux_ShowElems(Aux.buy.elements) + end + +end + function Aux_AuctionFrameTab_OnClick(index) if not index then diff --git a/core.xml b/core.xml index e498066..d21c3cd 100644 --- a/core.xml +++ b/core.xml @@ -16,61 +16,39 @@ - + + From 530dad98e13c2a58b406fa3c739209f882abec07 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 23 Oct 2015 23:12:52 +0200 Subject: [PATCH 4/6] progress on the new UI --- .idea/workspace.xml | 241 +++++++++---- buy.xml | 827 +++++++++++++++++++++----------------------- core.xml | 30 +- info.lua | 5 + 4 files changed, 589 insertions(+), 514 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1637d3d..9e0dc88 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,9 @@ - + + @@ -58,8 +59,8 @@ @@ -70,8 +71,8 @@ - - + + @@ -80,8 +81,8 @@ - - + + @@ -100,7 +101,7 @@ - + @@ -120,18 +121,28 @@ - + - + - - + + + + + + + + + + + + @@ -140,28 +151,18 @@ - - + + - - - - - - - - - - - + - - + + @@ -185,12 +186,12 @@ @@ -226,6 +227,7 @@ + @@ -247,7 +249,6 @@ - @@ -279,19 +280,6 @@ @@ -420,6 +421,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -476,58 +557,66 @@ - - - - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - - + + + + + + + + + + diff --git a/buy.xml b/buy.xml index c662710..75c8e12 100644 --- a/buy.xml +++ b/buy.xml @@ -117,13 +117,14 @@ - + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) this:RegisterForDrag('LeftButton') @@ -133,99 +134,58 @@ this:StopMovingOrSizing() - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + - + + + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + this:SetBackdropColor(0.15, 0.15, 0.15) + + - + - + @@ -251,344 +211,353 @@ - + + + + + + + + + + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) + this:SetBackdropColor(0.15, 0.15, 0.15) + getglobal(this:GetName().."Title"):SetText('Filters') + + - - - - - - - - - - this:SetBackdropBorderColor(0.4, 0.4, 0.4) - getglobal(this:GetName().."Title"):SetText('Filters') - - - - - - - - UIDropDownMenu_SetWidth(140) - UIDropDownMenu_Initialize(this, AuxBuyModeDropDown_Initialize) - UIDropDownMenu_SetSelectedValue(this, 1) - - - UIDropDownMenu_Initialize(this, AuxBuyModeDropDown_Initialize) - - - - - - - - - - - - - - - - - - - - - - - - this.completor = Aux.completion.completor(this) - - - this.completor.suggest() - - - if IsShiftKeyDown() then - this.completor.previous() - else - this.completor.next() - end - - - this.completor.close() - this:ClearFocus() - Aux.buy.SearchButton_onclick() - - - if this.completor.open() then - this.completor.close() - else - this:ClearFocus() - end - - - - - - - - - - - - - - - - - - - - - - - - - - - - UIDropDownMenu_SetWidth(140) - UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) - - - UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) - - - - - - - - - UIDropDownMenu_SetWidth(140) - UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) - - - UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this:ClearFocus() - - - - - - - - - - - this:ClearFocus() - - - - - - - - - - - - - - - - - - - - - - - - - - - - AuxBuyTooltipButton_OnClick(this) - - - - - - - - UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize) - - - - - - - - - - - - - - - - - - - - - this:EnableMouse(false) - this:SetAlpha(0.5) - - - this:ClearFocus() - - - - - - - - - - - - - - - - AuxBuyPageEditBox:EnableMouse(not this:GetChecked()) - AuxBuyPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1) - AuxBuyPageEditBox:ClearFocus() - - - - + + + + + + + + + + + + + + + + + + getglobal(this:GetName()..'Label'):SetText('Name') + this.completor = Aux.completion.completor(this) + + + this.completor.suggest() + + + if IsShiftKeyDown() then + this.completor.previous() + else + this.completor.next() + end + + + this.completor.close() + this:ClearFocus() + Aux.buy.SearchButton_onclick() + + + if this.completor.open() then + this.completor.close() + else + this:ClearFocus() + end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UIDropDownMenu_SetWidth(140) + UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) + + + UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) + + + + + + + + + UIDropDownMenu_SetWidth(140) + UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) + + + UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this:ClearFocus() + + + + + + + + + + + this:ClearFocus() + + + + + + + + + + + + + + + + + + + + getglobal(this:GetName()..'Label'):SetText('Tooltip') + this:SetWidth(110) + + + AuxBuyTooltipButton_OnClick(this) + + + + + + + + UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize) + + + + + + + + + + + + + + + + + + + + + this:EnableMouse(false) + this:SetAlpha(0.5) + + + this:ClearFocus() + + + + + + + + + + + + + + + + AuxBuyPageEditBox:EnableMouse(not this:GetChecked()) + AuxBuyPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1) + AuxBuyPageEditBox:ClearFocus() + + + + @@ -597,6 +566,7 @@ this:SetBackdropBorderColor(0.4, 0.4, 0.4) + this:SetBackdropColor(0.15, 0.15, 0.15) getglobal(this:GetName().."Title"):SetText('Search Results') @@ -647,7 +617,7 @@ - + @@ -703,17 +673,17 @@ - + - + - + SmallMoneyFrame_OnLoad() @@ -730,7 +700,7 @@ - - + + + diff --git a/core.xml b/core.xml index d21c3cd..58bc26e 100644 --- a/core.xml +++ b/core.xml @@ -30,26 +30,38 @@ - + - - - - - - + + + + + + this:SetBackdropBorderColor(0.4, 0.4, 0.4) - + this:SetBackdropColor(0.15, 0.15, 0.15) - + + + + + + + + + + + + + diff --git a/info.lua b/info.lua index 93505e1..34b24a9 100644 --- a/info.lua +++ b/info.lua @@ -159,6 +159,11 @@ function item_id(hyperlink) return tonumber(id_string) end +function parse_hyperlink(hyperlink) + local _, _, item_id, enchant_id, suffix_id, unique_id, name = strfind(hyperlink, '|Hitem:(%d+):(%d+):(%d+):(%d+)|h[[]([^]]+)[]]|h') + return tonumber(item_id) or 0, tonumber(suffix_id) or 0, tonumber(enchant_id) or 0, tonumber(unique_id) or 0, name +end + function hyperlink_item(hyperlink) local name, itemstring, quality, level, type, subtype, max_stack = GetItemInfo(item_id(hyperlink)) return { From 569d2ca8c4fdeb2222fceb3787f527464f000d97 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 25 Oct 2015 01:58:26 +0200 Subject: [PATCH 5/6] almost completed new UI --- .idea/workspace.xml | 166 +++++++++++---------- buy.lua | 62 ++++---- buy.xml | 65 +++------ core.lua | 348 ++++---------------------------------------- core.xml | 65 ++++++++- scan.lua | 24 +-- sell.lua | 250 ++++++++++++------------------- sell.xml | 155 ++++++++++---------- util.lua | 22 +++ 9 files changed, 434 insertions(+), 723 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0455aca..c16ea50 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,10 +6,7 @@ - - - - + @@ -76,21 +73,11 @@ - - - - - - - - - - - - + + @@ -109,8 +96,18 @@ - - + + + + + + + + + + + + @@ -120,7 +117,7 @@ - + @@ -129,28 +126,8 @@ - - - - - - - - - - - - - - - - - - - - - - + + @@ -159,8 +136,8 @@ - - + + @@ -169,8 +146,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + @@ -191,12 +188,13 @@ @@ -432,6 +430,7 @@ + @@ -447,7 +446,6 @@ - @@ -480,22 +478,6 @@ - - - - - - - - - - - - - - - - @@ -512,18 +494,18 @@ - + - - + + - + - - + + @@ -531,39 +513,63 @@ - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + diff --git a/buy.lua b/buy.lua index f50c7c4..232d83b 100644 --- a/buy.lua +++ b/buy.lua @@ -2,7 +2,6 @@ Aux.buy = {} local create_auction_record, show_dialog, find_auction, hide_sheet, update_sheet, auction_alpha_setter, group_alpha_setter local auctions -local selectedAuctions = {} local search_query local tooltip_patterns = {} local current_page @@ -426,8 +425,10 @@ Aux.buy.modes = { }, } -function Aux.buy.exit() - Aux.buy.dialog_cancel() +function Aux.buy.on_close() + if AuxBuyConfirmation:IsVisible() then + Aux.buy.dialog_cancel() + end current_page = nil end @@ -437,14 +438,8 @@ function Aux.buy.on_open() update_sheet() end -function Aux_AuctionFrameBid_Update() - Aux.orig.AuctionFrameBid_Update() - if PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index and AuctionFrame:IsShown() then - Aux_HideElems(Aux.tabs.buy.hiddenElements) - end -end - function Aux.buy.dialog_cancel() + Aux.log('Canceled.') Aux.scan.abort() AuxBuyConfirmation:Hide() update_sheet() @@ -497,7 +492,6 @@ function Aux.buy.SearchButton_onclick() AuxBuyStopButton:Show() auctions = nil - selectedAuctions = {} refresh = true @@ -515,18 +509,16 @@ function Aux.buy.SearchButton_onclick() usable = AuxBuyUsableCheckButton:GetChecked() } - Aux.log('Starting scan') + Aux.log('Scanning auctions ...') Aux.scan.start{ query = search_query, page = AuxBuyAllPagesCheckButton:GetChecked() and 0 or AuxBuyPageEditBox:GetNumber(), on_submit_query = function() current_page = nil end, - on_page_loaded = function(page) - current_page = page - end, - on_start_page = function(page, total_pages) - Aux.log('Scanning page ' .. page + 1 .. (total_pages > 0 and ' out of ' .. total_pages or '')) + on_page_loaded = function(page, total_pages) + Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...') + current_page = page end, on_read_auction = function(i) local auction_item = Aux.info.auction_item(i) @@ -539,14 +531,15 @@ function Aux.buy.SearchButton_onclick() end, on_complete = function() auctions = auctions or {} - Aux.log('Scan completed: '..getn(auctions)..' auctions found') - AuxBuyStopButton:Hide() + Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.') + + AuxBuyStopButton:Hide() AuxBuySearchButton:Show() refresh = true end, on_abort = function() auctions = auctions or {} - Aux.log('Scan aborted: '..getn(auctions)..' auctions found') + Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.') AuxBuyStopButton:Hide() AuxBuySearchButton:Show() refresh = true @@ -604,16 +597,16 @@ function find_auction(entry, buyout_mode, express_mode) return end - Aux.log('Processing '..(buyout_mode and 'buyout' or 'bid')..' request') + local amount + if buyout_mode then + amount = entry.buyout_price + else + amount = entry.bid + end + + Aux.log('Processing '..(buyout_mode and 'buyout' or 'bid')..' request for '..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..' ...') AuxBuySearchButton:Disable() - local amount - if buyout_mode then - amount = entry.buyout_price - else - amount = entry.bid - end - if not express_mode then show_dialog(buyout_mode, entry, amount) end @@ -646,23 +639,23 @@ function find_auction(entry, buyout_mode, express_mode) if entry.signature == signature then ctrl.suspend() found = true - Aux.log('Matching auction found') + Aux.log('Matching auction found.'..(express_mode and '' or ' Awaiting confirmation ...')) if express_mode then if GetMoney() >= amount then PlaceAuctionBid("list", i, amount) - Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size) + Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..'.') entry.gone = true refresh = true else - Aux.log('Not enough money.') + Aux.log((buyout_mode and 'Purchase' or 'Bid')..' failed: Not enough money.') end Aux.scan.abort() else Aux.buy.dialog_action = function() if GetMoney() >= amount then PlaceAuctionBid("list", i, amount) - Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size) + Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..'.') entry.gone = true refresh = true else @@ -679,6 +672,7 @@ function find_auction(entry, buyout_mode, express_mode) end, on_complete = function() if not found then + Aux.log('No matching auction found. Removing entry from the cache.') entry.gone = true refresh = true Aux.buy.dialog_cancel() @@ -724,7 +718,7 @@ function create_auction_record(auction_item, current_page) elseif auction_item.high_bidder then status = GREEN_FONT_COLOR_CODE..'Your Bid'..FONT_COLOR_CODE_CLOSE else - status = RED_FONT_COLOR_CODE .. 'Other Bidder'..FONT_COLOR_CODE_CLOSE + status = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE end return { @@ -832,7 +826,7 @@ function AuxBuyQualityDropDown_Initialize() end UIDropDownMenu_AddButton{ - text = ALL, + text = 'All', value = -1, func = on_click, } diff --git a/buy.xml b/buy.xml index f67e820..aef604e 100644 --- a/buy.xml +++ b/buy.xml @@ -117,7 +117,7 @@ - + @@ -176,10 +176,9 @@ - - + - + @@ -187,24 +186,25 @@ - - - - - + + getglobal(this:GetName()..'Label'):SetText('Level Range') + this:SetWidth(30) + this:ClearFocus() - - + + + this:SetWidth(30) + this:ClearFocus() @@ -215,7 +215,7 @@ - + @@ -278,20 +278,12 @@ - - - - - - - - - - - - + + + getglobal(this:GetName()..'Label'):SetText('Page') + this:SetWidth(30) this:EnableMouse(false) this:SetAlpha(0.5) @@ -305,7 +297,7 @@ - + @@ -368,12 +360,13 @@ - + + @@ -461,7 +454,7 @@ + + + + + + + + + + + + + + + + + + + + SendMailRadioButton_OnClick(this:GetID()); + + + + + + + + + + + + + @@ -126,7 +159,6 @@ - @@ -138,7 +170,7 @@ - + @@ -156,7 +188,7 @@ - + @@ -170,9 +202,22 @@ + + - + @@ -201,7 +246,7 @@ - +