Terrain Macro Texture

Adds another layer of detail-like texture to the terrain and the
interface updates in the Terrain Painter.
This commit is contained in:
xoltan 2013-03-27 18:58:37 -06:00
parent 769268784f
commit add2f8cb47
17 changed files with 2210 additions and 242 deletions

View file

@ -247,6 +247,29 @@ function TerrainMaterialDlg::changeDetail( %this )
%ctrl.setBitmap( %file );
}
//----------------------------------------------------------------------------
function TerrainMaterialDlg::changeMacro( %this )
{
%ctrl = %this-->macroTexCtrl;
%file = %ctrl.bitmap;
if( getSubStr( %file, 0 , 6 ) $= "tools/" )
%file = "";
%file = TerrainMaterialDlg._selectTextureFileDialog( %file );
if( %file $= "" )
{
if( %ctrl.bitmap !$= "" )
%file = %ctrl.bitmap;
else
%file = "tools/materialeditor/gui/unknownImage";
}
%file = makeRelativePath( %file, getMainDotCsDir() );
%ctrl.setBitmap( %file );
}
//-----------------------------------------------------------------------------
function TerrainMaterialDlg::changeNormal( %this )
@ -362,6 +385,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
}else{
%this-->detailTexCtrl.setBitmap( %mat.detailMap );
}
if (%mat.macroMap $= ""){
%this-->macroTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
%this-->macroTexCtrl.setBitmap( %mat.macroMap );
}
if (%mat.normalMap $= ""){
%this-->normTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
@ -373,6 +401,10 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
%this-->detDistanceCtrl.setText( %mat.detailDistance );
%this-->sideProjectionCtrl.setValue( %mat.useSideProjection );
%this-->parallaxScaleCtrl.setText( %mat.parallaxScale );
%this-->macroSizeCtrl.setText( %mat.macroSize );
%this-->macroStrengthCtrl.setText( %mat.macroStrength );
%this-->macroDistanceCtrl.setText( %mat.macroDistance );
%this.activateMaterialCtrls( true );
}
@ -411,12 +443,21 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
}else{
%newDetail = %this-->detailTexCtrl.bitmap;
}
if (%this-->macroTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){
%newMacro = "";
}else{
%newMacro = %this-->macroTexCtrl.bitmap;
}
%detailSize = %this-->detSizeCtrl.getText();
%diffuseSize = %this-->baseSizeCtrl.getText();
%detailStrength = %this-->detStrengthCtrl.getText();
%detailDistance = %this-->detDistanceCtrl.getText();
%useSideProjection = %this-->sideProjectionCtrl.getValue();
%parallaxScale = %this-->parallaxScaleCtrl.getText();
%macroSize = %this-->macroSizeCtrl.getText();
%macroStrength = %this-->macroStrengthCtrl.getText();
%macroDistance = %this-->macroDistanceCtrl.getText();
// If no properties of this materials have changed,
// return.
@ -425,11 +466,15 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap $= %newDiffuse &&
%mat.normalMap $= %newNormal &&
%mat.detailMap $= %newDetail &&
%mat.macroMap $= %newMacro &&
%mat.detailSize == %detailSize &&
%mat.diffuseSize == %diffuseSize &&
%mat.detailStrength == %detailStrength &&
%mat.detailDistance == %detailDistance &&
%mat.useSideProjection == %useSideProjection &&
%mat.macroSize == %macroSize &&
%mat.macroStrength == %macroStrength &&
%mat.macroDistance == %macroDistance &&
%mat.parallaxScale == %parallaxScale )
return;
@ -454,10 +499,14 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap = %newDiffuse;
%mat.normalMap = %newNormal;
%mat.detailMap = %newDetail;
%mat.macroMap = %newMacro;
%mat.detailSize = %detailSize;
%mat.diffuseSize = %diffuseSize;
%mat.detailStrength = %detailStrength;
%mat.detailDistance = %detailDistance;
%mat.macroSize = %macroSize;
%mat.macroStrength = %macroStrength;
%mat.macroDistance = %macroDistance;
%mat.useSideProjection = %useSideProjection;
%mat.parallaxScale = %parallaxScale;
@ -495,10 +544,14 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
diffuseMap = %mat.diffuseMap;
normalMap = %mat.normalMap;
detailMap = %mat.detailMap;
macroMap = %mat.macroMap;
detailSize = %mat.detailSize;
diffuseSize = %mat.diffuseSize;
detailStrength = %mat.detailStrength;
detailDistance = %mat.detailDistance;
macroSize = %mat.macroSize;
macroStrength = %mat.macroStrength;
macroDistance = %mat.macroDistance;
useSideProjection = %mat.useSideProjection;
parallaxScale = %mat.parallaxScale;
};
@ -525,10 +578,14 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat.diffuseMap = %obj.diffuseMap;
%mat.normalMap = %obj.normalMap;
%mat.detailMap = %obj.detailMap;
%mat.macroMap = %obj.macroMap;
%mat.detailSize = %obj.detailSize;
%mat.diffuseSize = %obj.diffuseSize;
%mat.detailStrength = %obj.detailStrength;
%mat.detailDistance = %obj.detailDistance;
%mat.macroSize = %obj.macroSize;
%mat.macroStrength = %obj.macroStrength;
%mat.macroDistance = %obj.macroDistance;
%mat.useSideProjection = %obj.useSideProjection;
%mat.parallaxScale = %obj.parallaxScale;
}

