-- <*
|
|
-- @Author: Saber
|
|
-- @Description: 圣物兑换界面
|
|
-- *>
|
|
PsionicExchangeView = PsionicExchangeView or BaseClass(BaseItem)
|
|
local PsionicExchangeView = PsionicExchangeView
|
|
|
|
function PsionicExchangeView:__init(parent_wnd,prefab_asset,layer_name)
|
|
self.base_file = "psionic"
|
|
self.layout_file = "PsionicExchangeView"
|
|
self.parent_wnd = parent_wnd
|
|
self.layer_name = layer_name
|
|
|
|
-- self.full_screen = true
|
|
-- self.ani_left = -200
|
|
-- self.ani_right = 200
|
|
|
|
self.model = PsionicModel:getInstance()
|
|
self:Load()
|
|
end
|
|
|
|
function PsionicExchangeView:Load_callback()
|
|
local nodes = {
|
|
"left/girl_st:raw",
|
|
"right/item_scroll:scroll", "right/item_scroll/Viewport/item_con",
|
|
}
|
|
self:GetChildren(nodes)
|
|
lua_resM:setOutsideRawImage(self, self.girl_st_raw, GameResPath.GetRoleBg("shop_girl_574_701"), false)
|
|
self:DoOpenAni(PsionicConst.TabId.PExchange)
|
|
self:UpdateView()
|
|
end
|
|
|
|
function PsionicExchangeView:UpdateView( )
|
|
local shop_cfg = self.model:GetExchangeShopCfg()
|
|
self.item_creator = self.item_creator or self:AddUIComponent(UI.ItemListCreator)
|
|
local info = {
|
|
data_list = shop_cfg,
|
|
item_con = self.item_con,
|
|
scroll_view = self.item_scroll,
|
|
item_class = PsionicExchangeItem,
|
|
item_width = 181,
|
|
item_height = 224,
|
|
start_x = 27.5,
|
|
start_y = -5.5,
|
|
space_x = 16,
|
|
space_y = 2,
|
|
create_frequency = 0.01,
|
|
is_scroll_back_on_update = true,
|
|
alignment = UnityEngine.TextAnchor.UpperLeft,
|
|
on_update_item = function(item, i, v)
|
|
item:SetData(v)
|
|
end,
|
|
}
|
|
self.item_creator:UpdateItems(info)
|
|
end
|
|
|
|
function PsionicExchangeView:__delete( )
|
|
|
|
end
|