Exemplo n.º 1
0
        public void AddQuestTaskPlotItemIndex()
        {
            if (Quests == null || SelectedQuest.Value == null || SelectedQuestTask == null)
            {
                return;
            }

            if (SelectedQuestTask.PlotItemIndices == null)
            {
                SelectedQuestTask.PlotItemIndices = InitCollection <int>();
            }

            var dlg = new NewObjectDialog
            {
                ContentText = "New quest task plot item index",
                ObjectId    = SelectedQuestTask.PlotItemIndices.Any() ? SelectedQuestTask.PlotItemIndices.Max(i => i) + 1 : 0
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            SelectedQuestTask.PlotItemIndices.Add(dlg.ObjectId);
        }
        public void AddSubstateSiblingIndex()
        {
            if (StateEvents == null || SelectedStateEvent.Value == null || SelectedStateEventElement == null)
            {
                return;
            }

            var selectedSubstate = SelectedStateEventElement as BioStateEventElementSubstate;

            if (selectedSubstate == null)
            {
                return;
            }

            if (!(selectedSubstate.SiblingIndices is BindableCollection <int>))
            {
                selectedSubstate.SiblingIndices = InitCollection(selectedSubstate.SiblingIndices);
            }

            var dlg = new NewObjectDialog
            {
                ContentText = "New substate sibling index",
                ObjectId    = 0
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            selectedSubstate.SiblingIndices.Add(dlg.ObjectId);
        }
Exemplo n.º 3
0
        private void NewOBJD_Click(object sender, EventArgs e)
        {
            var iff       = ActiveIff.MainIff;
            var objDialog = new NewObjectDialog(iff, false);

            objDialog.ShowDialog();
            if (objDialog.DialogResult == DialogResult.OK)
            {
                RegenObjMeta(ActiveIff);
                MainWindow.Instance.IffManager.OpenResourceWindow(GameContent.Get.WorldObjects.Get(objDialog.ResultGUID));
            }
        }
Exemplo n.º 4
0
        public void AddQuest()
        {
            if (Quests == null)
            {
                return;
            }

            var dlg = new NewObjectDialog
            {
                ContentText = "New codex section",
                ObjectId    = GetMaxQuestId() + 1
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            AddQuest(dlg.ObjectId);
        }
        public void AddCodexSection()
        {
            if (CodexSections == null)
            {
                CodexSections = InitCollection <KeyValuePair <int, BioCodexSection> >();
            }

            var dlg = new NewObjectDialog
            {
                ContentText = "New codex section",
                ObjectId    = GetMaxCodexSectionId() + 1
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            AddCodexSection(dlg.ObjectId);
        }
        public void AddStateEvent()
        {
            if (StateEvents == null)
            {
                StateEvents = InitCollection <KeyValuePair <int, BioStateEvent> >();
            }

            var dlg = new NewObjectDialog
            {
                ContentText = "New state event",
                ObjectId    = GetMaxStateEventId() + 1
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            AddStateEvent(dlg.ObjectId);
        }
Exemplo n.º 7
0
        private void NewOBJButton_Click(object sender, EventArgs e)
        {
            var iffDialog = new NewIffDialog();

            iffDialog.ShowDialog();
            if (iffDialog.DialogResult == DialogResult.OK)
            {
                var iff       = iffDialog.InitIff;
                var objDialog = new NewObjectDialog(iff, true);
                objDialog.ShowDialog();
                if (objDialog.DialogResult == DialogResult.OK)
                {
                    Browser.ObjectsModified();
                    IffManager.OpenResourceWindow(Content.Content.Get().WorldObjects.Get(objDialog.ResultGUID));
                }
                else
                {
                    MessageBox.Show("Object creation cancelled! Iff will not be created.");
                }
            }
        }
        public void AddStateTaskList()
        {
            if (StateTaskLists == null)
            {
                StateTaskLists = InitCollection <KeyValuePair <int, BioStateTaskList> >();
            }

            var dlg = new NewObjectDialog
            {
                ContentText =
                    string.Format("New {0}", "StateTaskList"),
                ObjectId = (GetMaxStateTaskListId() + 1)
            };

            if (dlg.ShowDialog() == false || dlg.ObjectId < 0)
            {
                return;
            }

            AddStateTaskList(dlg.ObjectId);
        }