View file

@ -6,7 +6,7 @@
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "800 600";
Extent = "800 768";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -20,8 +20,8 @@
HorizSizing = "center";
VertSizing = "center";
position = "221 151";
Extent = "394 322";
MinExtent = "358 298";
Extent = "394 432";
MinExtent = "358 432";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
@ -106,7 +106,7 @@
HorizSizing = "left";
VertSizing = "height";
position = "202 26";
Extent = "185 263";
Extent = "185 363";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -132,7 +132,7 @@
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
bitmap = "tools/gui/images/separator-v";
bitmap = "core/art/gui/images/separator-v";
wrap = "0";
};
new GuiTextCtrl() {
@ -438,7 +438,7 @@
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "6 206";
position = "6 295";
Extent = "185 50";
MinExtent = "8 2";
canSave = "1";
@ -622,6 +622,333 @@
passwordMask = "*";
};
};
new GuiBitmapCtrl() {
bitmap = "tools/gui/images/separator-v";
wrap = "0";
position = "6 288";
extent = "175 2";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
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 = "6 122";
extent = "185 72";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
position = "1 1";
extent = "47 47";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroTexCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "1 1";
extent = "48 48";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changeMacro();";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the active Macro Map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Macro";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 -3";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "EditorTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "None";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 17";
extent = "116 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Edit";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "116 0";
extent = "40 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changeMacro();";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/delete";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "159 0";
extent = "16 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg-->macroTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Size";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "132 33";
extent = "39 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "94 32";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroSizeCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Strength";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "39 54";
extent = "46 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "1 53";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroStrengthCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Distance";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "132 54";
extent = "45 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "94 53";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroDistanceCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiBitmapCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
@ -644,7 +971,7 @@
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "6 122";
position = "6 206";
Extent = "185 72";
MinExtent = "8 2";
canSave = "1";
@ -933,7 +1260,7 @@
HorizSizing = "width";
VertSizing = "height";
position = "6 42";
Extent = "189 273";
Extent = "189 373";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -947,7 +1274,7 @@
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "189 274";
Extent = "189 374";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -1006,7 +1333,7 @@
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "202 294";
position = "202 394";
Extent = "98 22";
MinExtent = "8 2";
canSave = "1";
@ -1025,7 +1352,7 @@
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "307 294";
position = "307 394";
Extent = "80 22";
MinExtent = "8 2";
canSave = "1";

View file

@ -247,6 +247,29 @@ function TerrainMaterialDlg::changeDetail( %this )
%ctrl.setBitmap( %file );
}
//----------------------------------------------------------------------------
function TerrainMaterialDlg::changeMacro( %this )
{
%ctrl = %this-->macroTexCtrl;
%file = %ctrl.bitmap;
if( getSubStr( %file, 0 , 6 ) $= "tools/" )
%file = "";
%file = TerrainMaterialDlg._selectTextureFileDialog( %file );
if( %file $= "" )
{
if( %ctrl.bitmap !$= "" )
%file = %ctrl.bitmap;
else
%file = "tools/materialeditor/gui/unknownImage";
}
%file = makeRelativePath( %file, getMainDotCsDir() );
%ctrl.setBitmap( %file );
}
//-----------------------------------------------------------------------------
function TerrainMaterialDlg::changeNormal( %this )
@ -362,6 +385,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
}else{
%this-->detailTexCtrl.setBitmap( %mat.detailMap );
}
if (%mat.macroMap $= ""){
%this-->macroTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
%this-->macroTexCtrl.setBitmap( %mat.macroMap );
}
if (%mat.normalMap $= ""){
%this-->normTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
@ -373,6 +401,10 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
%this-->detDistanceCtrl.setText( %mat.detailDistance );
%this-->sideProjectionCtrl.setValue( %mat.useSideProjection );
%this-->parallaxScaleCtrl.setText( %mat.parallaxScale );
%this-->macroSizeCtrl.setText( %mat.macroSize );
%this-->macroStrengthCtrl.setText( %mat.macroStrength );
%this-->macroDistanceCtrl.setText( %mat.macroDistance );
%this.activateMaterialCtrls( true );
}
@ -411,12 +443,21 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
}else{
%newDetail = %this-->detailTexCtrl.bitmap;
}
if (%this-->macroTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){
%newMacro = "";
}else{
%newMacro = %this-->macroTexCtrl.bitmap;
}
%detailSize = %this-->detSizeCtrl.getText();
%diffuseSize = %this-->baseSizeCtrl.getText();
%detailStrength = %this-->detStrengthCtrl.getText();
%detailDistance = %this-->detDistanceCtrl.getText();
%useSideProjection = %this-->sideProjectionCtrl.getValue();
%parallaxScale = %this-->parallaxScaleCtrl.getText();
%macroSize = %this-->macroSizeCtrl.getText();
%macroStrength = %this-->macroStrengthCtrl.getText();
%macroDistance = %this-->macroDistanceCtrl.getText();
// If no properties of this materials have changed,
// return.
@ -425,11 +466,15 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap $= %newDiffuse &&
%mat.normalMap $= %newNormal &&
%mat.detailMap $= %newDetail &&
%mat.macroMap $= %newMacro &&
%mat.detailSize == %detailSize &&
%mat.diffuseSize == %diffuseSize &&
%mat.detailStrength == %detailStrength &&
%mat.detailDistance == %detailDistance &&
%mat.useSideProjection == %useSideProjection &&
%mat.macroSize == %macroSize &&
%mat.macroStrength == %macroStrength &&
%mat.macroDistance == %macroDistance &&
%mat.parallaxScale == %parallaxScale )
return;
@ -454,10 +499,14 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap = %newDiffuse;
%mat.normalMap = %newNormal;
%mat.detailMap = %newDetail;
%mat.macroMap = %newMacro;
%mat.detailSize = %detailSize;
%mat.diffuseSize = %diffuseSize;
%mat.detailStrength = %detailStrength;
%mat.detailDistance = %detailDistance;
%mat.macroSize = %macroSize;
%mat.macroStrength = %macroStrength;
%mat.macroDistance = %macroDistance;
%mat.useSideProjection = %useSideProjection;
%mat.parallaxScale = %parallaxScale;
@ -495,10 +544,14 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
diffuseMap = %mat.diffuseMap;
normalMap = %mat.normalMap;
detailMap = %mat.detailMap;
macroMap = %mat.macroMap;
detailSize = %mat.detailSize;
diffuseSize = %mat.diffuseSize;
detailStrength = %mat.detailStrength;
detailDistance = %mat.detailDistance;
macroSize = %mat.macroSize;
macroStrength = %mat.macroStrength;
macroDistance = %mat.macroDistance;
useSideProjection = %mat.useSideProjection;
parallaxScale = %mat.parallaxScale;
};
@ -525,10 +578,14 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat.diffuseMap = %obj.diffuseMap;
%mat.normalMap = %obj.normalMap;
%mat.detailMap = %obj.detailMap;
%mat.macroMap = %obj.macroMap;
%mat.detailSize = %obj.detailSize;
%mat.diffuseSize = %obj.diffuseSize;
%mat.detailStrength = %obj.detailStrength;
%mat.detailDistance = %obj.detailDistance;
%mat.macroSize = %obj.macroSize;
%mat.macroStrength = %obj.macroStrength;
%mat.macroDistance = %obj.macroDistance;
%mat.useSideProjection = %obj.useSideProjection;
%mat.parallaxScale = %obj.parallaxScale;
}

