Example #1
0
        public Visual(string fileName, Vector3 pos, zMAT3 rot3, bool visible)
        {
            try
            {
                fileName = fileName.ToUpper();

                if (!fileName.StartsWith("LEVEL"))
                {
                    string[] fileNameSplit = fileName.Split('.');

                    this.FileName = fileNameSplit[0];

                    if (fileNameSplit.Length == 2)
                    {
                        if (fileNameSplit[1].All(char.IsDigit))
                        {
                            this.FileExtension = "";
                            this.Index         = int.Parse(fileNameSplit[1]);
                        }
                        else
                        {
                            this.FileExtension = fileNameSplit[1];
                            this.Index         = 0;
                        }
                    }
                    else if (fileNameSplit.Length == 3)
                    {
                        this.FileExtension = fileNameSplit[1];
                        this.Index         = int.Parse(fileNameSplit[2]);
                    }
                }
                else
                {
                    this.FileName      = Path.GetFileNameWithoutExtension(fileName);
                    this.FileExtension = "3DS";
                    this.Index         = 0;
                }
            }
            catch
            {
                throw new ArgumentException(Localization.Instance.GetTranslation("ObjectNameInvalid"), fileName);
            }
            this.Position = pos;
            this.Rotation = rot3;
            this.Visible  = visible;
            string upper = Path.GetExtension(fileName);

            if (upper == ".ASC" || upper == ".MDS" || upper == ".MMS")
            {
                this.Scale = new Vector3(1f, -1f, -1f);
                return;
            }
            if (!(upper == ".3DS") && !(upper == ".MRM") && !(upper == ".MSH"))
            {
                this.Scale = new Vector3(1f, 1f, 1f);
                return;
            }
            this.Scale = new Vector3(-1f, -1f, 1f);
        }
Example #2
0
 public Item(string fileName, Vector3 pos, zMAT3 rot3, bool visible) : base(fileName, pos, rot3, visible)
 {
     // Items are always visible, even if showVisual=bool:0
     Visible = true;
 }
Example #3
0
 public Level(string fileName, Vector3 pos, zMAT3 rot3, bool visible) : base(fileName, pos, rot3, visible)
 {
     this.Scale = new Vector3(1f, 1f, 1f);
 }
Example #4
0
 public Decal(string fileName, Vector3 pos, zMAT3 rot3, Vector3 dim, bool visible) : base(fileName, pos, rot3, visible)
 {
     this.Dimensions = dim;
 }
Example #5
0
 public Mob(string fileName, Vector3 pos, zMAT3 rot3, bool visible) : base(fileName, pos, rot3, visible)
 {
 }