コード例 #1
0
 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));
 }
コード例 #2
0
        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();
            });
        }
コード例 #3
0
        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();
            });
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        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();
            }
        }