View file

@ -247,6 +247,29 @@ function TerrainMaterialDlg::changeDetail( %this )
%ctrl.setBitmap( %file );
}
//----------------------------------------------------------------------------
function TerrainMaterialDlg::changeMacro( %this )
{
%ctrl = %this-->macroTexCtrl;
%file = %ctrl.bitmap;
if( getSubStr( %file, 0 , 6 ) $= "tools/" )
%file = "";
%file = TerrainMaterialDlg._selectTextureFileDialog( %file );
if( %file $= "" )
{
if( %ctrl.bitmap !$= "" )
%file = %ctrl.bitmap;
else
%file = "tools/materialeditor/gui/unknownImage";
}
%file = makeRelativePath( %file, getMainDotCsDir() );
%ctrl.setBitmap( %file );
}
//-----------------------------------------------------------------------------
function TerrainMaterialDlg::changeNormal( %this )
@ -362,6 +385,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
}else{
%this-->detailTexCtrl.setBitmap( %mat.detailMap );
}
if (%mat.macroMap $= ""){
%this-->macroTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
%this-->macroTexCtrl.setBitmap( %mat.macroMap );
}
if (%mat.normalMap $= ""){
%this-->normTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
@ -373,6 +401,10 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
%this-->detDistanceCtrl.setText( %mat.detailDistance );
%this-->sideProjectionCtrl.setValue( %mat.useSideProjection );
%this-->parallaxScaleCtrl.setText( %mat.parallaxScale );
%this-->macroSizeCtrl.setText( %mat.macroSize );
%this-->macroStrengthCtrl.setText( %mat.macroStrength );
%this-->macroDistanceCtrl.setText( %mat.macroDistance );
%this.activateMaterialCtrls( true );
}
@ -411,12 +443,21 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
}else{
%newDetail = %this-->detailTexCtrl.bitmap;
}
if (%this-->macroTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){
%newMacro = "";
}else{
%newMacro = %this-->macroTexCtrl.bitmap;
}
%detailSize = %this-->detSizeCtrl.getText();
%diffuseSize = %this-->baseSizeCtrl.getText();
%detailStrength = %this-->detStrengthCtrl.getText();
%detailDistance = %this-->detDistanceCtrl.getText();
%useSideProjection = %this-->sideProjectionCtrl.getValue();
%parallaxScale = %this-->parallaxScaleCtrl.getText();
%macroSize = %this-->macroSizeCtrl.getText();
%macroStrength = %this-->macroStrengthCtrl.getText();
%macroDistance = %this-->macroDistanceCtrl.getText();
// If no properties of this materials have changed,
// return.
@ -425,11 +466,15 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap $= %newDiffuse &&
%mat.normalMap $= %newNormal &&
%mat.detailMap $= %newDetail &&
%mat.macroMap $= %newMacro &&
%mat.detailSize == %detailSize &&
%mat.diffuseSize == %diffuseSize &&
%mat.detailStrength == %detailStrength &&
%mat.detailDistance == %detailDistance &&
%mat.useSideProjection == %useSideProjection &&
%mat.macroSize == %macroSize &&
%mat.macroStrength == %macroStrength &&
%mat.macroDistance == %macroDistance &&
%mat.parallaxScale == %parallaxScale )
return;
@ -454,10 +499,14 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap = %newDiffuse;
%mat.normalMap = %newNormal;
%mat.detailMap = %newDetail;
%mat.macroMap = %newMacro;
%mat.detailSize = %detailSize;
%mat.diffuseSize = %diffuseSize;
%mat.detailStrength = %detailStrength;
%mat.detailDistance = %detailDistance;
%mat.macroSize = %macroSize;
%mat.macroStrength = %macroStrength;
%mat.macroDistance = %macroDistance;
%mat.useSideProjection = %useSideProjection;
%mat.parallaxScale = %parallaxScale;
@ -495,10 +544,14 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
diffuseMap = %mat.diffuseMap;
normalMap = %mat.normalMap;
detailMap = %mat.detailMap;
macroMap = %mat.macroMap;
detailSize = %mat.detailSize;
diffuseSize = %mat.diffuseSize;
detailStrength = %mat.detailStrength;
detailDistance = %mat.detailDistance;
macroSize = %mat.macroSize;
macroStrength = %mat.macroStrength;
macroDistance = %mat.macroDistance;
useSideProjection = %mat.useSideProjection;
parallaxScale = %mat.parallaxScale;
};
@ -525,10 +578,14 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat.diffuseMap = %obj.diffuseMap;
%mat.normalMap = %obj.normalMap;
%mat.detailMap = %obj.detailMap;
%mat.macroMap = %obj.macroMap;
%mat.detailSize = %obj.detailSize;
%mat.diffuseSize = %obj.diffuseSize;
%mat.detailStrength = %obj.detailStrength;
%mat.detailDistance = %obj.detailDistance;
%mat.macroSize = %obj.macroSize;
%mat.macroStrength = %obj.macroStrength;
%mat.macroDistance = %obj.macroDistance;
%mat.useSideProjection = %obj.useSideProjection;
%mat.parallaxScale = %obj.parallaxScale;
}

