源战役客户端
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.

82 lines
2.2 KiB

  1. GodActivityEffectView = GodActivityEffectView or BaseClass(BaseView)
  2. local GodActivityEffectView = GodActivityEffectView
  3. function GodActivityEffectView:__init()
  4. self.base_file = "godActivity"
  5. self.layout_file = "GodActivityEffectView"
  6. self.layer_name = "Top"
  7. self.destroy_imm = true
  8. self.change_scene_close = true
  9. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  10. self.is_set_zdepth = true
  11. -- self.blur_activity_bg = true
  12. self.click_bg_toClose = false
  13. ------------------------
  14. -- 一级全屏界面:
  15. self.hide_maincancas = false --隐藏主界面
  16. self.use_background = true --不一定显示遮罩
  17. -- 二级界面:
  18. -- self.hide_maincancas = false --是否需要隐藏主界面,看策划需求
  19. -- self.use_background = true --需要遮罩
  20. ------------------------
  21. self.load_callback = function ()
  22. self:LoadSuccess()
  23. end
  24. self.open_callback = function ( )
  25. self:OpenSuccess()
  26. end
  27. self.close_win_callback = function ( )
  28. self:Close()
  29. end
  30. self.destroy_callback = function ( )
  31. self:DestroySuccess()
  32. end
  33. end
  34. function GodActivityEffectView:Open( data )
  35. self.data = data
  36. BaseView.Open(self)
  37. end
  38. function GodActivityEffectView:LoadSuccess()
  39. local nodes = {
  40. "con_effect","skipBtn:obj",
  41. }
  42. self:GetChildren(nodes)
  43. self:AddEvent()
  44. end
  45. function GodActivityEffectView:AddEvent()
  46. local on_click = function ( click_obj )
  47. if self.skipBtn_obj == click_obj then
  48. self:Close()
  49. end
  50. end
  51. AddClickEvent(self.skipBtn_obj, on_click)
  52. end
  53. function GodActivityEffectView:OpenSuccess()
  54. self:UpdateView()
  55. end
  56. function GodActivityEffectView:UpdateView()
  57. if not self.data then self:Close() end
  58. local function close_call( )
  59. self:Close()
  60. end
  61. self.time_close_id = self.time_close_id or setTimeout(close_call,self.data.time or 1)
  62. self:AddUIEffect(self.data.name, self.con_effect, self.layer_name, self.data.pos, self.data.scale, false,
  63. nil, nil, nil, nil, 5)
  64. end
  65. function GodActivityEffectView:DestroySuccess( )
  66. if self.time_close_id then
  67. GlobalTimerQuest:CancelQuest(self.time_close_id)
  68. self.time_close_id = nil
  69. end
  70. self:ClearUIEffect(self.con_effect.transform)
  71. if self.data.end_func then
  72. self.data.end_func()
  73. end
  74. end