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); }
private void LoadAnimDrawable(AnimDrawable anim) { InitDrawableDefaults(anim); anim.LoadFromRules(); anim.Shp = _vfs.Open <ShpFile>(anim.GetFilename()); }
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; }