added back localization
This commit is contained in:
+5
-4
@@ -34,10 +34,11 @@ function generate_suggestions(input)
|
||||
end
|
||||
|
||||
local best = {}
|
||||
for _, item in pairs(Aux.static.auctionable_items) do
|
||||
local rating = matcher(item.name)
|
||||
for _, id in ipairs(Aux.static.item_ids()) do
|
||||
local item_info = Aux.static.item_info(id)
|
||||
local rating = matcher(item_info.name)
|
||||
if rating then
|
||||
local candidate = { name=item.name, id=item.id, rating=rating }
|
||||
local candidate = { name=item_info.name, id=item_info.id, rating=rating }
|
||||
if getn(best) < NUM_MATCHES then
|
||||
tinsert(best, candidate)
|
||||
fuzzy_sort(best)
|
||||
@@ -48,7 +49,7 @@ function generate_suggestions(input)
|
||||
end
|
||||
end
|
||||
|
||||
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux_QualityColor(Aux.static.auctionable_items[match.id].quality)..'['..match.name..']'..'|r', value=match.id } end)
|
||||
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux_QualityColor(Aux.static.item_info(match.id).quality)..'['..match.name..']'..'|r', value=match.id } end)
|
||||
end
|
||||
|
||||
function public.completor(edit_box)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
AuxVersion = '2.2.3'
|
||||
AuxVersion = '2.2.4'
|
||||
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
||||
|
||||
local lastRightClickAction = GetTime()
|
||||
|
||||
@@ -63,7 +63,7 @@ public.recently_searched_config = {
|
||||
cell.icon = icon
|
||||
end,
|
||||
cell_setter = function(cell, datum)
|
||||
local item_info = Aux.static.auctionable_items[datum.item_id]
|
||||
local item_info = Aux.static.item_info(datum.item_id)
|
||||
cell.icon.icon_texture:SetTexture(item_info.texture)
|
||||
cell.text:SetText('['..item_info.name..']')
|
||||
local color = ITEM_QUALITY_COLORS[item_info.quality]
|
||||
@@ -477,7 +477,7 @@ function private.update_recently_searched()
|
||||
end
|
||||
|
||||
function public.set_item(item_id)
|
||||
if item_id ~= private.item_id and Aux.static.auctionable_items[item_id] then
|
||||
if item_id ~= private.item_id and Aux.static.item_info(item_id) then
|
||||
AuxItemSearchFrameItemRefreshButton:Enable()
|
||||
private.item_id = item_id
|
||||
public.update_item()
|
||||
@@ -504,7 +504,7 @@ end
|
||||
|
||||
function public.update_item()
|
||||
if private.item_id and not AuxItemSearchFrameItemItemInputBox:IsVisible() then
|
||||
local info = Aux.static.auctionable_items[private.item_id]
|
||||
local info = Aux.static.item_info(private.item_id)
|
||||
AuxItemSearchFrameItemItemIconTexture:SetTexture(info.texture)
|
||||
AuxItemSearchFrameItemItemName:SetText(info.name)
|
||||
local color = ITEM_QUALITY_COLORS[info.quality]
|
||||
@@ -527,7 +527,7 @@ function public.start_search()
|
||||
refresh = true
|
||||
|
||||
local item_id = private.item_id
|
||||
local item_info = Aux.static.auctionable_items[item_id]
|
||||
local item_info = Aux.static.item_info(item_id)
|
||||
|
||||
-- local class_index = Aux.item_class_index(item_info.class)
|
||||
-- local subclass_index = class_index and Aux.item_subclass_index(class_index, item_info.subclass)
|
||||
@@ -562,7 +562,7 @@ function public.start_search()
|
||||
end,
|
||||
on_complete = function()
|
||||
auctions = auctions or {}
|
||||
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..'|c'..Aux_QualityColor(Aux.static.auctionable_items[item_info.id].quality)..'['..item_info.name..']'..'|r'..' found.')
|
||||
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..'|c'..Aux_QualityColor(Aux.static.item_info(item_info.id).quality)..'['..item_info.name..']'..'|r'..' found.')
|
||||
|
||||
AuxItemSearchFrameItemStopButton:Hide()
|
||||
AuxItemSearchFrameItemRefreshButton:Show()
|
||||
@@ -570,7 +570,7 @@ function public.start_search()
|
||||
end,
|
||||
on_abort = function()
|
||||
auctions = auctions or {}
|
||||
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..'|c'..Aux_QualityColor(Aux.static.auctionable_items[item_info.id].quality)..'['..item_info.name..']'..'|r'..' found.')
|
||||
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..'|c'..Aux_QualityColor(Aux.static.item_info(item_info.id).quality)..'['..item_info.name..']'..'|r'..' found.')
|
||||
AuxItemSearchFrameItemStopButton:Hide()
|
||||
AuxItemSearchFrameItemRefreshButton:Show()
|
||||
refresh = true
|
||||
|
||||
@@ -12,5 +12,10 @@ function SlashCmdList.AUX(parameter)
|
||||
aux_database = {}
|
||||
Aux.persistence.load_dataset().snapshot = {}
|
||||
Aux.log('Snapshot and database cleared.')
|
||||
elseif parameter == 'generate item cache' then
|
||||
Aux.static.generate_cache()
|
||||
elseif parameter == 'delete item cache' then
|
||||
aux_auctionable_items = nil
|
||||
Aux.log('Item cache deleted; falling back to the default.')
|
||||
end
|
||||
end
|
||||
+19
-5
@@ -1,12 +1,26 @@
|
||||
local private, public = {}, {}
|
||||
Aux.static = public
|
||||
|
||||
aux_auctionable_items = {}
|
||||
aux_auctionable_items = nil
|
||||
|
||||
function public.on_event()
|
||||
-- if event == 'VARIABLES_LOADED' then
|
||||
-- public.generate_cache()
|
||||
-- end
|
||||
function public.item_ids()
|
||||
local ids = {}
|
||||
|
||||
local cache = aux_auctionable_items or public.auctionable_items
|
||||
|
||||
for id, _ in pairs(cache) do
|
||||
tinsert(ids, id)
|
||||
end
|
||||
|
||||
return ids
|
||||
end
|
||||
|
||||
function public.item_info(item_id)
|
||||
if aux_auctionable_items and aux_auctionable_items[item_id] then
|
||||
return aux_auctionable_items[item_id]
|
||||
else
|
||||
return public.auctionable_items[item_id]
|
||||
end
|
||||
end
|
||||
|
||||
function public.generate_cache()
|
||||
|
||||
+1
-11
@@ -1,16 +1,6 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
|
||||
<Script file="static.lua"/>
|
||||
|
||||
<Frame>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:RegisterEvent('VARIABLES_LOADED')
|
||||
</OnLoad>
|
||||
<OnEvent>
|
||||
Aux.static.on_event()
|
||||
</OnEvent>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<GameTooltip name="AuxStaticTooltip" inherits="GameTooltipTemplate"/>
|
||||
</Ui>
|
||||
|
||||
Reference in New Issue
Block a user