Beispiel #1
0
        private void OnEditIDClicked(object sender, EventArgs e)
        {
            if (!ready)
            {
                return;
            }

            DialogRename dialog = new DialogRename(currentActor.ID);

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string oldID = currentActor.ID;
                if (project.ChangeActorID(currentActor, dialog.NewID))
                {
                    List <Dialogue> dialogues = ResourcesHandler.GetAllDialogues();
                    foreach (Dialogue dialogue in dialogues)
                    {
                        if (dialogue.UpdateActorID(oldID, currentActor.ID))
                        {
                            ResourcesHandler.SetDirty(dialogue);
                        }
                    }

                    textBoxID.Text = currentActor.ID;

                    SetDirty();

                    if (EditorCore.MainWindow != null)
                    {
                        EditorCore.MainWindow.RefreshDirtyFlags();
                    }
                }
            }
        }