源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

531 行
23 KiB

  1. -- <*
  2. -- @Author: Saber
  3. -- @Description: 圣物系统抽奖结算界面
  4. -- *>
  5. PsionicDrawResultView = PsionicDrawResultView or BaseClass(BaseView)
  6. local PsionicDrawResultView = PsionicDrawResultView
  7. local PsionicConst = PsionicConst
  8. function PsionicDrawResultView:__init()
  9. self.base_file = "psionic"
  10. self.layout_file = "PsionicDrawResultView"
  11. self.layer_name = "Activity"
  12. self.destroy_imm = true
  13. self.use_background = true --全屏界面默认使用这个参数,非全屏界面自行设置
  14. self.change_scene_close = true --是否切换场景时关闭(弹出界面使用)
  15. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  16. self.is_set_zdepth = true
  17. self.blur_activity_bg = true
  18. self.use_show_anim = true
  19. self.use_hide_anim = true
  20. self.max_num = 10
  21. self.item_list = {}
  22. -- 抽卡消耗缓存
  23. self.cost_cache = {}
  24. self.cost_cache[PsionicConst.DrawPoolType.Normal] = {}
  25. self.cost_cache[PsionicConst.DrawPoolType.Deep] = {}
  26. self.is_animating = false
  27. self.can_close_view = false
  28. self.model = PsionicModel:getInstance()
  29. self.goods_model = GoodsModel:getInstance()
  30. self.load_callback = function ()
  31. self:LoadSuccess()
  32. self:AddEvent()
  33. end
  34. self.open_callback = function ( )
  35. self:UpdateView()
  36. end
  37. self.destroy_callback = function ( )
  38. self:DestroySuccess()
  39. end
  40. end
  41. function PsionicDrawResultView:Open(data)
  42. self.data = data
  43. BaseView.Open(self)
  44. end
  45. -- 重新抽奖后重新加载界面数据
  46. function PsionicDrawResultView:ReOpenView(data)
  47. self.data = data
  48. self:UpdateView()
  49. end
  50. function PsionicDrawResultView:LoadSuccess()
  51. local nodes = {
  52. "click_bg:obj",
  53. "bg:obj:raw",
  54. "title:obj",
  55. "skip_btn:obj",
  56. "box_con",
  57. "light_con:obj",
  58. "award_con",
  59. "btn_con:cg",
  60. "btn_con/draw_one_btn:obj",
  61. "btn_con/draw_ten_btn:obj",
  62. "btn_con/cost_icon1:img",
  63. "btn_con/cost_icon2:img",
  64. "btn_con/cost1:tmp",
  65. "btn_con/cost2:tmp",
  66. "btn_con/draw_tip:tmp",
  67. -- "btn_con/draw_btn:obj",
  68. -- "btn_con/draw_btn/draw_lb:tmp",
  69. -- "btn_con/confirm_btn:obj",
  70. }
  71. self:GetChildren(nodes)
  72. SetAnchoredPositionY(self.light_con, -45)
  73. lua_resM:setOutsideRawImage(self, self.bg_raw, GameResPath.GetViewBigBg("ps_draw_result_bg"), false)
  74. -- 提前预载配置
  75. self.normal_cfg = Config.Nucleonpool[1]
  76. self.deep_cfg = Config.Nucleonpool[2]
  77. -- self:AddUIEffect("ui_jihuoxinxitong01", self.light_con, self.layer_name, nil, 1.2, true,nil,nil, nil, nil,nil)
  78. end
  79. function PsionicDrawResultView:AddEvent()
  80. local function click_event(target)
  81. if target == self.draw_one_btn_obj then
  82. self:OnDrawBtnClick(PsionicConst.DrawNumType.OneDraw)
  83. elseif target == self.draw_ten_btn_obj then
  84. self:OnDrawBtnClick(PsionicConst.DrawNumType.TenDraw)
  85. elseif target == self.click_bg_obj or target == self.bg_obj then -- 关闭遮罩
  86. if self.can_close_view then
  87. self:Close()
  88. end
  89. elseif target == self.skip_btn_obj then -- 跳过动画
  90. self:SkipAllAnim()
  91. end
  92. -- if target == self.confirm_btn_obj then
  93. -- self:Close()
  94. -- elseif target == self.draw_btn_obj then
  95. -- self:OnDrawBtnClick()
  96. -- end
  97. end
  98. AddClickEvent(self.draw_one_btn_obj, click_event)
  99. AddClickEvent(self.draw_ten_btn_obj, click_event)
  100. AddClickEvent(self.click_bg_obj, click_event)
  101. AddClickEvent(self.bg_obj, click_event)
  102. AddClickEvent(self.skip_btn_obj, click_event)
  103. -- AddClickEvent(self.confirm_btn_obj, click_event)
  104. -- AddClickEvent(self.draw_btn_obj, click_event)
  105. local function update_draw_data(pool_type) -- 如果对应池子的数据更新,这边也要同步表现
  106. if self.data and self.data.pool == pool_type then
  107. self:UpdateDrawCostDataByType(self.data.pool)
  108. end
  109. end
  110. self:BindEvent(self.model, PsionicConst.UPDATE_DIG_DATA, update_draw_data)
  111. end
  112. function PsionicDrawResultView:UpdateView()
  113. self.data.col_num = 5--限定5了 不能改
  114. self.delay_time = self.data and self.data.delay_time or self.delay_time
  115. self:UpdateDrawCostDataByType(self.data.pool)
  116. self:UpdateDrawTips()
  117. -- self:UpdateDrawBtn()
  118. self:StartDrawAnim()
  119. -- self:UpdateItemList()
  120. end
  121. -- 新版调整 根据池子类型不同,直接更新对应池子的消耗物品信息,并缓存每种情况所需要的花费
  122. function PsionicDrawResultView:UpdateDrawCostDataByType(pool_type)
  123. local cfg_data = pool_type == PsionicConst.DrawPoolType.Normal and self.normal_cfg or self.deep_cfg
  124. local pool_data = self.model:GetPsionicDigData(pool_type)
  125. -- 当前是否能免费
  126. local can_free = pool_data and pool_data.remain > 0 and pool_data.rtime - TimeUtil:getServerTime() < 0 or false
  127. -- 获取抽奖券数
  128. local single_ticket_num = self.goods_model:GetTypeGoodsNum(cfg_data.one)
  129. local ten_ticket_num = self.goods_model:GetTypeGoodsNum(cfg_data.ten)
  130. local one_cost = stringtotable(cfg_data.cost)[1]
  131. local ten_cost = stringtotable(cfg_data.pay)[1]
  132. -- 单抽券价格
  133. local single_ticket_price = tonumber(one_cost[3])
  134. local single_ticket_price_type = tonumber(one_cost[1])
  135. local one_cost_icon_asset, one_cost_icon_name = WordManager:GetCommonMoneyIcon(single_ticket_price_type)
  136. local ten_cost_icon_asset, ten_cost_icon_name = WordManager:GetCommonMoneyIcon(ten_cost[1])
  137. if pool_type == PsionicConst.DrawPoolType.Normal then -- 普通池子默认展示红钻,有单抽券时显示单抽券
  138. -- 单抽
  139. -- 没有抽奖券的情况
  140. if can_free then
  141. lua_resM:setImageSprite(self, self.cost_icon1_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_1", true)
  142. self.cost1_tmp.text = "免费"
  143. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {free = true} -- 免费,可以直接抽
  144. -- 有抽奖券,则加载为抽奖券的图标
  145. elseif single_ticket_num > 0 then
  146. lua_resM:setImageSprite(self, self.cost_icon1_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_1", true)
  147. self.cost1_tmp.text = string.format("<color=%s>%s</color>/1",
  148. single_ticket_num > 0 and ColorUtil.GREEN_DARK or ColorUtil.RED_DARK,
  149. single_ticket_num)
  150. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {goods_id = cfg_data.one} -- 构造数据,扣除道具
  151. else -- 显示为钻石付费
  152. lua_resM:setImageSprite(self, self.cost_icon1_img, one_cost_icon_asset, one_cost_icon_name, true)
  153. self.cost1_tmp.text = single_ticket_price
  154. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {price_type = single_ticket_price_type, cost = single_ticket_price} -- 构造数据,扣除金额
  155. end
  156. -- 十连
  157. -- 有十连券,则加载为十连券的图标
  158. if ten_ticket_num > 0 then
  159. lua_resM:setImageSprite(self, self.cost_icon2_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_2", true)
  160. self.cost2_tmp.text = string.format("<color=%s>%s</color>/1", ColorUtil.GREEN_DARK, ten_ticket_num)
  161. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {goods_id = cfg_data.ten} -- 构造数据,表现为扣除道具
  162. -- 有单抽券,则加载为单抽券,并显示出所需个数相关表现
  163. elseif single_ticket_num > 0 then
  164. lua_resM:setImageSprite(self, self.cost_icon2_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_1", true)
  165. self.cost2_tmp.text = string.format("<color=%s>%s</color>/9",
  166. single_ticket_num >= 9 and ColorUtil.GREEN_DARK or ColorUtil.RED_DARK,
  167. single_ticket_num)
  168. if single_ticket_num >= 9 then -- 单抽券数量足够,表现为扣除道具
  169. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {goods_id = cfg_data.one} -- 构造数据,表现为扣除道具
  170. else -- 单抽不足,算出差价,表现为补齐单抽
  171. local need_cost = single_ticket_price * (9 - single_ticket_num)
  172. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {price_type = single_ticket_price_type, cost = need_cost} -- 构造数据,扣除金额
  173. end
  174. -- 普通池子没抽奖券展示红钻
  175. else
  176. lua_resM:setImageSprite(self, self.cost_icon2_img, ten_cost_icon_asset, ten_cost_icon_name, true)
  177. local need_cost = single_ticket_price * 9
  178. self.cost2_tmp.text = need_cost
  179. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {price_type = single_ticket_price_type, cost = need_cost} -- 构造数据,表现为扣除金额
  180. end
  181. else -- 高级池子默认展示道具
  182. -- 单抽
  183. lua_resM:setImageSprite(self, self.cost_icon1_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_1", true)
  184. -- 免费单抽
  185. if can_free then
  186. self.cost1_tmp.text = "免费"
  187. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {free = true} -- 构造数据,表现为扣除金额
  188. -- 有抽奖券,则加载为抽奖券的图标
  189. else
  190. self.cost1_tmp.text = string.format("<color=%s>%s</color>/1",
  191. single_ticket_num > 0 and ColorUtil.GREEN_DARK or ColorUtil.RED_DARK,
  192. single_ticket_num)
  193. if single_ticket_num > 0 then
  194. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {goods_id = cfg_data.one} -- 构造数据,扣除道具
  195. else
  196. self.cost_cache[pool_type][PsionicConst.DrawNumType.OneDraw] = {price_type = single_ticket_price_type, cost = single_ticket_price} -- 构造数据,扣除金额
  197. end
  198. end
  199. -- 十连
  200. -- 有十连券,就展示十连券的表现
  201. if ten_ticket_num > 0 then
  202. lua_resM:setImageSprite(self, self.cost_icon2_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_2", true)
  203. self.cost2_tmp.text = string.format("<color=%s>%s</color>/1", ColorUtil.GREEN_DARK, ten_ticket_num)
  204. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {goods_id = cfg_data.ten} -- 构造数据,表现为扣除道具
  205. -- 有单抽券,则加载为单抽券,并显示出所需个数相关表现
  206. else
  207. lua_resM:setImageSprite(self, self.cost_icon2_img, "psionic_asset", "psionic_dig_icon"..pool_type.."_1", true)
  208. self.cost2_tmp.text = string.format("<color=%s>%s</color>/9",
  209. single_ticket_num >= 9 and ColorUtil.GREEN_DARK or ColorUtil.RED_DARK,
  210. single_ticket_num)
  211. if single_ticket_num >= 9 then -- 单抽券满足
  212. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {goods_id = cfg_data.one} -- 构造数据,表现为扣除道具
  213. else
  214. local need_cost = single_ticket_price * (9 - single_ticket_num)
  215. self.cost_cache[pool_type][PsionicConst.DrawNumType.TenDraw] = {price_type = single_ticket_price_type, cost = need_cost} -- 构造数据,扣除金额
  216. end
  217. end
  218. end
  219. end
  220. function PsionicDrawResultView:UpdateDrawTips( )
  221. if self.data then
  222. -- 遍历属性找到当中符合相应池子配置条件的颜色的数量,并计算出保底数
  223. local cfg_data = self.data.pool == PsionicConst.DrawPoolType.Normal and self.normal_cfg or self.deep_cfg
  224. local rule_cfg = stringtotable(cfg_data.rule)[1]
  225. local color, num = tonumber(rule_cfg[1]), tonumber(rule_cfg[2])
  226. local str = ""
  227. for k, v in ipairs(self.data.show_awards) do
  228. if v.color == color then
  229. str = string.format("再抽 <color=%s>%s</color> 次必出橙色品质圣物", ColorUtil.GREEN_DARK, num - v.times)
  230. break
  231. end
  232. end
  233. self.draw_tip_tmp.text = str
  234. end
  235. end
  236. ----------------
  237. -- 开始抽奖动画 --
  238. ----------------
  239. function PsionicDrawResultView:StartDrawAnim( )
  240. self:InitViewNodes()
  241. self:UpdateBoxModel()
  242. end
  243. -- 初始化节点
  244. function PsionicDrawResultView:InitViewNodes( )
  245. -- 隐藏背景和标题
  246. self.bg_obj:SetActive(false)
  247. self.title_obj:SetActive(false)
  248. -- self.light_con_obj:SetActive(false)
  249. self:ClearUIEffect(self.light_con)
  250. self.can_close_view = false
  251. -- 清除模型
  252. lua_resM:clearRoleMode(self)
  253. -- 隐藏节点
  254. self:ClearAwardItemCreator()
  255. for k,v in pairs(self.item_list) do
  256. v:SetVisible(false, nil, true)
  257. end
  258. -- 隐藏按钮
  259. self.btn_con_cg.alpha = 0
  260. self.btn_con_cg.blocksRaycasts = false
  261. -- 显示跳过按钮
  262. self.skip_btn_obj:SetActive(true)
  263. end
  264. -- 创建宝箱模型
  265. function PsionicDrawResultView:UpdateBoxModel( )
  266. -- 容错处理,防止模型加载不出来导致后面的表现看不见
  267. self:DelayShowRewardAnim(4)
  268. local data = {
  269. father_node = self,
  270. transform = self.box_con,
  271. layer_name = self.layer_name,
  272. fashion_type = FuncOpenModel.TypeId.OtherGoods,
  273. figure_id = PsionicConst.DrawShowModel[self.data.pool],
  274. scale = 255 * 1.4,
  275. can_rotate = false,
  276. action_name_list = {"show"},
  277. position = Vector3(0, -120, -1000),
  278. rotate = Vector3(0, 0, 0),
  279. ui_model_type = UIModelCommon.ModelType.Model,
  280. callBack = function()
  281. -- 模型加载出来之后,停止容错的倒计时,使用模型回调产生的倒计时
  282. self:DelayShowRewardAnim(2.5)
  283. end,
  284. }
  285. FuncOpenModel:getInstance():SetModelRes(data)
  286. end
  287. -- 延迟展示奖励和按钮等的表现
  288. function PsionicDrawResultView:DelayShowRewardAnim(delay_time)
  289. self:ClearShowRewardDelayId()
  290. self.is_animating = true
  291. local function delay_show_reward_func( )
  292. lua_resM:clearRoleMode(self)
  293. -- 取消隐藏背景和标题
  294. self.bg_obj:SetActive(true)
  295. self.title_obj:SetActive(true)
  296. -- self.light_con_obj:SetActive(true)
  297. self:AddUIEffect("ui_jihuoxinxitong01", self.light_con, self.layer_name, nil, 1.2, true,nil,nil, nil, nil,nil)
  298. -- 加载奖励内容
  299. self:UpdateItemList()
  300. -- 延时x秒显示按钮
  301. self:DelayShowBtnCon(0.5)
  302. -- 隐藏跳过按钮
  303. self.skip_btn_obj:SetActive(false)
  304. end
  305. self.delay_show_reward_id = setTimeout(delay_show_reward_func, delay_time)
  306. end
  307. function PsionicDrawResultView:DelayShowBtnCon(delay_time)
  308. self:ClearShowBtnConId()
  309. local function delay_show_btn_con_func( )
  310. local function btn_con_alpha_anim_callback()
  311. self.is_animating = false
  312. end
  313. self.btn_con_alpha_id = TweenLite.to(self, self.btn_con, TweenLite.UiAnimationType.ALPHA_ALL, 1, 0.3, btn_con_alpha_anim_callback)
  314. self.btn_con_cg.blocksRaycasts = true
  315. end
  316. self.delay_show_btn_con_id = setTimeout(delay_show_btn_con_func, delay_time)
  317. -- 到了展示按钮的时候就可以关闭界面了
  318. self.can_close_view = true
  319. end
  320. function PsionicDrawResultView:ClearShowRewardDelayId( )
  321. if self.delay_show_reward_id then
  322. GlobalTimerQuest:CancelQuest(self.delay_show_reward_id)
  323. self.delay_show_reward_id = nil
  324. end
  325. end
  326. function PsionicDrawResultView:ClearShowBtnConId( )
  327. if self.delay_show_btn_con_id then
  328. GlobalTimerQuest:CancelQuest(self.delay_show_btn_con_id)
  329. self.delay_show_btn_con_id = nil
  330. end
  331. if self.btn_con_alpha_id then
  332. TweenLite.Stop(self.btn_con_alpha_id)
  333. self.btn_con_alpha_id = nil
  334. end
  335. end
  336. -- 跳过所有动画
  337. function PsionicDrawResultView:SkipAllAnim( )
  338. self.skip_btn_obj:SetActive(false)
  339. self.is_animating = false
  340. self.can_close_view = true
  341. lua_resM:clearRoleMode(self)
  342. -- 取消隐藏背景和标题
  343. self.bg_obj:SetActive(true)
  344. self.title_obj:SetActive(true)
  345. self:AddUIEffect("ui_jihuoxinxitong01", self.light_con, self.layer_name, nil, 1.2, true,nil,nil, nil, nil,nil)
  346. -- 加载奖励内容
  347. self:UpdateItemList(true)
  348. self:ClearShowRewardDelayId()
  349. self:ClearShowBtnConId()
  350. self.btn_con_cg.blocksRaycasts = true
  351. self.btn_con_cg.alpha = 1
  352. end
  353. ----------------
  354. ----------------
  355. function PsionicDrawResultView:UpdateItemList(skip_anim)
  356. for k,v in pairs(self.item_list) do
  357. v:SetVisible(false, nil, true)
  358. end
  359. self.col_num = self.data.col_num or self.col_num
  360. local item_list = self.data.award
  361. if not item_list or TableSize(item_list) == 0 then return end
  362. local len = #item_list
  363. local i = 0
  364. local x, y, v, grade_cfg
  365. local function frame_count_creator()
  366. -- 累加迭代
  367. i = i + 1
  368. if len >= i then
  369. v = item_list[i]
  370. local item = self.item_list[i]
  371. if item == nil then
  372. item = UIObjPool:getInstance():PopItem(UIObjPool.UIType.AwardItem, self.award_con)
  373. item:SetItemSize(78, 78)
  374. self.item_list[i] = item
  375. end
  376. if len == 1 then
  377. local con_size = self.award_con.sizeDelta
  378. item:SetAnchoredPosition(261, -76)
  379. else
  380. x = (78 + 49) * ((i - 1) % 5) + 7
  381. y = -(78 + 35) * math.floor((i - 1) / 5) - 20.5
  382. item:SetAnchoredPosition(x, y)
  383. end
  384. item:SetGoodsVo(v[4])
  385. local goods_Id, lock = GoodsModel:getInstance():GetMappingTypeId(v[1], v[2])
  386. local goodVo = GoodsModel:getInstance():GetGoodsBasicByTypeId(goods_Id)
  387. local stren_data = nil
  388. if v[4] then
  389. stren_data = EquipModel:getInstance():GetBagEquipAwaraItemInfo(v[4])
  390. stren_data.equip_key = "EquipView"
  391. end
  392. if not v.is_mul then--副本多倍
  393. if v.is_rare == 2 then
  394. item:SetNumLimitVisible(true, 12)
  395. elseif v.is_rare == 1 then
  396. item:SetNumLimitVisible(true, 13)
  397. end
  398. else
  399. item:SetNumLimitVisible(v.is_mul ~= nil, 15)
  400. end
  401. if goodVo then
  402. item:SetData(goods_Id, v[3], goodVo.color, stren_data, lock, true, nil)
  403. else
  404. -- error("没有找到物品信息 "..v.typeId)
  405. end
  406. item:SetVisible(true, nil, true)
  407. else
  408. self:ClearAwardItemCreator()
  409. end
  410. end
  411. self.award_creator_id = GlobalTimerQuest:AddPeriodQuest(frame_count_creator, skip_anim and 0 or 0.1)
  412. end
  413. function PsionicDrawResultView:ClearAwardItemCreator( )
  414. if self.award_creator_id then
  415. GlobalTimerQuest:CancelQuest(self.award_creator_id)
  416. self.award_creator_id = nil
  417. end
  418. end
  419. -- 抽奖按钮点击逻辑 pool_type:奖池类型 opty:次数类型
  420. -- 消耗顺序:免费次数(单抽)> 单抽/十连券 > 红钻/彩钻
  421. function PsionicDrawResultView:OnDrawBtnClick(opty)
  422. if not self.data then return end
  423. local pool_type = self.data.pool
  424. local cost_data = self.cost_cache[pool_type][opty]
  425. if not cost_data then return end
  426. local price_asset, price_icon, price_color
  427. local price_type, cost_price
  428. local priceText = ""
  429. local insufficientText = nil
  430. local special_icon_data = nil
  431. local cfg_data = pool_type == PsionicConst.DrawPoolType.Normal and self.normal_cfg or self.deep_cfg
  432. local function ok_callback()
  433. self.model:Fire(PsionicConst.REQUEST_CCMD_EVENT, 13911, pool_type, opty)
  434. end
  435. if cost_data.free then -- 免费抽,直接冲
  436. ok_callback()
  437. return
  438. end
  439. local cost_goods_name = self.goods_model:getGoodsName(cfg_data.one, true)
  440. -- 使用抽奖券的情况,提示后直接使用
  441. if cost_data.goods_id then
  442. special_icon_data = true
  443. price_asset = "psionic_asset"
  444. price_icon = "psionic_dig_icon" .. pool_type .. "_" .. opty
  445. price_type = 0
  446. if cost_data.goods_id == cfg_data.one then -- 单抽券需要区分抽奖次数,十连券每次消耗1张
  447. cost_price = opty == PsionicConst.DrawNumType.TenDraw and 9 or 1
  448. else
  449. cost_price = 1
  450. end
  451. price_color = self.goods_model:GetGoodsColor(cost_data.goods_id)
  452. priceText = string.format("<color=%s>%s</color> %s %s寻宝%s次?", price_color, cost_price, cost_goods_name,
  453. pool_type == PsionicConst.DrawPoolType.Deep and "深度" or "普通",
  454. opty == PsionicConst.DrawNumType.TenDraw and 10 or 1)
  455. else -- 需要使用钻石补足的情况
  456. price_type = cost_data.price_type
  457. cost_price = cost_data.cost
  458. price_asset, price_icon = WordManager:GetCommonMoneyIcon(price_type)
  459. -- price_color = WordManager.GetGoodsColor(pool_type == PsionicConst.DrawPoolType.Deep and 4 or 3)
  460. price_color = ColorUtil.YELLOW_DARK
  461. if pool_type == PsionicConst.DrawPoolType.Deep then -- 统一用抽奖券表现
  462. insufficientText = string.format("%s 不足", cost_goods_name)
  463. priceText = string.format("<color=%s>%s</color> 补齐 %s %s寻宝%s次?", price_color, cost_price, cost_goods_name,
  464. pool_type == PsionicConst.DrawPoolType.Deep and "深度" or "普通",
  465. opty == PsionicConst.DrawNumType.TenDraw and 10 or 1)
  466. else
  467. priceText = string.format("<color=%s>%s</color> %s寻宝%s次?", price_color, cost_price,
  468. pool_type == PsionicConst.DrawPoolType.Deep and "深度" or "普通",
  469. opty == PsionicConst.DrawNumType.TenDraw and 10 or 1)
  470. end
  471. end
  472. local function use_function( toggle_tip_data, call_fun_sum )
  473. if not self.model._dont_check_psionic_draw_tip[pool_type] then
  474. GlobalEventSystem:Fire(EventName.OPEN_COM_TOGGLE_TIP_VIEW, toggle_tip_data)
  475. else
  476. call_fun_sum()
  477. end
  478. end
  479. local data = {
  480. insufficientText = insufficientText,
  481. special_icon_data = special_icon_data,
  482. gold_type = price_type,
  483. cost_price = cost_price,
  484. ok_callback = ok_callback,
  485. togglePriceStr = priceText,
  486. use_function = use_function,
  487. toggle_function = function(flag)
  488. self.model._dont_check_psionic_draw_tip[pool_type] = flag
  489. end,
  490. recharge_open_call_back = function()
  491. self:Close()
  492. end,
  493. }
  494. CustomActivityModel:getInstance():BuyTips(data)
  495. end
  496. function PsionicDrawResultView:DestroySuccess( )
  497. self:ClearShowRewardDelayId()
  498. self:ClearShowBtnConId()
  499. self:ClearAwardItemCreator()
  500. lua_resM:clearRoleMode(self)
  501. self:ClearUIEffect(self.light_con)
  502. for i,item in pairs(self.item_list) do
  503. UIObjPool:getInstance():PushItem(UIObjPool.UIType.AwardItem, item)
  504. end
  505. self.item_list = {}
  506. ItemUseModel:getInstance():ShowItemUseView( )
  507. end