Esempio n. 1
0
        public MenuItem AddMenuItem(MenuItem parent, OtherKeyType key, String text, RhythmGame.GameStateType nextState)
        {
            VerticalTextItem newItem = new VerticalTextItem(Game, this);

            newItem.LargeFont = true;
            newItem.ItemText  = text;
            newItem.NextState = nextState;
            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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }