Example #1
0
        private void VariableSet_Ok(object sender, EventArgs e)
        {
            VariableSetForm vsf = (VariableSetForm)sender;

            vsf.Close();
            this.Close();
        }
Example #2
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            switch ((SpecialType)TypeComboBox.SelectedItem)
            {
            case SpecialType.None:
                break;

            case SpecialType.Battle:
                ResourceManager.Map.Segments[SegmentId].Special.Type = SpecialType.Battle;
                Leviathan.Editors.BattleEditor.BattleEditorForm bef = new BattleEditor.BattleEditorForm(ResourceManager.Map.Segments[SegmentId].Special);
                bef.Ok         += new EventHandler(BattleEditor_Ok);
                bef.Cancel     += new EventHandler(BattleEditor_Cancel);
                bef.FormClosed += new FormClosedEventHandler(BattleEditor_Closed);
                bef.Show();
                break;

            case SpecialType.Puzzle:
                throw new NotImplementedException();

            case SpecialType.Conversation:
                throw new NotImplementedException();

            case SpecialType.VariableSet:
                ResourceManager.Map.Segments[SegmentId].Special.Type = SpecialType.VariableSet;
                VariableSetForm vsf = new VariableSetForm(SegmentId);
                vsf.Ok         += new EventHandler(VariableSet_Ok);
                vsf.Cancel     += new EventHandler(VariableSet_Cancel);
                vsf.FormClosed += new FormClosedEventHandler(VariableSet_Closed);
                vsf.Show();
                break;
            }
            ResourceManager.Map.Segments[SegmentId].Special = ResourceManager.Map.Segments[SegmentId].Special;
            this.Enabled = false;
        }