Skip to content

Commit

Permalink
chore: update emmylua
Browse files Browse the repository at this point in the history
  • Loading branch information
DengSir committed Jan 1, 2022
1 parent 58c0178 commit 8b71232
Show file tree
Hide file tree
Showing 18 changed files with 175 additions and 72 deletions.
141 changes: 141 additions & 0 deletions .emmy/UI/Template.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---@class __tdAuctionFeaturesFrameTemplate_FullScanButton : UIPanelButtonTemplate , Button

---@class __tdAuctionFeaturesFrameTemplate_OptionButton : UIPanelButtonTemplate , Button

---@class tdAuctionFeaturesFrameTemplate : Frame
---@field FullScanButton __tdAuctionFeaturesFrameTemplate_FullScanButton
---@field OptionButton __tdAuctionFeaturesFrameTemplate_OptionButton
local tdAuctionFeaturesFrameTemplate = {}

---@class __tdAuctionFullScanFrameTemplate_CloseButton : UIPanelCloseButton , Button

---@class __tdAuctionFullScanFrameTemplate_ExecButton : UIPanelButtonTemplate , Button

---@class __tdAuctionFullScanFrameTemplate_ProgressBar : StatusBar
---@field Text FontString
local __tdAuctionFullScanFrameTemplate_ProgressBar = {}

---@class tdAuctionFullScanFrameTemplate : BackdropTemplate , Frame
---@field Header Texture
---@field HeaderText FontString
---@field Text FontString
---@field Blocker Frame
---@field CloseButton __tdAuctionFullScanFrameTemplate_CloseButton
---@field ExecButton __tdAuctionFullScanFrameTemplate_ExecButton
---@field ProgressBar __tdAuctionFullScanFrameTemplate_ProgressBar
local tdAuctionFullScanFrameTemplate = {}

---@class tdAuctionItemTextTemplate : Frame
local tdAuctionItemTextTemplate = {}

---@class tdAuctionItemTextLeftTemplate : tdAuctionItemTextTemplate , Frame
---@field Text FontString
local tdAuctionItemTextLeftTemplate = {}

---@class tdAuctionItemTextLeftElideTemplate : tdAuctionItemTextTemplate , Frame
---@field Text FontString
local tdAuctionItemTextLeftElideTemplate = {}

---@class tdAuctionItemTextCenterTemplate : tdAuctionItemTextTemplate , Frame
---@field Text FontString
local tdAuctionItemTextCenterTemplate = {}

---@class tdAuctionItemTextCenterElideTemplate : tdAuctionItemTextTemplate , Frame
---@field Text FontString
local tdAuctionItemTextCenterElideTemplate = {}

---@class tdAuctionItemTextRightTemplate : tdAuctionItemTextTemplate , Frame
---@field Text FontString
local tdAuctionItemTextRightTemplate = {}

---@class tdAuctionBrowseItemTemplate : Button
---@field Icon Texture
---@field Selected Texture
---@field Highlight Texture
---@field Bg Texture
---@field Enter Button
local tdAuctionBrowseItemTemplate = {}

---@class tdAuctionSortButtonTemplate : Button
---@field BgLeft Texture
---@field BgRight Texture
---@field Text FontString
---@field Arrow Texture
local tdAuctionSortButtonTemplate = {}

---@class __tdAuctionBrowseBuyFrameTemplate_ResetButton : UIPanelButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_ScrollFrame_scrollBar : HybridScrollBarTemplate , Slider

---@class __tdAuctionBrowseBuyFrameTemplate_ScrollFrame : HybridScrollFrameTemplate , ScrollFrame
---@field scrollBar __tdAuctionBrowseBuyFrameTemplate_ScrollFrame_scrollBar
local __tdAuctionBrowseBuyFrameTemplate_ScrollFrame = {}

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_UnitPrice : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Buyout : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Bid : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Seller : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Time : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Level : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Name : tdAuctionSortButtonTemplate , Button

---@class __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame : Frame
---@field UnitPrice __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_UnitPrice
---@field Buyout __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Buyout
---@field Bid __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Bid
---@field Seller __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Seller
---@field Time __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Time
---@field Level __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Level
---@field Name __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame_Name
local __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame = {}

---@class tdAuctionBrowseBuyFrameTemplate : Frame
---@field NoResultsText FontString
---@field ResetButton __tdAuctionBrowseBuyFrameTemplate_ResetButton
---@field ScrollFrame __tdAuctionBrowseBuyFrameTemplate_ScrollFrame
---@field SortButtonFrame __tdAuctionBrowseBuyFrameTemplate_SortButtonFrame
---@field ColumnOption Button
local tdAuctionBrowseBuyFrameTemplate = {}

