源战役客户端
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 rivejä
2.0 KiB

4 viikkoa sitten
  1. CSGWarBaseView = CSGWarBaseView or BaseClass(BaseView)
  2. local CSGWarBaseView = CSGWarBaseView
  3. function CSGWarBaseView:__init()
  4. self.base_file = "CSGWar"
  5. self.layout_file = "CSGWarBaseView"
  6. self.layer_name = "UI"
  7. self.destroy_imm = true
  8. self.use_background = true --全屏界面默认使用这个参数
  9. self.blur_activity_bg = true
  10. self.close_fog = true
  11. self.hide_maincancas = true --全屏界面需要放开隐藏主UI
  12. self.change_scene_close = true
  13. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  14. self.need_show_money = false --是否要显示顶部的金钱栏
  15. self.model = CSGWarModel:getInstance()
  16. self.load_callback = function ()
  17. self:LoadSuccess()
  18. self:AddEvent()
  19. end
  20. self.open_callback = function ( )
  21. self:OpenSuccess()
  22. end
  23. self.switch_callback = function(index)
  24. self:SwitchTab(index)
  25. end
  26. self.destroy_callback = function ( )
  27. self:DestroySuccess()
  28. end
  29. end
  30. function CSGWarBaseView:Open( )
  31. --self.data = data
  32. BaseView.Open(self)
  33. end
  34. function CSGWarBaseView:LoadSuccess()
  35. local nodes = {
  36. "container","close_btn:obj"
  37. }
  38. self:GetChildren(nodes)
  39. local function bg_back_func( ... )
  40. if self.background_wnd and self.background_wnd:GetComponent("RawImageExtend") then
  41. self:MoveUIToBack(self.background_wnd:GetComponent("RawImageExtend"))
  42. end
  43. end
  44. if self.background_wnd then
  45. bg_back_func()
  46. else
  47. self.bg_back_func = bg_back_func
  48. end
  49. end
  50. function CSGWarBaseView:AddEvent()
  51. local function on_close( )
  52. self:Close()
  53. end
  54. AddClickEvent(self.close_btn_obj, on_close)
  55. end
  56. function CSGWarBaseView:OpenSuccess()
  57. self:UpdateView()
  58. end
  59. function CSGWarBaseView:UpdateView()
  60. if not self.cswar_view then
  61. self.cswar_view = CSGWarSubView.New(self.container)
  62. end
  63. self.cswar_view:SetData()
  64. self.cswar_view:AppendToBackContainer(self)
  65. end
  66. function CSGWarBaseView:SwitchTab( index )
  67. end
  68. function CSGWarBaseView:DestroySuccess( )
  69. if self.cswar_view then
  70. self.cswar_view:DeleteMe()
  71. self.cswar_view = nil
  72. end
  73. end