Esempio n. 1
0
        public Spells(SpriteFont font, Texture2D magic, Texture2D magicSymbol, Texture2D button, Texture2D upDown, Texture2D mark, SoundEffect clickSound, SoundEffect booksound,
                      SoundEffect crystalsound, int startPos, int yStartPos, int yCuttOff)
        {
            this.clickSound = clickSound;
            move            = magic.Height / 2;
            spells          = new List <SpellSlots>();
            this.font       = font;
            spells.Add(new SpellSlots(magic, magicSymbol, font, new FireBlast(), startPos + 50, yStartPos, crystalsound, 0));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new IceBlast(), startPos + 50, yStartPos + (1 * move), crystalsound, 1));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new LightningBlast(), startPos + 50, yStartPos + (2 * move), crystalsound, 2));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new EarthBlast(), startPos + 50, yStartPos + (3 * move), crystalsound, 3));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new DarkBlast(), startPos + 50, yStartPos + (4 * move), crystalsound, 4));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new HolyBlast(), startPos + 50, yStartPos + (5 * move), crystalsound, 5));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Healing(), startPos + 50, yStartPos + (6 * move), crystalsound, 6));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Distract(), startPos + 50, yStartPos + (7 * move), crystalsound, 7));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Panic(), startPos + 50, yStartPos + (8 * move), crystalsound, 8));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Motivate(), startPos + 50, yStartPos + (9 * move), crystalsound, 9));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Barrier(), startPos + 50, yStartPos + (10 * move), crystalsound, 10));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new Weaken(), startPos + 50, yStartPos + (11 * move), crystalsound, 11));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new FireSummon(), startPos + 50, yStartPos + (12 * move), crystalsound, 12));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new IceSummon(), startPos + 50, yStartPos + (13 * move), crystalsound, 13));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new AirSummon(), startPos + 50, yStartPos + (14 * move), crystalsound, 14));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new EarthSummon(), startPos + 50, yStartPos + (15 * move), crystalsound, 15));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new DarkSummon(), startPos + 50, yStartPos + (16 * move), crystalsound, 16));
            spells.Add(new SpellSlots(magic, magicSymbol, font, new HolySummon(), startPos + 50, yStartPos + (17 * move), crystalsound, 17));

            buttonHeight = upDown.Height;
            slider       = new SliderClass(mark, upDown, yCuttOff - yStartPos - upDown.Height - mark.Height, 5, yStartPos + upDown.Height, startPos, yStartPos, yCuttOff - upDown.Height, startPos - (mark.Width / 2) + upDown.Width / 4, spells[0].mainRec.Height);
            slideStartX  = startPos;
            slideStartY  = yStartPos;
        }
Esempio n. 2
0
        public Load(Texture2D armyButtons, SpriteFont font, Texture2D markButton, string loadpath, string name, Texture2D decorationPic, int decorationPicNmr,
                    SoundEffect clickSound, SoundEffect bookSound, int buttonStart, Texture2D backGround, int xStart, int yStart, Texture2D mark, Texture2D upDown)
        {
            slider          = new SliderClass(mark, upDown, 661, 31, yStart, xStart + backGround.Width - (upDown.Width / 4) - 2, yStart - upDown.Height, yStart + backGround.Height, xStart + backGround.Width - (mark.Width / 2) - 2, 20);
            this.backGround = backGround;
            this.xStart     = xStart;
            this.yStart     = yStart;
            backRec         = new Rectangle(xStart, yStart, backGround.Width, backGround.Height);
            this.clickSound = clickSound;
            this.markButton = markButton;
            //Decoration = new Decoration(decorationPic, 1, 4, 925, 0, decorationPicNmr);
            this.decorationPic = decorationPic;
            this.name          = name;
            this.loadpath      = loadpath;
            markbuttons        = new List <MarkButton>();
            files = Directory.GetFiles(loadpath);
            for (int i = 0; i < files.Length; i++)
            {
                markbuttons.Add(new MarkButton(markButton, 3, 1, xStart + 10, yStart + 15 + (20 * i) + 1, "", clickSound));
                files[i] = files[i].Replace(loadpath + "\\", "");
                offsett++;
            }
            int buttonOffset = 0;

            load = new Button(armyButtons, 1, 2, xStart + (200 * buttonOffset), buttonStart, font, "Load " + name, bookSound);
            buttonOffset++;
            cancel = new Button(armyButtons, 1, 2, xStart + (200 * buttonOffset), buttonStart, font, "Cancel", bookSound);
            buttonOffset++;
            delete   = new Button(armyButtons, 1, 2, xStart + (200 * buttonOffset), buttonStart, font, "Delete " + name, bookSound);
            loadName = "";
        }