---@class tdAuctionSellDurationDropDown : UIDropDownMenuTemplate , Frame

---@class __tdAuctionSellFrameTemplate_PriceReading_AnimFrame : Frame
---@field Anim AnimationGroup
local __tdAuctionSellFrameTemplate_PriceReading_AnimFrame = {}

---@class __tdAuctionSellFrameTemplate_PriceReading : Frame
---@field AnimFrame __tdAuctionSellFrameTemplate_PriceReading_AnimFrame
local __tdAuctionSellFrameTemplate_PriceReading = {}

---@class __tdAuctionSellFrameTemplate_PriceList_ScrollFrame_scrollBar : HybridScrollBarTemplate , Slider

---@class __tdAuctionSellFrameTemplate_PriceList_ScrollFrame : HybridScrollFrameTemplate , ScrollFrame
---@field scrollBar __tdAuctionSellFrameTemplate_PriceList_ScrollFrame_scrollBar
local __tdAuctionSellFrameTemplate_PriceList_ScrollFrame = {}

---@class __tdAuctionSellFrameTemplate_PriceList : BackdropTemplate , Frame
---@field CountLabel FontString
---@field PriceLabel FontString
---@field Close Button
---@field ScrollFrame __tdAuctionSellFrameTemplate_PriceList_ScrollFrame
local __tdAuctionSellFrameTemplate_PriceList = {}

---@class tdAuctionSellFrameTemplate : Frame
---@field PriceSetText FontString
---@field DurationDropDown tdAuctionSellDurationDropDown
---@field PriceListButton Button
---@field BuyoutError Frame
---@field PriceReading __tdAuctionSellFrameTemplate_PriceReading
---@field PriceList __tdAuctionSellFrameTemplate_PriceList
local tdAuctionSellFrameTemplate = {}

---@class tdAuctionPriceItemTemplate : Button
---@field Count FontString
---@field Price FontString
local tdAuctionPriceItemTemplate = {}
60 changes: 0 additions & 60 deletions .index.lua

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Lua.diagnostics.disable": [
"undefined-global",
"redundant-parameter"
]
}
2 changes: 1 addition & 1 deletion API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- @Link : https://dengsir.github.io
-- @Date : 9/18/2020, 2:24:41 PM
--
---@type ns
---@class ns
local ns = select(2, ...)

local Hider
Expand Down
13 changes: 11 additions & 2 deletions Addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
-- @Link : https://dengsir.github.io
-- @Date : 9/16/2020, 6:21:49 PM
--
---@type ns
---@class ns
-- class
---@field Pending Pending
---@field Scaner Scaner
---@field BrowseScaner BrowseScaner
---@field FullScaner FullScaner
---@field PriceScaner PriceScaner
-- module
---@field Querier Querier
local ns = select(2, ...)

---@type Addon
---@class Addon: AceAddon-3.0, LibClass-2.0, AceEvent-3.0
local Addon = LibStub('AceAddon-3.0'):NewAddon('tdAuction', 'LibClass-2.0', 'AceEvent-3.0')

local L = LibStub('AceLocale-3.0'):GetLocale('tdAuction')
Expand Down Expand Up @@ -195,6 +203,7 @@ function Addon:SetupUI()
self.FullScan = ns.UI.FullScan:Bind(CreateFrame('Frame', nil, AuctionFrame, 'tdAuctionFullScanFrameTemplate'))
self.Browse = ns.UI.Browse:Bind(AuctionFrameBrowse)
self.Sell = ns.UI.Sell:Bind(AuctionFrameAuctions)
---@type tdAuctionFeaturesFrameTemplate
self.Features = CreateFrame('Frame', nil, AuctionFrame, 'tdAuctionFeaturesFrameTemplate')

self.Features.FullScanButton:SetText(L['Full scan'])
Expand Down
2 changes: 1 addition & 1 deletion Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- @Link : https://dengsir.github.io
-- @Date : 9/23/2020, 1:01:44 PM
--
---@type ns
---@class ns
local ns = select(2, ...)

