KLCardShapeArchangelPanel.lua 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---@class KLCardShapeArchangelPanel:UIKmlLuaPanelBase
  2. ---@field view KLCardShapeArchangelPanelView
  3. local KLCardShapeArchangelPanel = class(UIKmlLuaPanelBase)
  4. local this =KLCardShapeArchangelPanel
  5. function this:AsyncLoadUI()
  6. end
  7. ---创建时调用一次
  8. function this:Init()
  9. end
  10. ---注册UI事件和服务器消息
  11. function this:RegistEvents()
  12. GUI:AddOnClickEvent(self.view.btn_go, self, self.btn_go)
  13. GUI:AddOnClickEvent(self.view.btn_close, self, self.btn_close)
  14. GUI:SetToggleOnValueChange(self.view.today_show_toggle,self,self.today_show_toggle_value_change)
  15. end
  16. ---界面显示时调用一次
  17. function this:Show()
  18. end
  19. ---创建或者刷新界面数据时调用
  20. function this:Refresh()
  21. SL.HideMainPanel()
  22. if self.args then
  23. self.uiId = self.args
  24. ---@type cfg_system_foreshow_column
  25. self.ui_cfg = SL:GetConfig("cfg_system_foreshow", self.uiId)
  26. end
  27. local job = SL:GetMetaValue(EMetaVarGetKey.JOB)
  28. if job == 1 then
  29. GUI:Model_setSrc(self.view.item_model, "Model/Charactor/Sword/Sword20")
  30. GUI:setPosition(self.view.item_model, -170, 140)
  31. GUI:setPositionZ(self.view.item_model, -200)
  32. GUI:setRotation(self.view.item_model, 0)
  33. GUI:setRotationSkewX(self.view.item_model, 65)
  34. GUI:setRotationSkewY(self.view.item_model, -90)
  35. elseif job == 2 then
  36. GUI:Model_setSrc(self.view.item_model, "Model/Charactor/Staff/Staff11")
  37. GUI:setPosition(self.view.item_model, -220, 75)
  38. GUI:setPositionZ(self.view.item_model, -200)
  39. GUI:setRotation(self.view.item_model, 0)
  40. GUI:setRotationSkewX(self.view.item_model, 115)
  41. GUI:setRotationSkewY(self.view.item_model, -90)
  42. elseif job == 3 then
  43. GUI:Model_setSrc(self.view.item_model, "Model/Charactor/CrossBow/CrossBow19")
  44. GUI:setPosition(self.view.item_model, -260, -50)
  45. GUI:setPositionZ(self.view.item_model, -200)
  46. GUI:setRotation(self.view.item_model, 140)
  47. GUI:setRotationSkewX(self.view.item_model, 0)
  48. GUI:setRotationSkewY(self.view.item_model, 0)
  49. end
  50. end
  51. function this:btn_go()
  52. GUI:UIPanel_Close("dev/outui/Hook/Panel/KLOnHook/KLOnHookPanel")
  53. self:btn_close(_, true)
  54. local instruction = InfoManager.cardShapeShiftInfo:DeepCopy(self.ui_cfg.btnSkip[1])
  55. table.remove(instruction, 1)
  56. SL:ShortcutDO(instruction)
  57. end
  58. function this:btn_close(_, stop)
  59. GUI:UIPanel_Close("dev/outui/CardShapeShift/Panel/KLCardShapeArchangel/KLCardShapeArchangelPanel")
  60. if not stop then
  61. InfoManager.cardShapeShiftInfo:REFRESH_NEXT_CARD_SHAPE_UI()
  62. end
  63. end
  64. function this:today_show_toggle_value_change(_, _, data)
  65. self.isToggle = data[1]
  66. end
  67. function this:Hide()
  68. end
  69. function this:Close()
  70. if self.isToggle then
  71. SL:SendLuaNetMsg(LuaMessageIdToSever.REQ_CANCEL_FSPREVIEW, self.uiId)
  72. end
  73. if not GUI:GetUI("dev/outui/Hook/Panel/KLOnHook/KLOnHookPanel") then
  74. SL.ShowMainPanel()
  75. end
  76. end
  77. return this