Merge pull request #2182 from Areloch/AssetBrowser_Initial
Asset browser initial
10
Templates/BaseGame/game/core/CoreComponents.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
function CoreComponentsModule::onCreate(%this)
|
||||
{
|
||||
%classList = enumerateConsoleClasses( "Component" );
|
||||
|
||||
foreach$( %componentClass in %classList )
|
||||
{
|
||||
echo("Native Component of type: " @ %componentClass);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
ModuleId="CoreComponentsModule"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level components for the game."
|
||||
ScriptFile="CoreComponents.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Game">
|
||||
<DeclaredAssets
|
||||
canSave="true"
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@
|
|||
componentClass="CameraComponent"
|
||||
friendlyName="Camera"
|
||||
componentType="Game"
|
||||
scriptFile="core/components/game/camera.cs"
|
||||
description="Allows the component owner to operate as a camera." />
|
||||
description="Allows the component owner to operate as a camera."
|
||||
scriptFile="core/components/game/camera.cs" />
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
componentClass="Component"
|
||||
friendlyName="Control Object"
|
||||
componentType="Game"
|
||||
scriptFile="core/components/game/controlObject.cs"
|
||||
description="Allows the component owner to be controlled by a client." />
|
||||
description="Allows the component owner to be controlled by a client."
|
||||
scriptFile="core/components/game/controlObject.cs" />
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
componentClass="Component"
|
||||
friendlyName="Item Rotation"
|
||||
componentType="Game"
|
||||
scriptFile="core/components/game/itemRotate.cs"
|
||||
description="Rotates the entity around an axis, like an item pickup." />
|
||||
description="Rotates the entity around an axis, like an item pickup."
|
||||
scriptFile="core/components/game/itemRotate.cs" />
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@
|
|||
componentClass="Component"
|
||||
friendlyName="Player Spawner"
|
||||
componentType="Game"
|
||||
scriptFile="core/components/game/playerSpawner.cs"
|
||||
description="When a client connects, it spawns a player object for them and attaches them to it." />
|
||||
description="When a client connects, it spawns a player object for them and attaches them to it."
|
||||
scriptFile="core/components/game/playerSpawner.cs" />
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ function updateTSShapeLoadProgress(%progress, %msg)
|
|||
{
|
||||
// Check if the loading GUI is visible and use that instead of the
|
||||
// separate import progress GUI if possible
|
||||
if ( isObject(LoadingGui) && LoadingGui.isAwake() )
|
||||
/* if ( isObject(LoadingGui) && LoadingGui.isAwake() )
|
||||
{
|
||||
// Save/Restore load progress at the start/end of the import process
|
||||
if ( %progress == 0 )
|
||||
|
|
@ -245,7 +245,7 @@ function updateTSShapeLoadProgress(%progress, %msg)
|
|||
%textCtrl.setText(%msg);
|
||||
}
|
||||
|
||||
Canvas.repaint(33);
|
||||
Canvas.repaint(33);*/
|
||||
}
|
||||
|
||||
/// A helper function which will return the ghosted client object
|
||||
|
|
@ -952,3 +952,207 @@ function TestPManager::testObjectRemove(%doNotSave)
|
|||
TestPManager.removeObjectFromFile(AudioSim);
|
||||
}
|
||||
|
||||
//Game Object management
|
||||
function findGameObject(%name)
|
||||
{
|
||||
//find all GameObjectAssets
|
||||
%assetQuery = new AssetQuery();
|
||||
if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
|
||||
return 0; //if we didn't find ANY, just exit
|
||||
|
||||
%count = %assetQuery.getCount();
|
||||
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%i);
|
||||
|
||||
%assetName = AssetDatabase.getAssetName(%assetId);
|
||||
|
||||
if(%assetName $= %name)
|
||||
{
|
||||
%gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
|
||||
%assetQuery.delete();
|
||||
return %gameObjectAsset;
|
||||
}
|
||||
}
|
||||
|
||||
%assetQuery.delete();
|
||||
return 0;
|
||||
}
|
||||
|
||||
function spawnGameObject(%name, %addToMissionGroup)
|
||||
{
|
||||
if(%addToMissionGroup $= "")
|
||||
%addToMissionGroup = true;
|
||||
|
||||
//First, check if this already exists in our GameObjectPool
|
||||
if(isObject(GameObjectPool))
|
||||
{
|
||||
%goCount = GameObjectPool.countKey(%name);
|
||||
|
||||
//if we have some already in the pool, pull it out and use that
|
||||
if(%goCount != 0)
|
||||
{
|
||||
%goIdx = GameObjectPool.getIndexFromKey(%name);
|
||||
%go = GameObjectPool.getValue(%goIdx);
|
||||
|
||||
%go.setHidden(false);
|
||||
%go.setScopeAlways();
|
||||
|
||||
if(%addToMissionGroup == true) //save instance when saving level
|
||||
MissionGroup.add(%go);
|
||||
else // clear instance on level exit
|
||||
MissionCleanup.add(%go);
|
||||
|
||||
//remove from the object pool's list
|
||||
GameObjectPool.erase(%goIdx);
|
||||
|
||||
return %go;
|
||||
}
|
||||
}
|
||||
|
||||
//We have no existing pool, or no existing game objects of this type, so spawn a new one
|
||||
|
||||
%gameObjectAsset = findGameObject(%name);
|
||||
|
||||
if(isObject(%gameObjectAsset))
|
||||
{
|
||||
%newSGOObject = TamlRead(%gameObjectAsset.TAMLFilePath);
|
||||
|
||||
if(%addToMissionGroup == true) //save instance when saving level
|
||||
MissionGroup.add(%newSGOObject);
|
||||
else // clear instance on level exit
|
||||
MissionCleanup.add(%newSGOObject);
|
||||
|
||||
return %newSGOObject;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function saveGameObject(%name, %tamlPath, %scriptPath)
|
||||
{
|
||||
%gameObjectAsset = findGameObject(%name);
|
||||
|
||||
//find if it already exists. If it does, we'll update it, if it does not, we'll make a new asset
|
||||
if(isObject(%gameObjectAsset))
|
||||
{
|
||||
%assetID = %gameObjectAsset.getAssetId();
|
||||
|
||||
%gameObjectAsset.TAMLFilePath = %tamlPath;
|
||||
%gameObjectAsset.scriptFilePath = %scriptPath;
|
||||
|
||||
TAMLWrite(%gameObjectAsset, AssetDatabase.getAssetFilePath(%assetID));
|
||||
AssetDatabase.refreshAsset(%assetID);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Doesn't exist, so make a new one
|
||||
%gameObjectAsset = new GameObjectAsset()
|
||||
{
|
||||
assetName = %name @ "Asset";
|
||||
gameObjectName = %name;
|
||||
TAMLFilePath = %tamlPath;
|
||||
scriptFilePath = %scriptPath;
|
||||
};
|
||||
|
||||
//Save it alongside the taml file
|
||||
%path = filePath(%tamlPath);
|
||||
|
||||
TAMLWrite(%gameObjectAsset, %path @ "/" @ %name @ ".asset.taml");
|
||||
AssetDatabase.refreshAllAssets(true);
|
||||
}
|
||||
}
|
||||
|
||||
//Allocates a number of a game object into a pool to be pulled from as needed
|
||||
function allocateGameObjects(%name, %amount)
|
||||
{
|
||||
//First, we need to make sure our pool exists
|
||||
if(!isObject(GameObjectPool))
|
||||
{
|
||||
new ArrayObject(GameObjectPool);
|
||||
}
|
||||
|
||||
//Next, we loop and generate our game objects, and add them to the pool
|
||||
for(%i=0; %i < %amount; %i++)
|
||||
{
|
||||
%go = spawnGameObject(%name, false);
|
||||
|
||||
//When our object is in the pool, it's not "real", so we need to make sure
|
||||
//that we don't ghost it to clients untill we actually spawn it.
|
||||
%go.clearScopeAlways();
|
||||
|
||||
//We also hide it, so that we don't 'exist' in the scene until we spawn
|
||||
%go.hidden = true;
|
||||
|
||||
//Lastly, add us to the pool, with the key being our game object type
|
||||
GameObjectPool.add(%name, %go);
|
||||
}
|
||||
}
|
||||
|
||||
function Entity::delete(%this)
|
||||
{
|
||||
//we want to intercept the delete call, and add it to our GameObjectPool
|
||||
//if it's a game object
|
||||
if(%this.gameObjectAsset !$= "")
|
||||
{
|
||||
%this.setHidden(true);
|
||||
%this.clearScopeAlways();
|
||||
|
||||
if(!isObject(GameObjectPool))
|
||||
{
|
||||
new ArrayObject(GameObjectPool);
|
||||
}
|
||||
|
||||
GameObjectPool.add(%this.gameObjectAsset, %this);
|
||||
|
||||
%missionSet = %this.getGroup();
|
||||
%missionSet.remove(%this);
|
||||
}
|
||||
else
|
||||
{
|
||||
%this.superClass.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function clearGameObjectPool()
|
||||
{
|
||||
if(isObject(GameObjectPool))
|
||||
{
|
||||
%count = GameObjectPool.count();
|
||||
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%go = GameObjectPool.getValue(%i);
|
||||
|
||||
%go.superClass.delete();
|
||||
}
|
||||
|
||||
GameObjectPool.empty();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
function switchCamera(%client, %newCamEntity)
|
||||
{
|
||||
if(!isObject(%client) || !isObject(%newCamEntity))
|
||||
return error("SwitchCamera: No client or target camera!");
|
||||
|
||||
%cam = %newCamEntity.getComponent(CameraComponent);
|
||||
|
||||
if(!isObject(%cam))
|
||||
return error("SwitchCamera: Target camera doesn't have a camera behavior!");
|
||||
|
||||
//TODO: Cleanup clientOwner for previous camera!
|
||||
if(%cam.clientOwner == 0 || %cam.clientOwner $= "")
|
||||
%cam.clientOwner = 0;
|
||||
|
||||
%cam.scopeToClient(%client);
|
||||
%cam.setDirty();
|
||||
|
||||
%client.setCameraObject(%newCamEntity);
|
||||
%client.setControlCameraFov(%cam.FOV);
|
||||
|
||||
%client.camera = %newCamEntity;
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ function ClientServer::destroy( %this )
|
|||
disconnect();
|
||||
|
||||
// Destroy the physics plugin.
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
sfxShutdown();
|
||||
|
||||
|
|
|
|||
|
|
@ -25,11 +25,14 @@ function initServer()
|
|||
echo("\n--------- Initializing " @ $appName @ ": Server Scripts ---------");
|
||||
|
||||
//load prefs
|
||||
|
||||
//Force-load the defaults just so we don't have any mistakes
|
||||
exec( "data/clientServer/scripts/server/defaults.cs" );
|
||||
|
||||
//Then, if the user has saved preferences, we load those over-top the defaults
|
||||
%prefPath = getPrefpath();
|
||||
if ( isFile( %prefPath @ "/serverPrefs.cs" ) )
|
||||
exec( %prefPath @ "/serverPrefs.cs" );
|
||||
else
|
||||
exec( "data/clientServer/scripts/server/defaults.cs" );
|
||||
|
||||
exec( "data/clientServer/scripts/server/audio.cs" );
|
||||
exec( "data/clientServer/scripts/server/commands.cs" );
|
||||
|
|
@ -99,6 +102,11 @@ function createAndConnectToLocalServer( %serverType, %level )
|
|||
{
|
||||
%conn.delete();
|
||||
destroyServer();
|
||||
|
||||
MessageBoxOK("Error starting local server!", "There was an error when trying to connect to the local server.");
|
||||
|
||||
if(isObject(MainMenuGui))
|
||||
Canvas.setContent(MainMenuGui);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -201,7 +209,7 @@ function destroyServer()
|
|||
// End any running levels and shut down the physics sim
|
||||
onServerDestroyed();
|
||||
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
// Delete all the server objects
|
||||
if (isObject(ServerGroup))
|
||||
|
|
|
|||
|
|
@ -31,29 +31,29 @@ function ChooseLevelDlg::onWake( %this )
|
|||
%this->LevelDescriptionLabel.visible = false;
|
||||
%this->LevelDescription.visible = false;
|
||||
|
||||
%count = LevelFilesList.count();
|
||||
%assetQuery = new AssetQuery();
|
||||
AssetDatabase.findAssetType(%assetQuery, "LevelAsset");
|
||||
|
||||
%count = %assetQuery.getCount();
|
||||
|
||||
if(%count == 0)
|
||||
if(%count == 0 && !IsDirectory("tools"))
|
||||
{
|
||||
//We have no levels found. Prompt the user to open the editor to the default level if the tools are present
|
||||
if(IsDirectory("tools"))
|
||||
{
|
||||
MessageBoxYesNo("Error", "No levels were found in any modules. Do you want to load the editor and start a new level?",
|
||||
"fastLoadWorldEdit(1);",
|
||||
"Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.",
|
||||
"Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
|
||||
}
|
||||
|
||||
MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.",
|
||||
"Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
|
||||
|
||||
%assetQuery.delete();
|
||||
return;
|
||||
}
|
||||
|
||||
for ( %i=0; %i < %count; %i++ )
|
||||
{
|
||||
%file = LevelFilesList.getKey( %i );
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%i);
|
||||
|
||||
%levelAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
|
||||
%file = %levelAsset.LevelFile;
|
||||
|
||||
if ( !isFile(%file @ ".mis") && !isFile(%file) )
|
||||
continue;
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ function ChooseLevelDlg::onWake( %this )
|
|||
continue;
|
||||
}
|
||||
|
||||
%this.addMissionFile( %file );
|
||||
%this.addLevelAsset( %levelAsset );
|
||||
}
|
||||
|
||||
// Also add the new level mission as defined in the world editor settings
|
||||
|
|
@ -218,6 +218,38 @@ function ChooseLevelDlg::addMissionFile( %this, %file )
|
|||
CL_levelList.addRow( CL_levelList.rowCount(), %levelName TAB %file TAB %levelDesc TAB %levelPreview );
|
||||
}
|
||||
|
||||
function ChooseLevelDlg::addLevelAsset( %this, %levelAsset )
|
||||
{
|
||||
%file = %levelAsset.LevelFile;
|
||||
|
||||
/*%levelName = fileBase(%file);
|
||||
%levelDesc = "A Torque level";
|
||||
|
||||
%LevelInfoObject = getLevelInfo(%file);
|
||||
|
||||
if (%LevelInfoObject != 0)
|
||||
{
|
||||
if(%LevelInfoObject.levelName !$= "")
|
||||
%levelName = %LevelInfoObject.levelName;
|
||||
else if(%LevelInfoObject.name !$= "")
|
||||
%levelName = %LevelInfoObject.name;
|
||||
|
||||
if (%LevelInfoObject.desc0 !$= "")
|
||||
%levelDesc = %LevelInfoObject.desc0;
|
||||
|
||||
if (%LevelInfoObject.preview !$= "")
|
||||
%levelPreview = %LevelInfoObject.preview;
|
||||
|
||||
%LevelInfoObject.delete();
|
||||
}*/
|
||||
|
||||
%levelName = %levelAsset.friendlyName;
|
||||
%levelDesc = %levelAsset.description;
|
||||
%levelPreview = %levelAsset.levelPreviewImage;
|
||||
|
||||
CL_levelList.addRow( CL_levelList.rowCount(), %levelName TAB %file TAB %levelDesc TAB %levelPreview );
|
||||
}
|
||||
|
||||
function ChooseLevelDlg::onSleep( %this )
|
||||
{
|
||||
// This is set from the outside, only stays true for a single wake/sleep
|
||||
|
|
|
|||
BIN
Templates/BaseGame/game/tools/assetBrowser/art/animationIcon.png
Normal file
|
After Width: | Height: | Size: 8 KiB |
|
After Width: | Height: | Size: 14 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/componentIcon.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/guiIcon.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/levelIcon.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/materialIcon.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/scriptIcon.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
BIN
Templates/BaseGame/game/tools/assetBrowser/art/soundIcon.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -0,0 +1,18 @@
|
|||
<AssetImportConfigs>
|
||||
<Config Name="TestConfig">
|
||||
<Mesh ImportMesh="1" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="1" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
|
||||
<Materials ImportMaterials="1" CreateComposites="1" UseDiffuseSuffixOnOriginImg="1" UseExistingMaterials="1" />
|
||||
<Animations ImportAnimations="1" SeparateAnimations="1" SeparateAnimationPrefix="" />
|
||||
<Collisions GenerateCollisions="1" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
|
||||
<Images ImageType="N/A" DiffuseTypeSuffixes="_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL" NormalTypeSuffixes="_NORMAL,_NORM" SpecularTypeSuffixes="_SPECULAR,_SPEC" MetalnessTypeSuffixes="_METAL,_MET,_METALNESS,_METALLIC" RoughnessTypeSuffixes="_ROUGH,_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH,_SMOOTHNESS" AOTypeSuffixes="_AO,_AMBIENT,_AMBIENTOCCLUSION" CompositeTypeSuffixes="_COMP,_COMPOSITE" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="1" PopulateMaterialMaps="1" />
|
||||
<Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
|
||||
</Config>
|
||||
<Config Name="SecondTest">
|
||||
<Mesh ImportMesh="1" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="0" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
|
||||
<Materials ImportMaterials="1" CreateComposites="1" UseDiffuseSuffixOnOriginImg="" UseExistingMaterials="" />
|
||||
<Animations ImportAnimations="1" SeparateAnimations="1" SeparateAnimationPrefix="" />
|
||||
<Collisions GenerateCollisions="1" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
|
||||
<Images ImageType="N/A" DiffuseTypeSuffixes="_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL" NormalTypeSuffixes="_NORMAL,_NORM" SpecularTypeSuffixes="_SPECULAR,_SPEC" MetalnessTypeSuffixes="_METAL,_MET,_METALNESS,_METALLIC" RoughnessTypeSuffixes="_ROUGH,_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH,_SMOOTHNESS" AOTypeSuffixes="_AO,_AMBIENT,_AMBIENTOCCLUSION" CompositeTypeSuffixes="_COMP,_COMPOSITE" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="" PopulateMaterialMaps="" />
|
||||
<Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
|
||||
</Config>
|
||||
</AssetImportConfigs>
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(GameObjectCreator) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
selectedEntity = "20054";
|
||||
|
||||
new GuiWindowCtrl(CreateGameObjectWindow) {
|
||||
text = "Create GameObject";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "Canvas.popDialog(GameObjectCreator);";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "328 322";
|
||||
extent = "368 123";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl(GameObjectCreateBtn) {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "224 92";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_importAssetWindow.ImportAssets();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "292 92";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(GameObjectCreator);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl(GameObjectCreatorObjectName) {
|
||||
text = "Game Object Name:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 60";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Target Module:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 30";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl(GameObjectCreatorPkgBtn) {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "342 27";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.pushDialog(AssetBrowser_addModule);\nAssetBrowser_addModuleWindow.selectWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx(GameObjectModuleList) {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
text = "Characters";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 27";
|
||||
extent = "204 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(GameObjectCreatorName) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "116 60";
|
||||
extent = "234 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_AddModule) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_addModuleWindow) {
|
||||
text = "Create New Module";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "362 334";
|
||||
extent = "299 99";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
hidden = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextEditCtrl() {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "88 35";
|
||||
extent = "196 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "ModuleName";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Module Name";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 35";
|
||||
extent = "72 16";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Create";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "88 68";
|
||||
extent = "126 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_addModuleWindow.CreateNewModule();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "220 68";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_addModuleWindow.Close();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_AddPackage) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_addPackageWindow) {
|
||||
text = "Create New Package";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "362 334";
|
||||
extent = "299 99";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
hidden = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextEditCtrl() {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "88 35";
|
||||
extent = "196 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "PackageName";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Package Name";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 35";
|
||||
extent = "72 16";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Create";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "88 68";
|
||||
extent = "126 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_addPackageWindow.CreateNewPackage();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "220 68";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_addPackageWindow.Close();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
934
Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui
Normal file
|
|
@ -0,0 +1,934 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
AddNewArtAssetPopup = "18801";
|
||||
AddNewAssetPopup = "18802";
|
||||
AddNewScriptAssetPopup = "18800";
|
||||
currentPreviewPage = "0";
|
||||
enabled = "1";
|
||||
importAssetFinalListArray = "20465";
|
||||
importAssetNewListArray = "20463";
|
||||
importAssetUnprocessedListArray = "20464";
|
||||
totalPages = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_addFilterWindow) {
|
||||
text = "Create New Tag";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "321 334";
|
||||
extent = "381 99";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextEditCtrl() {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "64 35";
|
||||
extent = "196 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "tagName";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Tag Name";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 35";
|
||||
extent = "52 16";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Create";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "64 68";
|
||||
extent = "126 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.createFilter( AssetBrowser_addFilterWindow-->tagName.getText() );AssetBrowser_addFilterWindow.setVisible(0);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "196 68";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_addFilterWindow.setVisible(0);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiWindowCtrl(AssetBrowserWindow) {
|
||||
text = "Asset Browser";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "AssetBrowser::hideDialog();";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "256 107";
|
||||
extent = "512 554";
|
||||
minExtent = "383 274";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl(CreateAssetButton) {
|
||||
text = "New";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "3 22";
|
||||
extent = "45 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl(ImportAssetButton) {
|
||||
text = "Import";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "50 22";
|
||||
extent = "45 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiWindowCtrl(TagFilterWindow) {
|
||||
text = "New Window";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
docking = "None";
|
||||
margin = "4 4 4 4";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "0";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "0";
|
||||
anchorRight = "0";
|
||||
position = "129 62";
|
||||
extent = "161 250";
|
||||
minExtent = "161 86";
|
||||
horizSizing = "windowRelative";
|
||||
vertSizing = "windowRelative";
|
||||
profile = "ToolsGuiToolbarWindowProfile";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "VisibilityLayerWindow";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "1";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "2 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 9";
|
||||
extent = "159 238";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiStackControl(TagFilterList) {
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "-2";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "3 1";
|
||||
extent = "153 16";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "theVisOptionsList";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiSplitContainer() {
|
||||
orientation = "Vertical";
|
||||
splitterSize = "2";
|
||||
splitPoint = "149 100";
|
||||
fixedPanel = "None";
|
||||
fixedSize = "356";
|
||||
docking = "None";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "3 42";
|
||||
extent = "505 509";
|
||||
minExtent = "64 64";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "height";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiPanel() {
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "147 509";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "Panel1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "147 31";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "inspectorStyleRolloutDarkProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Filters";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "5 0";
|
||||
extent = "30 16";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconNew.png";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "113 1";
|
||||
extent = "15 15";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.viewTagsFilter();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Show assets grouped and filtered via tags.";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconList.png";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "130 1";
|
||||
extent = "15 15";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.viewListFilter();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Views assets via module-oriented list tree.";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 17";
|
||||
extent = "147 493";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "1";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "147 493";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiEditorScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiDefaultProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTreeViewCtrl(AssetBrowserFilterTree) {
|
||||
tabSize = "16";
|
||||
textOffset = "2";
|
||||
fullRowSelect = "0";
|
||||
itemHeight = "21";
|
||||
destroyTreeOnSleep = "1";
|
||||
mouseDragging = "1";
|
||||
multipleSelections = "1";
|
||||
deleteObjectAllowed = "1";
|
||||
dragToItemAllowed = "1";
|
||||
clearAllOnSingleSelection = "1";
|
||||
showRoot = "1";
|
||||
useInspectorTooltips = "0";
|
||||
tooltipOnWidthOnly = "0";
|
||||
showObjectIds = "1";
|
||||
showClassNames = "1";
|
||||
showObjectNames = "1";
|
||||
showInternalNames = "1";
|
||||
showClassNameForUnnamedObjects = "0";
|
||||
compareToObjectID = "1";
|
||||
canRenameObjects = "1";
|
||||
renameInternal = "0";
|
||||
position = "1 1";
|
||||
extent = "145 294";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTreeViewProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "filterTree";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiPanel() {
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "151 0";
|
||||
extent = "354 509";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "panel2";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 0";
|
||||
extent = "354 41";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "inspectorStyleRolloutDarkProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/new";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "42 22";
|
||||
extent = "15 15";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.createNewAsset();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Create New Asset";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/delete";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "23 22";
|
||||
extent = "15 15";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.showDeleteDialog();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Delete Asset";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(AssetBrowserSearchFilter) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
text = "\c2Filter...";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "62 19";
|
||||
extent = "273 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
class = "AssetBrowserSearchFilterText";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl(TagFilterButton) {
|
||||
bitmap = "tools/gui/images/visible";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "4 19";
|
||||
extent = "20 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.toggleTagFilterPopup();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Assets";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "5 0";
|
||||
extent = "53 16";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/delete";
|
||||
bitmapMode = "Stretched";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "337 22";
|
||||
extent = "15 15";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.showDeleteDialog();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Delete Asset";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "1";
|
||||
position = "1 40";
|
||||
extent = "354 468";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl(AssetListPanel) {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "1";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "354 448";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiEditorScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiDefaultProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiStackControl() {
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "0";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "0";
|
||||
position = "1 1";
|
||||
extent = "352 254";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiModelessDialogProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiControl() {
|
||||
position = "0 0";
|
||||
extent = "352 4";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiDynamicCtrlArrayControl() {
|
||||
colCount = "3";
|
||||
colSize = "100";
|
||||
rowCount = "2";
|
||||
rowSize = "124";
|
||||
rowSpacing = "2";
|
||||
colSpacing = "2";
|
||||
frozen = "0";
|
||||
autoCellSize = "1";
|
||||
fillRowFirst = "1";
|
||||
dynamicSize = "1";
|
||||
padding = "0 0 0 0";
|
||||
position = "3 4";
|
||||
extent = "352 250";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "materialSelection";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiContainer() {
|
||||
docking = "Bottom";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 448";
|
||||
extent = "354 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "materialPreviewControlContainer";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Select";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "242 491";
|
||||
extent = "53 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "SelectButton";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "300 491";
|
||||
extent = "52 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser.hideDialog();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
613
Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui
Normal file
|
|
@ -0,0 +1,613 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetImportCtrl) {
|
||||
position = "0 0";
|
||||
extent = "1440 900";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
new GuiWindowCtrl(ImportAssetOptionsWindow) {
|
||||
text = "Import Options";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "633 358";
|
||||
extent = "346 409";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "271 377";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetOptionsWindow.saveAssetOptions();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "dynamic";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "9 26";
|
||||
extent = "326 344";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiVariableInspector(ImportOptionsList) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "309 64";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiWindowCtrl(ImportAssetConfigEditorWindow) {
|
||||
text = "Import Options Config";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "562 251";
|
||||
extent = "376 503";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "0";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Configuration Name:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "10 26";
|
||||
extent = "100 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(AssetImportConfigName) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "113 25";
|
||||
extent = "250 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "301 471";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetConfigEditorWindow.saveAssetOptionsConfig();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "dynamic";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "9 50";
|
||||
extent = "356 414";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiVariableInspector(ImportOptionsConfigList) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "339 64";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiWindowCtrl(ImportAssetWindow) {
|
||||
text = "Import Assets";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "536 205";
|
||||
extent = "368 502";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "224 470";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetWindow.ImportAssets();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "292 470";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Target Module:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 30";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx(ImportAssetModuleList) {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 27";
|
||||
extent = "204 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "342 27";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.pushDialog(AssetBrowser_addModule);\nAssetBrowser_addModuleWindow.selectWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "New Module";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Import Options Config:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 56";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx(ImportAssetConfigList) {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "126 53";
|
||||
extent = "175 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "305 53";
|
||||
extent = "15 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetConfigEditorWindow.addNewConfig();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "New Config";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconInformation.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "325 53";
|
||||
extent = "15 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetConfigEditorWindow.editConfig();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Edit Config";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconDelete.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "346 53";
|
||||
extent = "15 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "ImportAssetConfigEditorWindow.deleteConfig();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Delete Config";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "dynamic";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "9 82";
|
||||
extent = "348 381";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiStackControl(ImportingAssetList) {
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "0";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "0";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "345 20";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
147
Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_editAsset) {
|
||||
position = "0 0";
|
||||
extent = "1920 1080";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_editAssetWindow) {
|
||||
text = "Asset Properties";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "1";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "Canvas.popDialog(AssetBrowser_editAsset);";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "710 375";
|
||||
extent = "500 329";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 21";
|
||||
extent = "498 283";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiInspector(AssetEditInspector) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "481 101";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiInspectorProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Save";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "402 305";
|
||||
extent = "45 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_editAsset.saveAsset();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "450 305";
|
||||
extent = "45 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_editAsset);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
147
Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_editModule) {
|
||||
position = "0 0";
|
||||
extent = "1920 1080";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_editModuleWindow) {
|
||||
text = "Module Properties";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "1";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "Canvas.popDialog(AssetBrowser_editModule);";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "710 375";
|
||||
extent = "500 329";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 21";
|
||||
extent = "498 283";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiInspector(ModuleEditInspector) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "481 101";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiInspectorProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Save";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "402 305";
|
||||
extent = "45 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_editModule.saveModule();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "450 305";
|
||||
extent = "45 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_editModule);";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
237
Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_newAsset) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_newAssetWindow) {
|
||||
text = "Create Asset";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "Canvas.popDialog(AssetBrowser_newAsset);";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "328 140";
|
||||
extent = "368 450";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiButtonCtrl(NewAssetCreateBtn) {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "227 419";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "CreateNewAsset();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "295 419";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "AssetBrowser_newAssetWindow.onClose();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Target Module:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 30";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx(NewAssetModuleList) {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 27";
|
||||
extent = "204 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
class = "AssetBrowserModuleList";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl(NewAssetModuleBtn) {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "342 27";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.pushDialog(AssetBrowser_AddModule);\nAssetBrowser_addModuleWindow.selectWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiControl(NewComponentAssetSettings) {
|
||||
position = "12 120";
|
||||
extent = "344 107";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOn";
|
||||
vScrollBar = "alwaysOn";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "7 56";
|
||||
extent = "354 357";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiVariableInspector(NewAssetPropertiesInspector) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "1 1";
|
||||
extent = "337 338";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -0,0 +1,434 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_newComponentAsset) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_newComponentAssetWindow) {
|
||||
text = "Create Component";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
closeCommand = "Canvas.popDialog(AssetBrowser_newComponentAsset);";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "328 250";
|
||||
extent = "368 268";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
text = "Target Module:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 30";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx() {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 27";
|
||||
extent = "204 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "NewComponentModuleList";
|
||||
class = "AssetBrowserModuleList";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "342 27";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.pushDialog(AssetBrowser_AddModule);\nAssetBrowser_addModuleWindow.selectWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "NewComponentModuleBtn";
|
||||
class = "NewAssetModuleBtn";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Component Name:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 83";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(NewComponentName) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 83";
|
||||
extent = "203 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Parent Component:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 57";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiPopUpMenuCtrlEx(ParentComponentList) {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 54";
|
||||
extent = "204 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "NewAssetTypeList.onSelected();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(NewComponentFriendlyName) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 109";
|
||||
extent = "203 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Friendly Name:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 109";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextEditCtrl(NewComponentGroup) {
|
||||
historySize = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 134";
|
||||
extent = "203 18";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Component Group:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 134";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "134 159";
|
||||
extent = "203 64";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiMLTextEditCtrl(NewComponentDescription) {
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
useURLMouseCursor = "0";
|
||||
position = "1 0";
|
||||
extent = "201 64";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "Description:";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "12 159";
|
||||
extent = "116 17";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiTextProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Done";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "224 240";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "createNewComponentAsset();";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "292 240";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_newComponentAsset);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
144
Templates/BaseGame/game/tools/assetBrowser/guis/selectModule.gui
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_SelectModule) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_SelectModuleWindow) {
|
||||
text = "Select Module";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "362 334";
|
||||
extent = "299 99";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiPopUpMenuCtrlEx() {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "39 34";
|
||||
extent = "217 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
class = "AssetBrowserModuleList";
|
||||
internalName = "ModuleList";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "260 32";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
class = "SelectPackage_NewAssetModuleBtn";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Select";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "88 68";
|
||||
extent = "126 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_SelectModule);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "220 68";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_addModule);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(AssetBrowser_SelectPackage) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultNonModalProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new GuiWindowCtrl(AssetBrowser_SelectPackageWindow) {
|
||||
text = "Select Package";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "0";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "362 334";
|
||||
extent = "299 99";
|
||||
minExtent = "48 92";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiPopUpMenuCtrlEx() {
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
hotTrackCallback = "0";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "39 34";
|
||||
extent = "217 19";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
class = "AssetBrowserPackageList";
|
||||
internalName = "PackageList";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
bitmap = "tools/gui/images/iconAdd.png";
|
||||
bitmapMode = "Centered";
|
||||
autoFitExtents = "0";
|
||||
useModifiers = "0";
|
||||
useStates = "1";
|
||||
masked = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "260 32";
|
||||
extent = "22 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
class = "SelectPackage_NewAssetPackageBtn";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Select";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "88 68";
|
||||
extent = "126 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_SelectPackage);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "Cancel";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "220 68";
|
||||
extent = "64 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "Canvas.popDialog(AssetBrowser_addPackage);";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
70
Templates/BaseGame/game/tools/assetBrowser/main.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
if( !isObject( ToolsGuiDefaultNonModalProfile ) )
|
||||
new GuiControlProfile (ToolsGuiDefaultNonModalProfile : ToolsGuiDefaultProfile)
|
||||
{
|
||||
modal = false;
|
||||
};
|
||||
|
||||
function initializeAssetBrowser()
|
||||
{
|
||||
echo(" % - Initializing Asset Browser");
|
||||
|
||||
exec("./guis/assetBrowser.gui");
|
||||
exec("./guis/addModuleWindow.gui");
|
||||
exec("./guis/gameObjectCreator.gui");
|
||||
exec("./guis/newAsset.gui");
|
||||
exec("./guis/newComponentAsset.gui");
|
||||
exec("./guis/editAsset.gui");
|
||||
exec("./guis/assetImport.gui");
|
||||
exec("./guis/selectModule.gui");
|
||||
exec("./guis/editModule.gui");
|
||||
|
||||
exec("./scripts/assetBrowser.cs");
|
||||
exec("./scripts/popupMenus.cs");
|
||||
exec("./scripts/addModuleWindow.cs");
|
||||
exec("./scripts/assetImport.cs");
|
||||
exec("./scripts/assetImportConfig.cs");
|
||||
exec("./scripts/gameObjectCreator.cs");
|
||||
exec("./scripts/newAsset.cs");
|
||||
exec("./scripts/editAsset.cs");
|
||||
exec("./scripts/editModule.cs");
|
||||
|
||||
exec("./scripts/fieldTypes.cs");
|
||||
|
||||
new ScriptObject( AssetBrowserPlugin )
|
||||
{
|
||||
superClass = "EditorPlugin";
|
||||
};
|
||||
|
||||
Input::GetEventManager().subscribe( AssetBrowser, "BeginDropFiles" );
|
||||
Input::GetEventManager().subscribe( AssetBrowser, "DropFile" );
|
||||
Input::GetEventManager().subscribe( AssetBrowser, "EndDropFiles" );
|
||||
|
||||
AssetBrowser.buildPopupMenus();
|
||||
}
|
||||
|
||||
function AssetBrowserPlugin::onWorldEditorStartup( %this )
|
||||
{
|
||||
// Add ourselves to the toolbar.
|
||||
AssetBrowser.addToolbarButton();
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
function AssetBrowser_addModuleWindow::onGainFirstResponder(%this)
|
||||
{
|
||||
%this-->moduleName.setFirstResponder();
|
||||
}
|
||||
|
||||
function AssetBrowser_addModuleWindow::close()
|
||||
{
|
||||
Canvas.popDialog(AssetBrowser_addModule);
|
||||
eval(AssetBrowser_addModuleWindow.callbackFunction);
|
||||
}
|
||||
|
||||
function AssetBrowser_addModuleWindow::CreateNewModule(%this)
|
||||
{
|
||||
%newModuleName = %this-->moduleName.getText();
|
||||
|
||||
if(%newModuleName $= "")
|
||||
return;
|
||||
|
||||
echo("Creating a new Module named: " @ %newModuleName);
|
||||
|
||||
%moduleFilePath = "data/" @ %newModuleName;
|
||||
%moduleDefinitionFilePath = %moduleFilePath @ "/" @ %newModuleName @ ".module";
|
||||
%moduleScriptFilePath = %moduleFilePath @ "/" @ %newModuleName @ ".cs";
|
||||
|
||||
%newModule = new ModuleDefinition()
|
||||
{
|
||||
ModuleId = %newModuleName;
|
||||
versionId = 1;
|
||||
ScriptFile = %newModuleName @ ".cs";
|
||||
CreateFunction="onCreate";
|
||||
DestroyFunction="onDestroy";
|
||||
Group = "Game";
|
||||
|
||||
new DeclaredAssets()
|
||||
{
|
||||
Extension = "asset.taml";
|
||||
Recurse = true;
|
||||
};
|
||||
};
|
||||
|
||||
TAMLWrite(%newModule, %moduleDefinitionFilePath);
|
||||
|
||||
//Now generate the script file for it
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%moduleScriptFilePath))
|
||||
{
|
||||
%file.writeline("function " @ %newModuleName @ "::onCreate(%this)\n{\n\n}\n");
|
||||
%file.writeline("function " @ %newModuleName @ "::onDestroy(%this)\n{\n\n}\n");
|
||||
|
||||
//todo, pre-write any event functions of interest
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
//force a refresh of our modules list
|
||||
ModuleDatabase.ignoreLoadedGroups(true);
|
||||
ModuleDatabase.scanModules();
|
||||
%success = ModuleDatabase.loadExplicit(%newModuleName, 1);
|
||||
ModuleDatabase.ignoreLoadedGroups(false);
|
||||
|
||||
//force a reload of the Module lists
|
||||
NewAssetModuleList.refresh();
|
||||
GameObjectModuleList.refresh();
|
||||
ImportAssetModuleList.refresh();
|
||||
|
||||
AssetBrowser.newModuleId = %newModuleName;
|
||||
|
||||
Canvas.popDialog(AssetBrowser_addModule);
|
||||
eval(AssetBrowser_addModuleWindow.callbackFunction);
|
||||
}
|
||||
|
||||
function AssetBrowserModuleList::onWake(%this)
|
||||
{
|
||||
%this.refresh();
|
||||
}
|
||||
|
||||
function AssetBrowserModuleList::refresh(%this)
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
//First, get our list of modules
|
||||
%moduleList = ModuleDatabase.findModules();
|
||||
|
||||
%count = getWordCount(%moduleList);
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%moduleName = getWord(%moduleList, %i);
|
||||
%this.add(%moduleName.ModuleId, %i);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
function AssetBrowser_addPackageWindow::onGainFirstResponder(%this)
|
||||
{
|
||||
%this-->packageName.setFirstResponder();
|
||||
}
|
||||
|
||||
function AssetBrowser_addPackageWindow::close()
|
||||
{
|
||||
Canvas.popDialog(AssetBrowser_addPackage);
|
||||
eval(AssetBrowser_addPackageWindow.callbackFunction);
|
||||
}
|
||||
|
||||
function AssetBrowser_addPackageWindow::CreateNewPackage(%this)
|
||||
{
|
||||
%newPackageName = %this-->packageName.getText();
|
||||
|
||||
if(%newPackageName $= "")
|
||||
return;
|
||||
|
||||
echo("Creating a new package named: " @ %newPackageName);
|
||||
|
||||
%moduleFilePath = "data/" @ %newPackageName;
|
||||
%moduleDefinitionFilePath = %moduleFilePath @ "/" @ %newPackageName @ ".module";
|
||||
%moduleScriptFilePath = %moduleFilePath @ "/" @ %newPackageName @ ".cs";
|
||||
|
||||
%newPackage = new ModuleDefinition()
|
||||
{
|
||||
ModuleId = %newPackageName;
|
||||
versionId = 1;
|
||||
ScriptFile = %newPackageName @ ".cs";
|
||||
CreateFunction="onCreate";
|
||||
DestroyFunction="onDestroy";
|
||||
Group = "Game";
|
||||
|
||||
new DeclaredAssets()
|
||||
{
|
||||
Extension = "asset.taml";
|
||||
Recurse = true;
|
||||
};
|
||||
};
|
||||
|
||||
TAMLWrite(%newPackage, %moduleDefinitionFilePath);
|
||||
|
||||
//Now generate the script file for it
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%moduleScriptFilePath))
|
||||
{
|
||||
%file.writeline("function " @ %newPackageName @ "::onCreate(%this)\n{\n\n}\n");
|
||||
%file.writeline("function " @ %newPackageName @ "::onDestroy(%this)\n{\n\n}\n");
|
||||
|
||||
//todo, pre-write any event functions of interest
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
//force a refresh of our modules list
|
||||
ModuleDatabase.ignoreLoadedGroups(true);
|
||||
ModuleDatabase.scanModules();
|
||||
%success = ModuleDatabase.loadExplicit(%newPackageName, 1);
|
||||
ModuleDatabase.ignoreLoadedGroups(false);
|
||||
|
||||
//force a reload of the package lists
|
||||
NewAssetPackageList.refresh();
|
||||
GameObjectPackageList.refresh();
|
||||
ImportAssetPackageList.refresh();
|
||||
|
||||
Canvas.popDialog(AssetBrowser_addPackage);
|
||||
eval(AssetBrowser_addPackageWindow.callbackFunction);
|
||||
}
|
||||
|
||||
function AssetBrowserPackageList::onWake(%this)
|
||||
{
|
||||
%this.refresh();
|
||||
}
|
||||
|
||||
function AssetBrowserPackageList::refresh(%this)
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
//First, get our list of modules
|
||||
%moduleList = ModuleDatabase.findModules();
|
||||
|
||||
%count = getWordCount(%moduleList);
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%moduleName = getWord(%moduleList, %i);
|
||||
%this.add(%moduleName.ModuleId, %i);
|
||||
}
|
||||
}
|
||||
1304
Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs
Normal file
1525
Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs
Normal file
|
|
@ -0,0 +1,472 @@
|
|||
function ImportAssetConfigList::onSelect( %this, %id, %text )
|
||||
{
|
||||
//Apply our settings to the assets
|
||||
echo("Changed our import config!");
|
||||
AssetBrowser.importAssetUnprocessedListArray.empty();
|
||||
AssetBrowser.importAssetUnprocessedListArray.duplicate(AssetBrowser.importAssetNewListArray);
|
||||
AssetBrowser.importAssetFinalListArray.empty();
|
||||
|
||||
ImportAssetWindow.activeImportConfigIndex = %id;
|
||||
ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id);
|
||||
ImportAssetWindow.refresh();
|
||||
}
|
||||
|
||||
function ImportAssetOptionsWindow::findMissingFile(%this, %assetItem)
|
||||
{
|
||||
if(%assetItem.assetType $= "Model")
|
||||
%filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts";
|
||||
else if(%assetItem.assetType $= "Image")
|
||||
%filters = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds";
|
||||
|
||||
%dlg = new OpenFileDialog()
|
||||
{
|
||||
Filters = %filters;
|
||||
DefaultPath = $Pref::WorldEditor::LastPath;
|
||||
DefaultFile = "";
|
||||
ChangePath = true;
|
||||
OverwritePrompt = true;
|
||||
forceRelativePath = false;
|
||||
//MultipleFiles = true;
|
||||
};
|
||||
|
||||
%ret = %dlg.Execute();
|
||||
|
||||
if ( %ret )
|
||||
{
|
||||
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
|
||||
%fullPath = %dlg.FileName;//makeRelativePath( %dlg.FileName, getMainDotCSDir() );
|
||||
}
|
||||
|
||||
%dlg.delete();
|
||||
|
||||
if ( !%ret )
|
||||
return;
|
||||
|
||||
%assetItem.filePath = %fullPath;
|
||||
|
||||
ImportAssetWindow.refresh();
|
||||
}
|
||||
|
||||
//
|
||||
function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem)
|
||||
{
|
||||
ImportAssetOptionsWindow.setVisible(1);
|
||||
ImportAssetOptionsWindow.selectWindow();
|
||||
|
||||
ImportOptionsList.clearFields();
|
||||
|
||||
%assetType = %assetItem.assetType;
|
||||
%filePath = %assetItem.filePath;
|
||||
%assetName = %assetItem.assetName;
|
||||
%assetConfigObj = %assetItem.importConfig;
|
||||
|
||||
ImportOptionsList.startGroup("Asset");
|
||||
ImportOptionsList.addField("AssetName", "Asset Name", "string", "", "NewAsset", "", %assetItem);
|
||||
ImportOptionsList.endGroup();
|
||||
|
||||
if(%assetType $= "Model")
|
||||
{
|
||||
//Get the shape info, so we know what we're doing with the mesh
|
||||
%shapeInfo = GetShapeInfo(%filePath);
|
||||
%meshItem = %shapeInfo.findItemByName("Meshes");
|
||||
%matItem = %shapeInfo.findItemByName("Materials");
|
||||
|
||||
%meshCount = %shapeInfo.getItemValue(%meshItem);
|
||||
%matCount = %shapeInfo.getItemValue(%matItem);
|
||||
|
||||
%firstMat = %shapeInfo.getChild(%matItem);
|
||||
echo("Mesh's first material texture path is: " @ %shapeInfo.getItemValue(%firstMat));
|
||||
|
||||
if(%meshCount > 0)
|
||||
{
|
||||
ImportOptionsList.startGroup("Mesh");
|
||||
ImportOptionsList.addField("AutogenCollisions", "Auto-gen Collisions", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("CollapseSubmeshes", "Collapse Submeshes", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("UpAxisOverride", "Up-Axis Override", "list", "", "Z_AXIS", "Z_AXIS,Y_AXIS,X_AXIS", %assetConfigObj);
|
||||
ImportOptionsList.addField("OverrideScale", "Override Scale", "float", "", "1.0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("IgnoreNodeScale", "IgnoreNodeScaling", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("AdjustCenter", "Adjust Center", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("CollapseSubmeshes", "Collapse Submeshes", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("AdjustFloor", "Adjust Floor", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("LODType", "LOD Type", "list", "", "TrailingNumber", "TrailingNumber,DetectDTS", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
}
|
||||
|
||||
if(%matItem > 0)
|
||||
{
|
||||
ImportOptionsList.startGroup("Material");
|
||||
ImportOptionsList.addCallbackField("ImportMaterials", "Import Materials", "bool", "", "1", "", "ImportMaterialsChanged", %assetConfigObj);
|
||||
ImportOptionsList.addField("UseExistingMaterials", "Use Existing Materials", "bool", "", "1", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
}
|
||||
}
|
||||
else if(%assetType $= "Material")
|
||||
{
|
||||
ImportOptionsList.startGroup("Material");
|
||||
ImportOptionsList.addField("CreateComposites", "Create Composite Textures", "bool", "", "1", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
}
|
||||
else if(%assetType $= "Image")
|
||||
{
|
||||
ImportOptionsList.startGroup("Formatting");
|
||||
ImportOptionsList.addField("ImageType", "Image Type", "string", "", "Diffuse", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("TextureFiltering", "Texture Filtering", "list", "", "Bilinear", "None,Bilinear,Trilinear", %assetConfigObj);
|
||||
ImportOptionsList.addField("UseMips", "Use Mips", "bool", "", "1", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("IsHDR", "Is HDR", "bool", "", "0", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
|
||||
ImportOptionsList.startGroup("Scaling");
|
||||
ImportOptionsList.addField("Scaling", "Scaling", "float", "", "1.0", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
|
||||
ImportOptionsList.startGroup("Compression");
|
||||
ImportOptionsList.addField("IsCompressed", "Is Compressed", "bool", "", "1", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
|
||||
ImportOptionsList.startGroup("Material");
|
||||
ImportOptionsList.addField("GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsList.addField("PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsList.addField("UseDiffuseSuffixOnOriginImg", "Use Diffuse Suffix for Origin Image", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsList.addField("UseExistingMaterials", "Use Existing Materials", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsList.endGroup();
|
||||
}
|
||||
else if(%assetType $= "Sound")
|
||||
{
|
||||
ImportOptionsList.startGroup("Adjustment");
|
||||
ImportOptionsList.addField("VolumeAdjust", "VolumeAdjustment", "float", "", "1.0", "", %assetConfigObj);
|
||||
ImportOptionsList.addField("PitchAdjust", "PitchAdjustment", "float", "", "1.0", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
|
||||
ImportOptionsList.startGroup("Compression");
|
||||
ImportOptionsList.addField("IsCompressed", "Is Compressed", "bool", "", "1", "", %assetConfigObj);
|
||||
ImportOptionsList.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
function ImportAssetOptionsWindow::deleteImportingAsset(%this, %assetItem)
|
||||
{
|
||||
%assetIndex = AssetBrowser.importAssetNewListArray.getIndexFromKey(%assetItem);
|
||||
AssetBrowser.importAssetNewListArray.erase(%assetIndex);
|
||||
|
||||
//check if we have any child assets and remove them as well
|
||||
for(%i=0; %i < AssetBrowser.importAssetNewListArray.count(); %i++)
|
||||
{
|
||||
%asset = AssetBrowser.importAssetNewListArray.getKey(%i);
|
||||
if(%asset.ParentAssetItem == %assetItem)
|
||||
{
|
||||
AssetBrowser.importAssetNewListArray.erase(%i);
|
||||
%i--;
|
||||
}
|
||||
}
|
||||
|
||||
%assetIndex = AssetBrowser.importAssetFinalListArray.getIndexFromKey(%assetItem);
|
||||
AssetBrowser.importAssetFinalListArray.erase(%assetIndex);
|
||||
|
||||
//check if we have any child assets and remove them as well
|
||||
for(%i=0; %i < AssetBrowser.importAssetFinalListArray.count(); %i++)
|
||||
{
|
||||
%asset = AssetBrowser.importAssetFinalListArray.getKey(%i);
|
||||
if(%asset.ParentAssetItem == %assetItem)
|
||||
{
|
||||
AssetBrowser.importAssetFinalListArray.erase(%i);
|
||||
%i--;
|
||||
}
|
||||
}
|
||||
|
||||
ImportAssetWindow.refresh();
|
||||
ImportAssetOptionsWindow.setVisible(0);
|
||||
}
|
||||
|
||||
function ImportAssetOptionsWindow::saveAssetOptions(%this)
|
||||
{
|
||||
ImportAssetWindow.refresh();
|
||||
ImportAssetOptionsWindow.setVisible(0);
|
||||
}
|
||||
|
||||
function ImportOptionsList::ImportMaterialsChanged(%this, %fieldName, %newValue, %ownerObject)
|
||||
{
|
||||
echo("CHANGED IF OUR IMPORTED MATERIALS WERE HAPPENING!");
|
||||
}
|
||||
|
||||
function ImportAssetConfigEditorWindow::populateConfigList(%this, %optionsObj)
|
||||
{
|
||||
AssetImportConfigName.setText(%optionsObj.Name);
|
||||
|
||||
ImportOptionsConfigList.clear();
|
||||
|
||||
ImportOptionsConfigList.startGroup("Mesh");
|
||||
ImportOptionsConfigList.addCallbackField("ImportMesh", "Import Mesh", "bool", "", "1", "", "ToggleImportMesh", %optionsObj);
|
||||
ImportOptionsConfigList.addField("DoUpAxisOverride", "Do Up-axis Override", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("UpAxisOverride", "Up-axis Override", "list", "", "Z_AXIS", "X_AXIS,Y_AXIS,Z_AXIS", %optionsObj);
|
||||
ImportOptionsConfigList.addField("DoScaleOverride", "Do Scale Override", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("ScaleOverride", "Scale Override", "float", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("IgnoreNodeScale", "Ignore Node Scale", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("AdjustCenter", "Adjust Center", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("AdjustFloor", "Adjust Floor", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("CollapseSubmeshes", "Collapse Submeshes", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("LODType", "LOD Type", "list", "", "TrailingNumber", "TrailingNumber,DetectDTS", %optionsObj);
|
||||
//ImportOptionsConfigList.addField("TrailingNumber", "Trailing Number", "float", "", "2", "", %optionsObj, "Mesh");
|
||||
ImportOptionsConfigList.addField("ImportedNodes", "Imported Nodes", "command", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("IgnoreNodes", "Ignore Nodes", "command", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("ImportMeshes", "Import Meshes", "command", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("IgnoreMeshes", "Imported Meshes", "command", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
|
||||
//Materials
|
||||
ImportOptionsConfigList.startGroup("Material");
|
||||
ImportOptionsConfigList.addField("ImportMaterials", "Import Materials", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("CreateComposites", "Create Composites", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("UseDiffuseSuffixOnOriginImg", "Use Diffuse Suffix for Origin Image", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("UseExistingMaterials", "Use Existing Materials", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("IgnoreMaterials", "Ignore Materials", "command", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
|
||||
//Animations
|
||||
ImportOptionsConfigList.startGroup("Animations");
|
||||
ImportOptionsConfigList.addField("ImportAnimations", "Import Animations", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("SeparateAnimations", "Separate Animations", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("SeparateAnimationPrefix", "Separate Animation Prefix", "string", "", "", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
|
||||
//Collision
|
||||
ImportOptionsConfigList.startGroup("Collision");
|
||||
ImportOptionsConfigList.addField("GenerateCollisions", "Generate Collisions", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("GenCollisionType", "Generate Collision Type", "list", "", "CollisionMesh", "CollisionMesh,ConvexHull", %optionsObj);
|
||||
ImportOptionsConfigList.addField("CollisionMeshPrefix", "CollisionMesh Prefix", "string", "", "Col", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("GenerateLOSCollisions", "Generate LOS Collisions", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("GenLOSCollisionType", "Generate LOS Collision Type", "list", "", "CollisionMesh", "CollisionMesh,ConvexHull", %optionsObj);
|
||||
ImportOptionsConfigList.addField("LOSCollisionMeshPrefix", "LOS CollisionMesh Prefix", "string", "", "LOS", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
|
||||
//Images
|
||||
ImportOptionsConfigList.startGroup("Image");
|
||||
ImportOptionsConfigList.addField("ImageType", "Image Type", "list", "", "N/A", "N/A,Diffuse,Normal,Specular,Metalness,Roughness,AO,Composite,GUI", %optionsObj);
|
||||
ImportOptionsConfigList.addField("DiffuseTypeSuffixes", "Diffuse Type Suffixes", "command", "", "_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("NormalTypeSuffixes", "Normal Type Suffixes", "command", "", "_NORMAL,_NORM", "", %optionsObj);
|
||||
|
||||
if(EditorSettings.lightingModel $= "Legacy")
|
||||
{
|
||||
ImportOptionsConfigList.addField("SpecularTypeSuffixes", "Specular Type Suffixes", "command", "", "_SPECULAR,_SPEC", "", %optionsObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImportOptionsConfigList.addField("MetalnessTypeSuffixes", "Metalness Type Suffixes", "command", "", "_METAL,_MET,_METALNESS,_METALLIC", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("RoughnessTypeSuffixes", "Roughness Type Suffixes", "command", "", "_ROUGH,_ROUGHNESS", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("SmoothnessTypeSuffixes", "Smoothness Type Suffixes", "command", "", "_SMOOTH,_SMOOTHNESS", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("AOTypeSuffixes", "AO Type Suffixes", "command", "", "_AO,_AMBIENT,_AMBIENTOCCLUSION", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("CompositeTypeSuffixes", "Composite Type Suffixes", "command", "", "_COMP,_COMPOSITE", "", %optionsObj);
|
||||
}
|
||||
|
||||
ImportOptionsConfigList.addField("TextureFilteringMode", "Texture Filtering Mode", "list", "", "Bilinear", "None,Bilinear,Trilinear", %optionsObj);
|
||||
ImportOptionsConfigList.addField("UseMips", "Use Mipmaps", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("IsHDR", "Is HDR", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("Scaling", "Scaling", "float", "", "1.0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("Compressed", "Is Compressed", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
|
||||
//Sounds
|
||||
ImportOptionsConfigList.startGroup("Sound");
|
||||
ImportOptionsConfigList.addField("VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "", %optionsObj);
|
||||
ImportOptionsConfigList.addField("Compressed", "Is Compressed", "bool", "", "0", "", %optionsObj);
|
||||
ImportOptionsConfigList.endGroup();
|
||||
}
|
||||
|
||||
function ImportAssetConfigEditorWindow::addNewConfig(%this)
|
||||
{
|
||||
ImportAssetConfigEditorWindow.setVisible(1);
|
||||
ImportAssetConfigEditorWindow.selectWindow();
|
||||
|
||||
%optionsObj = new ScriptObject(){};
|
||||
|
||||
ImportAssetWindow.importConfigsList.add(%optionsObj);
|
||||
|
||||
//Initial, blank configuration
|
||||
%optionsObj.ImportMesh = true;
|
||||
%optionsObj.DoUpAxisOverride = false;
|
||||
%optionsObj.UpAxisOverride = "Z_AXIS";
|
||||
%optionsObj.DoScaleOverride = false;
|
||||
%optionsObj.ScaleOverride = 1.0;
|
||||
%optionsObj.IgnoreNodeScale = false;
|
||||
%optionsObj.AdjustCenter = false;
|
||||
%optionsObj.AdjustFloor = false;
|
||||
%optionsObj.CollapseSubmeshes = false;
|
||||
%optionsObj.LODType = "TrailingNumber";
|
||||
//%optionsObj.TrailingNumber = 2;
|
||||
%optionsObj.ImportedNodes = "";
|
||||
%optionsObj.IgnoreNodes = "";
|
||||
%optionsObj.ImportMeshes = "";
|
||||
%optionsObj.IgnoreMeshes = "";
|
||||
|
||||
//Materials
|
||||
%optionsObj.ImportMaterials = true;
|
||||
%optionsObj.CreateComposites = true;
|
||||
%optionsObj.UseDiffuseSuffixOnOriginImg = true;
|
||||
%optionsObj.UseExistingMaterials = true;
|
||||
|
||||
//Animations
|
||||
%optionsObj.ImportAnimations = true;
|
||||
%optionsObj.SeparateAnimations = true;
|
||||
%optionsObj.SeparateAnimationPrefix = "";
|
||||
|
||||
//Collision
|
||||
%optionsObj.GenerateCollisions = true;
|
||||
%optionsObj.GenCollisionType = "CollisionMesh";
|
||||
%optionsObj.CollisionMeshPrefix = "Col";
|
||||
%optionsObj.GenerateLOSCollisions = true;
|
||||
%optionsObj.GenLOSCollisionType = "CollisionMesh";
|
||||
%optionsObj.LOSCollisionMeshPrefix = "LOS";
|
||||
|
||||
//Images
|
||||
%optionsObj.ImageType = "N/A";
|
||||
%optionsObj.DiffuseTypeSuffixes = "_ALBEDO;_DIFFUSE;_ALB;_DIF;_COLOR;_COL;_BASECOLOR;_BASE_COLOR";
|
||||
%optionsObj.NormalTypeSuffixes = "_NORMAL;_NORM";
|
||||
%optionsObj.SpecularTypeSuffixes = "_SPECULAR;_SPEC";
|
||||
%optionsObj.MetalnessTypeSuffixes = "_METAL;_MET;_METALNESS;_METALLIC";
|
||||
%optionsObj.RoughnessTypeSuffixes = "_ROUGH;_ROUGHNESS";
|
||||
%optionsObj.SmoothnessTypeSuffixes = "_SMOOTH;_SMOOTHNESS";
|
||||
%optionsObj.AOTypeSuffixes = "_AO;_AMBIENT;_AMBIENTOCCLUSION";
|
||||
%optionsObj.CompositeTypeSuffixes = "_COMP;_COMPOSITE";
|
||||
%optionsObj.TextureFilteringMode = "Bilinear";
|
||||
%optionsObj.UseMips = true;
|
||||
%optionsObj.IsHDR = false;
|
||||
%optionsObj.Scaling = 1.0;
|
||||
%optionsObj.Compressed = true;
|
||||
%optionsObj.GenerateMaterialOnImport = true;
|
||||
%optionsObj.PopulateMaterialMaps = true;
|
||||
|
||||
//Sounds
|
||||
%optionsObj.VolumeAdjust = 1.0;
|
||||
%optionsObj.PitchAdjust = 1.0;
|
||||
%optionsObj.Compressed = false;
|
||||
|
||||
//Hook in the UI
|
||||
%this.populateConfigList(%optionsObj);
|
||||
}
|
||||
|
||||
function ImportAssetConfigEditorWindow::editConfig(%this)
|
||||
{
|
||||
ImportAssetConfigEditorWindow.setVisible(1);
|
||||
ImportAssetConfigEditorWindow.selectWindow();
|
||||
|
||||
%this.populateConfigList(ImportAssetWindow.activeImportConfig);
|
||||
}
|
||||
|
||||
function ImportAssetConfigEditorWindow::deleteConfig(%this)
|
||||
{
|
||||
ImportAssetWindow.importConfigsList.erase(ImportAssetWindow.activeImportConfigIndex);
|
||||
ImportAssetConfigList.setSelected(0); //update it
|
||||
|
||||
ImportAssetConfigEditorWindow.saveAssetOptionsConfig();
|
||||
}
|
||||
|
||||
function ImportAssetConfigEditorWindow::saveAssetOptionsConfig(%this)
|
||||
{
|
||||
%xmlDoc = new SimXMLDocument();
|
||||
|
||||
%xmlDoc.pushNewElement("AssetImportConfigs");
|
||||
|
||||
for(%i = 0; %i < ImportAssetWindow.importConfigsList.count(); %i++)
|
||||
{
|
||||
%configObj = ImportAssetWindow.importConfigsList.getKey(%i);
|
||||
|
||||
%xmlDoc.pushNewElement("Config");
|
||||
|
||||
if(%configObj.Name $= "")
|
||||
%configObj.Name = AssetImportConfigName.getText();
|
||||
|
||||
%xmlDoc.setAttribute("Name", %configObj.Name);
|
||||
|
||||
%xmlDoc.pushNewElement("Mesh");
|
||||
%xmlDoc.setAttribute("ImportMesh", %configObj.ImportMesh);
|
||||
%xmlDoc.setAttribute("DoUpAxisOverride", %configObj.DoUpAxisOverride);
|
||||
%xmlDoc.setAttribute("UpAxisOverride", %configObj.UpAxisOverride);
|
||||
%xmlDoc.setAttribute("DoScaleOverride", %configObj.DoScaleOverride);
|
||||
%xmlDoc.setAttribute("ScaleOverride", %configObj.ScaleOverride);
|
||||
%xmlDoc.setAttribute("IgnoreNodeScale", %configObj.IgnoreNodeScale);
|
||||
%xmlDoc.setAttribute("AdjustCenter", %configObj.AdjustCenter);
|
||||
%xmlDoc.setAttribute("AdjustFloor", %configObj.AdjustFloor);
|
||||
%xmlDoc.setAttribute("CollapseSubmeshes", %configObj.CollapseSubmeshes);
|
||||
%xmlDoc.setAttribute("LODType", %configObj.LODType);
|
||||
%xmlDoc.setAttribute("ImportedNodes", %configObj.ImportedNodes);
|
||||
%xmlDoc.setAttribute("IgnoreNodes", %configObj.IgnoreNodes);
|
||||
%xmlDoc.setAttribute("ImportMeshes", %configObj.ImportMeshes);
|
||||
%xmlDoc.setAttribute("IgnoreMeshes", %configObj.IgnoreMeshes);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.pushNewElement("Materials");
|
||||
%xmlDoc.setAttribute("ImportMaterials", %configObj.ImportMaterials);
|
||||
%xmlDoc.setAttribute("CreateComposites", %configObj.CreateComposites);
|
||||
%xmlDoc.setAttribute("UseDiffuseSuffixOnOriginImg", %configObj.UseDiffuseSuffixOnOriginImg);
|
||||
%xmlDoc.setAttribute("UseExistingMaterials", %configObj.UseExistingMaterials);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.pushNewElement("Animations");
|
||||
%xmlDoc.setAttribute("ImportAnimations", %configObj.ImportAnimations);
|
||||
%xmlDoc.setAttribute("SeparateAnimations", %configObj.SeparateAnimations);
|
||||
%xmlDoc.setAttribute("SeparateAnimationPrefix", %configObj.SeparateAnimationPrefix);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.pushNewElement("Collisions");
|
||||
%xmlDoc.setAttribute("GenerateCollisions", %configObj.GenerateCollisions);
|
||||
%xmlDoc.setAttribute("GenCollisionType", %configObj.GenCollisionType);
|
||||
%xmlDoc.setAttribute("CollisionMeshPrefix", %configObj.CollisionMeshPrefix);
|
||||
%xmlDoc.setAttribute("GenerateLOSCollisions", %configObj.GenerateLOSCollisions);
|
||||
%xmlDoc.setAttribute("GenLOSCollisionType", %configObj.GenLOSCollisionType);
|
||||
%xmlDoc.setAttribute("LOSCollisionMeshPrefix", %configObj.LOSCollisionMeshPrefix);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.pushNewElement("Images");
|
||||
%xmlDoc.setAttribute("ImageType", %configObj.ImageType);
|
||||
%xmlDoc.setAttribute("DiffuseTypeSuffixes", %configObj.DiffuseTypeSuffixes);
|
||||
%xmlDoc.setAttribute("NormalTypeSuffixes", %configObj.NormalTypeSuffixes);
|
||||
%xmlDoc.setAttribute("SpecularTypeSuffixes", %configObj.SpecularTypeSuffixes);
|
||||
%xmlDoc.setAttribute("MetalnessTypeSuffixes", %configObj.MetalnessTypeSuffixes);
|
||||
%xmlDoc.setAttribute("RoughnessTypeSuffixes", %configObj.RoughnessTypeSuffixes);
|
||||
%xmlDoc.setAttribute("SmoothnessTypeSuffixes", %configObj.SmoothnessTypeSuffixes);
|
||||
%xmlDoc.setAttribute("AOTypeSuffixes", %configObj.AOTypeSuffixes);
|
||||
%xmlDoc.setAttribute("CompositeTypeSuffixes", %configObj.CompositeTypeSuffixes);
|
||||
%xmlDoc.setAttribute("TextureFilteringMode", %configObj.TextureFilteringMode);
|
||||
%xmlDoc.setAttribute("UseMips", %configObj.UseMips);
|
||||
%xmlDoc.setAttribute("IsHDR", %configObj.IsHDR);
|
||||
%xmlDoc.setAttribute("Scaling", %configObj.Scaling);
|
||||
%xmlDoc.setAttribute("Compressed", %configObj.Compressed);
|
||||
%xmlDoc.setAttribute("GenerateMaterialOnImport", %configObj.GenerateMaterialOnImport);
|
||||
%xmlDoc.setAttribute("PopulateMaterialMaps", %configObj.PopulateMaterialMaps);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.pushNewElement("Sounds");
|
||||
%xmlDoc.setAttribute("VolumeAdjust", %configObj.VolumeAdjust);
|
||||
%xmlDoc.setAttribute("PitchAdjust", %configObj.PitchAdjust);
|
||||
%xmlDoc.setAttribute("Compressed", %configObj.Compressed);
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.popElement();
|
||||
}
|
||||
|
||||
%xmlDoc.popElement();
|
||||
|
||||
%xmlDoc.saveFile($AssetBrowser::importConfigsFile);
|
||||
|
||||
ImportAssetConfigEditorWindow.setVisible(0);
|
||||
ImportAssetWindow.reloadImportOptionConfigs();
|
||||
}
|
||||
|
||||
function ImportOptionsConfigList::ToggleImportMesh(%this, %fieldName, %newValue, %ownerObject)
|
||||
{
|
||||
%this.setFieldEnabled("DoUpAxisOverride", %newValue);
|
||||
%this.setFieldEnabled("UpAxisOverride", %newValue);
|
||||
%this.setFieldEnabled("DoScaleOverride", %newValue);
|
||||
%this.setFieldEnabled("ScaleOverride", %newValue);
|
||||
%this.setFieldEnabled("IgnoreNodeScale", %newValue);
|
||||
%this.setFieldEnabled("AdjustCenter", %newValue);
|
||||
%this.setFieldEnabled("AdjustFloor", %newValue);
|
||||
%this.setFieldEnabled("CollapseSubmeshes", %newValue);
|
||||
%this.setFieldEnabled("LODType", %newValue);
|
||||
%this.setFieldEnabled("ImportedNodes", %newValue);
|
||||
%this.setFieldEnabled("IgnoreNodes", %newValue);
|
||||
%this.setFieldEnabled("ImportMeshes", %newValue);
|
||||
%this.setFieldEnabled("IgnoreMeshes", %newValue);
|
||||
}
|
||||
371
Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs
Normal file
|
|
@ -0,0 +1,371 @@
|
|||
function AssetBrowser_editAsset::saveAsset(%this)
|
||||
{
|
||||
%file = AssetDatabase.getAssetFilePath(%this.editedAssetId);
|
||||
%success = TamlWrite(AssetBrowser_editAsset.editedAsset, %file);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
Canvas.popDialog(AssetBrowser_editAsset);
|
||||
}
|
||||
|
||||
function AssetBrowser::editAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
|
||||
if(%assetType $= "MaterialAsset")
|
||||
{
|
||||
//if(EditorSettings.materialEditMode $= "MaterialEditor")
|
||||
//{
|
||||
%assetDef.materialDefinitionName.reload();
|
||||
|
||||
EditorGui.setEditor(MaterialEditorPlugin);
|
||||
|
||||
MaterialEditorGui.currentMaterial = %assetDef.materialDefinitionName;
|
||||
MaterialEditorGui.setActiveMaterial( %assetDef.materialDefinitionName );
|
||||
|
||||
AssetBrowser.hideDialog();
|
||||
/*}
|
||||
else
|
||||
{
|
||||
Canvas.pushDialog(ShaderEditor);
|
||||
ShaderEditorGraph.loadGraph(%assetDef.shaderGraph);
|
||||
$ShaderGen::targetShaderFile = filePath(%assetDef.shaderGraph) @"/"@fileBase(%assetDef.shaderGraph);
|
||||
}*/
|
||||
}
|
||||
else if(%assetType $= "StateMachineAsset")
|
||||
{
|
||||
eval("AssetBrowser.tempAsset = new " @ %assetDef.getClassName() @ "();");
|
||||
AssetBrowser.tempAsset.assignFieldsFrom(%assetDef);
|
||||
|
||||
SMAssetEditInspector.inspect(AssetBrowser.tempAsset);
|
||||
AssetBrowser_editAsset.editedAssetId = EditAssetPopup.assetId;
|
||||
AssetBrowser_editAsset.editedAsset = AssetBrowser.tempAsset;
|
||||
|
||||
//remove some of the groups we don't need:
|
||||
for(%i=0; %i < SMAssetEditInspector.getCount(); %i++)
|
||||
{
|
||||
%caption = SMAssetEditInspector.getObject(%i).caption;
|
||||
|
||||
if(%caption $= "Ungrouped" || %caption $= "Object" || %caption $= "Editing"
|
||||
|| %caption $= "Persistence" || %caption $= "Dynamic Fields")
|
||||
{
|
||||
SMAssetEditInspector.remove(SMAssetEditInspector.getObject(%i));
|
||||
%i--;
|
||||
}
|
||||
}
|
||||
|
||||
Canvas.pushDialog(StateMachineEditor);
|
||||
StateMachineEditor.loadStateMachineAsset(EditAssetPopup.assetId);
|
||||
StateMachineEditor-->Window.text = "State Machine Editor ("@EditAssetPopup.assetId@")";
|
||||
}
|
||||
else if(%assetType $= "ComponentAsset")
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%scriptFile = %assetDef.scriptFile;
|
||||
|
||||
EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0);
|
||||
}
|
||||
else if(%assetType $= "GameObjectAsset")
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%scriptFile = %assetDef.scriptFilePath;
|
||||
|
||||
EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0);
|
||||
}
|
||||
else if(%assetType $= "ScriptAsset")
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%scriptFile = %assetDef.scriptFilePath;
|
||||
|
||||
EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0);
|
||||
}
|
||||
else if(%assetType $= "ShapeAsset")
|
||||
{
|
||||
%this.hideDialog();
|
||||
ShapeEditorPlugin.openShapeAsset(EditAssetPopup.assetId);
|
||||
}
|
||||
else if(%assetType $= "ShapeAnimationAsset")
|
||||
{
|
||||
%this.hideDialog();
|
||||
ShapeEditorPlugin.openShapeAsset(EditAssetPopup.assetId);
|
||||
}
|
||||
else if(%assetType $= "LevelAsset")
|
||||
{
|
||||
schedule( 1, 0, "EditorOpenMission", %assetDef.LevelFile);
|
||||
}
|
||||
else if(%assetType $= "GUIAsset")
|
||||
{
|
||||
if(!isObject(%assetDef.assetName))
|
||||
{
|
||||
exec(%assetDef.GUIFilePath);
|
||||
exec(%assetDef.mScriptFilePath);
|
||||
}
|
||||
|
||||
GuiEditContent(%assetDef.assetName);
|
||||
}
|
||||
}
|
||||
|
||||
function AssetBrowser::editAssetInfo(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_editAsset);
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
|
||||
eval("AssetBrowser.tempAsset = new " @ %assetDef.getClassName() @ "();");
|
||||
AssetBrowser.tempAsset.assignFieldsFrom(%assetDef);
|
||||
|
||||
AssetEditInspector.inspect(AssetBrowser.tempAsset);
|
||||
AssetBrowser_editAsset.editedAssetId = EditAssetPopup.assetId;
|
||||
AssetBrowser_editAsset.editedAsset = AssetBrowser.tempAsset;
|
||||
|
||||
//remove some of the groups we don't need:
|
||||
for(%i=0; %i < AssetEditInspector.getCount(); %i++)
|
||||
{
|
||||
%caption = AssetEditInspector.getObject(%i).caption;
|
||||
|
||||
if(%caption $= "Ungrouped" || %caption $= "Object" || %caption $= "Editing"
|
||||
|| %caption $= "Persistence" || %caption $= "Dynamic Fields")
|
||||
{
|
||||
AssetEditInspector.remove(AssetEditInspector.getObject(%i));
|
||||
%i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
function AssetBrowser::refreshAsset(%this, %assetId)
|
||||
{
|
||||
if(%assetId $= "")
|
||||
{
|
||||
//if we have no passed-in asset ID, we're probably going through the popup menu, so get our edit popup id
|
||||
%assetId = EditAssetPopup.assetId;
|
||||
}
|
||||
|
||||
AssetDatabase.refreshAsset(%assetId);
|
||||
AssetBrowser.refreshPreviews();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
function AssetBrowser::renameAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
|
||||
%curFirstResponder = AssetBrowser.getFirstResponder();
|
||||
|
||||
if(%curFirstResponder != 0)
|
||||
%curFirstResponder.clearFirstResponder();
|
||||
|
||||
AssetBrowser.selectedAssetPreview-->AssetNameLabel.setActive(true);
|
||||
AssetBrowser.selectedAssetPreview-->AssetNameLabel.setFirstResponder();
|
||||
}
|
||||
|
||||
function AssetNameField::onReturn(%this)
|
||||
{
|
||||
//if the name is different to the asset's original name, rename it!
|
||||
%newName = %this.getText();
|
||||
if(%this.originalAssetName !$= %this.getText())
|
||||
{
|
||||
%moduleName = AssetBrowser.selectedModule;
|
||||
|
||||
//do a rename!
|
||||
%success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %this.originalAssetName, %moduleName @ ":" @ %this.getText());
|
||||
|
||||
if(%success)
|
||||
{
|
||||
%newAssetId = %moduleName @ ":" @ %this.getText();
|
||||
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);
|
||||
|
||||
//Rename any associated files as well
|
||||
%assetDef = AssetDatabase.acquireAsset(%newAssetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
|
||||
//rename the file to match
|
||||
%path = filePath(%assetPath);
|
||||
|
||||
if(%assetType $= "ComponentAsset")
|
||||
{
|
||||
%oldScriptFilePath = %assetDef.scriptFile;
|
||||
%scriptFilePath = filePath(%assetDef.scriptFile);
|
||||
%scriptExt = fileExt(%assetDef.scriptFile);
|
||||
|
||||
%newScriptFileName = %scriptFilePath @ "/" @ %newName @ %scriptExt;
|
||||
%newAssetFile = %path @ "/" @ %this.getText() @ ".asset.taml";
|
||||
|
||||
%assetDef.componentName = %newName;
|
||||
%assetDef.scriptFile = %newScriptFileName;
|
||||
|
||||
TamlWrite(%assetDef, %newAssetFile);
|
||||
fileDelete(%assetPath);
|
||||
|
||||
pathCopy(%oldScriptFilePath, %newScriptFileName);
|
||||
fileDelete(%oldScriptFilePath);
|
||||
|
||||
//Go through our scriptfile and replace the old namespace with the new
|
||||
%editedFileContents = "";
|
||||
|
||||
%file = new FileObject();
|
||||
if ( %file.openForRead( %newScriptFileName ) )
|
||||
{
|
||||
while ( !%file.isEOF() )
|
||||
{
|
||||
%line = %file.readLine();
|
||||
%line = trim( %line );
|
||||
|
||||
%editedFileContents = %editedFileContents @ strreplace(%line, %this.originalAssetName, %newName) @ "\n";
|
||||
}
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
if(%editedFileContents !$= "")
|
||||
{
|
||||
%file.openForWrite(%newScriptFileName);
|
||||
|
||||
%file.writeline(%editedFileContents);
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
exec(%newScriptFileName);
|
||||
}
|
||||
else if(%assetType $= "StateMachineAsset")
|
||||
{
|
||||
%oldScriptFilePath = %assetDef.stateMachineFile;
|
||||
%scriptFilePath = filePath(%assetDef.stateMachineFile);
|
||||
%scriptExt = fileExt(%assetDef.stateMachineFile);
|
||||
|
||||
%newScriptFileName = %scriptFilePath @ "/" @ %newName @ %scriptExt;
|
||||
%newAssetFile = %path @ "/" @ %this.getText() @ ".asset.taml";
|
||||
|
||||
%assetDef.stateMachineFile = %newScriptFileName;
|
||||
|
||||
TamlWrite(%assetDef, %newAssetFile);
|
||||
fileDelete(%assetPath);
|
||||
|
||||
pathCopy(%oldScriptFilePath, %newScriptFileName);
|
||||
fileDelete(%oldScriptFilePath);
|
||||
}
|
||||
else if(%assetType $= "GameObjectAsset")
|
||||
{
|
||||
%oldScriptFilePath = %assetDef.scriptFilePath;
|
||||
%scriptFilePath = filePath(%assetDef.scriptFilePath);
|
||||
%scriptExt = fileExt(%assetDef.scriptFilePath);
|
||||
|
||||
%oldGOFilePath = %assetDef.TAMLFilePath;
|
||||
|
||||
%newScriptFileName = %scriptFilePath @ "/" @ %newName @ %scriptExt;
|
||||
%newAssetFile = %path @ "/" @ %this.getText() @ ".asset.taml";
|
||||
%newGOFile = %path @ "/" @ %this.getText() @ ".taml";
|
||||
|
||||
%assetDef.gameObjectName = %newName;
|
||||
%assetDef.scriptFilePath = %newScriptFileName;
|
||||
%assetDef.TAMLFilePath = %newGOFile;
|
||||
|
||||
TamlWrite(%assetDef, %newAssetFile);
|
||||
fileDelete(%assetPath);
|
||||
|
||||
pathCopy(%oldScriptFilePath, %newScriptFileName);
|
||||
fileDelete(%oldScriptFilePath);
|
||||
|
||||
pathCopy(%oldGOFilePath, %newGOFile);
|
||||
fileDelete(%oldGOFilePath);
|
||||
|
||||
//Go through our scriptfile and replace the old namespace with the new
|
||||
%editedFileContents = "";
|
||||
|
||||
%file = new FileObject();
|
||||
if ( %file.openForRead( %newScriptFileName ) )
|
||||
{
|
||||
while ( !%file.isEOF() )
|
||||
{
|
||||
%line = %file.readLine();
|
||||
%line = trim( %line );
|
||||
|
||||
%editedFileContents = %editedFileContents @ strreplace(%line, %this.originalAssetName, %newName) @ "\n";
|
||||
}
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
if(%editedFileContents !$= "")
|
||||
{
|
||||
%file.openForWrite(%newScriptFileName);
|
||||
|
||||
%file.writeline(%editedFileContents);
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
exec(%newScriptFileName);
|
||||
|
||||
//Rename in the TAML file as well
|
||||
%file = new FileObject();
|
||||
if ( %file.openForRead( %newGOFile ) )
|
||||
{
|
||||
while ( !%file.isEOF() )
|
||||
{
|
||||
%line = %file.readLine();
|
||||
%line = trim( %line );
|
||||
|
||||
%editedFileContents = %editedFileContents @ strreplace(%line, %this.originalAssetName, %newName) @ "\n";
|
||||
}
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
if(%editedFileContents !$= "")
|
||||
{
|
||||
%file.openForWrite(%newGOFile);
|
||||
|
||||
%file.writeline(%editedFileContents);
|
||||
|
||||
%file.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%this.clearFirstResponder();
|
||||
%this.setActive(false);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
function AssetBrowser::duplicateAsset(%this)
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
|
||||
%this.setupCreateNewAsset(%assetDef.getClassName(), AssetBrowser.selectedModule);
|
||||
}
|
||||
|
||||
function AssetBrowser::deleteAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
|
||||
MessageBoxOKCancel("Warning!", "This will delete the selected asset and the files associated to it, do you wish to continue?",
|
||||
"AssetBrowser.confirmDeleteAsset();", "");
|
||||
}
|
||||
|
||||
function AssetBrowser::confirmDeleteAsset(%this)
|
||||
{
|
||||
%currentSelectedItem = AssetBrowserFilterTree.getSelectedItem();
|
||||
%currentItemParent = AssetBrowserFilterTree.getParentItem(%currentSelectedItem);
|
||||
|
||||
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
|
||||
|
||||
%this.loadFilters();
|
||||
|
||||
if(!AssetBrowserFilterTree.selectItem(%currentSelectedItem))
|
||||
{
|
||||
//if it failed, that means we deleted the last item in that category, and we need to do the parent
|
||||
AssetBrowserFilterTree.selectItem(%currentItemParent);
|
||||
AssetBrowserFilterTree.expandItem(%currentItemParent);
|
||||
}
|
||||
}
|
||||
127
Templates/BaseGame/game/tools/assetBrowser/scripts/editModule.cs
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
//
|
||||
function AssetBrowser::CreateNewModule(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
||||
AssetBrowser_addModuleWindow.selectWindow();
|
||||
|
||||
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadFilters();";
|
||||
}
|
||||
|
||||
function AssetBrowser_editModule::saveModule(%this)
|
||||
{
|
||||
//Check what special actions we may need to do, such as renames
|
||||
%moduleDef = ModuleDatabase.findModule(AssetBrowser.selectedModule, 1);
|
||||
|
||||
%oldModuleName = %moduleDef.ModuleID;
|
||||
|
||||
if(%oldModuleName !$= AssetBrowser.tempModule.ModuleID)
|
||||
{
|
||||
//rename the script file and script namespaces
|
||||
%oldScriptFilePath = "data/" @ %oldModuleName @ "/" @ %moduleDef.scriptFile;
|
||||
%newscriptFilePath = "data/" @ AssetBrowser.tempModule.ModuleID @ "/";
|
||||
%scriptExt = fileExt(%moduleDef.scriptFile);
|
||||
|
||||
%newScriptFileName = %newscriptFilePath @ "/" @ AssetBrowser.tempModule.ModuleID @ %scriptExt;
|
||||
%newScriptFileOldName = %newscriptFilePath @ "/" @ %oldModuleName @ %scriptExt;
|
||||
|
||||
%moduleDef.ModuleId = AssetBrowser.tempModule.ModuleID;
|
||||
%moduleDef.scriptFile = AssetBrowser.tempModule.ModuleID @ %scriptExt;
|
||||
|
||||
ModuleDatabase.copyModule(%moduleDef, AssetBrowser.tempModule.ModuleID, "data/" @ AssetBrowser.tempModule.ModuleID);
|
||||
|
||||
//Go through our scriptfile and replace the old namespace with the new
|
||||
%editedFileContents = "";
|
||||
|
||||
%file = new FileObject();
|
||||
if ( %file.openForRead( %newScriptFileOldName ) )
|
||||
{
|
||||
while ( !%file.isEOF() )
|
||||
{
|
||||
%line = %file.readLine();
|
||||
%line = trim( %line );
|
||||
|
||||
%editedFileContents = %editedFileContents @ strreplace(%line, %oldModuleName, AssetBrowser.tempModule.ModuleID) @ "\n";
|
||||
}
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
if(%editedFileContents !$= "")
|
||||
{
|
||||
%file.openForWrite(%newScriptFileName);
|
||||
|
||||
%file.writeline(%editedFileContents);
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
%success = fileDelete(%newScriptFileOldName);
|
||||
|
||||
ModuleDatabase.unloadExplicit(%oldModuleName);
|
||||
|
||||
%success = fileDelete("data/" @ %oldModuleName);
|
||||
|
||||
ModuleDatabase.loadExplicit(AssetBrowser.tempModule.ModuleID);
|
||||
}
|
||||
|
||||
//Now, update the module file itself
|
||||
//%file = ModuleDatabase.getAssetFilePath(%moduleDef.ModuleID);
|
||||
//%success = TamlWrite(AssetBrowser_editAsset.editedAsset, %file);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
Canvas.popDialog(AssetBrowser_editModule);
|
||||
}
|
||||
|
||||
function AssetBrowser::editModuleInfo(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_editModule);
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(AssetBrowser.selectedModule, 1);
|
||||
|
||||
AssetBrowser.tempModule = new ModuleDefinition();
|
||||
AssetBrowser.tempModule.assignFieldsFrom(%moduleDef);
|
||||
|
||||
ModuleEditInspector.inspect(AssetBrowser.tempModule);
|
||||
AssetBrowser_editModule.editedModuleId = AssetBrowser.selectedModule;
|
||||
AssetBrowser_editModule.editedModule = AssetBrowser.tempModule;
|
||||
|
||||
//remove some of the groups we don't need:
|
||||
for(%i=0; %i < ModuleEditInspector.getCount(); %i++)
|
||||
{
|
||||
%caption = ModuleEditInspector.getObject(%i).caption;
|
||||
|
||||
if(%caption $= "BuildId" || %caption $= "type" || %caption $= "Dependencies" || %caption $= "scriptFile"
|
||||
|| %caption $= "AssetTagsManifest" || %caption $= "ScopeSet" || %caption $= "ModulePath"
|
||||
|| %caption $= "ModuleFile" || %caption $= "ModuleFilePath" || %caption $= "ModuleScriptFilePath" )
|
||||
{
|
||||
ModuleEditInspector.remove(ModuleEditInspector.getObject(%i));
|
||||
%i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AssetBrowser::renameModule(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function AssetBrowser::reloadModule(%this)
|
||||
{
|
||||
ModuleDatabase.unregisterModule(AssetBrowser.SelectedModule, 1);
|
||||
ModuleDatabase.loadExplicit(AssetBrowser.SelectedModule);
|
||||
}
|
||||
|
||||
function AssetBrowser::deleteModule(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function AssetBrowser::RefreshModuleDependencies(%this)
|
||||
{
|
||||
//Iterate through all our modules
|
||||
|
||||
//then, iterate through the module's assets
|
||||
|
||||
//if an asset has a module that isn't us, queue that into the dependencies list
|
||||
}
|
||||
127
Templates/BaseGame/game/tools/assetBrowser/scripts/fieldTypes.cs
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
function GuiVariableInspector::onInspectorFieldModified(%this, %targetObj, %fieldName, %index, %oldValue, %newValue)
|
||||
{
|
||||
echo("FIELD CHANGED: " @ %fieldName @ " from " @ %oldValue @ " to " @ %newValue);
|
||||
}
|
||||
|
||||
function GuiInspectorVariableGroup::onConstructField(%this, %fieldName, %fieldLabel, %fieldTypeName, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %ownerObj)
|
||||
{
|
||||
%makeCommand = %this @ ".build" @ %fieldTypeName @ "Field(\""@ %fieldName @ "\",\"" @ %fieldLabel @ "\",\"" @ %fieldDesc @ "\",\"" @
|
||||
%fieldDefaultVal @ "\",\"" @ %fieldDataVals @ "\",\"" @ %ownerObj @"\");";
|
||||
eval(%makeCommand);
|
||||
}
|
||||
|
||||
function GuiInspectorVariableGroup::buildListField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %ownerObj)
|
||||
{
|
||||
%extent = 200;
|
||||
|
||||
%fieldCtrl = %this.createInspectorField();
|
||||
|
||||
%extent = %this.stack.getExtent();
|
||||
|
||||
%width = mRound(%extent/2);
|
||||
%height = 20;
|
||||
%inset = 10;
|
||||
|
||||
/*%container = new GuiControl() {
|
||||
canSaveDynamicFields = "0";
|
||||
Profile = "EditorContainerProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = %extent.x SPC %height;
|
||||
MinExtent = "8 2";
|
||||
canSave = "0";
|
||||
Visible = "1";
|
||||
hovertime = "100";
|
||||
tooltip = %tooltip;
|
||||
tooltipProfile = "EditorToolTipProfile";
|
||||
};
|
||||
|
||||
%labelControl = new GuiTextCtrl() {
|
||||
canSaveDynamicFields = "0";
|
||||
Profile = "EditorFontHLBold";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = %inset SPC "0";
|
||||
Extent = %width + %inset SPC %height;
|
||||
MinExtent = "8 2";
|
||||
canSave = "0";
|
||||
Visible = "1";
|
||||
hovertime = "100";
|
||||
tooltip = %tooltip;
|
||||
tooltipProfile = "EditorToolTipProfile";
|
||||
text = %fieldLabel;
|
||||
maxLength = "1024";
|
||||
};*/
|
||||
|
||||
%editControl = new GuiPopUpMenuCtrl() {
|
||||
class = "guiInspectorListField";
|
||||
maxPopupHeight = "200";
|
||||
sbUsesNAColor = "0";
|
||||
reverseTextList = "0";
|
||||
bitmapBounds = "16 16";
|
||||
maxLength = "1024";
|
||||
Margin = "0 0 0 0";
|
||||
Padding = "0 0 0 0";
|
||||
AnchorTop = "1";
|
||||
AnchorBottom = "0";
|
||||
AnchorLeft = "1";
|
||||
AnchorRight = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiPopUpMenuProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = %fieldCtrl.edit.position;
|
||||
Extent = %fieldCtrl.edit.extent;
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
tooltip = %tooltip;
|
||||
text = %fieldDefaultVal;
|
||||
hovertime = "1000";
|
||||
ownerObject = %ownerObj;
|
||||
fieldName = %fieldName;
|
||||
};
|
||||
|
||||
//set the field value
|
||||
if(getSubStr(%this.fieldName, 0, 1) $= "$")
|
||||
{
|
||||
if(%fieldName $= "")
|
||||
%editControl.setText(%fieldName);
|
||||
}
|
||||
else
|
||||
{
|
||||
//regular variable
|
||||
%setCommand = %editControl @ ".setText(" @ %ownerObj @ "." @ %fieldName @ ");";
|
||||
eval(%setCommand);
|
||||
}
|
||||
|
||||
%listCount = getTokenCount(%fieldDataVals, ",");
|
||||
|
||||
for(%i=0; %i < %listCount; %i++)
|
||||
{
|
||||
%entryText = getToken(%fieldDataVals, ",", %i);
|
||||
%editControl.add(%entryText);
|
||||
}
|
||||
|
||||
%fieldCtrl.setCaption(%fieldLabel);
|
||||
%fieldCtrl.setEditControl(%editControl);
|
||||
|
||||
%this.addInspectorField(%fieldCtrl);
|
||||
}
|
||||
|
||||
function guiInspectorListField::onSelect( %this, %id, %text )
|
||||
{
|
||||
if(getSubStr(%this.fieldName, 0, 1) $= "$")
|
||||
{
|
||||
//ah, a global var, just do it straight, then
|
||||
%setCommand = %this.fieldName @ " = \"" @ %text @ "\";";
|
||||
}
|
||||
else
|
||||
{
|
||||
//regular variable
|
||||
%setCommand = %this.ownerObject @ "." @ %this.fieldName @ " = \"" @ %text @ "\";";
|
||||
}
|
||||
eval(%setCommand);
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
function GameObjectModuleList::onWake(%this)
|
||||
{
|
||||
%this.refresh();
|
||||
}
|
||||
|
||||
function GameObjectModuleList::refresh(%this)
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
//First, get our list of modules
|
||||
%moduleList = ModuleDatabase.findModules();
|
||||
|
||||
%count = getWordCount(%moduleList);
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%moduleName = getWord(%moduleList, %i);
|
||||
%this.add(%moduleName.ModuleId, %i);
|
||||
}
|
||||
}
|
||||
|
||||
function GameObjectCreatorPkgBtn::onClick(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
||||
AssetBrowser_addModuleWindow.selectWindow();
|
||||
}
|
||||
|
||||
function GameObjectCreateBtn::onClick(%this)
|
||||
{
|
||||
%className = GameObjectCreatorName.getText();
|
||||
|
||||
if(%className $= "")
|
||||
{
|
||||
error("Attempted to make a new Game Object with no name!");
|
||||
Canvas.popDialog(GameObjectCreator);
|
||||
return;
|
||||
}
|
||||
|
||||
//First, find out if this one already exists. If so, we're obviously merely updating it
|
||||
//also, exec any components that may exist
|
||||
//find all GameObjectAssets
|
||||
%assetQuery = new AssetQuery();
|
||||
if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
|
||||
return; //if we didn't find ANY, just exit
|
||||
|
||||
%count = %assetQuery.getCount();
|
||||
|
||||
%createNew = true;
|
||||
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%i);
|
||||
|
||||
%gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
|
||||
if(%gameObjectAsset.gameObjectName $= %className)
|
||||
{
|
||||
%createNew = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
%selectedEntity = GameObjectCreator.selectedEntity;
|
||||
|
||||
%selectedEntity.class = %className;
|
||||
Inspector.inspect(%selectedEntity);
|
||||
|
||||
if(%createNew)
|
||||
{
|
||||
//get the selected module data
|
||||
%moduleName = GameObjectModuleList.getText();
|
||||
|
||||
%selectedEntity.gameObjectAsset = %moduleName @ ":" @ %className;
|
||||
|
||||
%path = "data/" @ %moduleName @ "/gameObjects/";
|
||||
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%path @ "\\" @ %className @ ".cs"))
|
||||
{
|
||||
%file.writeline("function " @ %className @ "::onAdd(%this)\n{\n\n}\n");
|
||||
%file.writeline("function " @ %className @ "::onRemove(%this)\n{\n\n}\n");
|
||||
|
||||
//todo, pre-write any event functions of interest
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
//set up the paths
|
||||
%tamlPath = %path @ %className @ ".taml";
|
||||
%scriptPath = %path @ %className @ ".cs";
|
||||
saveGameObject(%className, %tamlPath, %scriptPath);
|
||||
|
||||
%asset = new GameObjectAsset()
|
||||
{
|
||||
AssetName = %className;
|
||||
VersionId = 1;
|
||||
gameObjectName=%className;
|
||||
TAMLFilePath = %tamlPath;
|
||||
scriptFilePath = %scriptPath;
|
||||
};
|
||||
%assetPath = %path @ %className @ ".asset.taml";
|
||||
|
||||
//now, add the script file and a ref to the taml into our SGO manifest so we can readily spawn it later.
|
||||
TamlWrite(%selectedEntity, %tamlpath);
|
||||
TamlWrite(%asset, %assetPath);
|
||||
|
||||
GameObjectCreator.selectedEntity = "";
|
||||
|
||||
Canvas.popDialog(GameObjectCreator);
|
||||
|
||||
//Load it
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName,1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
%moduleDef = AssetDatabase.getAssetModule(%assetId);
|
||||
%moduleName = %moduleDef.ModuleId;
|
||||
%path = "data/" @ %moduleName @ "/gameObjects/";
|
||||
|
||||
%selectedEntity.gameObjectAsset = %moduleName @ ":" @ %className;
|
||||
|
||||
%tamlPath = %path @ %className @ ".taml";
|
||||
TamlWrite(%selectedEntity, %tamlpath);
|
||||
|
||||
GameObjectCreator.selectedEntity = "";
|
||||
|
||||
Canvas.popDialog(GameObjectCreator);
|
||||
}
|
||||
}
|
||||
663
Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs
Normal file
|
|
@ -0,0 +1,663 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
function CreateAssetButton::onClick(%this)
|
||||
{
|
||||
AddNewAssetPopup.showPopup(Canvas);
|
||||
}
|
||||
|
||||
function AssetBrowser_newAsset::onWake(%this)
|
||||
{
|
||||
NewAssetModuleList.refresh();
|
||||
//NewComponentParentClass.setText("Component");
|
||||
}
|
||||
|
||||
function AssetBrowser_newAssetWindow::onClose(%this)
|
||||
{
|
||||
NewAssetPropertiesInspector.clearFields();
|
||||
Canvas.popDialog(AssetBrowser_newAsset);
|
||||
}
|
||||
|
||||
function NewAssetTypeList::onWake(%this)
|
||||
{
|
||||
%this.refresh();
|
||||
}
|
||||
|
||||
function NewAssetTypeList::refresh(%this)
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
//TODO: make this more automated
|
||||
//%this.add("GameObject", 0);
|
||||
%this.add("Component", 0);
|
||||
%this.add("Image", 1);
|
||||
%this.add("Material", 2);
|
||||
%this.add("Shape", 3);
|
||||
%this.add("Sound", 4);
|
||||
%this.add("State Machine", 5);
|
||||
}
|
||||
|
||||
function NewAssetTypeList::onSelected(%this)
|
||||
{
|
||||
%assetType = %this.getText();
|
||||
|
||||
if(%assetType $= "Component")
|
||||
{
|
||||
NewComponentAssetSettings.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
function NewAssetModuleBtn::onClick(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
||||
AssetBrowser_addModuleWindow.selectWindow();
|
||||
}
|
||||
|
||||
function AssetBrowser::setupCreateNewAsset(%this, %assetType, %moduleName)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_newAsset);
|
||||
|
||||
AssetBrowser_newAssetWindow.text = "New" SPC %assetType SPC "Asset";
|
||||
|
||||
NewAssetPropertiesInspector.clear();
|
||||
|
||||
NewAssetModuleList.setText(%moduleName);
|
||||
|
||||
//get rid of the old one if we had one.
|
||||
if(isObject(%this.newAssetSettings))
|
||||
%this.newAssetSettings.delete();
|
||||
|
||||
%this.newAssetSettings = new ScriptObject();
|
||||
|
||||
%this.newAssetSettings.assetType = %assetType;
|
||||
%this.newAssetSettings.moduleName = %moduleName;
|
||||
|
||||
%shortAssetTypeName = strreplace(%assetType, "Asset", "");
|
||||
|
||||
NewAssetPropertiesInspector.startGroup("General");
|
||||
NewAssetPropertiesInspector.addField("assetName", "New Asset Name", "String", "Name of the new asset", "New" @ %shortAssetTypeName, "", %this.newAssetSettings);
|
||||
//NewAssetPropertiesInspector.addField("AssetType", "New Asset Type", "List", "Type of the new asset", %assetType, "Component,Image,Material,Shape,Sound,State Machine", %newAssetSettings);
|
||||
|
||||
NewAssetPropertiesInspector.addField("friendlyName", "Friendly Name", "String", "Human-readable name of new asset", "", "", %this.newAssetSettings);
|
||||
|
||||
NewAssetPropertiesInspector.addField("description", "Description", "Command", "Description of the new asset", "", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.endGroup();
|
||||
|
||||
if(%assetType $= "ComponentAsset")
|
||||
{
|
||||
NewAssetPropertiesInspector.startGroup("Components");
|
||||
NewAssetPropertiesInspector.addField("parentClass", "New Asset Parent Class", "String", "Name of the new asset's parent class", "Component", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.addField("componentGroup", "Component Group", "String", "Name of the group of components this component asset belongs to", "", "", %this.newAssetSettings);
|
||||
//NewAssetPropertiesInspector.addField("componentName", "Component Name", "String", "Name of the new component", "", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.endGroup();
|
||||
}
|
||||
else if(%assetType $= "LevelAsset")
|
||||
{
|
||||
NewAssetPropertiesInspector.startGroup("Level");
|
||||
NewAssetPropertiesInspector.addField("levelPreviewImage", "LevePreviewImage", "Image", "Preview Image for the level", "", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.endGroup();
|
||||
}
|
||||
else if(%assetType $= "ScriptAsset")
|
||||
{
|
||||
NewAssetPropertiesInspector.startGroup("Script");
|
||||
NewAssetPropertiesInspector.addField("isServerScript", "Is Server Script", "bool", "Is this script used on the server?", "1", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.endGroup();
|
||||
}
|
||||
/*else if(%assetType $= "ShapeAnimationAsset")
|
||||
{
|
||||
NewAssetPropertiesInspector.startGroup("Animation");
|
||||
NewAssetPropertiesInspector.addField("sourceFile", "Source File", "filename", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.addField("animationName", "Animation Name", "string", "Name of the animation clip when used in a shape", "", "", %this.newAssetSettings);
|
||||
|
||||
NewAssetPropertiesInspector.addField("startFrame", "Starting Frame", "int", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.addField("endFrame", "Ending Frame", "int", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
||||
|
||||
NewAssetPropertiesInspector.addField("padRotation", "Pad Rotations", "bool", "Source file this animation will pull from", "0", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.addField("padTransforms", "Pad Transforms", "bool", "Source file this animation will pull from", "0", "", %this.newAssetSettings);
|
||||
NewAssetPropertiesInspector.endGroup();
|
||||
}*/
|
||||
|
||||
return;
|
||||
|
||||
if(%moduleName $= "")
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_selectModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetBrowser.SelectedModule = %moduleName;
|
||||
|
||||
if(%assetType $= "MaterialAsset")
|
||||
{
|
||||
createNewMaterialAsset("NewMaterial", %moduleName);
|
||||
}
|
||||
else if(%assetType $= "StateMachineAsset")
|
||||
{
|
||||
createNewStateMachineAsset("NewStateMachine", %moduleName);
|
||||
}
|
||||
else if(%assetType $= "ScriptAsset")
|
||||
{
|
||||
createNewScriptAsset("NewScriptAsset", %moduleName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//We do a quick validation that mandatory fields are filled in before passing along to the asset-type specific function
|
||||
function CreateNewAsset()
|
||||
{
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
if(%assetName $= "")
|
||||
{
|
||||
MessageBoxOK( "Error", "Attempted to make a new asset with no name!");
|
||||
return;
|
||||
}
|
||||
|
||||
//get the selected module data
|
||||
%moduleName = NewAssetModuleList.getText();
|
||||
|
||||
if(%moduleName $= "")
|
||||
{
|
||||
MessageBoxOK( "Error", "Attempted to make a new asset with no module!");
|
||||
return;
|
||||
}
|
||||
|
||||
AssetBrowser.newAssetSettings.moduleName = %moduleName;
|
||||
|
||||
%assetType = AssetBrowser.newAssetSettings.assetType;
|
||||
if(%assetType $= "")
|
||||
{
|
||||
MessageBoxOK( "Error", "Attempted to make a new asset with no type!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(%assetType $= "ComponentAsset")
|
||||
{
|
||||
//Canvas.popDialog(AssetBrowser_newComponentAsset);
|
||||
//AssetBrowser_newComponentAsset-->AssetBrowserModuleList.setText(AssetBrowser.selectedModule);
|
||||
%assetFilePath = createNewComponentAsset(%assetName, %path);
|
||||
}
|
||||
else if(%assetType $= "MaterialAsset")
|
||||
{
|
||||
%assetFilePath = createNewMaterialAsset();
|
||||
}
|
||||
else if(%assetType $= "StateMachineAsset")
|
||||
{
|
||||
%assetFilePath = createNewStateMachineAsset();
|
||||
}
|
||||
else if(%assetType $= "GUIAsset")
|
||||
{
|
||||
%assetFilePath = createNewGUIAsset();
|
||||
}
|
||||
else if(%assetType $= "LevelAsset")
|
||||
{
|
||||
%assetFilePath = createNewLevelAsset();
|
||||
}
|
||||
else if(%assetType $= "ScriptAsset")
|
||||
{
|
||||
%assetFilePath = createNewScriptAsset();
|
||||
}
|
||||
else if(%assetType $= "ShapeAnimationAsset")
|
||||
{
|
||||
%assetFilePath = createShapeAnimationAsset();
|
||||
}
|
||||
|
||||
Canvas.popDialog(AssetBrowser_newAsset);
|
||||
|
||||
//Load it
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName,1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %assetFilePath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
}
|
||||
|
||||
function createNewComponentAsset()
|
||||
{
|
||||
%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%tamlpath = %modulePath @ "/components/" @ %assetName @ ".asset.taml";
|
||||
%scriptPath = %modulePath @ "/components/" @ %assetName @ ".cs";
|
||||
|
||||
%asset = new ComponentAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
componentName = %assetName;
|
||||
componentClass = AssetBrowser.newAssetSettings.parentClass;
|
||||
friendlyName = AssetBrowser.newAssetSettings.friendlyName;
|
||||
componentType = AssetBrowser.newAssetSettings.componentGroup;
|
||||
description = AssetBrowser.newAssetSettings.description;
|
||||
scriptFile = %scriptPath;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%scriptPath))
|
||||
{
|
||||
//TODO: enable ability to auto-embed a header for copyright or whatnot
|
||||
%file.writeline("//onAdd is called when the component is created and then added to it's owner entity.\n");
|
||||
%file.writeline("//You would also add any script-defined component fields via addComponentField().\n");
|
||||
%file.writeline("function " @ %assetName @ "::onAdd(%this)\n{\n\n}\n");
|
||||
%file.writeline("//onAdd is called when the component is removed and deleted from it's owner entity.");
|
||||
%file.writeline("function " @ %assetName @ "::onRemove(%this)\n{\n\n}\n");
|
||||
%file.writeline("//onClientConnect is called any time a new client connects to the server.");
|
||||
%file.writeline("function " @ %assetName @ "::onClientConnect(%this, %client)\n{\n\n}\n");
|
||||
%file.writeline("//onClientDisconnect is called any time a client disconnects from the server.");
|
||||
%file.writeline("function " @ %assetName @ "::onClientDisonnect(%this, %client)\n{\n\n}\n");
|
||||
%file.writeline("//update is called when the component does an update tick.\n");
|
||||
%file.writeline("function " @ %assetName @ "::Update(%this)\n{\n\n}\n");
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
Canvas.popDialog(AssetBrowser_newComponentAsset);
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "Components");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewMaterialAsset()
|
||||
{
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%tamlpath = %modulePath @ "/materials/" @ %assetName @ ".asset.taml";
|
||||
%sgfPath = %modulePath @ "/materials/" @ %assetName @ ".sgf";
|
||||
|
||||
%asset = new MaterialAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
shaderData = "";
|
||||
shaderGraph = %sgfPath;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "Materials");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewScriptAsset()
|
||||
{
|
||||
%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%tamlpath = %modulePath @ "/scripts/" @ %assetName @ ".asset.taml";
|
||||
%scriptPath = %modulePath @ "/scripts/" @ %assetName @ ".cs";
|
||||
|
||||
%asset = new ScriptAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
scriptFilePath = %scriptPath;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "Scripts");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%scriptPath))
|
||||
{
|
||||
%file.close();
|
||||
}
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewStateMachineAsset()
|
||||
{
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%assetQuery = new AssetQuery();
|
||||
|
||||
%matchingAssetCount = AssetDatabase.findAssetName(%assetQuery, %assetName);
|
||||
|
||||
%i=1;
|
||||
while(%matchingAssetCount > 0)
|
||||
{
|
||||
%newAssetName = %assetName @ %i;
|
||||
%i++;
|
||||
|
||||
%matchingAssetCount = AssetDatabase.findAssetName(%assetQuery, %newAssetName);
|
||||
}
|
||||
|
||||
%assetName = %newAssetName;
|
||||
|
||||
%assetQuery.delete();
|
||||
|
||||
%tamlpath = "data/" @ %moduleName @ "/stateMachines/" @ %assetName @ ".asset.taml";
|
||||
%smFilePath = "data/" @ %moduleName @ "/stateMachines/" @ %assetName @ ".xml";
|
||||
|
||||
%asset = new StateMachineAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
stateMachineFile = %smFilePath;
|
||||
};
|
||||
|
||||
%xmlDoc = new SimXMLDocument();
|
||||
%xmlDoc.saveFile(%smFilePath);
|
||||
%xmlDoc.delete();
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
//Now write our XML file
|
||||
%xmlFile = new FileObject();
|
||||
%xmlFile.openForWrite(%smFilePath);
|
||||
%xmlFile.writeLine("<StateMachine>");
|
||||
%xmlFile.writeLine("</StateMachine>");
|
||||
%xmlFile.close();
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "StateMachines");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewGUIAsset()
|
||||
{
|
||||
%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%tamlpath = %modulePath @ "/GUIs/" @ %assetName @ ".asset.taml";
|
||||
%guipath = %modulePath @ "/GUIs/" @ %assetName @ ".gui";
|
||||
%scriptPath = %modulePath @ "/GUIs/" @ %assetName @ ".cs";
|
||||
|
||||
%asset = new GUIAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
scriptFilePath = %scriptPath;
|
||||
guiFilePath = %guipath;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%guipath))
|
||||
{
|
||||
%file.writeline("//--- OBJECT WRITE BEGIN ---");
|
||||
%file.writeline("%guiContent = new GuiControl(" @ %assetName @ ") {");
|
||||
%file.writeline(" position = \"0 0\";");
|
||||
%file.writeline(" extent = \"100 100\";");
|
||||
%file.writeline("};");
|
||||
%file.writeline("//--- OBJECT WRITE END ---");
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
if(%file.openForWrite(%scriptPath))
|
||||
{
|
||||
%file.writeline("function " @ %assetName @ "::onWake(%this)\n{\n\n}\n");
|
||||
%file.writeline("function " @ %assetName @ "::onSleep(%this)\n{\n\n}\n");
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
//load the gui
|
||||
exec(%guipath);
|
||||
exec(%scriptPath);
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "GUIs");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewLevelAsset()
|
||||
{
|
||||
%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%tamlpath = %modulePath @ "/levels/" @ %assetName @ ".asset.taml";
|
||||
%levelPath = %modulePath @ "/levels/" @ %assetName @ ".mis";
|
||||
|
||||
%asset = new LevelAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
LevelFile = %levelPath;
|
||||
LevelDescription = AssetBrowser.newAssetSettings.levelDescription;
|
||||
PreviewImage = AssetBrowser.newAssetSettings.levelPreviewImage;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
if(!pathCopy("tools/levels/BlankRoom.mis", %levelPath, false))
|
||||
{
|
||||
echo("Unable to copy template level file!");
|
||||
}
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "Levels");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;
|
||||
}
|
||||
|
||||
function createNewShapeAnimationAsset()
|
||||
{
|
||||
%dlg = new OpenFileDialog()
|
||||
{
|
||||
Filters = "Animation Files(*.dae, *.cached.dts)|*.dae;*.cached.dts";
|
||||
DefaultPath = $Pref::WorldEditor::LastPath;
|
||||
DefaultFile = "";
|
||||
ChangePath = false;
|
||||
OverwritePrompt = true;
|
||||
forceRelativePath = false;
|
||||
//MultipleFiles = true;
|
||||
};
|
||||
|
||||
%ret = %dlg.Execute();
|
||||
|
||||
if ( %ret )
|
||||
{
|
||||
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
|
||||
%fullPath = %dlg.FileName;
|
||||
}
|
||||
|
||||
%dlg.delete();
|
||||
|
||||
if ( !%ret )
|
||||
return;
|
||||
|
||||
/*%moduleName = AssetBrowser.newAssetSettings.moduleName;
|
||||
%modulePath = "data/" @ %moduleName;
|
||||
|
||||
%assetName = AssetBrowser.newAssetSettings.assetName;
|
||||
|
||||
%tamlpath = %modulePath @ "/levels/" @ %assetName @ ".asset.taml";
|
||||
%levelPath = %modulePath @ "/levels/" @ %assetName @ ".mis";
|
||||
|
||||
%asset = new ShapeAnimationAsset()
|
||||
{
|
||||
AssetName = %assetName;
|
||||
versionId = 1;
|
||||
LevelFile = %levelPath;
|
||||
LevelDescription = AssetBrowser.newAssetSettings.levelDescription;
|
||||
PreviewImage = AssetBrowser.newAssetSettings.levelPreviewImage;
|
||||
};
|
||||
|
||||
TamlWrite(%asset, %tamlpath);
|
||||
|
||||
if(!pathCopy("tools/levels/BlankRoom.mis", %levelPath, false))
|
||||
{
|
||||
echo("Unable to copy template level file!");
|
||||
}
|
||||
|
||||
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
|
||||
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
|
||||
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
|
||||
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "Levels");
|
||||
|
||||
AssetBrowserFilterTree.onSelect(%smItem);
|
||||
|
||||
return %tamlpath;*/
|
||||
}
|
||||
|
||||
function ParentComponentList::onWake(%this)
|
||||
{
|
||||
%this.refresh();
|
||||
}
|
||||
|
||||
function ParentComponentList::refresh(%this)
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
%assetQuery = new AssetQuery();
|
||||
if(!AssetDatabase.findAssetType(%assetQuery, "ComponentAsset"))
|
||||
return; //if we didn't find ANY, just exit
|
||||
|
||||
// Find all the types.
|
||||
%count = %assetQuery.getCount();
|
||||
|
||||
/*%categories = "";
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%i);
|
||||
|
||||
%componentAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
%componentName = %componentAsset.componentName;
|
||||
|
||||
if(%componentName $= "")
|
||||
%componentName = %componentAsset.componentClass;
|
||||
|
||||
%this.add(%componentName, %i);
|
||||
}*/
|
||||
|
||||
%categories = "";
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%i);
|
||||
|
||||
%componentAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
%componentClass = %componentAsset.componentClass;
|
||||
if (!isInList(%componentClass, %categories))
|
||||
%categories = %categories TAB %componentClass;
|
||||
}
|
||||
|
||||
%categories = trim(%categories);
|
||||
|
||||
%index = 0;
|
||||
%categoryCount = getFieldCount(%categories);
|
||||
for (%i = 0; %i < %categoryCount; %i++)
|
||||
{
|
||||
%category = getField(%categories, %i);
|
||||
%this.addCategory(%category);
|
||||
|
||||
for (%j = 0; %j < %count; %j++)
|
||||
{
|
||||
%assetId = %assetQuery.getAsset(%j);
|
||||
|
||||
%componentAsset = AssetDatabase.acquireAsset(%assetId);
|
||||
%componentName = %componentAsset.componentName;
|
||||
%componentClass = %componentAsset.componentClass;
|
||||
|
||||
if (%componentClass $= %category)
|
||||
{
|
||||
if(%componentName !$= "")
|
||||
%this.add(" "@%componentName, %i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// Game Object creation
|
||||
//----------------------------------------------------------
|
||||
function EWorldEditor::createGameObject( %this )
|
||||
{
|
||||
GameObjectCreatorObjectName.text = "";
|
||||
|
||||
%activeSelection = %this.getActiveSelection();
|
||||
if( %activeSelection.getCount() == 0 )
|
||||
return;
|
||||
|
||||
GameObjectCreator.selectedEntity = %activeSelection.getObject( 0 );
|
||||
|
||||
Canvas.pushDialog(GameObjectCreator);
|
||||
}
|
||||
154
Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
function AssetBrowser::buildPopupMenus(%this)
|
||||
{
|
||||
if( !isObject( AddNewModulePopup ) )
|
||||
{
|
||||
new PopupMenu( AddNewModulePopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
isPopup = true;
|
||||
|
||||
item[ 0 ] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
|
||||
item[ 1 ] = "Refresh Module Dependencies" TAB "" TAB "AssetBrowser.RefreshModuleDependencies();";
|
||||
};
|
||||
}
|
||||
|
||||
if( !isObject( EditAssetPopup ) )
|
||||
{
|
||||
new PopupMenu( EditAssetPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
//isPopup = true;
|
||||
|
||||
item[ 0 ] = "Edit Asset" TAB "" TAB "AssetBrowser.editAsset();";
|
||||
item[ 1 ] = "Rename Asset" TAB "" TAB "AssetBrowser.renameAsset();";
|
||||
item[ 2 ] = "Refresh Asset" TAB "" TAB "AssetBrowser.refreshAsset();";
|
||||
item[ 3 ] = "Asset Properties" TAB "" TAB "AssetBrowser.editAssetInfo();";
|
||||
item[ 4 ] = "-";
|
||||
Item[ 5 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();";
|
||||
item[ 6 ] = "-";
|
||||
item[ 7 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();";
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();";
|
||||
|
||||
jumpFileName = "";
|
||||
jumpLineNumber = "";
|
||||
};
|
||||
}
|
||||
|
||||
if( !isObject( AddNewComponentAssetPopup ) )
|
||||
{
|
||||
new PopupMenu( AddNewComponentAssetPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
//isPopup = true;
|
||||
|
||||
//item[ 0 ] = "Create Component" TAB "" TAB "Canvas.pushDialog(AssetBrowser_newComponentAsset); AssetBrowser_newComponentAsset-->NewComponentPackageList.setText(AssetBrowser.selectedModule);";
|
||||
item[ 0 ] = "Component" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ComponentAsset\", AssetBrowser.selectedModule);";
|
||||
|
||||
//list other common component types here to shortcut the creation process
|
||||
};
|
||||
}
|
||||
|
||||
if( !isObject( AddNewScriptAssetPopup ) )
|
||||
{
|
||||
%this.AddNewScriptAssetPopup = new PopupMenu( AddNewScriptAssetPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
//isPopup = true;
|
||||
|
||||
item[ 0 ] = "Create Component" TAB AddNewComponentAssetPopup;
|
||||
item[ 1 ] = "Create Script" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ScriptAsset\", AssetBrowser.selectedModule);";
|
||||
item[ 2 ] = "Create State Machine" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"StateMachineAsset\", AssetBrowser.selectedModule);";
|
||||
//item[ 3 ] = "-";
|
||||
//item[ 3 ] = "Create Game Object" TAB "" TAB "AssetBrowser.createNewGameObjectAsset(\"NewGameObject\", AssetBrowser.selectedModule);";
|
||||
};
|
||||
//%this.AddNewScriptAssetPopup.insertSubMenu(0, "Create Component", AddNewComponentAssetPopup);
|
||||
}
|
||||
|
||||
if( !isObject( AddNewArtAssetPopup ) )
|
||||
{
|
||||
%this.AddNewArtAssetPopup = new PopupMenu( AddNewArtAssetPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
//isPopup = true;
|
||||
|
||||
item[ 0 ] = "Create Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"MaterialAsset\", AssetBrowser.selectedModule);";//"createNewMaterialAsset(\"NewMaterial\", AssetBrowser.selectedModule);";
|
||||
item[ 1 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);";
|
||||
item[ 2 ] = "-";
|
||||
item[ 3 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);";
|
||||
item[ 4 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);";
|
||||
item[ 5 ] = "-";
|
||||
item[ 6 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
|
||||
item[ 7 ] = "-";
|
||||
item[ 8 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
|
||||
item[ 9 ] = "-";
|
||||
item[ 10 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);";
|
||||
item[ 11 ] = "-";
|
||||
item[ 12 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);";
|
||||
};
|
||||
}
|
||||
|
||||
if( !isObject( AddNewAssetPopup ) )
|
||||
{
|
||||
%this.AddNewAssetPopup = new PopupMenu( AddNewAssetPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[0] = "Create Code Asset" TAB AddNewScriptAssetPopup;
|
||||
item[1] = "-";
|
||||
item[2] = "Create Art Asset" TAB AddNewArtAssetPopup;
|
||||
item[3] = "-";
|
||||
item[4] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);";
|
||||
};
|
||||
}
|
||||
|
||||
if( !isObject( EditModulePopup ) )
|
||||
{
|
||||
new PopupMenu( EditModulePopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
//isPopup = true;
|
||||
|
||||
item[ 0 ] = "Create New Asset" TAB AddNewAssetPopup;
|
||||
item[ 1 ] = "Reload Module" TAB "" TAB "AssetBrowser.reloadModule();";
|
||||
Item[ 2 ] = "-";
|
||||
Item[ 3 ] = "Edit Module" TAB "" TAB "AssetBrowser.editModuleInfo();";
|
||||
Item[ 4 ] = "-";
|
||||
Item[ 5 ] = "Duplicate Module" TAB "" TAB "AssetBrowser.copyModule();";
|
||||
Item[ 6 ] = "-";
|
||||
Item[ 7 ] = "Delete Module" TAB "" TAB "AssetBrowser.deleteModule();";
|
||||
};
|
||||
}
|
||||
|
||||
//Some assets are not yet ready/implemented, so disable their creation here
|
||||
AddNewArtAssetPopup.enableItem(3, false); //shape
|
||||
AddNewArtAssetPopup.enableItem(4, false); //shape animation
|
||||
AddNewArtAssetPopup.enableItem(8, false); //post effect
|
||||
AddNewArtAssetPopup.enableItem(10, false); //sound asset
|
||||
AddNewArtAssetPopup.enableItem(12, false); //particle effect
|
||||
|
||||
AddNewScriptAssetPopup.enableItem(2, false); //state machine
|
||||
}
|
||||
|
||||
function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
function AddNewScriptAssetPopupMenu::setupDefaultState(%this)
|
||||
{
|
||||
// Setup camera speed gui's. Both menu and editorgui
|
||||
%this.setupGuiControls();
|
||||
|
||||
Parent::setupDefaultState(%this);
|
||||
}
|
||||
|
||||
function AddNewScriptAssetPopupMenu::setupGuiControls(%this)
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function AssetBrowser_selectModule::onWake(%this)
|
||||
{
|
||||
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
|
||||
}
|
||||
|
||||
function SelectModule_NewAssetModuleBtn::onClick(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
||||
AssetBrowser_addModuleWindow.selectWindow();
|
||||
|
||||
AssetBrowser_AddModule.callback = "AssetBrowser_selectModule.newModuleAdded();";
|
||||
}
|
||||
|
||||
function AssetBrowser_selectModule::newModuleAdded(%this)
|
||||
{
|
||||
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function AssetBrowser_selectPackage::onWake(%this)
|
||||
{
|
||||
AssetBrowser_SelectPackageWindow-->packageList.refresh();
|
||||
}
|
||||
|
||||
function SelectPackage_NewAssetPackageBtn::onClick(%this)
|
||||
{
|
||||
Canvas.pushDialog(AssetBrowser_AddPackage);
|
||||
AssetBrowser_addPackageWindow.selectWindow();
|
||||
|
||||
AssetBrowser_AddPackage.callback = "AssetBrowser_selectPackage.newPackageAdded();";
|
||||
}
|
||||
|
||||
function AssetBrowser_selectPackage::newPackageAdded(%this)
|
||||
{
|
||||
AssetBrowser_SelectPackageWindow-->packageList.refresh();
|
||||
}
|
||||
BIN
Templates/BaseGame/game/tools/gui/images/iconError.png
Normal file
|
After Width: | Height: | Size: 723 B |
BIN
Templates/BaseGame/game/tools/gui/images/iconWarn.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -287,6 +287,31 @@ new GuiControlProfile( ToolsGuiTextEditProfile )
|
|||
category = "Tools";
|
||||
};
|
||||
|
||||
if( !isObject( ToolsGuiTextEditCenterProfile ) )
|
||||
new GuiControlProfile (ToolsGuiTextEditCenterProfile)
|
||||
{
|
||||
opaque = true;
|
||||
//bitmap = "./images/textEditFrame";
|
||||
//hasBitmapArray = true;
|
||||
border = -2; // fix to display textEdit img
|
||||
//borderWidth = "1"; // fix to display textEdit img
|
||||
//borderColor = "100 100 100";
|
||||
fillColor = "255 255 255 0";
|
||||
fillColorHL = "72 72 72";
|
||||
fillColorSEL = "255 255 255";
|
||||
fontColor = "196 196 196 255";
|
||||
fontColorHL = "255 255 255";
|
||||
fontColorSEL = "0 0 0";
|
||||
fontColorNA = "196 196 196 255";
|
||||
textOffset = "4 2";
|
||||
autoSizeWidth = false;
|
||||
autoSizeHeight = true;
|
||||
justify = "center";
|
||||
tab = true;
|
||||
canKeyFocus = true;
|
||||
category = "Tools";
|
||||
};
|
||||
|
||||
if( !isObject( ToolsGuiNumericTextEditProfile ) )
|
||||
new GuiControlProfile( ToolsGuiNumericTextEditProfile : ToolsGuiTextEditProfile )
|
||||
{
|
||||
|
|
@ -1068,10 +1093,14 @@ singleton GuiControlProfile( GuiMenuBarProfile )
|
|||
{
|
||||
fillcolor = "255 255 255";
|
||||
fillcolorHL = "213 231 248";
|
||||
borderColor = "98 163 229";
|
||||
borderColorHL = "122 177 232";
|
||||
border = 0;
|
||||
|
||||
fontColorNA = "180 180 180";
|
||||
|
||||
border = 1;
|
||||
borderThickness = 1;
|
||||
borderColor = "128 128 128";
|
||||
borderColorHL = "122 177 232";
|
||||
|
||||
opaque = true;
|
||||
mouseOverSelected = true;
|
||||
category = "Editor";
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ function GuiEditor::switchToWorldEditor( %this )
|
|||
|
||||
function GuiEditor::enableMenuItems(%this, %val)
|
||||
{
|
||||
%menu = GuiEditCanvas.menuBar->EditMenu.getID();
|
||||
%menu = GuiEditCanvas.menuBar.findMenu("Edit").getID();
|
||||
|
||||
%menu.enableItem( 3, %val ); // cut
|
||||
%menu.enableItem( 4, %val ); // copy
|
||||
|
|
@ -239,8 +239,8 @@ function GuiEditor::enableMenuItems(%this, %val)
|
|||
%menu.enableItem( 18, %val ); // group
|
||||
%menu.enableItem( 19, %val ); // ungroup
|
||||
|
||||
GuiEditCanvas.menuBar->LayoutMenu.enableAllItems( %val );
|
||||
GuiEditCanvas.menuBar->MoveMenu.enableAllItems( %val );
|
||||
GuiEditCanvas.menuBar.findMenu("Layout").enableAllItems( %val );
|
||||
GuiEditCanvas.menuBar.findMenu("Move").enableAllItems( %val );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -294,7 +294,7 @@ function GuiEditor::updateUndoMenu(%this)
|
|||
%nextUndo = %uman.getNextUndoName();
|
||||
%nextRedo = %uman.getNextRedoName();
|
||||
|
||||
%editMenu = GuiEditCanvas.menuBar->editMenu;
|
||||
%editMenu = GuiEditCanvas.menuBar.findMenu("Edit");
|
||||
|
||||
%editMenu.setItemName( 0, "Undo " @ %nextUndo );
|
||||
%editMenu.setItemName( 1, "Redo " @ %nextRedo );
|
||||
|
|
@ -443,7 +443,7 @@ function GuiEditor::setPreviewResolution( %this, %width, %height )
|
|||
function GuiEditor::toggleEdgeSnap( %this )
|
||||
{
|
||||
%this.snapToEdges = !%this.snapToEdges;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, %this.snapToEdges );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, %this.snapToEdges );
|
||||
GuiEditorEdgeSnapping_btn.setStateOn( %this.snapToEdges );
|
||||
}
|
||||
|
||||
|
|
@ -452,7 +452,7 @@ function GuiEditor::toggleEdgeSnap( %this )
|
|||
function GuiEditor::toggleCenterSnap( %this )
|
||||
{
|
||||
%this.snapToCenters = !%this.snapToCenters;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, %this.snapToCenters );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, %this.snapToCenters );
|
||||
GuiEditorCenterSnapping_btn.setStateOn( %this.snapToCenters );
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ function GuiEditor::toggleCenterSnap( %this )
|
|||
function GuiEditor::toggleFullBoxSelection( %this )
|
||||
{
|
||||
%this.fullBoxSelection = !%this.fullBoxSelection;
|
||||
GuiEditCanvas.menuBar->EditMenu.checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, %this.fullBoxSelection );
|
||||
GuiEditCanvas.menuBar.findMenu("Edit").checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, %this.fullBoxSelection );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -469,7 +469,7 @@ function GuiEditor::toggleFullBoxSelection( %this )
|
|||
function GuiEditor::toggleDrawGuides( %this )
|
||||
{
|
||||
%this.drawGuides= !%this.drawGuides;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, %this.drawGuides );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, %this.drawGuides );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -477,7 +477,7 @@ function GuiEditor::toggleDrawGuides( %this )
|
|||
function GuiEditor::toggleGuideSnap( %this )
|
||||
{
|
||||
%this.snapToGuides = !%this.snapToGuides;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, %this.snapToGuides );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, %this.snapToGuides );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -485,7 +485,7 @@ function GuiEditor::toggleGuideSnap( %this )
|
|||
function GuiEditor::toggleControlSnap( %this )
|
||||
{
|
||||
%this.snapToControls = !%this.snapToControls;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, %this.snapToControls );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, %this.snapToControls );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -493,7 +493,7 @@ function GuiEditor::toggleControlSnap( %this )
|
|||
function GuiEditor::toggleCanvasSnap( %this )
|
||||
{
|
||||
%this.snapToCanvas = !%this.snapToCanvas;
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, %this.snapToCanvas );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, %this.snapToCanvas );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
@ -506,7 +506,7 @@ function GuiEditor::toggleGridSnap( %this )
|
|||
else
|
||||
%this.setSnapToGrid( %this.snap2GridSize );
|
||||
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, %this.snap2Grid );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, %this.snap2Grid );
|
||||
GuiEditorSnapCheckBox.setStateOn( %this.snap2Grid );
|
||||
}
|
||||
|
||||
|
|
@ -993,14 +993,14 @@ function GuiEditorGui::onWake( %this )
|
|||
|
||||
// Set up initial menu toggle states.
|
||||
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, GuiEditor.snapToEdges );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, GuiEditor.snapToCenters );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, GuiEditor.snapToGuides );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, GuiEditor.snapToControls );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, GuiEditor.snapToCanvas );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, GuiEditor.snap2Grid );
|
||||
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, GuiEditor.drawGuides );
|
||||
GuiEditCanvas.menuBar->EditMenu.checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, GuiEditor.fullBoxSelection );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, GuiEditor.snapToEdges );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, GuiEditor.snapToCenters );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, GuiEditor.snapToGuides );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, GuiEditor.snapToControls );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, GuiEditor.snapToCanvas );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, GuiEditor.snap2Grid );
|
||||
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, GuiEditor.drawGuides );
|
||||
GuiEditCanvas.menuBar.findMenu("Edit").checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, GuiEditor.fullBoxSelection );
|
||||
|
||||
// Sync toolbar buttons.
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ new SimGroup(MissionGroup) {
|
|||
soundDistanceModel = "Linear";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
desc0 = "A blank room ready to be populated with Torque objects. Guns, anyone?";
|
||||
desc0 = "A blank room template that acts as a starting point.";
|
||||
enabled = "1";
|
||||
levelName = "Blank Room";
|
||||
levelName = "Blank Room Template";
|
||||
};
|
||||
new SkyBox(theSky) {
|
||||
Material = "BlankSkyMat";
|
||||
|
|
|
|||
|
|
@ -122,6 +122,17 @@ package Tools
|
|||
if( isFunction( %initializeFunction ) )
|
||||
call( %initializeFunction );
|
||||
}
|
||||
|
||||
//Now, go through and load any tool-group modules
|
||||
ModuleDatabase.setModuleExtension("module");
|
||||
|
||||
//Any common tool modules
|
||||
ModuleDatabase.scanModules( "tools", false );
|
||||
ModuleDatabase.LoadGroup( "Tool" );
|
||||
|
||||
//Do any tools that come in with a gameplay package. These are usually specialized tools
|
||||
//ModuleDatabase.scanModules( "data", false );
|
||||
//ModuleDatabase.LoadGroup( "Tool" );
|
||||
|
||||
// Popuplate the default SimObject icons that
|
||||
// are used by the various editors.
|
||||
|
|
@ -214,6 +225,29 @@ package Tools
|
|||
}
|
||||
};
|
||||
|
||||
function EditorCreateFakeGameSession(%fileName)
|
||||
{
|
||||
// Create a local game server and connect to it.
|
||||
if(isObject(ServerGroup))
|
||||
ServerGroup.delete();
|
||||
|
||||
new SimGroup(ServerGroup);
|
||||
|
||||
if(isObject(ServerConnection))
|
||||
ServerConnection.delete();
|
||||
|
||||
new GameConnection(ServerConnection);
|
||||
|
||||
// This calls GameConnection::onConnect.
|
||||
ServerConnection.connectLocal();
|
||||
|
||||
$instantGroup = ServerGroup;
|
||||
|
||||
$Game::MissionGroup = "MissionGroup";
|
||||
|
||||
exec(%file);
|
||||
}
|
||||
|
||||
function fastLoadWorldEdit(%val)
|
||||
{
|
||||
if(%val)
|
||||
|
|
@ -222,37 +256,64 @@ function fastLoadWorldEdit(%val)
|
|||
{
|
||||
onStart();
|
||||
}
|
||||
|
||||
if(!$Game::running)
|
||||
|
||||
%timerId = startPrecisionTimer();
|
||||
|
||||
if( GuiEditorIsActive() )
|
||||
toggleGuiEditor(1);
|
||||
|
||||
if( !$missionRunning )
|
||||
{
|
||||
//startGame();
|
||||
activatePackage( "BootEditor" );
|
||||
ChooseLevelDlg.launchInEditor = false;
|
||||
StartGame("tools/levels/BlankRoom.mis", "SinglePlayer");
|
||||
|
||||
if(!isObject(Observer))
|
||||
{
|
||||
datablock CameraData(Observer) {};
|
||||
}
|
||||
|
||||
%cam = new Camera()
|
||||
{
|
||||
datablock = Observer;
|
||||
};
|
||||
|
||||
%cam.scopeToClient(LocalClientConnection);
|
||||
|
||||
LocalClientConnection.setCameraObject(%cam);
|
||||
LocalClientConnection.setControlObject(%cam);
|
||||
|
||||
LocalClientConnection.camera = %cam;
|
||||
|
||||
%cam.setPosition("0 0 0");
|
||||
// Flag saying, when level is chosen, launch it with the editor open.
|
||||
ChooseLevelDlg.launchInEditor = true;
|
||||
Canvas.pushDialog( ChooseLevelDlg );
|
||||
}
|
||||
else
|
||||
{
|
||||
toggleEditor(true);
|
||||
{
|
||||
pushInstantGroup();
|
||||
|
||||
if ( !isObject( Editor ) )
|
||||
{
|
||||
Editor::create();
|
||||
MissionCleanup.add( Editor );
|
||||
MissionCleanup.add( Editor.getUndoManager() );
|
||||
}
|
||||
|
||||
if( EditorIsActive() )
|
||||
{
|
||||
if (theLevelInfo.type $= "DemoScene")
|
||||
{
|
||||
commandToServer('dropPlayerAtCamera');
|
||||
Editor.close("SceneGui");
|
||||
}
|
||||
else
|
||||
{
|
||||
Editor.close("PlayGui");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
canvas.pushDialog( EditorLoadingGui );
|
||||
canvas.repaint();
|
||||
|
||||
Editor.open();
|
||||
|
||||
// Cancel the scheduled event to prevent
|
||||
// the level from cycling after it's duration
|
||||
// has elapsed.
|
||||
cancel($Game::Schedule);
|
||||
|
||||
if (theLevelInfo.type $= "DemoScene")
|
||||
commandToServer('dropCameraAtPlayer', true);
|
||||
|
||||
canvas.popDialog(EditorLoadingGui);
|
||||
}
|
||||
|
||||
popInstantGroup();
|
||||
}
|
||||
|
||||
%elapsed = stopPrecisionTimer( %timerId );
|
||||
warn( "Time spent in toggleEditor() : " @ %elapsed / 1000.0 @ " s" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,6 +145,13 @@ function ShapeEditorPlugin::onWorldEditorStartup(%this)
|
|||
}
|
||||
}
|
||||
|
||||
function ShapeEditorPlugin::openShapeAsset(%this, %assetId)
|
||||
{
|
||||
%this.selectedAssetId = %assetId;
|
||||
%this.selectedAssetDef = AssetDatabase.acquireAsset(%assetId);
|
||||
%this.open(%this.selectedAssetDef.fileName);
|
||||
}
|
||||
|
||||
function ShapeEditorPlugin::open(%this, %filename)
|
||||
{
|
||||
if ( !%this.isActivated )
|
||||
|
|
|
|||
|
|
@ -611,6 +611,19 @@ function ShapeEdPropWindow::update_onShapeSelectionChanged( %this )
|
|||
ShapeEdSequenceList.addItem( %name );
|
||||
}
|
||||
ShapeEdThreadWindow.onAddThread(); // add thread 0
|
||||
|
||||
//Now, fetch any animation assets if we're utilizing a shape asset
|
||||
if(ShapeEditorPlugin.selectedAssetId !$= "")
|
||||
{
|
||||
%animationAssetCount = ShapeEditorPlugin.selectedAssetDef.getAnimationCount();
|
||||
|
||||
for(%animIdx = 0; %animIdx < %animationAssetCount; %animIdx++)
|
||||
{
|
||||
%animAsset = ShapeEditorPlugin.selectedAssetDef.getAnimation(%animIdx);
|
||||
|
||||
//ShapeEdSequenceList.addItem( %animAsset.assetName );
|
||||
}
|
||||
}
|
||||
|
||||
// --- DETAILS TAB ---
|
||||
// Add detail levels and meshes to tree
|
||||
|
|
@ -789,7 +802,8 @@ function ShapeEdSeqNodeTabBook::onTabSelected( %this, %name, %index )
|
|||
{
|
||||
case "Seq":
|
||||
ShapeEdPropWindow-->newBtn.ToolTip = "Add new sequence";
|
||||
ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();";
|
||||
//ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();";
|
||||
ShapeEdPropWindow-->newBtn.Command = "AssetBrowser.showDialog(\"ShapeAnimationAsset\", \"onAddAnimationAssetShapeEditor\", \"\", \"\", \"\");";
|
||||
ShapeEdPropWindow-->newBtn.setActive( true );
|
||||
ShapeEdPropWindow-->deleteBtn.ToolTip = "Delete selected sequence (cannot be undone)";
|
||||
ShapeEdPropWindow-->deleteBtn.Command = "ShapeEdSequences.onDeleteSequence();";
|
||||
|
|
|
|||
|
|
@ -299,6 +299,12 @@ function ActionEditNodeTransform::undo( %this )
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// Add sequence
|
||||
function onAddAnimationAssetShapeEditor(%selectedAnimation)
|
||||
{
|
||||
echo("SELECTED MUH ASSET");
|
||||
ShapeEditor.doAddSequence(%selectedAnimation, 0, 0, 0);
|
||||
}
|
||||
|
||||
function ShapeEditor::doAddSequence( %this, %seqName, %from, %start, %end )
|
||||
{
|
||||
%action = %this.createAction( ActionAddSequence, "Add sequence" );
|
||||
|
|
@ -313,23 +319,44 @@ function ShapeEditor::doAddSequence( %this, %seqName, %from, %start, %end )
|
|||
|
||||
function ActionAddSequence::doit( %this )
|
||||
{
|
||||
// If adding this sequence from an existing sequence, make a backup copy of
|
||||
// the existing sequence first, so we can edit the start/end frames later
|
||||
// without having to worry if the original source sequence has changed.
|
||||
if ( ShapeEditor.shape.getSequenceIndex( %this.from ) >= 0 )
|
||||
if(ShapeEditorPlugin.selectedAssetId $= "")
|
||||
{
|
||||
%this.from = ShapeEditor.getUniqueName( "sequence", "__backup__" @ %this.origFrom @ "_" );
|
||||
ShapeEditor.shape.addSequence( %this.origFrom, %this.from );
|
||||
// If adding this sequence from an existing sequence, make a backup copy of
|
||||
// the existing sequence first, so we can edit the start/end frames later
|
||||
// without having to worry if the original source sequence has changed.
|
||||
if ( ShapeEditor.shape.getSequenceIndex( %this.from ) >= 0 )
|
||||
{
|
||||
%this.from = ShapeEditor.getUniqueName( "sequence", "__backup__" @ %this.origFrom @ "_" );
|
||||
ShapeEditor.shape.addSequence( %this.origFrom, %this.from );
|
||||
}
|
||||
|
||||
// Add the sequence
|
||||
$collada::forceLoadDAE = EditorSettings.value( "forceLoadDAE" );
|
||||
%success = ShapeEditor.shape.addSequence( %this.from, %this.seqName, %this.start, %this.end );
|
||||
$collada::forceLoadDAE = false;
|
||||
|
||||
if ( %success )
|
||||
{
|
||||
ShapeEdPropWindow.update_onSequenceAdded( %this.seqName, -1 );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the sequence
|
||||
$collada::forceLoadDAE = EditorSettings.value( "forceLoadDAE" );
|
||||
%success = ShapeEditor.shape.addSequence( %this.from, %this.seqName, %this.start, %this.end );
|
||||
$collada::forceLoadDAE = false;
|
||||
|
||||
if ( %success )
|
||||
else
|
||||
{
|
||||
ShapeEdPropWindow.update_onSequenceAdded( %this.seqName, -1 );
|
||||
%assetDef = AssetDatabase.acquireAsset(%this.seqName);
|
||||
%moduleName = getWord(getToken(%this.seqName, ":", 0),0);
|
||||
|
||||
%idx = ShapeEdSequenceList.rowCount();
|
||||
|
||||
%matSet = "ShapeEditorPlugin.selectedAssetDef.animationSequence"@%idx@"=\"@Asset="@%moduleName@":"@%this.seqName.assetName@"\";";
|
||||
eval(%matSet);
|
||||
|
||||
%assetPath = AssetDatabase.getAssetFilePath(ShapeEditorPlugin.selectedAssetId);
|
||||
|
||||
%assetImportSuccessful = TAMLWrite(ShapeEditorPlugin.selectedAssetDef, %assetPath);
|
||||
|
||||
AssetDatabase.refreshAsset(ShapeEditorPlugin.selectedAssetId);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1570,6 +1570,27 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
%haveObjectEntries = false;
|
||||
%haveLockAndHideEntries = true;
|
||||
|
||||
//Set up the generic pop-up pre-emptively if we haven't already
|
||||
if( !isObject( ETContextPopup ) )
|
||||
{
|
||||
%popup = new PopupMenu( ETContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId( %this.object ) );";
|
||||
item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject( %this.object );";
|
||||
item[ 2 ] = "Inspect" TAB "" TAB "inspectObject( %this.object );";
|
||||
item[ 3 ] = "-";
|
||||
item[ 4 ] = "Locked" TAB "" TAB "%this.object.setLocked( !%this.object.locked ); EWorldEditor.syncGui();";
|
||||
item[ 5 ] = "Hidden" TAB "" TAB "EWorldEditor.hideObject( %this.object, !%this.object.hidden ); EWorldEditor.syncGui();";
|
||||
item[ 6 ] = "-";
|
||||
item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
|
||||
|
||||
object = -1;
|
||||
};
|
||||
}
|
||||
|
||||
// Handle multi-selection.
|
||||
if( %this.getSelectedItemsCount() > 1 )
|
||||
{
|
||||
|
|
@ -1616,12 +1637,67 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
item[ 0 ] = "Add Camera Bookmark" TAB "" TAB "EditorGui.addCameraBookmarkByGui();";
|
||||
};
|
||||
}
|
||||
|
||||
else if(%obj.isMemberOfClass("Entity"))
|
||||
{
|
||||
%popup = EntityObjectPopup;
|
||||
if(!isObject(EntityObjectPopup))
|
||||
{
|
||||
%popup = new PopupMenu( EntityObjectPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId( %this.object ) );";
|
||||
item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject( %this.object );";
|
||||
item[ 2 ] = "Inspect" TAB "" TAB "inspectObject( %this.object );";
|
||||
item[ 3 ] = "-";
|
||||
item[ 4 ] = "Toggle Lock Children" TAB "" TAB "EWorldEditor.toggleLockChildren( %this.object );";
|
||||
item[ 5 ] = "Toggle Hide Children" TAB "" TAB "EWorldEditor.toggleHideChildren( %this.object );";
|
||||
item[ 6 ] = "-";
|
||||
item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Add New Objects Here" TAB "" TAB "EWCreatorWindow.setNewObjectGroup( %this.object );";
|
||||
item[ 10 ] = "Add Children to Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( %this.object, false );";
|
||||
item[ 11 ] = "Remove Children from Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( %this.object, true );";
|
||||
item[ 12 ] = "-";
|
||||
item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
|
||||
item[ 14 ] = "Duplicate Game Object" TAB "" TAB "EWorldEditor.duplicateGameObject( %this.object );";
|
||||
item[ 15 ] = "Show in Asset Browser" TAB "" TAB "EWorldEditor.showGameObjectInAssetBrowser( %this.object );";
|
||||
|
||||
object = -1;
|
||||
};
|
||||
}
|
||||
|
||||
if(!isObject(AssetDatabase.acquireAsset(%obj.gameObjectAsset)))
|
||||
{
|
||||
EntityObjectPopup.enableItem(13, true);
|
||||
EntityObjectPopup.enableItem(14, false);
|
||||
EntityObjectPopup.enableItem(15, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
EntityObjectPopup.enableItem(13, false);
|
||||
EntityObjectPopup.enableItem(14, true);
|
||||
EntityObjectPopup.enableItem(15, true);
|
||||
}
|
||||
|
||||
%popup.object = %obj;
|
||||
|
||||
%hasChildren = %obj.getCount() > 0;
|
||||
%popup.enableItem( 10, %hasChildren );
|
||||
%popup.enableItem( 11, %hasChildren );
|
||||
|
||||
%haveObjectEntries = true;
|
||||
%haveLockAndHideEntries = false;
|
||||
}
|
||||
|
||||
// Open context menu if this is a SimGroup
|
||||
else if( !%obj.isMemberOfClass( "SceneObject" ) )
|
||||
{
|
||||
%popup = ETSimGroupContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
{
|
||||
%popup = new PopupMenu( ETSimGroupContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
|
|
@ -1642,30 +1718,6 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
|
||||
object = -1;
|
||||
};
|
||||
|
||||
if(%obj.isMemberOfClass("Entity"))
|
||||
{
|
||||
if( !isObject( GameObjectPopup ) )
|
||||
%popup = new PopupMenu( GameObjectPopup : ETSimGroupContextPopup )
|
||||
{
|
||||
//item[ 12 ] = "-";
|
||||
item[ 12 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
|
||||
item[ 13 ] = "Duplicate Game Object" TAB "" TAB "EWorldEditor.duplicateGameObject( %this.object );";
|
||||
item[ 14 ] = "Show in Asset Browser" TAB "" TAB "EWorldEditor.showGameObjectInAssetBrowser( %this.object );";
|
||||
};
|
||||
|
||||
if(!isObject(AssetDatabase.acquireAsset(%obj.gameObjectAsset)))
|
||||
{
|
||||
GameObjectPopup.enableItem(12, true);
|
||||
GameObjectPopup.enableItem(13, false);
|
||||
GameObjectPopup.enableItem(14, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObjectPopup.enableItem(12, false);
|
||||
GameObjectPopup.enableItem(13, true);
|
||||
GameObjectPopup.enableItem(14, true);
|
||||
}
|
||||
}
|
||||
|
||||
%popup.object = %obj;
|
||||
|
|
@ -1678,77 +1730,56 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
%haveLockAndHideEntries = false;
|
||||
}
|
||||
|
||||
// Open generic context menu.
|
||||
else
|
||||
// Specialized version for ConvexShapes.
|
||||
else if( %obj.isMemberOfClass( "ConvexShape" ) )
|
||||
{
|
||||
%popup = ETContextPopup;
|
||||
%popup = ETConvexShapeContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETContextPopup )
|
||||
{
|
||||
%popup = new PopupMenu( ETConvexShapeContextPopup : ETContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId( %this.object ) );";
|
||||
item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject( %this.object );";
|
||||
item[ 2 ] = "Inspect" TAB "" TAB "inspectObject( %this.object );";
|
||||
item[ 3 ] = "-";
|
||||
item[ 4 ] = "Locked" TAB "" TAB "%this.object.setLocked( !%this.object.locked ); EWorldEditor.syncGui();";
|
||||
item[ 5 ] = "Hidden" TAB "" TAB "EWorldEditor.hideObject( %this.object, !%this.object.hidden ); EWorldEditor.syncGui();";
|
||||
item[ 6 ] = "-";
|
||||
item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
|
||||
|
||||
object = -1;
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Convert to Zone" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Zone\" );";
|
||||
item[ 10 ] = "Convert to Portal" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Portal\" );";
|
||||
item[ 11 ] = "Convert to Occluder" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"OcclusionVolume\" );";
|
||||
item[ 12 ] = "Convert to Sound Space" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"SFXSpace\" );";
|
||||
};
|
||||
|
||||
if(%obj.isMemberOfClass("Entity"))
|
||||
{
|
||||
%popup = ETEntityContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETEntityContextPopup : ETSimGroupContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 12 ] = "-";
|
||||
item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
|
||||
};
|
||||
}
|
||||
|
||||
// Specialized version for ConvexShapes.
|
||||
else if( %obj.isMemberOfClass( "ConvexShape" ) )
|
||||
{
|
||||
%popup = ETConvexShapeContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETConvexShapeContextPopup : ETContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Convert to Zone" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Zone\" );";
|
||||
item[ 10 ] = "Convert to Portal" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Portal\" );";
|
||||
item[ 11 ] = "Convert to Occluder" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"OcclusionVolume\" );";
|
||||
item[ 12 ] = "Convert to Sound Space" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"SFXSpace\" );";
|
||||
};
|
||||
}
|
||||
|
||||
// Specialized version for polyhedral objects.
|
||||
else if( %obj.isMemberOfClass( "Zone" ) ||
|
||||
%obj.isMemberOfClass( "Portal" ) ||
|
||||
%obj.isMemberOfClass( "OcclusionVolume" ) ||
|
||||
%obj.isMemberOfClass( "SFXSpace" ) )
|
||||
%popup.object = %obj;
|
||||
%haveObjectEntries = true;
|
||||
}
|
||||
|
||||
// Specialized version for polyhedral objects.
|
||||
else if( %obj.isMemberOfClass( "Zone" ) ||
|
||||
%obj.isMemberOfClass( "Portal" ) ||
|
||||
%obj.isMemberOfClass( "OcclusionVolume" ) ||
|
||||
%obj.isMemberOfClass( "SFXSpace" ) )
|
||||
{
|
||||
%popup = ETPolyObjectContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
{
|
||||
%popup = ETPolyObjectContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETPolyObjectContextPopup : ETContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
%popup = new PopupMenu( ETPolyObjectContextPopup : ETContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Convert to ConvexShape" TAB "" TAB "EWorldEditor.convertSelectionToConvexShape();";
|
||||
};
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Convert to ConvexShape" TAB "" TAB "EWorldEditor.convertSelectionToConvexShape();";
|
||||
};
|
||||
}
|
||||
|
||||
%popup.object = %obj;
|
||||
%haveObjectEntries = true;
|
||||
}
|
||||
|
||||
// Open generic context menu.
|
||||
else
|
||||
{
|
||||
%popup = ETContextPopup;
|
||||
|
||||
%popup.object = %obj;
|
||||
%haveObjectEntries = true;
|
||||
|
|
@ -2279,155 +2310,6 @@ function EWorldEditor::deleteMissionObject( %this, %object )
|
|||
EditorTree.buildVisibleTree( true );
|
||||
}
|
||||
|
||||
function EWorldEditor::createGameObject( %this, %entity )
|
||||
{
|
||||
if(!isObject(GameObjectBuilder))
|
||||
{
|
||||
new GuiControl(GameObjectBuilder, EditorGuiGroup) {
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "800 600";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiWindowCtrl(GameObjectBuilderTargetWindow) {
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "384 205";
|
||||
extent = "256 102";
|
||||
minExtent = "256 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "0";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
minSize = "50 50";
|
||||
text = "Create Object";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
profile = "GuiCenterTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "9 26";
|
||||
extent = "84 16";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
text = "Object Name:";
|
||||
};
|
||||
new GuiTextEditCtrl(GameObjectBuilderObjectName) {
|
||||
class = ObjectBuilderGuiTextEditCtrl;
|
||||
profile = "ToolsGuiTextEditProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
position = "78 26";
|
||||
extent = "172 18";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
historySize = "0";
|
||||
};
|
||||
new GuiButtonCtrl(GameObjectBuilderOKButton) {
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
position = "7 250";
|
||||
extent = "156 24";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
command = "EWorldEditor.buildGameObject();";
|
||||
helpTag = "0";
|
||||
text = "Create New";
|
||||
Accelerator = "return";
|
||||
};
|
||||
new GuiButtonCtrl(GameObjectBuilderCancelButton) {
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "170 250";
|
||||
extent = "80 24";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
command = "Canvas.popDialog(GameObjectBuilder);";
|
||||
helpTag = "0";
|
||||
text = "Cancel";
|
||||
Accelerator = "escape";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
GameObjectBuilderTargetWindow.extent = getWord(GameObjectBuilderTargetWindow.extent, 0) SPC 88;
|
||||
GameObjectBuilderOKButton.position = getWord(GameObjectBuilderOKButton.position, 0) SPC 57;
|
||||
GameObjectBuilderCancelButton.position = getWord(GameObjectBuilderCancelButton.position, 0) SPC 57;
|
||||
}
|
||||
|
||||
GameObjectBuilderObjectName.text = "";
|
||||
GameObjectBuilder.selectedEntity = %entity;
|
||||
|
||||
Canvas.pushDialog(GameObjectBuilder);
|
||||
}
|
||||
|
||||
function EWorldEditor::buildGameObject(%this)
|
||||
{
|
||||
if(GameObjectBuilderObjectName.getText() $= "")
|
||||
{
|
||||
error("Attempted to make a new Game Object with no name!");
|
||||
Canvas.popDialog(GameObjectBuilder);
|
||||
return;
|
||||
}
|
||||
|
||||
%path = EditorSettings.value( "WorldEditor/newGameObjectDir" );
|
||||
%className = GameObjectBuilderObjectName.getText();
|
||||
GameObjectBuilder.selectedEntity.class = %className;
|
||||
Inspector.inspect(GameObjectBuilder.selectedEntity);
|
||||
|
||||
%file = new FileObject();
|
||||
|
||||
if(%file.openForWrite(%path @ "\\" @ %className @ ".cs"))
|
||||
{
|
||||
%file.writeline("function " @ %className @ "::onAdd(%this)\n{\n\n}\n");
|
||||
%file.writeline("function " @ %className @ "::onRemove(%this)\n{\n\n}\n");
|
||||
|
||||
//todo, pre-write any event functions of interest
|
||||
|
||||
%file.close();
|
||||
}
|
||||
|
||||
//set up the paths
|
||||
%tamlPath = %path @ "/" @ %className @ ".taml";
|
||||
%scriptPath = %path @ "/" @ %className @ ".cs";
|
||||
saveGameObject(%className, %tamlPath, %scriptPath);
|
||||
|
||||
//reload it
|
||||
execGameObjects();
|
||||
|
||||
//now, add the script file and a ref to the taml into our SGO manifest so we can readily spawn it later.
|
||||
TamlWrite(GameObjectBuilder.selectedEntity, %tamlpath);
|
||||
|
||||
GameObjectBuilder.selectedEntity = "";
|
||||
|
||||
Canvas.popDialog(GameObjectBuilder);
|
||||
}
|
||||
|
||||
function EWorldEditor::selectAllObjectsInSet( %this, %set, %deselect )
|
||||
{
|
||||
if( !isObject( %set ) )
|
||||
|
|
|
|||
|
|
@ -587,6 +587,13 @@ function makeSelectedAMesh()
|
|||
EditorTree.buildVisibleTree( true );
|
||||
}
|
||||
|
||||
function EditorTakeControlOfEntity()
|
||||
{
|
||||
%object = EWorldEditor.getSelectedObject(0);
|
||||
switchCamera(localClientConnection, %object);
|
||||
switchControlObject(localClientConnection, %object);
|
||||
}
|
||||
|
||||
function EditorMount()
|
||||
{
|
||||
echo( "EditorMount" );
|
||||
|
|
|
|||
|
|
@ -379,8 +379,10 @@ function EditorGui::buildMenus(%this)
|
|||
Item[17] = "Make Selection Prefab" TAB "" TAB "EditorMakePrefab();";
|
||||
Item[18] = "Explode Selected Prefab" TAB "" TAB "EditorExplodePrefab();";
|
||||
Item[19] = "-";
|
||||
Item[20] = "Mount Selection A to B" TAB "" TAB "EditorMount();";
|
||||
Item[21] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();";
|
||||
Item[20] = "Take control of entity" TAB "" TAB "EditorTakeControlOfEntity();";
|
||||
Item[21] = "-";
|
||||
Item[22] = "Mount Selection A to B" TAB "" TAB "EditorMount();";
|
||||
Item[23] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||