Skip to content

Commit

Permalink
Include .svg in .quest file
Browse files Browse the repository at this point in the history
Also add publishfileextensions field so this can be controlled by a
game author.
  • Loading branch information
alexwarren committed Jan 30, 2015
1 parent 8f85b09 commit 190c50e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion WorldModel/WorldModel/Core/CoreTypes.aslx
Expand Up @@ -66,7 +66,8 @@
<feature_limitinventory type="boolean">false</feature_limitinventory>
<feature_asktell type="boolean">false</feature_asktell>
<deactivatecommandlinks type="boolean">false</deactivatecommandlinks>
<multiplecommands type="boolean">false</multiplecommands>
<multiplecommands type="boolean">false</multiplecommands>
<publishfileextensions>*.jpg;*.jpeg;*.png;*.gif;*.js;*.wav;*.mp3;*.htm;*.html;*.svg</publishfileextensions>
</type>

<type name="theme_novella">
Expand Down
1 change: 1 addition & 0 deletions WorldModel/WorldModel/Fields.cs
Expand Up @@ -115,6 +115,7 @@ public static class FieldDefinitions
public static IField<bool> IsBaseTemplate = new FieldDef<bool>("isbasetemplate");
public static IField<string> DisplayVerb = new FieldDef<string>("displayverb");
public static IField<string> Cover = new FieldDef<string>("cover");
public static IField<string> PublishFileExtensions = new FieldDef<string>("publishfileextensions");
}

public static class MetaFieldDefinitions
Expand Down
6 changes: 5 additions & 1 deletion WorldModel/WorldModel/GameLoader/Packager.cs
Expand Up @@ -27,7 +27,11 @@ public bool CreatePackage(string filename, bool includeWalkthrough, out string e
using (ZipFile zip = new ZipFile(filename))
{
zip.AddEntry("game.aslx", data, Encoding.UTF8);
foreach (string file in m_worldModel.GetAvailableExternalFiles("*.jpg;*.jpeg;*.png;*.gif;*.js;*.wav;*.mp3;*.htm;*.html"))

var fileTypesToInclude = m_worldModel.Game.Fields[FieldDefinitions.PublishFileExtensions] ??
"*.jpg;*.jpeg;*.png;*.gif;*.js;*.wav;*.mp3;*.htm;*.html;*.svg";

foreach (string file in m_worldModel.GetAvailableExternalFiles(fileTypesToInclude))
{
zip.AddFile(System.IO.Path.Combine(baseFolder, file), "");
}
Expand Down

0 comments on commit 190c50e

Please sign in to comment.