mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Merge pull request #920 from Azaezel/alpha402/ramblinRoad
add MeshRoadEditorGui::onRoadCreation callback
This commit is contained in:
commit
d40351414f
3 changed files with 12 additions and 0 deletions
|
|
@ -677,6 +677,10 @@ void GuiMeshRoadEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
|
||||||
// Submit it.
|
// Submit it.
|
||||||
undoMan->addAction( action );
|
undoMan->addAction( action );
|
||||||
|
|
||||||
|
//send a callback to script after were done here if one exists
|
||||||
|
if (isMethod("onRoadCreation"))
|
||||||
|
Con::executef(this, "onRoadCreation");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( mMode == mAddNodeMode )
|
else if ( mMode == mAddNodeMode )
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,13 @@ function MeshRoadEditorGui::onRoadSelected( %this, %road )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function MeshRoadEditorGui::onRoadCreation( %this )
|
||||||
|
{
|
||||||
|
%this.road.TopMaterialAsset = "Core_GameObjects:DefaultDecalRoadMaterial";
|
||||||
|
%this.road.SideMaterialAsset = "Core_GameObjects:DefaultRoadMaterialOther";
|
||||||
|
%this.road.BottomMaterialAsset = "Core_GameObjects:DefaultRoadMaterialOther";
|
||||||
|
}
|
||||||
|
|
||||||
function MeshRoadEditorGui::onNodeSelected( %this, %nodeIdx )
|
function MeshRoadEditorGui::onNodeSelected( %this, %nodeIdx )
|
||||||
{
|
{
|
||||||
if ( %nodeIdx == -1 )
|
if ( %nodeIdx == -1 )
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ function RoadEditorGui::onEscapePressed( %this )
|
||||||
//just in case we need it later
|
//just in case we need it later
|
||||||
function RoadEditorGui::onRoadCreation( %this )
|
function RoadEditorGui::onRoadCreation( %this )
|
||||||
{
|
{
|
||||||
|
%this.road.MaterialAsset = "Core_GameObjects:DefaultDecalRoadMaterial";
|
||||||
}
|
}
|
||||||
|
|
||||||
function RoadEditorGui::onRoadSelected( %this, %road )
|
function RoadEditorGui::onRoadSelected( %this, %road )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue