コード例 #1
0
        public override ArrayList GetItemInfo()
        {
            ArrayList itemInfo = new ArrayList
            {
                new InputText(this, "TextureStart:", TextureStart.ToString(), false, ""),
                new InputText(this, "NumFlat:", NumFlat.ToString(), false, "NumFlat"),
                new InputText(this, "NumFlatMetal:", NumFlatMetal.ToString(), false, "NumFlatMetal"),
                new InputText(this, "NumGouraud:", NumGouraud.ToString(), false, "NumGouraud"),
                new InputText(this, "NumGouraudMetal:", NumGouraudMetal.ToString(), false, "NumGouraudMetal"),
                new InputText(this, "NumGouraudMetalEnv:", NumGouraudMetalEnv.ToString(), false, "NumGouraudMetalEnv"),
                new InputText(this, "NumShining:", NumShining.ToString(), false, "NumShining"),
            };

            return(itemInfo);
        }
コード例 #2
0
ファイル: UI.cs プロジェクト: adrientoub/CrystalGate
        public UI(User user, Texture2D PaletteEte, Texture2D PaletteHiver, Texture2D PaletteVolcanique, SpriteFont spriteFont, Texture2D fondTexte)
        {
            this.user = user;

            this.Palette = PaletteEte;
            this.PaletteEte = PaletteEte;
            this.PaletteHiver = PaletteHiver;
            this.PaletteVolcanique = PaletteVolcanique;
            this.fondTexte = fondTexte;
            this.SpriteFont = spriteFont;

            this.PalettePosition = new Vector2(width - Palette.Width, 0);
            stack = new Stack<Vector4> { };
            ShowMap = true;

            textureStart = TextureStart.Desert;
        }
コード例 #3
0
        public UI(User user, Texture2D PaletteEte, Texture2D PaletteHiver, Texture2D PaletteVolcanique, SpriteFont spriteFont, Texture2D fondTexte)
        {
            this.user = user;

            this.Palette           = PaletteEte;
            this.PaletteEte        = PaletteEte;
            this.PaletteHiver      = PaletteHiver;
            this.PaletteVolcanique = PaletteVolcanique;
            this.fondTexte         = fondTexte;
            this.SpriteFont        = spriteFont;

            this.PalettePosition = new Vector2(width - Palette.Width, 0);
            stack   = new Stack <Vector4> {
            };
            ShowMap = true;

            textureStart = TextureStart.Desert;
        }
コード例 #4
0
ファイル: UI.cs プロジェクト: adrientoub/CrystalGate
        public bool OuvrirMap(string MapName)
        {
            try
            {
                // Read the file and display it line by line.
                string line;
                int longueur = 0;
                int hauteur = 0;

                StreamReader file = new StreamReader(SceneEngine2.Editor.baseDirectory + "Maps/" + MapName + ".txt");
                // On regarde quel type de sol c'est grace au header

                switch (int.Parse(file.ReadLine()))
                {
                    case 1: textureStart = TextureStart.Herbe;
                        Palette = PaletteEte;
                        break;
                    case 2: textureStart = TextureStart.Desert;
                        Palette = PaletteEte;
                        break;
                    case 3: textureStart = TextureStart.Hiver;
                        Palette = PaletteHiver;
                        break;
                    case 4: textureStart = TextureStart.Volcanique;
                        Palette = PaletteVolcanique;
                        break;
                    default: textureStart = TextureStart.Herbe;
                        Palette = PaletteEte;
                        break;
                }

                // On établit la longueur et la hauteur
                while ((line = file.ReadLine()) != null)
                {
                    char[] splitchar = { '|' };

                    if (line != null)
                        longueur = line.Split(splitchar).Length - 1;
                    hauteur++;
                }
                // Creation de la carte
                Map = new Vector2[longueur, hauteur];
                // Reset
                file.Close();
                file = new StreamReader(SceneEngine2.Editor.baseDirectory + "Maps/" + MapName + ".txt");
                int j = 0;
                file.ReadLine(); // pour passer le header
                while ((line = file.ReadLine()) != null)
                {
                    char[] splitchar = { '|' };
                    string[] tiles = line.Split(splitchar);

                    for (int i = 0; i < longueur; i++)
                    {
                        char[] splitchar2 = { ',' };
                        int x = int.Parse((tiles[i].Split(splitchar2))[0]);
                        int y = int.Parse((tiles[i].Split(splitchar2))[1]);
                        Map[i, j] = new Vector2(x, y);
                    }
                    j++;
                }
                file.Close();
                return true;
            }
            catch
            {
                return false;
            }
        }
コード例 #5
0
        public bool OuvrirMap(string MapName)
        {
            try
            {
                // Read the file and display it line by line.
                string line;
                int    longueur = 0;
                int    hauteur  = 0;

                StreamReader file = new StreamReader(SceneEngine2.Editor.baseDirectory + "Maps/" + MapName + ".txt");
                // On regarde quel type de sol c'est grace au header

                switch (int.Parse(file.ReadLine()))
                {
                case 1: textureStart = TextureStart.Herbe;
                    Palette          = PaletteEte;
                    break;

                case 2: textureStart = TextureStart.Desert;
                    Palette          = PaletteEte;
                    break;

                case 3: textureStart = TextureStart.Hiver;
                    Palette          = PaletteHiver;
                    break;

                case 4: textureStart = TextureStart.Volcanique;
                    Palette          = PaletteVolcanique;
                    break;

                default: textureStart = TextureStart.Herbe;
                    Palette           = PaletteEte;
                    break;
                }

                // On établit la longueur et la hauteur
                while ((line = file.ReadLine()) != null)
                {
                    char[] splitchar = { '|' };

                    if (line != null)
                    {
                        longueur = line.Split(splitchar).Length - 1;
                    }
                    hauteur++;
                }
                // Creation de la carte
                Map = new Vector2[longueur, hauteur];
                // Reset
                file.Close();
                file = new StreamReader(SceneEngine2.Editor.baseDirectory + "Maps/" + MapName + ".txt");
                int j = 0;
                file.ReadLine(); // pour passer le header
                while ((line = file.ReadLine()) != null)
                {
                    char[]   splitchar = { '|' };
                    string[] tiles     = line.Split(splitchar);

                    for (int i = 0; i < longueur; i++)
                    {
                        char[] splitchar2 = { ',' };
                        int    x          = int.Parse((tiles[i].Split(splitchar2))[0]);
                        int    y          = int.Parse((tiles[i].Split(splitchar2))[1]);
                        Map[i, j] = new Vector2(x, y);
                    }
                    j++;
                }
                file.Close();
                return(true);
            }
            catch
            {
                return(false);
            }
        }