//Events private void MainWindow_DataLoaded(TaleData obj) { StoryFile.ItemCreated += StoryFile_ItemCreated; StoryFile.ItemRemoved += StoryFile_ItemRemoved; EditingClip = StoryFile.RootClip; }
private void StoryFile_ItemRemoved(StoryBlockBase item, StoryClip parentItem) { //Remove view dataToViewDict[item].DetachParent(); //StoryFile.RemoveStoryBlockItem(item); dataToViewDict.Remove(item); }
void LoadStory(StoryClip clip) { currentClip = Instantiate(clip); currentStory = currentClip.story; bgm = currentClip.bgm; SetTextColor(currentClip.textColor); SetBackColor(currentClip.backgroundColor); }
private void StoryFile_ItemCreated(StoryBlockBase item, StoryClip parentItem) { if (parentItem == null) { return; } if (parentItem != EditingClip) { return; } //Create view StoryBlockItemView itemView = new StoryBlockItemView(item); StoryBlockTreeView.ChildItemCollection.Add(itemView); itemView.ParentItem = StoryBlockTreeView; dataToViewDict.Add(item, itemView); }