local UISelectRegionViewVirtualGidC = UIViewClass() function UISelectRegionViewVirtualGidC:OnOpened(context) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_Region_RegionListTitle) if CTL.Login.IsFierceServerRegion() then self.selectedRegion = 1 self:OnSelectRegion(self.group_SelectArea[1].btn) UIUtils.SetActive(self.group_SelectArea[1].group_Now, true) else self.selectedRegion = 2 self:OnSelectRegion(self.group_SelectArea[2].btn) UIUtils.SetActive(self.group_SelectArea[2].group_Now, true) end end function UISelectRegionViewVirtualGidC:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UISelectRegionViewVirtualGidC:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.btn_Change then self:ClickChange() else self:OnSelectRegion(comp) end end function UISelectRegionViewVirtualGidC:ClickChange() UTL.MessageBox.ShowOKCancelBox("", UIUtils.GetLocalizedTxt(Const_IDS.IDS_VirtualGidC_Tip), function() CTL.Login.ChangeSelectServerPanel(self.selectRegion) end) end function UISelectRegionViewVirtualGidC:OnSelectRegion(comp) for i,v in ipairs(self.group_SelectArea) do if comp == v.btn then self.selectRegion = i end self.btn_Change:SetGray(self.selectRegion == self.selectedRegion) UIUtils.SetActive(v.img_Select, comp == v.btn) end end return UISelectRegionViewVirtualGidC