Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ddpMovements.SelectedIndexChanged += new EventHandler(ddpMovements_SelectedIndexChanged);

            List <VO_ListItem> list = FormsTools.GetMovementsList();

            ddpMovements.Items.Clear();
            ddpMovements.DisplayMember = "Title";
            ddpMovements.ValueMember   = "Id";
            int i = 0;

            foreach (VO_ListItem item in list)
            {
                ddpMovements.Items.Add(item);
                if (item.Id == (int)Direction)
                {
                    ddpMovements.SelectedItem = item;
                }
                i++;
            }

            ddpMovements.SelectedIndexChanged += new EventHandler(ddpMovements_SelectedIndexChanged);
        }
Пример #2
0
        /// <summary>
        /// Charger les listes propres à CharacterDB
        /// </summary>
        private void LoadLists()
        {
            this.ddpStartingDirection.SelectedIndexChanged -= new System.EventHandler(this.ddpStartingDirection_SelectedIndexChanged);
            this.ddpCharacterTemplate.SelectedValueChanged -= new EventHandler(ddpCharacterTemplate_SelectedValueChanged);

            List <VO_Base> list = _Service.GetCharacterTemplateList(CurrentCharacter.Id);

            ddpCharacterTemplate.DataSource    = list;
            ddpCharacterTemplate.DisplayMember = "Title";
            ddpCharacterTemplate.ValueMember   = "Id";
            ddpCharacterTemplate.SelectedValue = CurrentCharacter.CharacterId;
            List <VO_ListItem> list2 = FormsTools.GetMovementsList();

            ddpStartingDirection.DataSource    = list2;
            ddpStartingDirection.DisplayMember = "Title";
            ddpStartingDirection.ValueMember   = "Id";
            ddpStartingDirection.SelectedValue = (int)CurrentCharacter.StartPosition;
            if (ddpStartingDirection.SelectedValue == null)
            {
                CurrentCharacter.StartPosition     = 0;
                ddpStartingDirection.SelectedValue = 0;
            }

            this.ddpStartingDirection.SelectedIndexChanged += new System.EventHandler(this.ddpStartingDirection_SelectedIndexChanged);
            this.ddpCharacterTemplate.SelectedValueChanged += new EventHandler(ddpCharacterTemplate_SelectedValueChanged);
        }
Пример #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (IsAdd == true)
            {
                CurrentCharacterId = Guid.Empty;
            }

            ddpMovements.SelectedIndexChanged += new EventHandler(ddpMovements_SelectedIndexChanged);

            //Character List
            VO_Stage CurrentStage = GameCore.Instance.GetStageById(EditorHelper.Instance.CurrentStage);

            cmbCharacterSelection.Items.Clear();
            cmbCharacterSelection.DisplayMember = "Title";
            cmbCharacterSelection.ValueMember   = "Id";

            cmbCharacterSelection.Enabled = true;

            foreach (VO_StageCharacter item in CurrentStage.ListCharacters)
            {
                cmbCharacterSelection.Items.Add(item);
                cmbCharacterSelection.SelectedItem = item;
            }

            if (cmbCharacterSelection.Items.Count <= 0)
            {
                cmbCharacterSelection.Enabled = false;
                return;
            }

            if (IsAdd == false)
            {
                foreach (VO_StageCharacter CurrentCharacter in CurrentStage.ListCharacters)
                {
                    if (CurrentCharacter.Id == CurrentCharacterId)
                    {
                        cmbCharacterSelection.SelectedItem = CurrentCharacter;
                    }
                }
            }

            // Movement List
            List <VO_ListItem> list = FormsTools.GetMovementsList();

            ddpMovements.Items.Clear();
            ddpMovements.DisplayMember = "Title";
            ddpMovements.ValueMember   = "Id";
            int i = 0;

            foreach (VO_ListItem item in list)
            {
                ddpMovements.Items.Add(item);
                if (item.Id == (int)Direction)
                {
                    ddpMovements.SelectedItem = item;
                }
                i++;
            }

            ddpMovements.SelectedIndexChanged += new EventHandler(ddpMovements_SelectedIndexChanged);
        }
Пример #4
0
        /// <summary>
        /// Charge les contrôles
        /// </summary>
        public void LoadControls(VO_Page currentPage, Guid characterId)
        {
            if (currentPage.PageEventType == Enums.EventType.Character)
            {
                _CharacterId = characterId;

                //Désactivation des events
                ddpDirection.SelectedValueChanged    -= new EventHandler(ddpDirection_SelectedValueChanged);
                ddpSpeed.SelectedValueChanged        -= new EventHandler(ddpSpeed_SelectedValueChanged);
                ddpFrequency.SelectedValueChanged    -= new EventHandler(ddpFrequency_SelectedValueChanged);
                ddpStandingType.SelectedValueChanged -= new EventHandler(ddpStandingType_SelectedValueChanged);
                ddpWalkingType.SelectedValueChanged  -= new EventHandler(ddpWalkingType_SelectedValueChanged);
                ddpTalkingType.SelectedValueChanged  -= new EventHandler(ddpTalkingType_SelectedValueChanged);

                List <VO_ListItem> list = FormsTools.GetMovementsList();
                ddpDirection.DataSource    = list;
                ddpDirection.DisplayMember = "Title";
                ddpDirection.ValueMember   = "Id";
                ddpDirection.SelectedValue = (int)currentPage.CharacterDirection;

                ddpSpeed.SelectedValue     = currentPage.CharacterSpeed;
                ddpFrequency.SelectedValue = currentPage.CharacterAnimationFrequency;

                ddpStandingType.DataSource    = GameCore.Instance.GetCharAnimations(characterId);
                ddpStandingType.DisplayMember = "Title";
                ddpStandingType.ValueMember   = "Id";
                if (currentPage.CharacterStandingType == Guid.Empty)
                {
                    ddpStandingType.SelectedIndex = 0;
                }
                else
                {
                    ddpStandingType.SelectedValue = currentPage.CharacterStandingType;
                }

                ddpWalkingType.DataSource    = GameCore.Instance.GetCharAnimations(characterId);
                ddpWalkingType.DisplayMember = "Title";
                ddpWalkingType.ValueMember   = "Id";
                if (currentPage.CharacterWalkingType == Guid.Empty)
                {
                    ddpWalkingType.SelectedIndex = 0;
                }
                else
                {
                    ddpWalkingType.SelectedValue = currentPage.CharacterWalkingType;
                }

                ddpTalkingType.DataSource    = GameCore.Instance.GetCharAnimations(characterId);
                ddpTalkingType.DisplayMember = "Title";
                ddpTalkingType.ValueMember   = "Id";
                if (currentPage.CharacterTalkingType == Guid.Empty)
                {
                    ddpTalkingType.SelectedIndex = 0;
                }
                else
                {
                    ddpTalkingType.SelectedValue = currentPage.CharacterTalkingType;
                }

                LoadAnimation();

                //Réactivation des events
                ddpDirection.SelectedValueChanged    += new EventHandler(ddpDirection_SelectedValueChanged);
                ddpSpeed.SelectedValueChanged        += new EventHandler(ddpSpeed_SelectedValueChanged);
                ddpFrequency.SelectedValueChanged    += new EventHandler(ddpFrequency_SelectedValueChanged);
                ddpStandingType.SelectedValueChanged += new EventHandler(ddpStandingType_SelectedValueChanged);
                ddpWalkingType.SelectedValueChanged  += new EventHandler(ddpWalkingType_SelectedValueChanged);
                ddpTalkingType.SelectedValueChanged  += new EventHandler(ddpTalkingType_SelectedValueChanged);
            }
        }