Ejemplo n.º 1
0
        //---------------------------------------------------
        //-------------------Methodes------------------------
        //---------------------------------------------------

        public Boolean Init(String _ProjectName, String _ProjectPath,
                            CoronaGameProject.OrientationScreen _orientation,
                            int _width, int _height, String _scale, String _xAlign, String _yAlign, System.Windows.Forms.ListBox.ObjectCollection _imageSuffix, int _fps, Boolean _antialias,
                            String _AndroidVersionCode, System.Windows.Forms.ListBox.ObjectCollection _SupportedOrientation, System.Windows.Forms.ListBox.ObjectCollection _AndroidPermissions, String _CustomBuildName, Image _icon)
        {
            if (_ProjectName == "" || _ProjectPath == "")
            {
                return(false);
            }

            if (this.ProjectPath != null && this.ProjectName != null)
            {
                if (!(this.ProjectPath + "\\" + this.ProjectName + ".krp").Equals(this.ProjectPath + "\\" + _ProjectName.Replace(" ", "_") + ".krp"))
                {
                    if (File.Exists(this.ProjectPath + "\\" + this.ProjectName + ".krp"))
                    {
                        File.Move(this.ProjectPath + "\\" + this.ProjectName + ".krp", this.ProjectPath + "\\" + _ProjectName.Replace(" ", "_") + ".krp");
                    }

                    //Renommer le projet de ressource correspondant
                    string assetProjectsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Native-Software\\Asset Manager";
                    if (!Directory.Exists(assetProjectsDirectory))
                    {
                        Directory.CreateDirectory(assetProjectsDirectory);
                    }


                    if (File.Exists(assetProjectsDirectory + "\\" + this.ProjectName + "\\" + this.ProjectName + ".kres"))
                    {
                        File.Move(assetProjectsDirectory + "\\" + this.ProjectName + "\\" + this.ProjectName + ".kres",
                                  assetProjectsDirectory + "\\" + this.ProjectName + "\\" + _ProjectName.Replace(" ", "_") + ".kres");
                    }

                    if (Directory.Exists(assetProjectsDirectory + "\\" + this.ProjectName))
                    {
                        Directory.Move(assetProjectsDirectory + "\\" + this.ProjectName, assetProjectsDirectory + "\\" + _ProjectName.Replace(" ", "_"));
                    }
                }
            }

            this.ProjectName = _ProjectName.Replace(" ", "_");

            if (this.BuildFolderPath != null)
            {
                if (!this.BuildFolderPath.Equals(this.ProjectPath + "\\" + this.ProjectName))
                {
                    if (Directory.Exists(this.BuildFolderPath))
                    {
                        Directory.Move(this.BuildFolderPath, this.ProjectPath + "\\" + this.ProjectName);
                    }
                }
            }

            if (this.ProjectPath != null)
            {
                if (!this.ProjectPath.Equals(_ProjectPath))
                {
                    if (Directory.Exists(this.ProjectPath))
                    {
                        Directory.Move(this.ProjectPath, _ProjectPath);
                    }
                }
            }



            this.ProjectPath        = _ProjectPath;
            this.BuildFolderPath    = this.ProjectPath + "\\" + this.ProjectName;
            this.SourceFolderPath   = this.ProjectPath + "\\Sources";
            this.CgeProjectFilename = this.ProjectPath + "\\" + this.ProjectName + ".krp";
            this.Orientation        = _orientation;

            this.Icone = _icon;
            if (this.Icone == null)
            {
                this.Icone = Properties.Resources.Icon;
            }

            this.width  = _width;
            this.height = _height;
            this.scale  = _scale;

            if (_xAlign.Equals("center"))
            {
                this.ScreenXAlign = XScreenAlignment.center;
            }
            else if (_xAlign.Equals("left"))
            {
                this.ScreenXAlign = XScreenAlignment.left;
            }
            else if (_xAlign.Equals("right"))
            {
                this.ScreenXAlign = XScreenAlignment.right;
            }

            if (_yAlign.Equals("center"))
            {
                this.ScreenYAlign = YScreenAlignment.center;
            }
            else if (_yAlign.Equals("top"))
            {
                this.ScreenYAlign = YScreenAlignment.top;
            }
            else if (_yAlign.Equals("bottom"))
            {
                this.ScreenYAlign = YScreenAlignment.bottom;
            }

            if (_imageSuffix != null)
            {
                this.ImageSuffix.Clear();
                for (int i = 0; i < _imageSuffix.Count; i++)
                {
                    this.ImageSuffix.Add(_imageSuffix[i].ToString());
                }
            }

            this.fps                = _fps;
            this.antialias          = _antialias;
            this.AndroidVersionCode = _AndroidVersionCode;

            if (_SupportedOrientation != null)
            {
                this.SupportedOrientation.Clear();
                for (int i = 0; i < _SupportedOrientation.Count; i++)
                {
                    this.SupportedOrientation.Add(_SupportedOrientation[i].ToString());
                }
            }

            if (_AndroidPermissions != null)
            {
                this.AndroidPermissions.Clear();
                for (int i = 0; i < _AndroidPermissions.Count; i++)
                {
                    this.AndroidPermissions.Add(_AndroidPermissions[i].ToString());
                }
            }

            this.CustomBuildName = _CustomBuildName;


            return(true);
        }
