Exemple #1
0
        public MenuItem AddMenuItem(MenuItem parent, String name, String details, Texture2D logo, OtherKeyType key)
        {
            PhotoTextItem newItem = new PhotoTextItem(Game, this);

            MenuItem.ScreenInfo info = newItem.CurrentInfo;
            info.pos.Y         -= 110;
            info.pos.X         -= 275;
            newItem.CurrentInfo = info;
            newItem.SetStringAndLogo(name, logo);
            newItem.SetDetails(details);

            newItem.NextState = RhythmGame.GameStateType.None;
            MenuItem inside = (MenuItem)newItem;

            if (parent != null)
            {
                if (!parent.AddLink(ref inside, key))
                {
                    parent = null;
                }
            }

            if (parent == null)
            {
                newItem.ItemSetup();
                Selected = newItem;
            }

            Items.Add(newItem);
            Shift += new Action <int, int>(newItem.Shift);
            return(newItem);
        }
Exemple #2
0
        public MenuItem AddMenuItem(MenuItem parent, OtherKeyType key, String text, RhythmGame.GameStateType nextState, int childId, SkillInformation info)
        {
            VerticalTextItem newItem = new VerticalTextItem(Game, this);
            bool             owns    = (info.Level <= 0);

            if (owns)
            {
                newItem.FontColor = Color.Gray;
            }
            newItem.ChildId  = childId;
            newItem.ItemText = text;
            if (owns)
            {
                newItem.NextState = nextState;
            }
            else
            {
                newItem.NextState = RhythmGame.GameStateType.None;
            }
            //newItem.DriftRateX = -2.0f;
            //newItem.DriftRateY = -0.25f;
            //newItem.ScaleRate = 0.9f;
            newItem.DefaultX = 120;
            newItem.StartY   = 175;
            MenuItem.ScreenInfo screenInfo = newItem.CurrentInfo;
            //info.pos.Y -= 220;
            //info.pos.X += 30;
            newItem.CurrentInfo = screenInfo;
            newItem.LargeFont   = true;
            MenuItem inside = (MenuItem)newItem;

            if (parent != null)
            {
                if (!parent.AddLink(ref inside, key))
                {
                    parent = null;
                }
            }

            if (parent == null)
            {
                newItem.ItemSetup();
                Selected = newItem;
            }

            skillInformation.Add(childId, info);

            Items.Add(newItem);
            Shift += new Action <int, int>(newItem.Shift);
            newItem.PreSelected += new Action <RhythmGame.GameStateType>(BuySkill);
            //newItem.PreSelected += new Action<RhythmGame.GameStateType>(LeavingMenu);
            return(newItem);
        }
Exemple #3
0
        public MenuItem AddMenuItem(MenuItem parent, OtherKeyType key, String text, RhythmGame.GameStateType nextState, int childId, TaskInformation info)
        {
            VerticalTextItem newItem = new VerticalTextItem(Game, this);

            newItem.ChildId   = childId;
            newItem.ItemText  = text;
            newItem.NextState = RhythmGame.GameStateType.None;
            //newItem.DriftRateX = -2.0f;
            //newItem.DriftRateY = -0.25f;
            //newItem.ScaleRate = 0.9f;
            newItem.DefaultX = 120;
            newItem.StartY   = 175;
            MenuItem.ScreenInfo screenInfo = newItem.CurrentInfo;
            //info.pos.Y -= 220;
            //info.pos.X += 30;
            newItem.CurrentInfo = screenInfo;
            newItem.LargeFont   = true;
            MenuItem inside = (MenuItem)newItem;

            if (parent != null)
            {
                if (!parent.AddLink(ref inside, key))
                {
                    parent = null;
                }
            }

            if (parent == null)
            {
                newItem.ItemSetup();
                Selected = newItem;
            }

            taskInformation.Add(childId, info);

            Items.Add(newItem);
            Shift += new Action <int, int>(newItem.Shift);

            return(newItem);
        }