private void ExecuteCommandEditFactionDescription(bool isPrivateDescription) { BbTextEditorHelper.ClientOpenTextEditor( originalText: isPrivateDescription ? this.factionPrivateState.DescriptionPrivate : this.factionPrivateState.DescriptionPublic, maxLength: isPrivateDescription ? FactionSystem.MaxDescriptionLengthPrivate : FactionSystem.MaxDescriptionLengthPublic, windowHeight: isPrivateDescription ? 450 : 200, onSave: text => FactionSystem.ClientOfficerSetFactionDescription(text, isPrivateDescription)); }
public static async void ClientEditDescription() { var originalText = await Instance.CallServer(_ => _.ServerRemote_GetDescriptionMessage()); BbTextEditorHelper.ClientOpenTextEditor(originalText, maxLength: MaxDescriptionLength, windowHeight: 200, onSave: async text => { await Instance.CallServer( _ => _.ServerRemote_SetDescription(text)); RefreshDescription(); }); }
public static async void ClientEditWelcomeMessage() { var welcomeMessageData = await Instance.CallServer(_ => _.ServerRemote_GetInfo()); BbTextEditorHelper.ClientOpenTextEditor(welcomeMessageData.WelcomeMessage, maxLength: MaxWelcomeMessageLength, windowHeight: 530, onSave: async text => { await Instance.CallServer( _ => _.ServerRemote_SetWelcomeMessage(text)); RefreshWelcomeMessage(); }); }
public static async void ClientEditDescription() { var originalText = await Instance.CallServer(_ => _.ServerRemote_GetDescriptionMessage()); BbTextEditorHelper.ClientOpenTextEditor(originalText, maxLength: MaxDescriptionLength, windowHeight: 200, onSave: OnSave); async void OnSave(string text) { if (Api.Client.SteamApi.IsSteamClient) { text = Api.Client.SteamApi.FilterText(text); } text = ProfanityFilteringSystem.SharedApplyFilters(text); await Instance.CallServer(_ => _.ServerRemote_SetDescription(text)); RefreshDescription(); } }
public static async void ClientEditWelcomeMessage() { var welcomeMessageData = await Instance.CallServer(_ => _.ServerRemote_GetInfo()); BbTextEditorHelper.ClientOpenTextEditor(welcomeMessageData.WelcomeMessage, maxLength: MaxWelcomeMessageLength, windowHeight: 530, onSave: OnSave); async void OnSave(string text) { if (Api.Client.SteamApi.IsSteamClient) { text = Api.Client.SteamApi.FilterText(text); } text = ProfanityFilteringSystem.SharedApplyFilters(text); await Instance.CallServer(_ => _.ServerRemote_SetWelcomeMessage(text)); RefreshWelcomeMessage(); } }