View file

@ -6,7 +6,7 @@
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "800 600";
Extent = "800 768";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -20,8 +20,8 @@
HorizSizing = "center";
VertSizing = "center";
position = "221 151";
Extent = "394 322";
MinExtent = "358 298";
Extent = "394 432";
MinExtent = "358 432";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
@ -106,7 +106,7 @@
HorizSizing = "left";
VertSizing = "height";
position = "202 26";
Extent = "185 263";
Extent = "185 363";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -132,7 +132,7 @@
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
bitmap = "tools/gui/images/separator-v";
bitmap = "core/art/gui/images/separator-v";
wrap = "0";
};
new GuiTextCtrl() {
@ -438,7 +438,7 @@
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "6 206";
position = "6 295";
Extent = "185 50";
MinExtent = "8 2";
canSave = "1";
@ -622,6 +622,333 @@
passwordMask = "*";
};
};
new GuiBitmapCtrl() {
bitmap = "tools/gui/images/separator-v";
wrap = "0";
position = "6 288";
extent = "175 2";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
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 = "6 122";
extent = "185 72";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
position = "1 1";
extent = "47 47";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroTexCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "1 1";
extent = "48 48";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changeMacro();";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the active Macro Map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Macro";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 -3";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "EditorTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "None";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 17";
extent = "116 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Edit";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "116 0";
extent = "40 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changeMacro();";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/delete";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "159 0";
extent = "16 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg-->macroTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Size";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "132 33";
extent = "39 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "94 32";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroSizeCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Strength";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "39 54";
extent = "46 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "1 53";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroStrengthCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Distance";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "132 54";
extent = "45 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 GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "0";
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
position = "94 53";
extent = "34 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "macroDistanceCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiBitmapCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
@ -644,7 +971,7 @@
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "6 122";
position = "6 206";
Extent = "185 72";
MinExtent = "8 2";
canSave = "1";
@ -933,7 +1260,7 @@
HorizSizing = "width";
VertSizing = "height";
position = "6 42";
Extent = "189 273";
Extent = "189 373";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -947,7 +1274,7 @@
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "189 274";
Extent = "189 374";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -1006,7 +1333,7 @@
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "202 294";
position = "202 394";
Extent = "98 22";
MinExtent = "8 2";
canSave = "1";
@ -1025,7 +1352,7 @@
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "307 294";
position = "307 394";
Extent = "80 22";
MinExtent = "8 2";
canSave = "1";

View file

@ -247,6 +247,29 @@ function TerrainMaterialDlg::changeDetail( %this )
%ctrl.setBitmap( %file );
}
//----------------------------------------------------------------------------
function TerrainMaterialDlg::changeMacro( %this )
{
%ctrl = %this-->macroTexCtrl;
%file = %ctrl.bitmap;
if( getSubStr( %file, 0 , 6 ) $= "tools/" )
%file = "";
%file = TerrainMaterialDlg._selectTextureFileDialog( %file );
if( %file $= "" )
{
if( %ctrl.bitmap !$= "" )
%file = %ctrl.bitmap;
else
%file = "tools/materialeditor/gui/unknownImage";
}
%file = makeRelativePath( %file, getMainDotCsDir() );
%ctrl.setBitmap( %file );
}
//-----------------------------------------------------------------------------
function TerrainMaterialDlg::changeNormal( %this )
@ -362,6 +385,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
}else{
%this-->detailTexCtrl.setBitmap( %mat.detailMap );
}
if (%mat.macroMap $= ""){
%this-->macroTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
%this-->macroTexCtrl.setBitmap( %mat.macroMap );
}
if (%mat.normalMap $= ""){
%this-->normTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" );
}else{
@ -373,6 +401,10 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
%this-->detDistanceCtrl.setText( %mat.detailDistance );
%this-->sideProjectionCtrl.setValue( %mat.useSideProjection );
%this-->parallaxScaleCtrl.setText( %mat.parallaxScale );
%this-->macroSizeCtrl.setText( %mat.macroSize );
%this-->macroStrengthCtrl.setText( %mat.macroStrength );
%this-->macroDistanceCtrl.setText( %mat.macroDistance );
%this.activateMaterialCtrls( true );
}
@ -411,12 +443,21 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
}else{
%newDetail = %this-->detailTexCtrl.bitmap;
}
if (%this-->macroTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){
%newMacro = "";
}else{
%newMacro = %this-->macroTexCtrl.bitmap;
}
%detailSize = %this-->detSizeCtrl.getText();
%diffuseSize = %this-->baseSizeCtrl.getText();
%detailStrength = %this-->detStrengthCtrl.getText();
%detailDistance = %this-->detDistanceCtrl.getText();
%useSideProjection = %this-->sideProjectionCtrl.getValue();
%parallaxScale = %this-->parallaxScaleCtrl.getText();
%macroSize = %this-->macroSizeCtrl.getText();
%macroStrength = %this-->macroStrengthCtrl.getText();
%macroDistance = %this-->macroDistanceCtrl.getText();
// If no properties of this materials have changed,
// return.
@ -425,11 +466,15 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap $= %newDiffuse &&
%mat.normalMap $= %newNormal &&
%mat.detailMap $= %newDetail &&
%mat.macroMap $= %newMacro &&
%mat.detailSize == %detailSize &&
%mat.diffuseSize == %diffuseSize &&
%mat.detailStrength == %detailStrength &&
%mat.detailDistance == %detailDistance &&
%mat.useSideProjection == %useSideProjection &&
%mat.macroSize == %macroSize &&
%mat.macroStrength == %macroStrength &&
%mat.macroDistance == %macroDistance &&
%mat.parallaxScale == %parallaxScale )
return;
@ -454,10 +499,14 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%mat.diffuseMap = %newDiffuse;
%mat.normalMap = %newNormal;
%mat.detailMap = %newDetail;
%mat.macroMap = %newMacro;
%mat.detailSize = %detailSize;
%mat.diffuseSize = %diffuseSize;
%mat.detailStrength = %detailStrength;
%mat.detailDistance = %detailDistance;
%mat.macroSize = %macroSize;
%mat.macroStrength = %macroStrength;
%mat.macroDistance = %macroDistance;
%mat.useSideProjection = %useSideProjection;
%mat.parallaxScale = %parallaxScale;
@ -495,10 +544,14 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
diffuseMap = %mat.diffuseMap;
normalMap = %mat.normalMap;
detailMap = %mat.detailMap;
macroMap = %mat.macroMap;
detailSize = %mat.detailSize;
diffuseSize = %mat.diffuseSize;
detailStrength = %mat.detailStrength;
detailDistance = %mat.detailDistance;
macroSize = %mat.macroSize;
macroStrength = %mat.macroStrength;
macroDistance = %mat.macroDistance;
useSideProjection = %mat.useSideProjection;
parallaxScale = %mat.parallaxScale;
};
@ -525,10 +578,14 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat.diffuseMap = %obj.diffuseMap;
%mat.normalMap = %obj.normalMap;
%mat.detailMap = %obj.detailMap;
%mat.macroMap = %obj.macroMap;
%mat.detailSize = %obj.detailSize;
%mat.diffuseSize = %obj.diffuseSize;
%mat.detailStrength = %obj.detailStrength;
%mat.detailDistance = %obj.detailDistance;
%mat.macroSize = %obj.macroSize;
%mat.macroStrength = %obj.macroStrength;
%mat.macroDistance = %obj.macroDistance;
%mat.useSideProjection = %obj.useSideProjection;
%mat.parallaxScale = %obj.parallaxScale;
}