mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge remote-tracking branch 'devhead/Preview4_0' into tsneo
# Conflicts: # Templates/BaseGame/game/data/ui/guis/loadingGui.gui # Templates/BaseGame/game/data/ui/guis/mainMenu.gui # Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui # Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui # Templates/BaseGame/game/tools/forestEditor/brushes.tscript
This commit is contained in:
commit
717c7acca9
2266 changed files with 48780 additions and 26034 deletions
|
|
@ -0,0 +1,7 @@
|
|||
<GUIAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="DecalEditorGui"
|
||||
scriptFile="@assetFile=decalEditorGui.gui"
|
||||
GUIFile="@assetFile=decalEditorGui.gui"
|
||||
VersionId="1" />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="add_decal_d_image"
|
||||
imageFile="@assetFile=add-decal_d.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="add_decal_h_image"
|
||||
imageFile="@assetFile=add-decal_h.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="add_decal_n_image"
|
||||
imageFile="@assetFile=add-decal_n.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -310,7 +310,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
tooltip = "Save All";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
bitmap = "tools/gui/images/save-icon";
|
||||
bitmapAsset = "ToolsModule:save_icon_n_image";
|
||||
};
|
||||
|
||||
new GuiBitmapButtonCtrl(RetargetDecalButton) {
|
||||
|
|
@ -329,7 +329,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Retarget missing decals to an existing decal datablock";
|
||||
bitmap = "tools/gui/images/retarget-btn";
|
||||
bitmapAsset = "ToolsModule:retarget_btn_n_image";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
};
|
||||
|
|
@ -350,7 +350,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Create New Decal Template";
|
||||
bitmap = "tools/gui/images/new";
|
||||
bitmapAsset = "ToolsModule:new_n_image";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
};
|
||||
|
|
@ -372,7 +372,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
hovertime = "1000";
|
||||
text = "";
|
||||
tooltip = "Delete Selected Decal Template";
|
||||
bitmap = "tools/gui/images/delete";
|
||||
bitmapAsset = "ToolsModule:delete_n_image";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
|
|
@ -515,7 +515,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
wrap = "0";
|
||||
bitmap= "tools/materialeditor/gui/unknownImage";
|
||||
bitmapAsset= "ToolsModule:unknownImage_image";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
canSaveDynamicFields = "0";
|
||||
|
|
@ -532,7 +532,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
Visible = "1";
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
bitmap = "tools/worldEditor/images/terrainpainter/terrain-painter-border-large";
|
||||
bitmapAsset = "ToolsModule:terrain_painter_border_large_image";
|
||||
wrap = "0";
|
||||
};
|
||||
};
|
||||
|
|
@ -755,7 +755,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
wrap = "0";
|
||||
bitmap= "tools/materialeditor/gui/unknownImage";
|
||||
bitmapAsset= "ToolsModule:unknownImage_image";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
canSaveDynamicFields = "0";
|
||||
|
|
@ -772,7 +772,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
|
|||
Visible = "1";
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
bitmap = "tools/worldEditor/images/terrainpainter/terrain-painter-border-large";
|
||||
bitmapAsset = "ToolsModule:terrain_painter_border_large_image";
|
||||
wrap = "0";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ function DecalEditorGui::syncNodeDetails( %this )
|
|||
return;
|
||||
|
||||
%lookupName = DecalEditorGui.getDecalLookupName( %decalId );
|
||||
DecalEditorGui.updateInstancePreview( %lookupName.material );
|
||||
DecalEditorGui.updateInstancePreview( %lookupName.materialAsset );
|
||||
|
||||
DecalEditorDetailContainer-->instanceId.setText(%decalId @ " " @ %lookupName);
|
||||
%transformData = DecalEditorGui.getDecalTransform(%decalId);
|
||||
|
|
@ -131,7 +131,7 @@ function DecalDataList::onSelect( %this, %id, %text )
|
|||
|
||||
//Canvas.pushDialog( DecalEditDlg );
|
||||
DecalInspector.inspect( %data );
|
||||
DecalEditorGui.updateDecalPreview( %data.material );
|
||||
DecalEditorGui.updateDecalPreview( %data.materialAsset );
|
||||
}
|
||||
|
||||
function RetargetDecalButton::onClick( %this )
|
||||
|
|
@ -158,6 +158,15 @@ function RetargetDecalButton::onClick( %this )
|
|||
|
||||
function NewDecalButton::onClick( %this )
|
||||
{
|
||||
AssetBrowser_SelectModule.showDialog("DecalEditorGui.pickedNewDecalTargetModule");
|
||||
AssetBrowser_SelectModuleWindow.selectWindow();
|
||||
}
|
||||
|
||||
function DecalEditorGui::pickedNewDecalTargetModule(%this, %module)
|
||||
{
|
||||
%moduleDef = ModuleDatabase.findModule(%module);
|
||||
$decalDataFile = %moduleDef.ModulePath @ "/scripts/managedData/managedDecalData." @ $TorqueScriptFileExtension;
|
||||
|
||||
%name = getUniqueName( "NewDecalData" );
|
||||
|
||||
%str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";
|
||||
|
|
@ -286,7 +295,7 @@ function DecalEditorTreeView::addNodeTree(%this, %nodeName, %parentName)
|
|||
|
||||
function DecalInspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue )
|
||||
{
|
||||
if( %fieldName $= "Material" )
|
||||
if( %fieldName $= "Material" || %fieldName $= "MaterialAsset")
|
||||
DecalEditorGui.updateDecalPreview( %newValue );
|
||||
|
||||
// Same work to do as for the regular WorldEditor Inspector.
|
||||
|
|
@ -313,17 +322,50 @@ function DecalInspector::removeDirty()
|
|||
function DecalEditorGui::updateDecalPreview( %this, %material )
|
||||
{
|
||||
if( isObject( %material ) )
|
||||
DecalPreviewWindow-->decalPreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) );
|
||||
{
|
||||
DecalPreviewWindow-->decalPreview.setBitmap( %material.getDiffuseMap(0) );
|
||||
}
|
||||
else
|
||||
DecalPreviewWindow-->decalPreview.setBitmap("tools/materialEditor/gui/unknownImage");
|
||||
{
|
||||
if(AssetDatabase.isDeclaredAsset(%material))
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(%material);
|
||||
%difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
|
||||
AssetDatabase.acquireAsset(%material);
|
||||
|
||||
if(%difMap !$= "" && %difMap !$= "Core_Rendering:missingTexture")
|
||||
{
|
||||
DecalPreviewWindow-->decalPreview.setBitmap( %difMap );
|
||||
return;
|
||||
}
|
||||
}
|
||||
DecalPreviewWindow-->decalPreview.setBitmap("ToolsModule:unknownImage_image");
|
||||
}
|
||||
}
|
||||
|
||||
function DecalEditorGui::updateInstancePreview( %this, %material )
|
||||
{
|
||||
if( isObject( %material ) )
|
||||
DecalPreviewWindow-->instancePreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) );
|
||||
{
|
||||
DecalPreviewWindow-->instancePreview.setBitmap( %material.getDiffuseMap(0) );
|
||||
}
|
||||
else
|
||||
DecalPreviewWindow-->instancePreview.setBitmap("tools/materialEditor/gui/unknownImage");
|
||||
{
|
||||
if(AssetDatabase.isDeclaredAsset(%material))
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(%material);
|
||||
%difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
|
||||
AssetDatabase.acquireAsset(%material);
|
||||
|
||||
if(%difMap !$= "" && %difMap !$= "Core_Rendering:missingTexture")
|
||||
{
|
||||
DecalPreviewWindow-->instancePreview.setBitmap( %difMap );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DecalPreviewWindow-->instancePreview.setBitmap("ToolsModule:unknownImage_image");
|
||||
}
|
||||
}
|
||||
|
||||
function DecalEditorGui::rebuildInstanceTree( %this )
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="decal_editor_d_image"
|
||||
imageFile="@assetFile=decal-editor_d.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="decal_editor_h_image"
|
||||
imageFile="@assetFile=decal-editor_h.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="decal_editor_n_image"
|
||||
imageFile="@assetFile=decal-editor_n.png"
|
||||
UseMips="true"
|
||||
isHDRImage="false"
|
||||
imageType="Albedo" />
|
||||
|
|
@ -24,7 +24,7 @@ function initializeDecalEditor()
|
|||
{
|
||||
echo(" % - Initializing Decal Editor");
|
||||
|
||||
$decalDataFile = "art/decals/managedDecalData." @ $TorqueScriptFileExtension;
|
||||
$decalDataFile = "data/managedDecalData." @ $TorqueScriptFileExtension;
|
||||
|
||||
exec( "./decalEditor." @ $TorqueScriptFileExtension );
|
||||
exec( "./decalEditorGui.gui" );
|
||||
|
|
@ -78,7 +78,7 @@ function DecalEditorPlugin::onWorldEditorStartup( %this )
|
|||
|
||||
// Add ourselves to the ToolsToolbar
|
||||
%tooltip = "Decal Editor (" @ %accel @ ")";
|
||||
EditorGui.addToToolsToolbar( "DecalEditorPlugin", "DecalEditorPalette", expandFilename("tools/decalEditor/decal-editor"), %tooltip );
|
||||
EditorGui.addToToolsToolbar( "DecalEditorPlugin", "DecalEditorPalette", "ToolsModule:decal_editor_n_image", %tooltip );
|
||||
|
||||
//connect editor windows
|
||||
GuiWindowCtrl::attach( DecalPreviewWindow, DecalEditorWindow );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue