예제 #1
0
 public ucNPCCharacterListEdit(MBNPCCharacters characters)
 {
     InitializeComponent();
     ucNPCCharacterList = new ucNPCCharacterList(characters);
     ucNPCCharacterList.SelectNPCCharacterChanged += UcNPCCharacterList_SelectNPCCharacterChanged;
     panel2.Controls.Clear();
     panel2.Controls.Add(ucNPCCharacterList);
     ucNPCCharacterList.Dock = DockStyle.Fill;
     state = AddEditState.View;
 }
예제 #2
0
 public ucHeroListEdit(MBHeroes heroes)
 {
     InitializeComponent();
     ucHeroList = new ucHeroList(heroes);
     ucHeroList.SelectHeroChanged += UcHeroList_SelectHeroChanged;
     panel2.Controls.Clear();
     panel2.Controls.Add(ucHeroList);
     ucHeroList.Dock = DockStyle.Fill;
     state           = AddEditState.View;
 }
예제 #3
0
        public AddEditFilmForm(MainForm mainForm, AddEditState currentState, FilmotecClass filmotecClass, SettingClass settingClass, FilmInfo editFilmInfo)
        {
            InitializeComponent();

            this.mMainForm      = mainForm;
            this.mCurrentState  = currentState;
            this.mFilmotecClass = filmotecClass;
            this.mSettingClass  = settingClass;
            this.mOldFilmInfo   = editFilmInfo;
        }
예제 #4
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            state = AddEditState.Edit;

            ucHeroList.Enabled = false;
            btnAdd.Enabled     = false;
            btnDelete.Enabled  = false;
            btnModify.Enabled  = false;

            SelectedHeroChanged?.Invoke(selectedHero, selectedIndex, state);
        }
예제 #5
0
        public AddEditDiskForm(MainForm mainForm, AddEditState currentState, FilmotecClass filmotecClass, SettingClass settingClass, DiskInfo editDiskInfo, int selectedIndex)
        {
            InitializeComponent();

            m_MainForm      = mainForm;
            m_CurrentState  = currentState;
            m_FilmotecClass = filmotecClass;
            m_SettingClass  = settingClass;
            m_OldDiskInfo   = editDiskInfo;
            m_SelectedIndex = selectedIndex;
        }
예제 #6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            state = AddEditState.Add;

            ucHeroList.Enabled = false;
            btnAdd.Enabled     = false;
            btnDelete.Enabled  = false;
            btnModify.Enabled  = false;

            MBHero hero = new MBHero();

            SelectedHeroChanged?.Invoke(hero, -1, state);
        }
예제 #7
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            state = AddEditState.Add;

            ucNPCCharacterList.Enabled = false;
            btnAdd.Enabled             = false;
            btnDelete.Enabled          = false;
            btnModify.Enabled          = false;

            MBNPCCharacter character = new MBNPCCharacter();

            SelectNPCCharacterChanged?.Invoke(character, -1, state);
        }
예제 #8
0
        public void ChangeAddEditState(AddEditState newState)
        {
            if ((state == AddEditState.Add || state == AddEditState.Edit) &&
                newState == AddEditState.View)
            {
                ucNPCCharacterList.Enabled = true;
                btnAdd.Enabled             = true;
                if (ucNPCCharacterList.SelectedCharacter != null)
                {
                    btnDelete.Enabled = true;
                    btnModify.Enabled = true;
                }

                state = newState;
            }
        }
        public ucNPCCharacterDetails(AMProject project, MBNPCCharacter character, AddEditState state, int index)
        {
            InitializeComponent();
            this.project   = project;
            this.character = character;
            this.state     = state;
            this.index     = index;

            if (state == AddEditState.View)
            {
                btnSave.Visible = false;
            }
            else
            {
                btnSave.Visible = true;
            }

            LoadNPCCharacter();
        }
예제 #10
0
 private void FactionDetailsCtrl_SaveKingdomInfoFinished(MBKingdom savedKingdom, AddEditState state, int index)
 {
     if (state == AddEditState.Add)
     {
         kingdoms.Kingdoms.Add(savedKingdom);
         XmlObjectLoader xmlObjectLoader = new XmlObjectLoader(kingdoms.FilePath);
         xmlObjectLoader.Save(kingdoms);
         factionListCtrl.ChangeAddEditState(AddEditState.View);
         factionListCtrl.RefreshData();
     }
     else if (state == AddEditState.Edit)
     {
         kingdoms.Kingdoms[index] = savedKingdom;
         XmlObjectLoader xmlObjectLoader = new XmlObjectLoader(kingdoms.FilePath);
         xmlObjectLoader.Save(kingdoms);
         factionListCtrl.ChangeAddEditState(AddEditState.View);
         factionListCtrl.RefreshData();
     }
 }