mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Added import config handling for prepending Directory to asset name Added handling for import config of appending a sound suffix Integrated handling of directory prepend and asset type suffix to rename issue resolution of asset importing Corrected miswording of warn message for duplicate object names Correct GUI issues with verve tools Convert verve tools to utilize assets for their GUI elements Fix window binding/naming issue depending on window mode for verve Fix popup menus formatting for verve WIP fix for material swap in Material editor. Corrects crash, but swap action is unreliable depending on object type Fix display issue with mission area editor toolbar button image Fix tooltip display of SFXEmitters in editor tree to correctly show the bound asset Changed network graph accelerator keybind from just N to Ctrl N to avoid keybind issues when typing Fixed Create New Emitter button in particle emitter that was showing as no texture
234 lines
5.8 KiB
Plaintext
234 lines
5.8 KiB
Plaintext
//-----------------------------------------------------------------------------
|
|
// Verve
|
|
// Copyright (C) - Violent Tulip
|
|
//-----------------------------------------------------------------------------
|
|
|
|
function InitializeVerveEditor()
|
|
{
|
|
$Verve::UseSeparateWindow = ($pref::Video::deviceMode == 0); //can't do separate window atm if you're in fullscreen or borderless full
|
|
|
|
// Preferences.
|
|
exec( "./DefaultPrefs." @ $TorqueScriptFileExtension );
|
|
|
|
// GUI.
|
|
exec( "./GUI/GuiProfiles." @ $TorqueScriptFileExtension );
|
|
exec( "./GUI/VerveEditorGroupBuilder.gui" );
|
|
exec( "./GUI/VerveEditorImportPathNodes.gui" );
|
|
|
|
// Scripts.
|
|
exec( "./Scripts/Plugin." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/Utility." @ $TorqueScriptFileExtension );
|
|
|
|
exec( "./Scripts/EditorControls." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/EditorHistory." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/EditorMenu." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/EditorPreferences." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/EditorWindow." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/Persistence." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/ScrollNotify." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/VObject." @ $TorqueScriptFileExtension );
|
|
|
|
exec( "./Scripts/Inspector/main." @ $TorqueScriptFileExtension );
|
|
|
|
exec( "./Scripts/Controller/main." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/Groups/main." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/Tracks/main." @ $TorqueScriptFileExtension );
|
|
exec( "./Scripts/Events/main." @ $TorqueScriptFileExtension );
|
|
|
|
exec( "./Torque/main." @ $TorqueScriptFileExtension );
|
|
|
|
// Register Events.
|
|
VerveEditor::RegisterEvent( "VGroupObjectUpdate" );
|
|
}
|
|
|
|
function DestroyVerveEditor()
|
|
{
|
|
// Ensure the Editor has Shutdown.
|
|
if ( isObject( VerveEditorWindow ) )
|
|
{
|
|
// Prompt for Save.
|
|
VerveEditor::SavePrompt();
|
|
|
|
// Reset.
|
|
VerveEditor::Reset();
|
|
|
|
// Delete the Window.
|
|
VerveEditorWindow.delete();
|
|
}
|
|
}
|
|
|
|
function ToggleVerveEditor( %value )
|
|
{
|
|
if ( %value)
|
|
{
|
|
if ( !isObject( VerveEditorWindow ) )
|
|
{
|
|
VerveEditor::LaunchEditor();
|
|
}
|
|
else
|
|
{
|
|
VerveEditorWindow.onWindowClose();
|
|
}
|
|
}
|
|
}
|
|
|
|
function VerveEditor::LaunchEditor()
|
|
{
|
|
// Launch Window.
|
|
%mainScreen = VerveEditorWindow::Open();
|
|
|
|
if ( !isObject( VerveEditorGui ) )
|
|
{
|
|
// Load the GUI.
|
|
exec ( "./GUI/VerveEditor.gui" );
|
|
}
|
|
|
|
// Apply GUI.
|
|
if($Verve::UseSeparateWindow)
|
|
%mainScreen.setContent( VerveEditorGUI );
|
|
else
|
|
{
|
|
%mainScreen.add(VerveEditorGUI);
|
|
VerveEditorGUI.position.y = VerveEditorGUI.Position.y + 20;
|
|
EditorGUI.add(%mainScreen);
|
|
}
|
|
|
|
// Clear History.
|
|
VerveEditor::ClearHistory();
|
|
|
|
// Update Window Title.
|
|
VerveEditorWindow.UpdateWindowTitle();
|
|
|
|
// Update Selection.
|
|
VerveEditor::OnSelectionUpdate();
|
|
|
|
// Update Sizes.
|
|
VerveEditor::UpdateSizes();
|
|
}
|
|
|
|
function VerveEditor::ResetController()
|
|
{
|
|
// Delete.
|
|
VerveEditor::DeleteController();
|
|
// Create.
|
|
return VerveEditor::CreateController();
|
|
}
|
|
|
|
function VerveEditor::DeleteController()
|
|
{
|
|
// Current Controller?
|
|
if ( isObject( $VerveEditor::Controller ) )
|
|
{
|
|
// Stop but do not Reset.
|
|
$VerveEditor::Controller.stop( false );
|
|
// Delete the Controller.
|
|
$VerveEditor::Controller.delete();
|
|
// Deleted?
|
|
return !isObject( $VerveEditor::Controller );
|
|
}
|
|
|
|
// No Deletion.
|
|
return false;
|
|
}
|
|
|
|
function VerveEditor::CreateController()
|
|
{
|
|
// Current Controller?
|
|
if ( !isObject( VerveEditorController ) )
|
|
{
|
|
// Create Controller.
|
|
$VerveEditor::Controller = new VController( VerveEditorController );
|
|
}
|
|
|
|
// Return ID.
|
|
return $VerveEditor::Controller;
|
|
}
|
|
|
|
function VerveEditor::Refresh()
|
|
{
|
|
if ( !isObject( $VerveEditor::Controller ) )
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Clear Selection.
|
|
VerveEditor::ClearSelection();
|
|
|
|
// Delete Existing Controls.
|
|
VerveEditor::DeleteControls();
|
|
|
|
// Sort Groups & Tracks.
|
|
$VerveEditor::Controller.sortGroups();
|
|
$VerveEditor::Controller.sortTracks();
|
|
|
|
%groupSet = $VerveEditor::Controller;
|
|
%groupCount = %groupSet.getCount();
|
|
for ( %i = 0; %i < %groupCount; %i++ )
|
|
{
|
|
// Update Controls.
|
|
%groupSet.getObject( %i ).Refresh();
|
|
}
|
|
|
|
// Update Window Title.
|
|
VerveEditorWindow.UpdateWindowTitle();
|
|
|
|
// Update Duration.
|
|
VerveEditor::UpdateDuration();
|
|
|
|
// Update Sizes.
|
|
VerveEditor::UpdateSizes();
|
|
|
|
// Update Selection.
|
|
VerveEditor::OnSelectionUpdate();
|
|
}
|
|
|
|
function VerveEditor::UpdateSizes()
|
|
{
|
|
VerveEditorGroupNotify.UpdateSize();
|
|
VerveEditorTrackNotify.UpdateSize();
|
|
VerveEditorTimeNotify.UpdateSize();
|
|
}
|
|
|
|
function VerveEditor::UpdateDuration( %duration )
|
|
{
|
|
if ( %duration !$= "" )
|
|
{
|
|
// Update Duration.
|
|
$VerveEditor::Controller.setFieldValue( "Duration", %duration );
|
|
}
|
|
|
|
// Update Duration.
|
|
VerveEditorTimeLine.updateDuration();
|
|
VerveEditorTrackTimeLine.updateDuration();
|
|
|
|
// Update Sizes.
|
|
VerveEditorGroupNotify.UpdateSize();
|
|
VerveEditorTrackNotify.UpdateSize();
|
|
VerveEditorTimeNotify.UpdateSize();
|
|
}
|
|
|
|
package VerveEditorSaveIntercept
|
|
{
|
|
function EditorSaveMission()
|
|
{
|
|
// Reset.
|
|
VerveEditor::Reset();
|
|
|
|
// Perform the Save.
|
|
Parent::EditorSaveMission();
|
|
}
|
|
};
|
|
|
|
function VerveEditor::Reset()
|
|
{
|
|
// Valid Controller?
|
|
if ( isObject( $VerveEditor::Controller ) )
|
|
{
|
|
// Reset.
|
|
$VerveEditor::Controller.Reset();
|
|
|
|
// Stop.
|
|
$VerveEditor::Controller.Stop();
|
|
}
|
|
}
|