local UICountryGuildInfoTips = UIViewClass() function UICountryGuildInfoTips:OnOpened(context) self.txt_MainGuildName.text = context.guildInfo.name UTL.Item.SetAtlasSprite(self.ico_GuildBg, "UI_Guild", DataSheetManager.GuildEmblem:GetDataByID(context.guildInfo.emblemFrame).Image) self.txt_TitleGuildName.text = context.guildInfo.emblemContent self.txt_Member.text = context.guildInfo.memberCount local activeness = 3 local activenessArray = DataSheetManager.ConstData:GetDataByID("GuildActivityValueRange").IntListValue for i, v in ipairs(activenessArray) do if context.guildInfo.activeness <= v then activeness = i - 1 break end end self.lights:SetState(activeness) local fameStr, fameNum = CTL.Guild.GetGuildReputationInfo(context.guildInfo.fameLevel) self.txt_GuildFame.text = fameStr if fameNum > 0 then self.txt_GuileLevel.text = fameNum UIUtils.SetActive(self.img_bg, true) else UIUtils.SetActive(self.img_bg, false) end self.txt_Notice.text = context.guildInfo.recruitTagline self:SetGuildLeader(context.guildInfo.leader, context.guildInfo.diplomat) self.txt_CE.text = context.guildInfo.GuildActiveGs end function UICountryGuildInfoTips:SetGuildLeader(leader, diplomat) CTL.Player.OperateGenderImage(self.image_Gender, leader.sex) self.txt_JobPlayerName.text = leader.name if leader.rankIdx > 0 then self.txt_Rank.text = string.FormatByIdsId(Const_IDS.IDS_GuildApply_Label2, leader.rankIdx) else UIUtils.SetLabelText(self.txt_Rank, Const_IDS.IDS_GuildBoss_NotInList) end if diplomat and not string.isNilOrEmpty(diplomat.acid) then self.txt_NeishiName.text = diplomat.name if diplomat.rankIdx > 0 then self.neishi_Rank.text = string.FormatByIdsId(Const_IDS.IDS_GuildApply_Label2, diplomat.rankIdx) else UIUtils.SetLabelText(self.neishi_Rank, Const_IDS.IDS_GuildBoss_NotInList) end UIUtils.SetActive(self.image_NS_Gender, true) UIUtils.SetActive(self.neishi_Empty, false) UIUtils.SetActive(self.neishi_Chat, true) CTL.Player.OperateGenderImage(self.image_NS_Gender, diplomat.sex) UIUtils.SetActive(self.neishi_Chat, diplomat.acid ~= BattleDataGetter.GetAcID()) else UIUtils.SetLabelText(self.neishi_Empty, Const_IDS.IDS_GuildApply_Label7) self.txt_NeishiName.text = nil self.neishi_Rank.text = nil UIUtils.SetActive(self.image_NS_Gender, false) UIUtils.SetActive(self.neishi_Empty, true) UIUtils.SetActive(self.neishi_Chat, false) end UIUtils.SetActive(self.boss_Chat, leader.acid ~= BattleDataGetter.GetAcID()) end function UICountryGuildInfoTips:OnButtonClicked(comp) if comp == self.Bottom then self:CloseView() elseif comp == self.boss_Chat then CTL.Friend.PrivateTalkToAcid(self.context.guildInfo.leader.acid) self:CloseView() elseif comp == self.neishi_Chat then CTL.Friend.PrivateTalkToAcid(self.context.guildInfo.diplomat.acid) self:CloseView() end end return UICountryGuildInfoTips