feat(kæde): fanen Kæder og forslag i Kræver handling
This commit is contained in:
@@ -62,6 +62,8 @@ end
|
||||
|
||||
-- entry fra ADStorageStats.attentionList -> advice ("open"|"flow"|"produce"|"none"), info
|
||||
function SmartPickupFrame:attentionAdvice(entry)
|
||||
-- kæde-forslag har ingen vare (stat): klik fører til fanen Kæder
|
||||
if entry ~= nil and entry.kind == "chainSuggest" then return "chain", nil end
|
||||
if entry ~= nil and entry.kind == "sell" and entry.stat ~= nil then return sellAdviceFor(entry.stat) end
|
||||
if entry == nil or entry.kind ~= "empty" or entry.stat == nil then return "none", nil end
|
||||
local stat = entry.stat
|
||||
@@ -83,6 +85,7 @@ function SmartPickupFrame:attentionAdvice(entry)
|
||||
end
|
||||
|
||||
function SmartPickupFrame:attentionHint(advice, info)
|
||||
if advice == "chain" then return self.i18n:getText("spu_attention_hintChain") end
|
||||
if advice == "open" then return string.format(self.i18n:getText("spu_attention_hintOpen"), tostring(info.run.name)) end
|
||||
if advice == "flow" then return self.i18n:getText(info.sell and "spu_attention_hintSellFlow" or "spu_attention_hintFlow") end
|
||||
if advice == "produce" then return self.i18n:getText("spu_attention_hintProduce") end
|
||||
@@ -91,6 +94,10 @@ end
|
||||
|
||||
function SmartPickupFrame:onAttentionClick(entry)
|
||||
self:safe(function(frame)
|
||||
if entry ~= nil and entry.kind == "chainSuggest" then
|
||||
frame:switchTab(SmartPickupFrame.TAB_CHAINS)
|
||||
return
|
||||
end
|
||||
local adEnv = frame.getAdEnv()
|
||||
local advice, info = frame:attentionAdvice(entry)
|
||||
if adEnv == nil or advice == "none" then return end
|
||||
|
||||
Reference in New Issue
Block a user