Пример #1
0
        public string GetRelativePath(DialogObjectManager manager, string fileName)
        {
            string directory;
            int idx = RelativePath.LastIndexOf('\\');
            if (idx <= 0)
                directory = manager.RootDirectory;
            else
                directory = Path.Combine(manager.RootDirectory, RelativePath.Substring(0, idx));

            return PathHelper.GetRelativePath(directory, fileName);
        }
Пример #2
0
        public SaveForm(DialogObjectManager manager)
        {
            InitializeComponent();

            _tree.ImageList=new ImageList();
            _tree.ImageList.Images.Add("Folder", Properties.Resources.folder);
            _tree.ImageList.Images.Add("FolderBlue", Properties.Resources.folder_blue);
            _tree.ImageList.Images.Add("Dialog", Properties.Resources.message);

            _manager = manager;
        }
Пример #3
0
        public string GetFullPath(DialogObjectManager manager, string relativePath)
        {
            string directory=null;
            int lastBackslash = RelativePath.IndexOf('\\');
            if (lastBackslash > 0)
                directory = RelativePath.Substring(0, lastBackslash);

            directory = string.IsNullOrEmpty(directory)
                            ? manager.RootDirectory
                            : Path.Combine(manager.RootDirectory, directory);

            return Path.GetFullPath(Path.Combine(directory, relativePath));
        }
Пример #4
0
        public FormDialogEditor()
        {
            InitializeComponent();
            _dialogManager=new DialogObjectManager();
            _controlDialogNode.Init(_dialogManager);

            _dialogManager.RootDirectoryChanged += DialogRootDirectoryChanged;
            _bindingDialogLink.CurrentChanged += DialogNodeChanged;
            _bindingDialog.CurrentChanged += DialogChanged;

            _treeDialogs.ImageList=new ImageList();
            _treeDialogs.ImageList.Images.Add("Folder", Properties.Resources.folder);
            _treeDialogs.ImageList.Images.Add("Dialog", Properties.Resources.messages);
            _treeDialogs.ImageList.Images.Add("FolderBlue", Properties.Resources.folder_blue);

            DialogRootDirectoryChanged();
        }
Пример #5
0
        public FormDialogProperties(DialogObjectManager manager, DialogObject dialog)
        {
            InitializeComponent();

            _dialogObject = dialog;
            _dialog = _dialogObject.Dialog;
            _manager = manager;

            _comboCharacters.Items.AddRange(_dialog.Dialogs.Characters.Keys.ToArray());

            foreach(var character in _dialog.DialogCharacters)
            {
                var item = _listCharacters.Items.Add(new ListViewItem(character.Name));
                item.Tag = new DialogCharacter(_dialog) {IsPlayer = character.IsPlayer, Name = character.Name};
                item.Checked = character.IsPlayer;
            }

            string name = _dialogObject.GetName();

            _textDialogName.Text = name;

            string scriptFileName;
            try
            {
                if(_dialog.ScriptFile!=null)
                    scriptFileName = _dialog.ScriptFile;
                else
                {
                    var filePath = Path.Combine(manager.RootDirectory, _dialogObject.RelativePath + ".lua");
                    if (File.Exists(filePath))
                        scriptFileName = name + ".lua";
                    else
                        scriptFileName = string.Empty;
                }
            }
            catch
            {
                scriptFileName = string.Empty;
            }

            _textScriptFile.Text = scriptFileName;
        }