示例#1
0
        private Drawable InitAnimDrawable(IniFile.IniSection rules, IniFile.IniSection art)
        {
            var anim = new AnimDrawable(rules, art);

            InitDrawableDefaults(anim, art);
            anim.LoadFromRules();
            anim.Shp = VFS.Open <ShpFile>(anim.Image + ".shp");
            return(anim);
        }
示例#2
0
        private AnimDrawable LoadExtraImage(string extraImage, DrawProperties inheritProps)
        {
            string animSection = Art.ReadString(extraImage);

            if (animSection == "")
            {
                return(null);
            }

            IniFile.IniSection extraRules = OwnerCollection.Rules.GetOrCreateSection(animSection);
            IniFile.IniSection extraArt   = OwnerCollection.Art.GetOrCreateSection(animSection);
            var anim = new AnimDrawable(extraRules, extraArt);

            anim.OwnerCollection = OwnerCollection;
            anim.LoadFromRules();

            anim.NewTheater = this.NewTheater;

            if (extraArt.HasKey("YSortAdjust") || Art.HasKey(extraImage + "YSort") ||
                extraArt.HasKey("ZAdjust") || Art.HasKey(extraImage + "ZAdjust"))
            {
                anim.Props.SortIndex = extraArt.ReadInt("YSortAdjust", Art.ReadInt(extraImage + "YSort"))
                                       - extraArt.ReadInt("ZAdjust", Art.ReadInt(extraImage + "ZAdjust"));
            }
            else
            {
                anim.Props.SortIndex = inheritProps.SortIndex;
            }
            if (Art.HasKey(extraImage + "X") || Art.HasKey(extraImage + "Y"))
            {
                anim.Props.Offset = this.Props.Offset + new Size(Art.ReadInt(extraImage + "X"), Art.ReadInt(extraImage + "Y"));
            }
            else
            {
                anim.Props.Offset = inheritProps.Offset;
            }
            anim.Props.ZAdjust  = Art.ReadInt(extraImage + "ZAdjust");
            anim.IsBuildingPart = true;

            anim.Shp = VFS.Open <ShpFile>(anim.GetFilename());
            return(anim);
        }
示例#3
0
 private void LoadAnimDrawable(AnimDrawable anim)
 {
     InitDrawableDefaults(anim);
     anim.LoadFromRules();
     anim.Shp = VFS.Open <ShpFile>(anim.Image + ".shp");
 }
示例#4
0
 private void LoadAnimDrawable(AnimDrawable anim)
 {
     InitDrawableDefaults(anim);
     anim.LoadFromRules();
     anim.Shp = _vfs.Open <ShpFile>(anim.GetFilename());
 }
示例#5
0
		private void LoadAnimDrawable(AnimDrawable anim) {
			InitDrawableDefaults(anim);
			anim.LoadFromRules();
			anim.Shp = VFS.Open<ShpFile>(anim.Image + ".shp");
		}
示例#6
0
		private AnimDrawable LoadExtraImage(string extraImage, DrawProperties inheritProps) {
			string animSection = Art.ReadString(extraImage);
			if (animSection == "") return null;

			IniFile.IniSection extraRules = OwnerCollection.Rules.GetOrCreateSection(animSection);
			IniFile.IniSection extraArt = OwnerCollection.Art.GetOrCreateSection(animSection);
			var anim = new AnimDrawable(extraRules, extraArt);
			anim.OwnerCollection = OwnerCollection;
			anim.LoadFromRules();

			anim.NewTheater = this.NewTheater;

			if (extraArt.HasKey("YSortAdjust") || Art.HasKey(extraImage + "YSort") ||
				extraArt.HasKey("ZAdjust") || Art.HasKey(extraImage + "ZAdjust"))
				anim.Props.SortIndex = extraArt.ReadInt("YSortAdjust", Art.ReadInt(extraImage + "YSort"))
					- extraArt.ReadInt("ZAdjust", Art.ReadInt(extraImage + "ZAdjust"));
			else
				anim.Props.SortIndex = inheritProps.SortIndex;
			if (Art.HasKey(extraImage + "X") || Art.HasKey(extraImage + "Y"))
				anim.Props.Offset = this.Props.Offset + new Size(Art.ReadInt(extraImage + "X"), Art.ReadInt(extraImage + "Y"));
			else
				anim.Props.Offset = inheritProps.Offset;
			anim.Props.ZAdjust = Art.ReadInt(extraImage + "ZAdjust");
			anim.IsBuildingPart = true;

			anim.Shp = VFS.Open<ShpFile>(anim.GetFilename());
			return anim;
		}