Esempio n. 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            control.CurrentNumberControlItems = fields[control.CurrentActiveField].maxItems;

            control.Update(gameTime);

            if (control.CurrentActiveItem != 10)
            {
                items[control.CurrentActiveItem].itemsetting.Text = option_member.GetString(1, items[control.CurrentActiveItem].currentIndex);
            }

            foreach (var control_field in fields)
            {
                control_field.Status = -1;
                control_field.SetStatus(control.CurrentActiveField);
                control_field.Update(gameTime);
            }

            foreach (var item in items)
            {
                item.IsSelected = false;
                item.SetSelected((int)control.currentSelectedItemControl);
                item.Update(gameTime);
            }
            if (control.currentSelectedMainControl == Control1.selection.fieldactive)
            {
                items[control.CurrentActiveItem].IsSelected = true;
                items[control.CurrentActiveItem].Update(gameTime);
            }

            //When the Escape key has been pressed exit the game
            if (InputManager.Instance.KeyPressed(Keys.Escape) || ScreenManager.Instance.Controllers[0].X_Button(true))
            {
                ScreenManager.Instance.ChangeScreen("MenuScreen");
            }

            if (InputManager.Instance.KeyPressed(Keys.I))
            {
                //option_member.ExcuteAction(Options_Members.Actions.changeResolution, items[control.CurrentActiveItem].currentIndex);
            }
        }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            control.CurrentNumberControlItems = fields[control.CurrentActiveField].maxItems;

            control.Update(gameTime);

            if (control.CurrentActiveField == 0)
            {
                for (int i = 0; i < items1.Length; i++)
                {
                    if (i != 10 && items1[i] != null)
                    {
                        items1[i].itemsetting.Text = charCreatin_member.GetString(0, i, items1[i].currentIndex);
                    }
                }
            }
            else if (control.CurrentActiveField == 2)
            {
                for (int i = 0; i < items2.Length; i++)
                {
                    if (i != 10 && items2[i] != null)
                    {
                        items2[i].itemsetting.Text = charCreatin_member.GetString(2, i, items2[i].currentIndex);
                    }
                }
            }
            else if (control.CurrentActiveField == 1)
            {
                for (int i = 0; i < items3.Length; i++)
                {
                    if (i != 10 && items3[i] != null)
                    {
                        items3[i].itemsetting.Text = charCreatin_member.GetString(1, i, items3[i].currentIndex);
                    }
                }
            }

            foreach (var control_field in fields)
            {
                control_field.Status = -1;
                control_field.SetStatus(control.CurrentActiveField);
                control_field.Update(gameTime);
            }

            foreach (var item in items1)
            {
                if (item != null)
                {
                    item.IsSelected = false;
                    item.SetSelected((int)control.currentSelectedItemControl);
                    item.Update(gameTime);
                }
            }
            foreach (var item in items2)
            {
                if (item != null)
                {
                    item.IsSelected = false;
                    item.SetSelected((int)control.currentSelectedItemControl);
                    item.Update(gameTime);
                }
            }
            foreach (var item in items3)
            {
                if (item != null)
                {
                    item.IsSelected = false;
                    item.SetSelected((int)control.currentSelectedItemControl);
                    item.Update(gameTime);
                }
            }

            if (control.currentSelectedMainControl == Control1.selection.fieldactive)
            {
                if (control.CurrentActiveItem != 10)
                {
                    if (control.CurrentActiveField == 0)
                    {
                        items1[control.CurrentActiveItem].IsSelected = true;
                        items1[control.CurrentActiveItem].Update(gameTime);
                    }
                    if (control.CurrentActiveField == 2)
                    {
                        items2[control.CurrentActiveItem].IsSelected = true;
                        items2[control.CurrentActiveItem].Update(gameTime);
                    }
                    if (control.CurrentActiveField == 1)
                    {
                        items3[control.CurrentActiveItem].IsSelected = true;
                        items3[control.CurrentActiveItem].Update(gameTime);
                    }
                }
            }

            if (control.CurrentActiveField == 1 || control.CurrentActiveField == 2)
            {
                for (int i = 0; i < characterCreator.curAppearencesettings.Length; i++)
                {
                    characterCreator.curAppearencesettings[i] = items3[i].currentIndex;
                }
                for (int i = 0; i < characterCreator.curClothessettings.Length; i++)
                {
                    characterCreator.curClothessettings[i] = items2[i].currentIndex;
                }
                characterCreator.Update(gameTime);
            }

            if (ScreenManager.Instance.Controllers[0].characterInfo.NotFound)
            {
                ScreenManager.Instance.Controllers[0].characterInfo.NameIndex = items1[0].currentIndex;

                ScreenManager.Instance.Controllers[0].characterInfo.Gender    = items3[0].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Skincolor = items3[1].currentIndex;

                ScreenManager.Instance.Controllers[0].characterInfo.Head  = items2[0].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Shirt = items2[1].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Belt  = items2[2].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Pants = items2[3].currentIndex;

                ScreenManager.Instance.Controllers[0].characterInfo.NotFound = false;
            }


            if (control.currentSelectedMainControl == Control1.selection.buttoncontinue && (InputManager.Instance.KeyPressed(Keys.Enter) || ScreenManager.Instance.Controllers[0].A_Button(true)))
            {
                ScreenManager.Instance.Controllers[0].characterInfo.Name      = charCreatin_member.GetString(0, 0, items1[0].currentIndex);
                ScreenManager.Instance.Controllers[0].characterInfo.Gender    = items3[0].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Skincolor = items3[1].currentIndex;

                ScreenManager.Instance.Controllers[0].characterInfo.Head  = items2[0].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Shirt = items2[1].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Belt  = items2[2].currentIndex;
                ScreenManager.Instance.Controllers[0].characterInfo.Pants = items2[3].currentIndex;

                ScreenManager.Instance.Controllers[0].SaveSettings();

                ScreenManager.Instance.ChangeScreen("MapTestScreen");
            }

            //When the Escape key has been pressed exit the game
            if (InputManager.Instance.KeyPressed(Keys.Escape))
            {
                //ScreenManager.Instance.ChangeScreen("MenuScreen");
            }
        }