Esempio n. 3
0
        public ArmyTextWriter(Texture2D upDown, Texture2D background, Texture2D mark, Texture2D sortButtonsTexture, SpriteFont font, int x, int y, int halfWayPoint, int buttonwidth, int cutOffSize)
        {
            this.cutOffSize    = cutOffSize;
            numberOfUnitsDrawn = 31;
            this.halfWayPoint  = halfWayPoint;
            this.widthButton   = buttonwidth;
            this.x             = x;
            this.y             = y;
            negative           = 0;
            this.font          = font;
            slider             = new SliderClass(mark, upDown, 661, numberOfUnitsDrawn, y, x + background.Width - (upDown.Width / 4) - 2, y - upDown.Height, y + background.Height, x + background.Width - (mark.Width / 2) - 2, 20);
            sortButtons        = new List <UpDownButtons>();
            sortButtons.Add(new UpDownButtons(sortButtonsTexture, 2, 1, x + 639, y, 0));
            sortButtons.Add(new UpDownButtons(sortButtonsTexture, 2, 1, x + 639, y + background.Height - (sortButtonsTexture.Height / 2), 1));

            markButtons     = new List <MarkButton>();
            this.background = background;
        }
Esempio n. 4
0
 public UnitSave(Texture2D armyButtons, SpriteFont font, string typeSave, Texture2D decorationPic, int decorationPicNmr, Texture2D markButtons,
                 string savePath, SoundEffect clickSound, SoundEffect bookSound, Texture2D lineTexture, Texture2D backGround, int x, int y, Texture2D mark, Texture2D upDown) : base(armyButtons, font, typeSave, decorationPic, decorationPicNmr, bookSound, lineTexture)
 {
     backRec         = new Rectangle(x, y + 20, backGround.Width, backGround.Height);
     this.backGround = backGround;
     this.clickSound = clickSound;
     this.button     = markButtons;
     this.font       = font;
     buttons         = new List <MarkButton>();
     write           = new WriteClass(font, lineTexture, x, y);
     save            = new Button(armyButtons, 1, 2, x, y + 20 + backGround.Height + 10, font, "Save Regiment", bookSound);
     cancel          = new Button(armyButtons, 1, 2, x + save.mainRec.Width + 10, y + 20 + backGround.Height + 10, font, "Cancel Save", bookSound);
     newfolder       = new Button(armyButtons, 1, 2, x + (save.mainRec.Width + 10) * 2, y + 20 + backGround.Height + 10, font, "New Folder", bookSound);
     foldername      = new Save(armyButtons, font, "Folder Path", decorationPic, 2, bookSound, lineTexture);
     slider          = new SliderClass(mark, upDown, backGround.Height, 32, y + 20, x + backGround.Width - upDown.Width / 4, y + 20 - upDown.Height, y + 20 + backGround.Height, x + backGround.Width - mark.Width / 2, 20);
     for (int i = 0; i < Directory.GetDirectories(savePath).Count(); i++)
     {
         string temp = Directory.GetDirectories(savePath)[i];
         temp = temp.Replace(savePath + "\\", "");
         buttons.Add(new MarkButton(markButtons, 3, 1, x + 5, y + 25 + (i * 20), temp, clickSound));
     }
     buttons[0].ChangeState();
     tempname = buttons[0].Text();
 }