源战役客户端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

82 satır
2.2 KiB

  1. --社团协助感谢快捷前往
  2. GuildSupportTipView = GuildSupportTipView or BaseClass(BaseView)
  3. local GuildSupportTipView = GuildSupportTipView
  4. function GuildSupportTipView:__init()
  5. self.base_file = "guild"
  6. self.layout_file = "GuildSupportTipView"
  7. self.layer_name = "Main"
  8. self.destroy_imm = true
  9. self.use_background = false
  10. self.hide_maincancas = false --全屏界面需要放开隐藏主UI
  11. self.change_scene_close = false
  12. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  13. self.need_show_money = false --是否要显示顶部的金钱栏
  14. self.model = GuildModel:getInstance()
  15. self.item_list = {}
  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.destroy_callback = function ( )
  24. self:DestroySuccess()
  25. end
  26. end
  27. function GuildSupportTipView:DestroySuccess()
  28. end
  29. function GuildSupportTipView:LoadSuccess()
  30. local nodes = {
  31. "closeBtn:obj", "titleText:tmp", "sendBtn:obj",
  32. }
  33. self:GetChildren(nodes)
  34. self.titleText_tmp.text = "发送感谢"
  35. self.transform_x = ScreenWidth/2-380--380是对右边的值
  36. self.transform_y = -ScreenHeight/2+185--200是对下边的值
  37. SetAnchoredPosition(self.transform,self.transform_x,self.transform_y)
  38. if self.need_refreshData then
  39. self:UpdateView( )
  40. end
  41. end
  42. function GuildSupportTipView:AddEvent()
  43. local function onBtnClickHandler(target,x,y)
  44. if target == self.closeBtn_obj then--关闭
  45. self:Close()
  46. elseif target == self.sendBtn_obj then--发送感谢
  47. self:Close()
  48. self.model:Fire(GuildModel.OPEN_GUILD_SUPPORT_IFNO_VIEW, GuildModel.SupportTab.Thank, self.support_data)
  49. end
  50. end
  51. AddClickEvent(self.closeBtn_obj,onBtnClickHandler, LuaSoundManager.SOUND_UI.NONE)
  52. AddClickEvent(self.sendBtn_obj,onBtnClickHandler, LuaSoundManager.SOUND_UI.NONE)
  53. end
  54. function GuildSupportTipView:Open( support_data )
  55. self.support_data = support_data
  56. BaseView.Open(self)
  57. end
  58. function GuildSupportTipView:OpenSuccess( )
  59. self:UpdateView()
  60. end
  61. function GuildSupportTipView:UpdateView( support_data )
  62. self.support_data = support_data or self.support_data
  63. if self.is_loaded then
  64. self.need_refreshData = false
  65. else
  66. self.need_refreshData = true
  67. return
  68. end
  69. end