GuildFaithPage = class("GuildFaithPage", SubView) autoImport("GFaithTypeCell"); autoImport("GAstrolabeAttriCell"); autoImport("GvGPvpAttrCell"); autoImport("GvGPvpPrayData") local titleDeepColor = Color(67.0/255.0,77.0/255.0,141.0/255.0,1) local titleNormalColor = Color(139.0/255.0,139.0/255.0,139.0/255.0,1) function GuildFaithPage:Init() self:InitUI(); self:MapEvent(); end function GuildFaithPage:InitUI() local goPrayButton = self:FindGO("GoPrayButton"); self:AddClickEvent(goPrayButton, function (go) self:TraceNpc(2); end); local goAstrolabeButton = self:FindGO("GoAstrolabeButton") self:AddClickEvent(goAstrolabeButton,function (go) self:TraceNpc(6270); end) local faithGrid = self:FindComponent("FaithTypeGrid", UIGrid); self.faithAttriCtl = UIGridListCtrl.new(faithGrid, GFaithTypeCell, "GFaithTypeCell") local astrolabeGrid = self:FindComponent("AstrolabeGrid", UIGrid); self.astrolabeCtl = UIGridListCtrl.new(astrolabeGrid, GAstrolabeAttriCell, "GAstrolabeAttriCell") -- self.astrolabeAttriMap local gvgPvpAttrGrid1 = self:FindComponent("gvgPvpAttrGrid1",UIGrid); local gvgPvpAttrGrid2 = self:FindComponent("gvgPvpAttrGrid2",UIGrid); local gvgPvpAttrGrid3 = self:FindComponent("gvgPvpAttrGrid3",UIGrid); self.gvgPvpAttrCtl1 = UIGridListCtrl.new(gvgPvpAttrGrid1,GvGPvpAttrCell,"GvGPvpAttrCell"); self.gvgPvpAttrCtl2 = UIGridListCtrl.new(gvgPvpAttrGrid2,GvGPvpAttrCell,"GvGPvpAttrCell"); self.gvgPvpAttrCtl3 = UIGridListCtrl.new(gvgPvpAttrGrid3,GvGPvpAttrCell,"GvGPvpAttrCell"); self.gvgPvpAttrBord = self:FindGO("gvgPvpAttrBord") self.astrolabeBord = self:FindGO("AstrolabeBord"); self.lockTip = self:FindGO("LockTip"); self.gvgPvpLockTip=self:FindGO("gvgPvpLockTip") self.faithRoot = self:FindGO("faithRoot") self.astroRoot = self:FindGO("astroRoot") self.faithTitleImg = self:FindGO("faithTitleImg") self.astroTitleImg = self:FindGO("astroTitleImg") self.FaithTitle=self:FindComponent("FaithTitle",UILabel); self:AddClickEvent(self.FaithTitle.gameObject, function () self:UpdateFaithGrid() end) self.astroTitle=self:FindComponent("astroTitle",UILabel); self:AddClickEvent(self.astroTitle.gameObject, function () self:UpdateAstrolabeGrid() end) self:InitFaithGrid(); end local tempArgs = {}; function GuildFaithPage:TraceNpc(uniqueid) if(Game.Myself:IsDead())then MsgManager.ShowMsgByIDTable(2500); else if(GuildProxy.Instance:IHaveGuild())then local currentRaidID = SceneProxy.Instance:GetCurRaidID() local raidData = currentRaidID and Table_MapRaid[currentRaidID]; if(raidData and raidData.Type == 10)then TableUtility.TableClear(tempArgs); tempArgs.npcUID = uniqueid; local cmd = MissionCommandFactory.CreateCommand(tempArgs, MissionCommandVisitNpc); if(cmd)then Game.Myself:Client_SetMissionCommand( cmd ); end self.container:CloseSelf(); else ServiceGuildCmdProxy.Instance:CallEnterTerritoryGuildCmd(); end else MsgManager.ShowMsgByIDTable(2620); end end end function GuildFaithPage:_setTitleToggleState(isFaith) if(isFaith)then self.FaithTitle.color=titleDeepColor self.astroTitle.color=titleNormalColor self:Hide(self.astroTitleImg) self:Show(self.faithTitleImg) self:Show(self.faithRoot) self:Hide(self.astroRoot) else self.FaithTitle.color=titleNormalColor self.astroTitle.color=titleDeepColor self:Show(self.astroTitleImg) self:Hide(self.faithTitleImg) self:Show(self.astroRoot) self:Hide(self.faithRoot) end end function GuildFaithPage:InitFaithGrid() self.faithDatas = {}; local myfaithData = Game.Myself.data.guildPray; for _,data in pairs(myfaithData)do table.insert(self.faithDatas, data); end table.sort(self.faithDatas, function (a,b) return a.staticData.id 0)then self.astrolabeBord:SetActive(true); self.lockTip:SetActive(false); self.astrolabeBord:SetActive(#datas > 0); table.sort(datas, GuildFaithPage.SortRule); self.astrolabeCtl:ResetDatas(datas); else self.astrolabeBord:SetActive(false); self.lockTip:SetActive(true); end end function GuildFaithPage:MapEvent() self:AddListenEvt(ServiceEvent.GuildCmdGuildMemberDataUpdateGuildCmd, self.UpdateFaithGrid); end function GuildFaithPage:OnEnter() GuildFaithPage.super.OnEnter(self); self:UpdateFaithGrid(); -- self:UpdateAstrolabeGrid(); end function GuildFaithPage:OnExit() GuildFaithPage.super.OnExit(self); end