public EventCommandText(ShowTextCommand refCommand, FrmEvent editor)
        {
            InitializeComponent();
            mMyCommand   = refCommand;
            mEventEditor = editor;
            InitLocalization();
            txtShowText.Text = mMyCommand.Text;
            cmbFace.Items.Clear();
            cmbFace.Items.Add(Strings.General.none);
            cmbFace.Items.AddRange(GameContentManager.GetSmartSortedTextureNames(GameContentManager.TextureType.Face));
            if (cmbFace.Items.IndexOf(TextUtils.NullToNone(mMyCommand.Face)) > -1)
            {
                cmbFace.SelectedIndex = cmbFace.Items.IndexOf(TextUtils.NullToNone(mMyCommand.Face));
            }
            else
            {
                cmbFace.SelectedIndex = 0;
            }

            UpdateFacePreview();
        }
        public ModalWindowViewModel()
        {
            ShowTextCommand.Subscribe(_ =>
            {
                NumberOutput.Value = NumberInput.Value;
                NumberInput.Value  = null;

                FocusTextBoxCommand.Execute();
            });

            ClearTextCommand = NumberOutput
                               .Select(number => !(number is null))
                               .ToReactiveCommand();
            ClearTextCommand.Subscribe(_ =>
            {
                NumberOutput.Value = null;
                NumberInput.Value  = null;

                FocusTextBoxCommand.Execute();
            });
        }
Exemplo n.º 3
0
    ShowTextCommand RegisterTextCommand( string main )
    {
        char[] delimiter;
        string[] parsedCommand;
        delimiter = new char[4];
        //delimiter = new char[4];
        delimiter[0] = '$';
        delimiter[1] = '"';

        delimiter[2] = '+';
        delimiter[3] = '%';

        parsedCommand = main.Split( delimiter, System.StringSplitOptions.RemoveEmptyEntries );
        if( parsedCommand.Length == 3 )
        {
            DialogueHolder.Instance.AddDialogue( ref parsedCommand[0], parsedCommand[2] );
        }
        else if( parsedCommand.Length == 2 )
        {
            DialogueHolder.Instance.AddDialogue( ref parsedCommand[0], parsedCommand[1] );
        }
        ShowTextCommand showText = new ShowTextCommand();
        showText.SetConversation(parsedCommand[0].ToLower());
        return showText;
    }
Exemplo n.º 4
0
        //TODO: Bring this in and clean up the above later (AFTER we get everything else working and we can actually test our changes.)
        //public static void PrintCommand(List<EventCommand> commandList, EventCommand command, string indent, ListBox lstEventCommands, List<CommandListProperties> mCommandProperties)
        //{
        //    lstEventCommands.Items.Add(indent + Strings.EventCommandList.linestart + GetCommandText(command));
        //    var clp = new CommandListProperties
        //    {
        //        Editable = true,
        //        MyIndex = commandList.IndexOf(command),
        //        MyList = commandList,
        //        Type = command.Type,
        //        Cmd = command
        //    };
        //    mCommandProperties.Add(clp);
        //}

        private static string GetCommandText(ShowTextCommand command, MapInstance map)
        {
            return(Strings.EventCommandList.showtext.ToString(Truncate(command.Text, 30)));
        }