---@class KLShortcurKeyExplainPanel:UIKmlLuaPanelBase ---@field view KLShortcurKeyExplainPanelView local KLShortcurKeyExplainPanel = class(UIKmlLuaPanelBase) local this = KLShortcurKeyExplainPanel this.datas = {} --this.datas[0] = "测试01" --this.datas[1] = "测试02" --this.datas[2] = "测试03" --this.datas[3] = "测试04" --this.datas[4] = "测试05" --this.datas[5] = "测试06" --this.datas[6] = "测试07" --this.datas[7] = "测试08" --this.datas[8] = "测试09" --this.datas[9] = "测试10" function this:AsyncLoadUI() end ---创建时调用一次 function this:Init() local width, height = GUI:getSizeDelta(self.view.layout1) SL:ScheduleOnce(0.1, function() GUI:setContentSize(self.view.bg, width, height + 35) end) end ---注册UI事件和服务器消息 function this:RegistEvents() end ---界面显示时调用一次 function this:Show() this:GetConfigData() if this.datas and table.count(this.datas) > 0 then GUI:DataListInitData(self.view.datalist3, function() return table.count(this.datas) end, function() end, function() end, function(realIndex) self:ItemUpdateFunc(realIndex) end) GUI:DataListUpdateData(self.view.datalist3) end ---GUI:UIPanel_Close("dev/ui/MainUI/Panel/KLUILeftUp/KLUILeftUpPanel") SL.HideMainSinglePanel("KLUILeftUpPanel") end ---创建或者刷新界面数据时调用 function this:Refresh() end function this:Hide() ---GUI:UIPanel_Open("dev/ui/MainUI/Panel/KLUILeftUp/KLUILeftUpPanel") SL.ShowMainSinglePanel("KLUILeftUpPanel") end function this:Close() PCPlatformMgr.ShowedShortcutKeyPanel = false end function this:ItemUpdateFunc(realIndex) local data = this.datas[realIndex + 1].text local text = GUI:GetChildControl(self.view.datalist3, realIndex, 'text5') if text then GUI:Text_setString(text, tostring(data)) end end function this:GetConfigData() this.datas = SL:GetConfigTable("cfg_shortcutKey") if this.datas and table.count(this.datas) > 0 then table.sort(this.datas, function(a, b) return a.order < b.order end) end end return this