Ejemplo n.º 1
0
        public Listbox(ICanyonShooterGame game, Vector2 pos, bool scroll, MenuDescription xml, int district, Dictionary <string, object> Data, Dictionary <string, string> Format, List <string> Names)
            : base(district)
        {
            this.isActive = true;
            this.visible  = true;
            this.game     = game;
            this.style    = 1;

            this.Position   = pos;
            this.scrollable = scroll;

            this.data = Data;

            this.BoxContentPosition = new Vector2(Position.X + 7, Position.Y + 30);
            this.BoxContentHeight   = this.BoxHeight - 30 - 31;
            this.Titel = "Optionen: ";

            switch (difficulty)
            {
            case 0:
                this.Titel += "Spielereinstellungen";
                break;

            case 1:
                this.Titel += "Grafik";
                break;

            case 2:
                this.Titel += "Sound";
                break;

            case 3:
                this.Titel += "Steuerung";
                break;

            default:
                break;
            }

            //Building the Member for the Buttons and Scores
            this.List    = new OptionList(game, game.Content.Load <OptionDescription>("Content\\Menu\\OptionMenu"), district, BoxContentPosition, Data, Format, Names, false, this);
            this.Buttons = new NormalList(game, ButtonPosition(xml), "OptionList", xml, true);
            this.Scrolling();
            this.intializeScrollbar();

            slideBars = new Dictionary <string, HSlideBar>();
            int counter = Names.Count;

            foreach (Button g in this.List)
            {
                HSlideBar hsb = getSlideBar(g, Names[Names.Count - counter]);
                if (hsb != null)
                {
                    slideBars.Add(g.getButtonName(), hsb);
                }

                counter--;
            }
        }
Ejemplo n.º 2
0
        public Dialog(ICanyonShooterGame game, OptionDescription xml, int district,
                      Dictionary <string, object> Data, Dictionary <string, string> Format, List <string> Names)
            : base(game as Game)
        {
            this.game     = game;
            this.xml      = xml;
            this.Data     = Data;
            this.Format   = Format;
            this.Names    = Names;
            this.district = district;
            this.visible  = true;
            this.list     = new OptionList(game, xml, district, Data, Format, Names, false, this);

            OptMod   = new Dictionary <string, OptionModulationButton>();
            SlideMod = new Dictionary <string, HSlideBar>();
            int counter = Names.Count;

            foreach (Button g in this.list)
            {
                OptionModulationButton opt = getOptionModulationButton(g, Names[Names.Count - counter]);
                if (opt != null)
                {
                    OptMod.Add(g.getButtonName(), opt);
                }
                else
                {
                    HSlideBar hsb = getSlideBar(g, Names[Names.Count - counter]);
                    if (hsb != null)
                    {
                        SlideMod.Add(g.getButtonName(), hsb);
                    }
                }
                counter--;
            }

            foreach (OptionpartDescription i in xml.OptionParts)
            {
                if (i.Number == this.district)
                {
                    this.Position = new Rectangle(game.Graphics.Device.Viewport.Width - 398 + (i.Position.X - 398),
                                                  i.Position.Y, i.Position.Width, list.Height + i.Position.Height);
                    this.startposition = new Vector2(game.Graphics.Device.Viewport.Width - 398 + (i.StartPosition.X - 398),
                                                     i.StartPosition.Y);
                    foreach (OptionButtonDescription g in i.Buttons)
                    {
                        if (g.ButtonName == "Akzeptieren")
                        {
                            accept = new Button(game, g.ButtonName, startposition, g.height, g.width,
                                                "OptionDialog\\" + g.ButtonImage, true, this);
                        }
                        else if (g.ButtonName == "Ablehnen")
                        {
                            decline = new Button(game, g.ButtonName, startposition, g.height, g.width,
                                                 "OptionDialog\\" + g.ButtonImage, true, this);
                        }
                    }
                }
            }
        }