local UIGuildJoinInPanel = UIViewClass() function UIGuildJoinInPanel:OnOpened(context) self:ScrollPadCallback(context.listInfo.limit.level, true) self.obj_CEInputField.text = context.listInfo.limit.gs self.powerLimit = context.listInfo.limit.gs or 0 UIUtils.SetLabelText(self.UICommonPopUp.txt_Title,Const_IDS.IDS_GuildApply_Title3) self.keyBoardView = nil self.scrollPadView = nil self.disableSmartInvite = context.listInfo.disableSmartInvite --是否开启智能邀请 self:RefreshSmartInviteCheck() end function UIGuildJoinInPanel:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIGuildJoinInPanel:OnButtonClicked(comp) if comp == self.btn_LevelEdit then if not self.scrollPadView then self.scrollPadView = self.subView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIScrollPad), { parentView = self, formerLevel = self.levelLimit, x = -120, y = 60 }) end elseif comp == self.btn_CEEdit then if not self.keyBoardView then local maxLimit = DataSheetManager.ConstData:GetDataByID("TeamPowerMaxLimitMax").IntValue self.keyBoardView = self.subView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIKeypad), { parentView = self, x = 680, y = 160, minNum = 0, maxNum = maxLimit }) end elseif comp == self.btn_1 then MDL.Guild.GuildSetupGroupReq({ MDL.Guild.GuildUpdateType.LimitGs, MDL.Guild.GuildUpdateType.LimitLevel, MDL.Guild.GuildUpdateType.SwitchSmartInvite }, { tostring(self.powerLimit or 0), tostring(self.levelLimit or 0), tostring(self.disableSmartInvite and "1" or "0") }) self:CloseView() elseif comp == self.event_Btn then self.disableSmartInvite = not self.disableSmartInvite self:RefreshSmartInviteCheck() elseif comp == self.UICommonPopUp.btn_Close then self:CloseView() end end function UIGuildJoinInPanel:ExcuteKeyBoardBack(count, paramData) self:RefreshCENumber(count) end function UIGuildJoinInPanel:CloseKeyBoardView() self.keyBoardView:CloseView() self.keyBoardView = nil end function UIGuildJoinInPanel:CloseScrollPadView(index) self.scrollPadView:CloseView() self.scrollPadView = nil self:ScrollPadCallback(index) end function UIGuildJoinInPanel:ScrollPadCallback(index, send) if index <= 0 then UIUtils.SetLabelText(self.lab_LevelLimitNum, Const_IDS["IDS_TeamUI_ApplyLimit_None"]) self.levelLimit = 0 else local maxLimit = math.min(MDL.HeroSelect.GetTeamLevel() + 20, DataSheetManager.HeroLevelUp:GetDataCount()) if index > maxLimit then index = maxLimit end UIUtils.SetLabel(self.lab_LevelLimitNum, MDL.HeroSelect.GetTeamLevelName(index)) self.levelLimit = index end end function UIGuildJoinInPanel:RefreshCENumber(count) self.powerLimit = count if self.powerLimit <= 0 then self.powerLimit = 0 self.obj_CEInputField.text = UIUtils.GetLocalizedTxt(Const_IDS["IDS_TeamUI_ApplyLimit_None"]) return end local maxLimit = DataSheetManager.ConstData:GetDataByID("TeamPowerMaxLimitMax").IntValue if count > maxLimit then self.powerLimit = maxLimit end self.obj_CEInputField.text = self.powerLimit end function UIGuildJoinInPanel:RefreshSmartInviteCheck() UIUtils.SetActive(self.Checkmark1, not self.disableSmartInvite) end return UIGuildJoinInPanel