1234567891011121314151617181920212223242526272829303132333435363738 |
- ---@class KLMapHookPointItem:UIKmlLuaPanelBase
- ---@field view KLMapHookPointItemView
- local KLMapHookPointItem = class(UIKmlLuaPanelBase)
- local this =KLMapHookPointItem
- ---创建时调用一次
- function this:Init()
- SL:KeepOpenPanel("KLMapHookPointItemKml",true)
- end
- ---注册UI事件和服务器消息
- function this:RegistEvents()
- GUI:AddOnClickEvent(self.view.btnPos, self, self.GoOnClick)
- end
- ---创建或者刷新界面数据时调用
- function this:Refresh()
- local index = self.args.index
- GUI:Text_setString(self.view.txtIndex, index)
- local pos = self.args.pos
- GUI:Text_setString(self.view.txtPos, string.format("[%s,%s]", pos[1], pos[2]))
- end
- function this:GoOnClick()
- GUI:UIPanel_Close("dev/outui/Hook/Panel/KLOnHook/KLOnHookPanel")
- GUI:UIPanel_Close("dev/outui/Hook/Panel/KLMapHookPoints/KLMapHookPointsPanel")
- SL.ShowMainPanel()
- local line = SL:GetMetaValue("MAP_LINE")
- SL:Pathfinding(self.args.mapId, line, self.args.pos[1], self.args.pos[2], function()
- SL:StartOnHook(true,true)
- end)
- end
- function this:Close()
- SL:KeepOpenPanel("KLMapHookPointItemKml",false)
- end
- return this
|