local UIGuildRecruitManifestoPanel = UIViewClass() local EventSystem = require('Event/EventSystem') function UIGuildRecruitManifestoPanel:OnOpened(context) local str = string.FormatByIdsId(Const_IDS.IDS_GuildRecruit_InitialText,MDL.Guild.GetMyGuildInfo().guildName, #MDL.Guild.GetGuildMemberInfo().members,MDL.Guild.GetMaxMemberCount()) self.lab_NoticeDefult.text = str self.obj_InputField.text = MDL.Guild.GetGuildMemberInfo().listInfo.recruitTagline UIUtils.SetLabelText(self.UICommonPopUp.txt_Title,Const_IDS.IDS_GuildMainpage_Button3) end function UIGuildRecruitManifestoPanel:OnValueChanged(comp, value) if comp == self.obj_InputField then local length = DataSheetManager.ConstData:GetDataByID("GuildRecruitCharNumlimit").IntValue self.obj_InputField.text = UTL.String.CutStrByLength(self.obj_InputField.text, length) end end function UIGuildRecruitManifestoPanel:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIGuildRecruitManifestoPanel:OnButtonClicked(comp) if comp == self.btn_1 then if string.isNilOrEmpty(self.obj_InputField.text) then CTL.Sound.PlayGameSound("UI_invalid") CTL.Tips.AddTipsMsg(Const_IDS.IDS_Chat_CantBlank) elseif not MDL.Guild.JobHasPermission(MDL.Guild.GetMyGuildInfo().jobTitle,MDL.Guild.AuthorityEnum.GuildRecruit) then CTL.Sound.PlayGameSound("UI_invalid") CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonFail4) else CTL.Tips.AddTipsMsg(Const_IDS.IDS_GuildRecruit_Succeed1) CTL.Guild.SetCdTime() MDL.ChannelChat.SendChatGuildRecruitMsg(self.lab_NoticeDefult.text, self.obj_InputField.text, MDL.Guild.GetMyGuildInfo().guildId) EventSystem.Dispatch(EventID.UI_Guild_GuildRecruitRefresh) self:CloseView() end elseif comp == self.UICommonPopUp.btn_Close then self:CloseView() end end return UIGuildRecruitManifestoPanel