示例#1
0
        //


        public WorldCreator()
        {
            this.steps.Add("character"); //basic character customization; stardew valley basically
            this.steps.Add("stats");     //10 of each base stat at start, 25 points to distribute freely among them

            this.curStep = steps[0];


            nameBox          = new TypeBox();
            genderBoxes      = new OptionGrid(new Vector2(504, 200), 1, 2);
            hairstyleList    = new ListClicker(new Vector2(460, 290), "Hairstyle ", 20);
            manaColorSlider  = new ColorSlider(new Vector2(180, 170), "Mana Color");
            skinColorSlider  = new ColorSlider(new Vector2(180, 245), "Skin Color");
            hairColorSlider  = new ColorSlider(new Vector2(180, 320), "Hair Color");
            shirtColorSlider = new ColorSlider(new Vector2(180, 395), "Shirt Color");


            charPrev = new CharacterPreview(new Vector2(380, 200));

            nextButton1 = new NextButton(new Vector2(690, 525), "Next");
            backButton1 = new NextButton(new Vector2(15, 525), "Back");

            nextButton2 = new NextButton(new Vector2(690, 525), "Next");
            backButton2 = new NextButton(new Vector2(15, 525), "Back");
        }
示例#2
0
        public void LoadContent(Resources res, SpriteFont font)
        {
            String userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Split(new List <char>()
            {
                '\\'
            }.ToArray(), 2)[1];
            //PLACEHOLDER
            //userName = "******"; //put in a thing that just rips this part away from the EMP/ part
            //PLACEHOLDER
            String saveDir = "C:/Users/" + userName + "/Documents/My Games/Afterhour/";

            this.saveDir = saveDir;

            if (Directory.Exists(saveDir))
            {
                this.saveFileCount = Directory.GetFiles(saveDir).Length;
                this.saveFilePaths = Directory.GetFiles(saveDir).ToList();
            }
            else
            {
                this.saveFileCount = 0;
            }

            getSaveData(saveDir);



            //Texture loading
            this.font     = font;
            this.frameTex = res.Menu_Continue_Frame;

            this.frameRect = new Rectangle((int)(Window.resolution.X / 2 - frameTex.Width / 2), (int)(Window.resolution.Y / 2 - frameTex.Height / 2), frameTex.Width, frameTex.Height);

            this.saveBarTex = res.Menu_Continue_SaveBar;

            this.playButtonTex   = res.Menu_Continue_FuncButton_Play;
            this.deleteButtonTex = res.Menu_Continue_FuncButton_Delete;

            //Post-Texture Loading

            for (int i = 0; i < saveFileCount; i++)
            {
                this.playButtons.Add(new ContFuncButton(ContFuncButton.PLAY, new Vector2(this.frameRect.X + 20, this.frameRect.Y + 105 + ((this.saveBarTex.Height + 5) * i))));
                this.deleteButtons.Add(new ContFuncButton(ContFuncButton.DELETE, new Vector2(this.frameRect.X + 40, this.frameRect.Y + 105 + ((this.saveBarTex.Height + 5) * i))));

                this.playButtons[i].LoadContent(playButtonTex);
                this.deleteButtons[i].LoadContent(deleteButtonTex);
            }

            backButton = new NextButton(new Vector2(15, 525), "Back");
            backButton.LoadContent(res);
        }