GvGPvPPrayDialog = class("GvGPvPPrayDialog", ContainerView) autoImport("DialogCell"); autoImport("GvGPvpPrayTypeCell"); autoImport("PrayToggleCell") autoImport("WrapCellHelper") GvGPvPPrayDialog.ViewType = UIViewType.DialogLayer; GuildCertificateId = GameConfig.Guild.praydeduction[1]; -- pray page Type GvGPvPPrayDialog.PageType = GameConfig.GvGPvP_PrayType[1].RaidMap local toggleCsv = GameConfig.GvGPvP_PrayType function GvGPvPPrayDialog:Init() local npc = self.viewdata.viewdata.npcdata self.npcguid = npc.data.id; self:InitUI(); self:InitCoins(); self:AddMapEvent(); end function GvGPvPPrayDialog:GetCurNpc() if(self.npcguid)then return NSceneNpcProxy.Instance:Find(self.npcguid); end end function GvGPvPPrayDialog:InitUI() self.mask = self:FindGO("Mask"); self.pageToggleRoot=self:FindGO("toggleRoot") local ListTable = self.pageToggleRoot:GetComponent(UIGrid) self.gridListCtl = UIGridListCtrl.new(ListTable,PrayToggleCell,"PrayToggleCell") self.gridListCtl:AddEventListener(MouseEvent.MouseClick, self._clickPageToggle, self); local togList = {} for i=1,#toggleCsv do table.insert(togList,toggleCsv[i]) end self.gridListCtl:ResetDatas(togList) self:_refreshChoose() self.choosePageID=GuildCmd_pb.EPRAYTYPE_GVG_ATK; self.itemPrayRoot = self:FindGO("cutWrap") self.menuBg = self:FindComponent("MenuGg", UISprite); self.dialogContent = self:FindComponent("DialogContent", UILabel); self.atkLab = self:FindComponent("Label", UILabel, self:FindGO("atkIcon")); self.atkIcon = self:FindComponent("symbol",UISprite,self:FindGO("atkIcon")); self.defLab = self:FindComponent("Label", UILabel, self:FindGO("defIcon")); self.defIcon = self:FindComponent("symbol", UISprite, self:FindGO("defIcon")); self.attrCellLab = self:FindComponent("Label", UILabel, self:FindGO("attrCellIcon")); self.attrCellIcon = self:FindComponent("symbol", UISprite, self:FindGO("attrCellIcon")); local prayButton = self:FindGO("PrayButton"); self:AddClickEvent(prayButton, function (go) local chooseData = self.chooseData; if(chooseData)then local queryID = chooseData.id if(not chooseData.nextPray or 0==chooseData.nextPray.lv)then MsgManager.ShowMsgByIDTable(2720); return end local ownCost = BagProxy.Instance:GetItemNumByStaticID(chooseData.nextPray.itemCost.staticData.id) if(ownCost