local UICountryCheckPanel = UIViewClass() local UIGuildCheckPanel = UIViewClass() function UICountryCheckPanel:OnOpened(context) local index = 1 for _, data in DataSheetManager.CountryJob:GetEnumerator() do if self.titiles[index] then UIUtils.SetLabelText(self.titiles[index], Const_IDS[MDL.Country.GetJobName(data.ID)]) index = index + 1 end end for _, data in DataSheetManager.CountryAuthority:GetEnumerator() do self.LoopScroll_Details:AddData(data, 0) end UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_GuildMainpage_Button5) UIUtils.SetActive(self.UICommonPopUp.img_Info, true) end function UICountryCheckPanel:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UICountryCheckPanel:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.UICommonPopUp.img_Info then UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, {id = LuaConst.NoteID.CountryReset}) end end function UICountryCheckPanel:OnClosed() UIUtils.SetActive(self.UICommonPopUp.img_Info, false) end function UICountryCheckPanel:OnCellInit(scrollRect, index, cellTable, data) local ind = 1 for _, d in DataSheetManager.CountryJob:GetEnumerator() do local exist = false for i, v in ipairs(d.JobID) do if v == data.ID then exist = true end end if cellTable.masks[ind] then cellTable.masks[ind].gameObject:SetActive(exist) end ind = ind + 1 end cellTable.lab_Title.text = UIUtils.GetLocalizedTxt(Const_IDS[data.AuthorityName]) cellTable.bg_State:SetState(index % 2) end return UICountryCheckPanel