-- <*
|
|
-- @Author: Saber
|
|
-- @Description: 社团boss 掉落和roll点奖励展示界面
|
|
-- *>
|
|
GuildBossRollPreviewView = GuildBossRollPreviewView or BaseClass(BaseView)
|
|
local GuildBossRollPreviewView = GuildBossRollPreviewView
|
|
|
|
function GuildBossRollPreviewView:__init()
|
|
self.base_file = "guildScene"
|
|
self.layout_file = "GuildBossRollPreviewView"
|
|
self.layer_name = "Activity"
|
|
self.destroy_imm = true
|
|
self.use_background = true --全屏界面默认使用这个参数,非全屏界面自行设置
|
|
self.change_scene_close = true --是否切换场景时关闭(弹出界面使用)
|
|
self:AddPreLoadList("guildScene", {"GuildBossRollPreviewItem"})
|
|
self.model = GuildModel:getInstance()
|
|
self.item_list = {}
|
|
|
|
self.load_callback = function ()
|
|
self:LoadSuccess()
|
|
self:AddEvent()
|
|
end
|
|
self.open_callback = function ( )
|
|
self:UpdateView()
|
|
end
|
|
self.destroy_callback = function ( )
|
|
self:DestroySuccess()
|
|
end
|
|
end
|
|
|
|
function GuildBossRollPreviewView:Open( )
|
|
BaseView.Open(self)
|
|
end
|
|
|
|
function GuildBossRollPreviewView:LoadSuccess()
|
|
local nodes = {
|
|
"bg:raw",
|
|
"close_btn:obj",
|
|
"ques_icon",
|
|
"item_scroll", "item_scroll/Viewport/item_con",
|
|
"tips:tmp",
|
|
}
|
|
self:GetChildren(nodes)
|
|
lua_resM:setOutsideRawImage(self, self.bg_raw, GameResPath.GetViewBigBg("guild_boss_reward_pv_bg"))
|
|
end
|
|
|
|
function GuildBossRollPreviewView:AddEvent()
|
|
local function click_event(target)
|
|
if target == self.close_btn_obj then
|
|
self:Close()
|
|
end
|
|
end
|
|
AddClickEvent(self.close_btn_obj, click_event)
|
|
end
|
|
|
|
function GuildBossRollPreviewView:UpdateView()
|
|
local item_data_list = {}
|
|
item_data_list[#item_data_list+1] = {title = "社团幻魔 掷骰奖励"}
|
|
local show_roll_reward = stringtotable(Config.Guildbosskv["show_roll_reward"].value)
|
|
item_data_list[#item_data_list+1] = {reward = show_roll_reward}
|
|
item_data_list[#item_data_list+1] = {title = "社团幻魔 掉落奖励"}
|
|
local show_boss_reward = stringtotable(Config.Guildbosskv["show_boss_reward"].value)
|
|
item_data_list[#item_data_list+1] = {reward = show_boss_reward}
|
|
|
|
local height = 0
|
|
local item = nil
|
|
for k, v in ipairs(item_data_list) do
|
|
item = self.item_list[k]
|
|
if not item then
|
|
item = GuildBossRollPreviewItem.New(self.item_con)
|
|
self.item_list[k] = item
|
|
end
|
|
item:SetAnchoredPosition(0, -height)
|
|
height = height + item:SetData(v)
|
|
end
|
|
SetSizeDeltaY(self.item_con, height + 10)
|
|
-- 对齐提示节点
|
|
self.tips_tmp.text = "社团参与活动人数越多,奖励发放越多"
|
|
local offset_x = (511 - 27 - 4 - self.tips_tmp.preferredWidth) * 0.5
|
|
SetAnchoredPositionX(self.ques_icon, -261 + offset_x)
|
|
SetAnchoredPositionX(self.tips, -261 + offset_x + 27 + 4)
|
|
end
|
|
|
|
function GuildBossRollPreviewView:DestroySuccess( )
|
|
for k, v in ipairs(self.item_list) do
|
|
v:DeleteMe()
|
|
end
|
|
self.item_list = nil
|
|
end
|