|
@@ -30,8 +30,7 @@ function AssetDictionaryButton::loadImageAsset(%this, %assetID)
|
|
|
{
|
|
|
%imageAsset = AssetDatabase.acquireAsset(%assetID);
|
|
|
|
|
|
- %extent = %this.getIconExtent(%imageAsset.getFrameSize(0));
|
|
|
- %texture = %this.buildIcon(%extent);
|
|
|
+ %texture = %this.buildIcon();
|
|
|
%texture.setImage(%assetID);
|
|
|
|
|
|
%this.ImageAsset = %imageAsset;
|
|
@@ -46,8 +45,7 @@ function AssetDictionaryButton::loadAnimationAsset(%this, %assetID)
|
|
|
%imageAssetID = %animationAsset.getImage();
|
|
|
%imageAsset = AssetDatabase.acquireAsset(%imageAssetID);
|
|
|
|
|
|
- %extent = %this.getIconExtent(%imageAsset.getFrameSize(0));
|
|
|
- %texture = %this.buildIcon(%extent);
|
|
|
+ %texture = %this.buildIcon();
|
|
|
%texture.setAnimation(%assetID);
|
|
|
|
|
|
%this.ImageAsset = %imageAsset;
|
|
@@ -58,20 +56,71 @@ function AssetDictionaryButton::loadAnimationAsset(%this, %assetID)
|
|
|
%this.add(%texture);
|
|
|
}
|
|
|
|
|
|
-function AssetDictionaryButton::getIconExtent(%this, %size)
|
|
|
+function AssetDictionaryButton::loadParticleAsset(%this, %assetID)
|
|
|
{
|
|
|
- return "50 50";
|
|
|
+ %particleAsset = AssetDatabase.acquireAsset(%assetID);
|
|
|
+
|
|
|
+ %texture = %this.buildIcon();
|
|
|
+ %texture.setImage("AssetAdmin:assetIcons");
|
|
|
+ %texture.setImageFrame(0);
|
|
|
+
|
|
|
+ %this.particleAsset = %particleAsset;
|
|
|
+ %this.particleAssetID = %assetID;
|
|
|
+
|
|
|
+ %this.add(%texture);
|
|
|
}
|
|
|
|
|
|
-function AssetDictionaryButton::buildIcon(%this, %extent)
|
|
|
+function AssetDictionaryButton::loadFontAsset(%this, %assetID)
|
|
|
+{
|
|
|
+ %fontAsset = AssetDatabase.acquireAsset(%assetID);
|
|
|
+
|
|
|
+ %texture = %this.buildIcon();
|
|
|
+ %texture.setImage("AssetAdmin:assetIcons");
|
|
|
+ %texture.setImageFrame(1);
|
|
|
+
|
|
|
+ %this.fontAsset = %fontAsset;
|
|
|
+ %this.fontAssetID = %assetID;
|
|
|
+
|
|
|
+ %this.add(%texture);
|
|
|
+}
|
|
|
+
|
|
|
+function AssetDictionaryButton::loadAudioAsset(%this, %assetID)
|
|
|
+{
|
|
|
+ %audioAsset = AssetDatabase.acquireAsset(%assetID);
|
|
|
+
|
|
|
+ %texture = %this.buildIcon();
|
|
|
+ %texture.setImage("AssetAdmin:assetIcons");
|
|
|
+ %texture.setImageFrame(3);
|
|
|
+
|
|
|
+ %this.audioAsset = %audioAsset;
|
|
|
+ %this.audioAssetID = %assetID;
|
|
|
+
|
|
|
+ %this.add(%texture);
|
|
|
+}
|
|
|
+
|
|
|
+function AssetDictionaryButton::loadSpineAsset(%this, %assetID)
|
|
|
+{
|
|
|
+ %spineAsset = AssetDatabase.acquireAsset(%assetID);
|
|
|
+
|
|
|
+ %texture = %this.buildIcon();
|
|
|
+ %texture.setImage("AssetAdmin:assetIcons");
|
|
|
+ %texture.setImageFrame(2);
|
|
|
+
|
|
|
+ %this.spineAsset = %spineAsset;
|
|
|
+ %this.spineAssetID = %assetID;
|
|
|
+
|
|
|
+ %this.add(%texture);
|
|
|
+}
|
|
|
+
|
|
|
+function AssetDictionaryButton::buildIcon(%this)
|
|
|
{
|
|
|
%texture = new GuiSpriteCtrl()
|
|
|
{
|
|
|
class = "AssetDictionarySprite";
|
|
|
HorizSizing="center";
|
|
|
VertSizing="center";
|
|
|
- Extent = %extent;
|
|
|
- minExtent=%extent;
|
|
|
+ Extent = "50 50";
|
|
|
+ minExtent = "50 50";
|
|
|
Position = "0 0";
|
|
|
constrainProportions = "1";
|
|
|
fullSize = "1";
|
|
@@ -82,6 +131,18 @@ function AssetDictionaryButton::buildIcon(%this, %extent)
|
|
|
|
|
|
function AssetDictionaryButton::onClick(%this)
|
|
|
{
|
|
|
+ if(AssetAdmin.chosenButton != %this)
|
|
|
+ {
|
|
|
+ if(isObject(AssetAdmin.chosenButton))
|
|
|
+ {
|
|
|
+ ThemeManager.setProfile(AssetAdmin.chosenButton, "itemSelectProfile");
|
|
|
+ }
|
|
|
+ ThemeManager.setProfile(%this, "itemSelectedProfile");
|
|
|
+ }
|
|
|
+
|
|
|
+ AssetAdmin.audioPlayButton.setVisible(false);
|
|
|
+ AssetAdmin.AssetWindow.setVisible(true);
|
|
|
+
|
|
|
if(isObject(%this.AnimationAsset) && %this.AnimationAssetID !$= "")
|
|
|
{
|
|
|
AssetAdmin.AssetWindow.displayAnimationAsset(%this.imageAsset, %this.AnimationAsset, %this.AnimationAssetID);
|
|
@@ -92,6 +153,26 @@ function AssetDictionaryButton::onClick(%this)
|
|
|
AssetAdmin.AssetWindow.displayImageAsset(%this.ImageAsset, %this.ImageAssetID);
|
|
|
AssetAdmin.inspector.loadImageAsset(%this.ImageAsset, %this.ImageAssetID);
|
|
|
}
|
|
|
+ else if(isObject(%this.ParticleAsset) && %this.ParticleAssetID !$= "")
|
|
|
+ {
|
|
|
+ AssetAdmin.AssetWindow.displayParticleAsset(%this.ParticleAsset, %this.ParticleAssetID);
|
|
|
+ AssetAdmin.inspector.loadParticleAsset(%this.ParticleAsset, %this.ParticleAssetID);
|
|
|
+ }
|
|
|
+ else if(isObject(%this.FontAsset) && %this.FontAssetID !$= "")
|
|
|
+ {
|
|
|
+ AssetAdmin.AssetWindow.displayFontAsset(%this.FontAsset, %this.FontAssetID);
|
|
|
+ AssetAdmin.inspector.loadFontAsset(%this.FontAsset, %this.FontAssetID);
|
|
|
+ }
|
|
|
+ else if(isObject(%this.AudioAsset) && %this.AudioAssetID !$= "")
|
|
|
+ {
|
|
|
+ AssetAdmin.AssetWindow.displayAudioAsset(%this.AudioAsset, %this.AudioAssetID);
|
|
|
+ AssetAdmin.inspector.loadAudioAsset(%this.AudioAsset, %this.AudioAssetID);
|
|
|
+ }
|
|
|
+ else if(isObject(%this.SpineAsset) && %this.SpineAssetID !$= "")
|
|
|
+ {
|
|
|
+ AssetAdmin.AssetWindow.displaySpineAsset(%this.SpineAsset, %this.SpineAssetID);
|
|
|
+ AssetAdmin.inspector.loadSpineAsset(%this.SpineAsset, %this.SpineAssetID);
|
|
|
+ }
|
|
|
|
|
|
AssetAdmin.chosenButton = %this;
|
|
|
}
|