Skip to content
Permalink
Browse files

added the ability to have classes embedded into the Resource manager …

…using the ResourceType Metadata tag, When using ResourceBundles in PBE
  • Loading branch information...
hybridmindset committed Apr 3, 2011
1 parent 69696d7 commit 77fa32faee9a4ead53aa279c882a1323736fb391
Showing with 13 additions and 4 deletions.
  1. +13 −4 src/com/pblabs/engine/resource/ResourceBundle.as
@@ -87,8 +87,12 @@ package com.pblabs.engine.resource
resSource = "";
resMimeType = "";
resTypeName="";

// Loop through each metadata tag in the child variable

if(v.@type != 'Class' && res == null){
res = getDefinitionByName( v.@type ) as Class;
}

// Loop through each metadata tag in the child variable
for each (var meta:XML in v.children())
{
// If we've got an embedded metadata
@@ -114,18 +118,23 @@ package com.pblabs.engine.resource
{
for each (arg in meta.children())
{
if (arg.@key == "name")
{
resSource = arg.@value;
resIsEmbedded = true;
}
if (arg.@key == "className")
{
resTypeName = arg.@value;
}
}
}
}
}

// Now that we've processed all of the metadata, it's time to see if it embedded properly.

// Sanity check:
if ( !resIsEmbedded || resSource == "" || res == null )
if ( !resIsEmbedded || resSource == "" || res == null)
{
Logger.error(this, "ResourceBundle", "A resource in the resource bundle with the name '" + v.@name + "' has failed to embed properly. Please ensure that you have the command line option \"--keep-as3-metadata+=TypeHint,EditorData,Embed\" set properly. Additionally, please check that the [Embed] metadata syntax is correct.");
continue;

0 comments on commit 77fa32f

Please sign in to comment.
You can’t perform that action at this time.