ns.DISENCHANT_KEYS = {
Expand Down
2 changes: 1 addition & 1 deletion Query/BrowseScaner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local min = math.min
local L = ns.L
local Scaner = ns.Scaner

---@type BrowseScaner
---@class BrowseScaner: Scaner
local BrowseScaner = ns.Addon:NewClass('BrowseScaner', ns.Scaner)

function BrowseScaner:Query(params)
Expand Down
2 changes: 1 addition & 1 deletion Query/FullScaner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local tinsert, tconcat = table.insert, table.concat

local GetItemQualityColor = GetItemQualityColor

---@type FullScaner
---@class FullScaner: Scaner
local FullScaner = ns.Addon:NewClass('FullScaner', Scaner)

function FullScaner:Constructor()
Expand Down
1 change: 1 addition & 0 deletions Query/Pending.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
---@type ns
local ns = select(2, ...)

---@class Pending: Object
local Pending = ns.Addon:NewClass('Pending')

function Pending:Constructor()
Expand Down
2 changes: 1 addition & 1 deletion Query/PriceScaner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local SortAuctionSetSort = SortAuctionSetSort

local Scaner = ns.Scaner

---@type PriceScaner
---@class PriceScaner: Scaner
local PriceScaner = ns.Addon:NewClass('PriceScaner', Scaner)

function PriceScaner:Query(params)
Expand Down
2 changes: 1 addition & 1 deletion Query/Querier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local STATUS_PENDING = 1
local STATUS_WAITRESP = 2
local STATUS_RUNNING = 3

---@type Querier
---@class Querier: AceAddon-3.0, AceEvent-3.0
local Querier = ns.Addon:NewModule('Querier', 'AceEvent-3.0')

function Querier:OnInitialize()
Expand Down
2 changes: 1 addition & 1 deletion Query/Scaner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ do
end
end

---@type Scaner
---@class Scaner: Object
local Scaner = ns.Addon:NewClass('Scaner')

function Scaner:Query(params)
Expand Down
2 changes: 2 additions & 0 deletions UI/Browse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function Browse:Constructor()
end

function Browse:LayoutBlizzard()
---@type tdAuctionBrowseBuyFrameTemplate
self.BuyFrame = CreateFrame('Frame', nil, self, 'tdAuctionBrowseBuyFrameTemplate')
self.Name = BrowseName
self.SearchButton = BrowseSearchButton
Expand All @@ -48,6 +49,7 @@ function Browse:LayoutBlizzard()
self.ResetButton = self.BuyFrame.ResetButton
self.SortButtonFrame = self.BuyFrame.SortButtonFrame

---@type UICheckButtonTemplate
self.ExactCheckButton = CreateFrame('CheckButton', nil, self, 'UICheckButtonTemplate')
self.ExactCheckButton:SetSize(24, 24)
self.ExactCheckButton:SetPoint('TOPLEFT', self.Name, 'BOTTOMLEFT', -10, -1)
Expand Down
2 changes: 1 addition & 1 deletion UI/ComboBox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
---@type ns
local ns = select(2, ...)

---@type ComboBox
---@class UI.ComboBox: UIDropDownMenuTemplate
local ComboBox = ns.Addon:NewClass('UI.ComboBox', 'Frame')

local function ButtonOnClick(self)
Expand Down
2 changes: 1 addition & 1 deletion UI/FullScan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ local STATUS_QUERY = 2
local STATUS_SCAN = 3
local STATUS_DONE = 4

---@type FullScan
---@class UI.FullScan: Frame, tdAuctionFullScanFrameTemplate
local FullScan = ns.Addon:NewClass('UI.FullScan', 'Frame')

function FullScan:Constructor()
Expand Down
1 change: 1 addition & 0 deletions UI/Option.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local ns = select(2, ...)

local L = ns.L

---@class Addon
local Addon = ns.Addon

local AceConfigRegistry = LibStub('AceConfigRegistry-3.0')
Expand Down
1 change: 1 addition & 0 deletions UI/Sell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function Sell:LayoutBlizzard()
t:SetTexture([[Interface\AuctionFrame\UI-AuctionFrame-ItemSlot]])
t:SetTexCoord(0.15625, 0.83203125, 0.171875, 0.796875)

---@type tdAuctionSellFrameTemplate
self.SellFrame = CreateFrame('Frame', nil, self, 'tdAuctionSellFrameTemplate')
self.StartPrice = StartPrice
self.BuyoutPrice = BuyoutPrice
Expand Down
4 changes: 3 additions & 1 deletion UI/SellOutput.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ local GetMoneyString = GetMoneyString

local ERR_AUCTION_STARTED = ERR_AUCTION_STARTED

---@type SellOutput
---@class SellOutput: AceAddon-3.0, AceEvent-3.0, AceHook-3.0
local SellOutput = ns.Addon:NewModule('SellOutput', 'AceEvent-3.0', 'AceHook-3.0')

function SellOutput:OnInitialize()
Expand All @@ -35,6 +35,7 @@ function SellOutput:OnPostAuction(_, price, _, stackSize, numStacks)
self.stackSize = stackSize
self.numStacks = numStacks
self.price = price
self.failure = nil
end

function SellOutput:CHAT_MSG_SYSTEM(_, msg)
Expand Down Expand Up @@ -65,4 +66,5 @@ function SellOutput:Done()
self.stackSize = nil
self.numStacks = nil
self.price = nil
self.failure = nil
end

0 comments on commit 8b71232

Please sign in to comment.