源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

192 lines
5.7 KiB

--社团协助Boss前往界面
GuildSupportGuildBossGoView = GuildSupportGuildBossGoView or BaseClass(BaseView)
local GuildSupportGuildBossGoView = GuildSupportGuildBossGoView
GuildSupportGuildBossGoView.TITLE_1 = "下面是本次虚空副本的怪物信息,请小心!"
GuildSupportGuildBossGoView.TITLE_2 = "一个游走在虚空中的超强怪物"
function GuildSupportGuildBossGoView:__init()
self.base_file = "guild"
self.layout_file = "GuildSupportGuildBossGoView"
self.layer_name = "Activity"
self.destroy_imm = true
self.use_background = true
self.hide_maincancas = false
self.change_scene_close = true
self.append_to_ctl_queue = false --是否要添加进界面堆栈
self.need_show_money = false --是否要显示顶部的金钱栏
self.blur_activity_bg = true
self.mainVo = RoleManager.Instance.mainRoleInfo
self.model = GuildModel:getInstance()
self.item_list = {}
self.load_callback = function ()
self:LoadSuccess()
self:AddEvent()
end
self.open_callback = function ( )
self:OpenSuccess()
end
self.destroy_callback = function ( )
self:DestroySuccess()
end
end
function GuildSupportGuildBossGoView:DestroySuccess()
for k, v in pairs(self.item_list) do
v:DeleteMe()
v = nil
end
self.item_list = {}
if self.roleItem then
self.roleItem:DeleteMe()
self.roleItem = nil
end
end
function GuildSupportGuildBossGoView:LoadSuccess()
local nodes = {
"award_con",
"btnOK:obj",
"my_name:tmp",
"bg:img",
"Window/windowCloseBtn:obj",
"lb_message:tmp",
"lb_boss_message:tmp",
"boss_power:tmp",
"role_con",
"boss_name:tmp",
"my_icon",
"boss_icon:img",
}
self:GetChildren(nodes)
lua_resM:setOutsideImageSprite(self, self.bg_img, GameResPath.GetViewBigBg("guild_support_guild_boss_go_bg"))
if self.need_refreshData then
self:UpdateView( )
end
self.lb_message_tmp.text = ChuanWenManager:getInstance():FormatColorTag2(GuildSupportGuildBossGoView.TITLE_1)
self.lb_boss_message_tmp.text = ChuanWenManager:getInstance():FormatColorTag2(GuildSupportGuildBossGoView.TITLE_2)
end
function GuildSupportGuildBossGoView:AddEvent()
local function onBtnClickHandler(target,x,y)
if target == self.windowCloseBtn_obj then--关闭
self:Close()
elseif target == self.btnOK_obj then--确认
self.model:Fire(GuildModel.REQUEST_CCMD_EVENT,40052,self.data.support_sid)
self:Close()
end
end
AddClickEvent(self.windowCloseBtn_obj,onBtnClickHandler)
AddClickEvent(self.btnOK_obj,onBtnClickHandler)
end
function GuildSupportGuildBossGoView:Open( data )
self.data = data
BaseView.Open(self)
end
function GuildSupportGuildBossGoView:OpenSuccess( )
self:UpdateView()
end
function GuildSupportGuildBossGoView:UpdateView( )
if self.is_loaded then
self.need_refreshData = false
else
self.need_refreshData = true
return
end
if not self.data then return end
if not self.roleItem then
self.roleItem = HeadRoleItem.New(self.my_icon)
self.roleItem:SetItemSize(55,55)
end
--头像
local head_data = {
vo = {
id = self.data.role_data.role_id,
-- server_id = self.data.ser_id,
level = self.data.role_data.level,
career = self.data.role_data.career,
sex = self.data.role_data.sex,
turn = self.data.role_data.turn,
picture_ver = self.data.role_data.picture_ver,
picture = self.data.role_data.picture,
profile_photo_id = self.data.role_data.profile_photo_id,
-- dress_board_id = self.data.dress_list[2] or nil,
empty_head = false, -- 是否是空数据头像
}
}
self.roleItem:SetData(head_data)
self.roleItem:SetCareerIconVisible(false)
self.my_name_tmp.text = self.data.role_data.name
local monster = ConfigItemMgr.Instance:GetMonsterDataItem(self.data.boss_id)
if monster then
self.boss_name_tmp.text = HtmlColorTxt(Trim(monster.name), ColorUtil.PURPLE_DARK)
lua_resM:setOutsideImageSprite(self,self.boss_icon_img,GameResPath.GetBossIcon(Trim(monster.icon)),false)
local aciton_list = {"show"}
local res_data = {
clothe_res_id = monster.icon,
--weapon_res_id = monster.weapon_id,
type = SceneBaseType.Monster,
action_name_list = aciton_list,
layer_name = self.layer_name,
father_node = self,
transform = self.role_con,
rotate = Vector3(0,180,0),
fashion_type = FuncOpenModel.TypeId.Monster,
position = Vector3(0, 110 , -500),
scale = 100,
shadow2_plane_pos = Vector4(0, 10, 0, 1),
-- scale = 100,
ui_model_type = UIModelCommon.ModelType.Model,
}
FuncOpenModel:getInstance():SetModelRes(res_data)
end
self.boss_power_tmp.text = string.format("%s%s", HtmlColorTxt("战力:" , "#f3fcff" ), HtmlColorTxt(self.data.boss_power , "#fdffc2" ))
self:UpdateItemList()
end
function GuildSupportGuildBossGoView:UpdateItemList( )
local cfg = Config.Guildsupport[self.data.role_data.support_cfg_id]
if not cfg then return end
self.cfg = cfg
for k,v in pairs(self.item_list) do
v:SetVisible(false)
end
local item_list = {{0,100003,cfg.reward_reputation}}
if not item_list or TableSize(item_list) == 0 then return end
local offer_x = 0
local offer_y = 0
local x = 0
local y = 0
for i, v in ipairs(item_list) do
local item = self.item_list[i]
if item == nil then
item = UIObjPool:getInstance():PopItem(UIObjPool.UIType.AwardItem,self.award_con)
item:SetItemSize(62,62)
self.item_list[i] = item
end
local goods_Id, lock = GoodsModel:getInstance():GetMappingTypeId(v[1], v[2])
local goodVo = GoodsModel:getInstance():GetGoodsBasicByTypeId(goods_Id)
if goodVo then
item:SetData(goods_Id, v[3] , goodVo.color, 0, lock,true,nil)
else
-- error("没有找到物品信息 "..v.typeId)
end
item:SetVisible(true)
end
end