Updates the behavior and layout of the ImageAsset, MaterialAsset and ShapeAsset inspector field types to be clearer, with previews and obvious edit buttons

Also fixes drag-n-drop behavior from the AB into the image and shape fields to ensure they update as expected.
This commit is contained in:
Areloch 2022-12-08 20:00:55 -06:00
parent fc1bbabe46
commit 6162c5da05
11 changed files with 422 additions and 108 deletions

View file

@ -336,17 +336,14 @@ function GuiInspectorTypeImageAssetPtr::onControlDropped( %this, %payload, %posi
return;
%assetType = %payload.assetType;
%module = %payload.moduleName;
%assetName = %payload.assetName;
if(%assetType $= "ImageAsset")
{
%module = %payload.moduleName;
%asset = %payload.assetName;
%oldValue = %this.targetObject.bitmapAsset;
%arrayIndex = "";
%targetObject = %this.targetObject;
%targetObject.bitmapAsset = %module @ ":" @ %asset;
%cmd = %this @ ".apply(\""@ %module @ ":" @ %assetName @ "\");";
echo("Changing asset via the " @ %cmd @ " command");
eval(%cmd);
}
EWorldEditor.isDirty = true;

View file

@ -411,18 +411,14 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi
return;
%assetType = %payload.assetType;
%module = %payload.moduleName;
%assetName = %payload.assetName;
if(%assetType $= "ShapeAsset")
{
%module = %payload.moduleName;
%asset = %payload.assetName;
%oldValue = %this.targetObject.shapeAsset;
%arrayIndex = "";
%targetObject = %this.targetObject;
%targetObject.shapeAsset = %module @ ":" @ %asset;
%cmd = %this @ ".apply(\""@ %module @ ":" @ %assetName @ "\");";
echo("Changing asset via the " @ %cmd @ " command");
eval(%cmd);
}
EWorldEditor.isDirty = true;

View file

@ -305,7 +305,7 @@ new GuiControlProfile( ToolsGuiTextEditProfile )
border = -2; // fix to display textEdit img
//borderWidth = "1"; // fix to display textEdit img
//borderColor = "100 100 100";
fillColor = EditorSettings.value("Theme/fieldBGColor");
fillColor = EditorSettings.value("Theme/dividerDarkColor");
fillColorHL = "75 75 75 255";
fillColorSEL = EditorSettings.value("Theme/fieldBGSELColor");