Ejemplo n.º 2
0
        //---------------------------------------------------
        //-------------------Methodes------------------------
        //---------------------------------------------------
        public Boolean Init(String _ProjectName, String _ProjectPath,
 CoronaGameProject.OrientationScreen _orientation,
        int _width, int _height, String _scale, String _xAlign, String _yAlign, System.Windows.Forms.ListBox.ObjectCollection _imageSuffix, int _fps, Boolean _antialias,
        String _AndroidVersionCode, System.Windows.Forms.ListBox.ObjectCollection _SupportedOrientation, System.Windows.Forms.ListBox.ObjectCollection _AndroidPermissions, String _CustomBuildName, Image _icon)
        {
            if (_ProjectName == "" || _ProjectPath == "") return false;

            if (this.ProjectPath != null && this.ProjectName != null)
            {
                if (!(this.ProjectPath + "\\" + this.ProjectName + ".krp").Equals(this.ProjectPath + "\\" + _ProjectName.Replace(" ", "_") + ".krp"))
                {
                    if (File.Exists(this.ProjectPath + "\\" + this.ProjectName + ".krp"))
                        File.Move(this.ProjectPath + "\\" + this.ProjectName + ".krp", this.ProjectPath + "\\" + _ProjectName.Replace(" ", "_") + ".krp");

                    //Renommer le projet de ressource correspondant
                    string assetProjectsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Native-Software\\Asset Manager";
                    if (!Directory.Exists(assetProjectsDirectory))
                        Directory.CreateDirectory(assetProjectsDirectory);

                    if (File.Exists(assetProjectsDirectory + "\\" + this.ProjectName + "\\" + this.ProjectName + ".kres"))
                        File.Move(assetProjectsDirectory + "\\" + this.ProjectName + "\\" + this.ProjectName + ".kres",
                            assetProjectsDirectory+"\\" + this.ProjectName + "\\" + _ProjectName.Replace(" ", "_") + ".kres");

                    if (Directory.Exists(assetProjectsDirectory+"\\" + this.ProjectName))
                        Directory.Move(assetProjectsDirectory +"\\" + this.ProjectName, assetProjectsDirectory+"\\" + _ProjectName.Replace(" ", "_"));
                }

            }

            this.ProjectName = _ProjectName.Replace(" ","_");

            if (this.BuildFolderPath != null)
            {
                if(!this.BuildFolderPath.Equals( this.ProjectPath + "\\" + this.ProjectName))
                    if (Directory.Exists(this.BuildFolderPath))
                        Directory.Move(this.BuildFolderPath, this.ProjectPath + "\\" + this.ProjectName);
            }

            if (this.ProjectPath != null)
            {
                if (!this.ProjectPath.Equals(_ProjectPath))
                    if (Directory.Exists(this.ProjectPath))
                        Directory.Move(this.ProjectPath, _ProjectPath);
            }

            this.ProjectPath = _ProjectPath;
            this.BuildFolderPath = this.ProjectPath + "\\" + this.ProjectName;
            this.SourceFolderPath = this.ProjectPath + "\\Sources";
            this.CgeProjectFilename = this.ProjectPath + "\\" + this.ProjectName + ".krp";
            this.Orientation = _orientation;

            this.Icone = _icon;
            if (this.Icone == null) this.Icone = Properties.Resources.Icon;

            this.width = _width;
            this.height = _height;
            this.scale = _scale;

            if (_xAlign.Equals("center"))
                this.ScreenXAlign = XScreenAlignment.center;
            else if (_xAlign.Equals("left"))
                this.ScreenXAlign = XScreenAlignment.left;
            else if (_xAlign.Equals("right"))
                this.ScreenXAlign = XScreenAlignment.right;

            if (_yAlign.Equals("center"))
                this.ScreenYAlign = YScreenAlignment.center;
            else if (_yAlign.Equals("top"))
                this.ScreenYAlign = YScreenAlignment.top;
            else if (_yAlign.Equals("bottom"))
                this.ScreenYAlign = YScreenAlignment.bottom;

            if (_imageSuffix != null)
            {
                this.ImageSuffix.Clear();
                for (int i = 0; i < _imageSuffix.Count; i++)
                {
                    this.ImageSuffix.Add(_imageSuffix[i].ToString());
                }
            }

            this.fps = _fps;
            this.antialias = _antialias;
            this.AndroidVersionCode = _AndroidVersionCode;

            if (_SupportedOrientation != null)
            {
                this.SupportedOrientation.Clear();
                for (int i = 0; i < _SupportedOrientation.Count; i++)
                {
                    this.SupportedOrientation.Add(_SupportedOrientation[i].ToString());
                }
            }

            if (_AndroidPermissions != null)
            {
                this.AndroidPermissions.Clear();
                for (int i = 0; i < _AndroidPermissions.Count; i++)
                {
                    this.AndroidPermissions.Add(_AndroidPermissions[i].ToString());
                }
            }

            this.CustomBuildName = _CustomBuildName;

            return true;
        }