mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
* Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
156 lines
4 KiB
Plaintext
156 lines
4 KiB
Plaintext
function PostFXEditor::onDialogPush( %this )
|
|
{
|
|
//Apply the settings to the controls
|
|
postVerbose("% - PostFX Editor - Loading GUI.");
|
|
|
|
%this.refresh();
|
|
|
|
PostEffectEditorList.setSelectedById( 1 );
|
|
}
|
|
|
|
function PostFXEditor::onDialogPop( %this )
|
|
{
|
|
//Always change the manager target back to the scene's just to be save when done editing
|
|
$PostFXManager::currentPreset = $Client::LevelAsset.getPostFXPresetPath();
|
|
|
|
PostFXManager.loadPresetHandler($PostFXManager::currentPreset);
|
|
|
|
PostFXEditorWindow.text = "PostFX Editor";
|
|
}
|
|
|
|
function PostFXEditor::editScenePostFXSettings( %this )
|
|
{
|
|
$PostFXManager::currentPreset = $Client::LevelAsset.getPostFXPresetPath();
|
|
Canvas.pushDialog(%this);
|
|
|
|
PostFXEditorWindow.text = "PostFX Editor - " @ getScene(0).getName();
|
|
|
|
PostFXEditorActionButton.text = "Revert";
|
|
PostFXEditorActionButton.command = "PostFXEditor.revert();";
|
|
}
|
|
|
|
function PostFXEditor::editDefaultPostFXSettings( %this )
|
|
{
|
|
$PostFXManager::currentPreset = $PostFXManager::defaultPreset;
|
|
PostFXManager.loadPresetHandler($PostFXManager::currentPreset);
|
|
|
|
Canvas.pushDialog(%this);
|
|
|
|
PostFXEditorWindow.text = "PostFX Editor - Default Config";
|
|
|
|
PostFXEditorActionButton.text = "Save";
|
|
PostFXEditorActionButton.command = "PostFXManager::savePresetHandler($PostFXManager::defaultPreset);";
|
|
}
|
|
|
|
function PostEffectEditorInspector::refresh(%this)
|
|
{
|
|
PostFXEditor.refresh();
|
|
}
|
|
|
|
function PostFXEditor::refresh(%this)
|
|
{
|
|
%selectedItem = PostEffectEditorList.getSelectedRow();
|
|
PostEffectEditorList.clear();
|
|
|
|
%count = PostFXManager.Count();
|
|
for(%i=0; %i < %count; %i++)
|
|
{
|
|
%postEffect = PostFXManager.getKey(%i);
|
|
|
|
if(%postEffect.isEnabled())
|
|
PostEffectEditorList.addRow( %i, %postEffect.getName() );
|
|
}
|
|
|
|
PostEffectEditorList.setSelectedRow(%selectedItem);
|
|
}
|
|
|
|
function PostFXEditor::apply(%this)
|
|
{
|
|
%count = PostFXManager.Count();
|
|
for(%i=0; %i < %count; %i++)
|
|
{
|
|
%postEffect = PostFXManager.getKey(%i);
|
|
|
|
if(isObject(%postEffect) && %postEffect.isMethod("applyFromPreset"))
|
|
{
|
|
%postEffect.applyFromPreset();
|
|
}
|
|
}
|
|
}
|
|
|
|
function PostFXEditor::revert(%this)
|
|
{
|
|
%targetPreset = $PostFXManager::currentPreset;
|
|
if(%targetPreset $= "")
|
|
%targetPreset = $PostFXManager::defaultPreset;
|
|
|
|
PostFXManager::loadPresetHandler(%targetPreset);
|
|
|
|
%this.refresh();
|
|
|
|
PostEffectEditorInspector.clearFields();
|
|
PostEffectEditorList.setSelectedRow(1);
|
|
}
|
|
|
|
function PostEffectEditorList::onSelect( %this, %id, %text )
|
|
{
|
|
PostEffectEditorInspector.clearFields();
|
|
|
|
%postEffect = PostFXManager.getKey(%id);
|
|
|
|
if(isObject(%postEffect) && %postEffect.isMethod("populatePostFXSettings"))
|
|
{
|
|
%postEffect.populatePostFXSettings();
|
|
}
|
|
}
|
|
|
|
function PostFXEditor::addNewPostFXs(%this)
|
|
{
|
|
%rowIndex = PostFXEditorNewPFXList.getSelectedRow();
|
|
%postFXName = PostFXEditorNewPFXList.getRowText(%rowIndex);
|
|
|
|
%postFXName.enable();
|
|
|
|
%this.refresh();
|
|
|
|
%rowIndex = PostEffectEditorList.findTextIndex(%postFXName);
|
|
PostEffectEditorList.setSelectedRow(%rowIndex);
|
|
|
|
PostFXEditorNewPFXWindow.setHidden(true);
|
|
}
|
|
|
|
function PostFXEditor::removePostFX(%this)
|
|
{
|
|
%rowIndex = PostEffectEditorList.getSelectedRow();
|
|
%postFXName = PostEffectEditorList.getRowText(%rowIndex);
|
|
|
|
%postFXName.disable();
|
|
|
|
%this.refresh();
|
|
|
|
PostEffectEditorInspector.clearFields();
|
|
PostEffectEditorList.setSelectedRow(1);
|
|
}
|
|
|
|
function editScenePostEffects(%scene)
|
|
{
|
|
if(EditorIsActive())
|
|
PostFXEditor.editScenePostFXSettings();
|
|
}
|
|
|
|
function PostFXEditorNewPFXWindow::showDialog(%this)
|
|
{
|
|
%this.setHidden(false);
|
|
PostFXEditorNewPFXWindow.selectWindow();
|
|
|
|
PostFXEditorNewPFXList.clear();
|
|
|
|
%count = PostFXManager.Count();
|
|
for(%i=0; %i < %count; %i++)
|
|
{
|
|
%postEffect = PostFXManager.getKey(%i);
|
|
|
|
if(!%postEffect.isEnabled())
|
|
PostFXEditorNewPFXList.addRow( %i, %postEffect.getName() );
|
|
}
|
|
} |