|
|
@@ -296,127 +296,72 @@ function NavEditorGui::showSidePanel()
|
|
|
%parent.panelHidden = false;
|
|
|
}
|
|
|
|
|
|
-//------------------------------------------------------------------------------
|
|
|
+//------------------------------------------------------
|
|
|
+// NAVMESHSELECTTOOL
|
|
|
+//------------------------------------------------------
|
|
|
|
|
|
-function NavEditorGui::onModeSet(%this, %mode)
|
|
|
+function NavMeshSelectTool::onActivated(%this)
|
|
|
{
|
|
|
- // Callback when the nav editor changes mode. Set the appropriate dynamic
|
|
|
- // GUI contents in the properties/actions boxes.
|
|
|
NavInspector.setVisible(false);
|
|
|
-
|
|
|
%actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
- %actions->SelectActions.setVisible(false);
|
|
|
- %actions->LinkActions.setVisible(false);
|
|
|
- %actions->CoverActions.setVisible(false);
|
|
|
- %actions->TileActions.setVisible(false);
|
|
|
- %actions->TestActions.setVisible(false);
|
|
|
+ NavInspector.setVisible(true);
|
|
|
+ %actions->SelectActions.setVisible(true);
|
|
|
|
|
|
- %properties = NavEditorOptionsWindow->PropertiesBox;
|
|
|
- %properties->LinkProperties.setVisible(false);
|
|
|
- %properties->TileProperties.setVisible(false);
|
|
|
- %properties->TestProperties.setVisible(false);
|
|
|
-
|
|
|
- switch$(%mode)
|
|
|
- {
|
|
|
- case "SelectMode":
|
|
|
- NavInspector.setVisible(true);
|
|
|
- %actions->SelectActions.setVisible(true);
|
|
|
- case "LinkMode":
|
|
|
- %actions->LinkActions.setVisible(true);
|
|
|
- %properties->LinkProperties.setVisible(true);
|
|
|
- case "CoverMode":
|
|
|
- //
|
|
|
- %actions->CoverActions.setVisible(true);
|
|
|
- case "TileMode":
|
|
|
- %actions->TileActions.setVisible(true);
|
|
|
- %properties->TileProperties.setVisible(true);
|
|
|
- case "TestMode":
|
|
|
- %actions->TestActions.setVisible(true);
|
|
|
- %properties->TestProperties.setVisible(true);
|
|
|
- }
|
|
|
+ NavInspector.inspect(NavEditorGui.getMesh());
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::paletteSync(%this, %mode)
|
|
|
+function NavMeshSelectTool::onDeactivated(%this)
|
|
|
{
|
|
|
- // Synchronise the palette (small buttons on the left) with the actual mode
|
|
|
- // the nav editor is in.
|
|
|
- %evalShortcut = "ToolsPaletteArray-->" @ %mode @ ".setStateOn(1);";
|
|
|
- eval(%evalShortcut);
|
|
|
-}
|
|
|
-
|
|
|
-function NavEditorGui::onEscapePressed(%this)
|
|
|
-{
|
|
|
- return false;
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->SelectActions.setVisible(false);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::selectObject(%this, %obj)
|
|
|
+function NavMeshSelectTool::onNavMeshSelected(%this)
|
|
|
{
|
|
|
NavTreeView.clearSelection();
|
|
|
- if(isObject(%obj))
|
|
|
- NavTreeView.selectItem(%obj);
|
|
|
- %this.onObjectSelected(%obj);
|
|
|
+ if(isObject(NavEditorGui.getMesh()))
|
|
|
+ NavTreeView.selectItem(NavEditorGui.getMesh());
|
|
|
+ // we set the naveditorgui navmesh in source so just get it
|
|
|
+ // and update here.
|
|
|
+ NavInspector.inspect(NavEditorGui.getMesh());
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::onObjectSelected(%this, %obj)
|
|
|
-{
|
|
|
- if(isObject(%this.selectedObject))
|
|
|
- %this.deselect();
|
|
|
- %this.selectedObject = %obj;
|
|
|
- if(isObject(%obj))
|
|
|
- {
|
|
|
- %this.selectMesh(%obj);
|
|
|
- NavInspector.inspect(%obj);
|
|
|
- }
|
|
|
-}
|
|
|
+//------------------------------------------------------
|
|
|
+// OffMeshConnectionTool
|
|
|
+//------------------------------------------------------
|
|
|
|
|
|
-function NavEditorGui::deleteMesh(%this)
|
|
|
+function OffMeshConnectionTool::onActivated(%this)
|
|
|
{
|
|
|
- if(isObject(%this.selectedObject))
|
|
|
- {
|
|
|
- %this.selectedObject.delete();
|
|
|
- %this.selectObject(-1);
|
|
|
- }
|
|
|
-}
|
|
|
+ NavInspector.setVisible(false);
|
|
|
|
|
|
-function NavEditorGui::deleteSelected(%this)
|
|
|
-{
|
|
|
- switch$(%this.getMode())
|
|
|
- {
|
|
|
- case "SelectMode":
|
|
|
- // Try to delete the selected NavMesh.
|
|
|
- if(isObject(NavEditorGui.selectedObject))
|
|
|
- toolsMessageBoxYesNo("Warning",
|
|
|
- "Are you sure you want to delete" SPC NavEditorGui.selectedObject.getName(),
|
|
|
- "NavEditorGui.deleteMesh();");
|
|
|
- case "TestMode":
|
|
|
- %this.getPlayer().delete();
|
|
|
- %this.onPlayerDeselected();
|
|
|
- case "LinkMode":
|
|
|
- %this.deleteLink();
|
|
|
- %this.isDirty = true;
|
|
|
- }
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %properties = NavEditorOptionsWindow->PropertiesBox;
|
|
|
+
|
|
|
+ %actions->LinkActions.setVisible(true);
|
|
|
+ %properties->LinkProperties.setVisible(true);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::buildSelectedMeshes(%this)
|
|
|
+function OffMeshConnectionTool::onDeactivated(%this)
|
|
|
{
|
|
|
- if(isObject(%this.getMesh()))
|
|
|
- {
|
|
|
- %this.getMesh().build(NavEditorGui.backgroundBuild, NavEditorGui.saveIntermediates);
|
|
|
- %this.isDirty = true;
|
|
|
- }
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->LinkActions.setVisible(false);
|
|
|
+ %properties = NavEditorOptionsWindow->PropertiesBox;
|
|
|
+ %properties->LinkProperties.setVisible(false);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::buildLinks(%this)
|
|
|
+function OffMeshConnectionTool::updateLinkFlags(%this)
|
|
|
{
|
|
|
- if(isObject(%this.getMesh()))
|
|
|
- {
|
|
|
- %this.getMesh().buildLinks();
|
|
|
- %this.isDirty = true;
|
|
|
- }
|
|
|
+ %properties = NavEditorOptionsWindow-->LinkProperties;
|
|
|
+ %this.setLinkProperties(getLinkFlags(%properties), %properties->LinkBiDirection.isStateOn(), %properties->LinkRadius.getValue());
|
|
|
}
|
|
|
|
|
|
-function updateLinkData(%control, %flags)
|
|
|
+function updateLinkData(%control, %flags, %biDir, %radius)
|
|
|
{
|
|
|
+ %control->LinkRadius.setActive(true);
|
|
|
+ %control->LinkBiDirection.setActive(true);
|
|
|
%control->LinkWalkFlag.setActive(true);
|
|
|
%control->LinkJumpFlag.setActive(true);
|
|
|
%control->LinkDropFlag.setActive(true);
|
|
|
@@ -424,6 +369,8 @@ function updateLinkData(%control, %flags)
|
|
|
%control->LinkClimbFlag.setActive(true);
|
|
|
%control->LinkTeleportFlag.setActive(true);
|
|
|
|
|
|
+ %control->LinkRadius.setValue(%radius);
|
|
|
+ %control->LinkBiDirection.setStateOn(%biDir);
|
|
|
%control->LinkWalkFlag.setStateOn(%flags & $Nav::WalkFlag);
|
|
|
%control->LinkJumpFlag.setStateOn(%flags & $Nav::JumpFlag);
|
|
|
%control->LinkDropFlag.setStateOn(%flags & $Nav::DropFlag);
|
|
|
@@ -444,6 +391,8 @@ function getLinkFlags(%control)
|
|
|
|
|
|
function disableLinkData(%control)
|
|
|
{
|
|
|
+ %control->LinkRadius.setActive(false);
|
|
|
+ %control->LinkBiDirection.setActive(false);
|
|
|
%control->LinkWalkFlag.setActive(false);
|
|
|
%control->LinkJumpFlag.setActive(false);
|
|
|
%control->LinkDropFlag.setActive(false);
|
|
|
@@ -452,122 +401,273 @@ function disableLinkData(%control)
|
|
|
%control->LinkTeleportFlag.setActive(false);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::onLinkSelected(%this, %flags)
|
|
|
+function OffMeshConnectionTool::onLinkSelected(%this, %flags, %biDir, %radius)
|
|
|
+{
|
|
|
+ updateLinkData(NavEditorOptionsWindow-->LinkProperties, %flags, %biDir, %radius);
|
|
|
+}
|
|
|
+
|
|
|
+function OffMeshConnectionTool::onLinkDeselected(%this)
|
|
|
+{
|
|
|
+ disableLinkData(NavEditorOptionsWindow-->LinkProperties);
|
|
|
+}
|
|
|
+
|
|
|
+function OffMeshConnectionTool::updateRadius(%this)
|
|
|
+{
|
|
|
+ %this.updateLinkFlags();
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshLinkFlagButton::onClick(%this)
|
|
|
+{
|
|
|
+ NavMeshTools->LinkTool.updateLinkFlags();
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshLinkBiDirection::onClick(%this)
|
|
|
+{
|
|
|
+ NavMeshTools->LinkTool.updateLinkFlags();
|
|
|
+}
|
|
|
+
|
|
|
+//------------------------------------------------------
|
|
|
+// CoverTool
|
|
|
+//------------------------------------------------------
|
|
|
+
|
|
|
+function CoverTool::onActivated(%this)
|
|
|
+{
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->CoverActions.setVisible(true);
|
|
|
+}
|
|
|
+
|
|
|
+function CoverTool::onDeactivated(%this)
|
|
|
+{
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->CoverActions.setVisible(false);
|
|
|
+}
|
|
|
+
|
|
|
+//------------------------------------------------------
|
|
|
+// NAVMESHTESTTOOL
|
|
|
+//------------------------------------------------------
|
|
|
+
|
|
|
+function NavMeshTestTool::onActivated(%this)
|
|
|
+{
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->TestActions.setVisible(true);
|
|
|
+
|
|
|
+ %classList = enumerateConsoleClasses("Player") TAB enumerateConsoleClasses("Vehicle");
|
|
|
+ //echo(%classList);
|
|
|
+
|
|
|
+ SpawnClassSelector.clear();
|
|
|
+ foreach$(%class in %classList)
|
|
|
+ {
|
|
|
+ if(%class !$= "Vehicle") // vehicle doesnt work, purely virtual class.
|
|
|
+ SpawnClassSelector.add(%class);
|
|
|
+ }
|
|
|
+
|
|
|
+ SpawnClassSelector.setFirstSelected(true);
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshTestTool::onDeactivated(%this)
|
|
|
{
|
|
|
- updateLinkData(NavEditorOptionsWindow-->LinkProperties, %flags);
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->TestActions.setVisible(false);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::onPlayerSelected(%this, %flags)
|
|
|
+function NavMeshTestTool::onPlayerSelected(%this)
|
|
|
{
|
|
|
- if (!isObject(%this.getPlayer().aiController) || (isObject(%this.getPlayer().aiController) && !(%this.getPlayer().isMemberOfClass("AIPlayer"))))
|
|
|
+ if (!isObject(%this.getPlayer().aiController))
|
|
|
{
|
|
|
%this.getPlayer().aiController = new AIController(){ ControllerData = %this.getPlayer().getDatablock().aiControllerData; };
|
|
|
%this.getPlayer().setAIController(%this.getPlayer().aiController);
|
|
|
}
|
|
|
+
|
|
|
+ if(%this.getPlayer().isMemberOfClass("AIPlayer"))
|
|
|
+ {
|
|
|
+ NavInspector.inspect(%this.getPlayer());
|
|
|
+ NavInspector.setVisible(true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ NavInspector.inspect(%this.getPlayer().getDatablock().aiControllerData);
|
|
|
+ NavInspector.setVisible(true);
|
|
|
+ }
|
|
|
+
|
|
|
NavMeshIgnore(%this.getPlayer(), true);
|
|
|
%this.getPlayer().setDamageState("Enabled");
|
|
|
-
|
|
|
- updateLinkData(NavEditorOptionsWindow-->TestProperties, %flags);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::updateLinkFlags(%this)
|
|
|
+function NavMeshTestTool::onPlayerDeselected(%this)
|
|
|
{
|
|
|
- if(isObject(%this.getMesh()))
|
|
|
+ NavInspector.inspect();
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshTestTool::stop(%this)
|
|
|
+{
|
|
|
+ if (isObject(%this.getPlayer().aiController))
|
|
|
+ %this.getPlayer().aiController.stop();
|
|
|
+ else
|
|
|
+ {
|
|
|
+ %this.getPlayer().stop();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshTestTool::toggleFollow(%this)
|
|
|
+{
|
|
|
+
|
|
|
+ if(isObject(%this.getFollowObject()) && isObject(%this.getPlayer()))
|
|
|
{
|
|
|
- %properties = NavEditorOptionsWindow-->LinkProperties;
|
|
|
- %this.setLinkFlags(getLinkFlags(%properties));
|
|
|
- %this.isDirty = true;
|
|
|
+ %player = %this.getPlayer();
|
|
|
+ if(%player.isMemberOfClass("AIPlayer"))
|
|
|
+ %player.followObject(%this.getFollowObject(), "2.0");
|
|
|
+ else
|
|
|
+ %player.getAIController().followObject(%this.getFollowObject(), %player.getDatablock().aiControllerData.mFollowTolerance);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::updateTestFlags(%this)
|
|
|
+function NavMeshTestTool::followObject(%this)
|
|
|
+{
|
|
|
+ %this.followSelectMode();
|
|
|
+}
|
|
|
+
|
|
|
+function NavMeshTestTool::findCover(%this)
|
|
|
{
|
|
|
if(isObject(%this.getPlayer()))
|
|
|
{
|
|
|
- %properties = NavEditorOptionsWindow-->TestProperties;
|
|
|
%player = %this.getPlayer();
|
|
|
+ %pos = %player.getPosition();
|
|
|
|
|
|
- %player.allowWwalk = %properties->LinkWalkFlag.isStateOn();
|
|
|
- %player.allowJump = %properties->LinkJumpFlag.isStateOn();
|
|
|
- %player.allowDrop = %properties->LinkDropFlag.isStateOn();
|
|
|
- %player.allowLedge = %properties->LinkLedgeFlag.isStateOn();
|
|
|
- %player.allowClimb = %properties->LinkClimbFlag.isStateOn();
|
|
|
- %player.allowTeleport = %properties->LinkTeleportFlag.isStateOn();
|
|
|
+ if(%player.isMemberOfClass("AIPlayer"))
|
|
|
+ %player.findCover(%pos, CoverRadius.getText());
|
|
|
+ else
|
|
|
+ %player.getAIController().findCover(%pos, CoverRadius.getText());
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- %this.isDirty = true;
|
|
|
+function SpawnClassSelector::onSelect(%this, %id)
|
|
|
+{
|
|
|
+ %className = %this.getTextById(%id);
|
|
|
+
|
|
|
+ NavMeshTools->TestTool.setSpawnClass(%className);
|
|
|
+
|
|
|
+ SpawnDatablockSelector.clear();
|
|
|
+ %classData = %className @ "Data";
|
|
|
+ if(%className $= "AIPlayer")
|
|
|
+ {
|
|
|
+ %classData = "PlayerData";
|
|
|
+ }
|
|
|
+
|
|
|
+ // add the datablocks
|
|
|
+ for(%i = 0; %i < DataBlockGroup.getCount(); %i++)
|
|
|
+ {
|
|
|
+ %obj = DataBlockGroup.getObject(%i);
|
|
|
+ if( isMemberOfClass( %obj.getClassName(), %classData ))
|
|
|
+ SpawnDatablockSelector.add(%obj.getName());
|
|
|
}
|
|
|
+
|
|
|
+ SpawnDatablockSelector.setFirstSelected(true);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::onLinkDeselected(%this)
|
|
|
+function SpawnDatablockSelector::onSelect(%this, %id)
|
|
|
{
|
|
|
- disableLinkData(NavEditorOptionsWindow-->LinkProperties);
|
|
|
+ %className = %this.getTextById(%id);
|
|
|
+ NavMeshTools->TestTool.setSpawnDatablock(%className);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::onPlayerDeselected(%this)
|
|
|
+//------------------------------------------------------
|
|
|
+// TILETOOL
|
|
|
+//------------------------------------------------------
|
|
|
+
|
|
|
+function TileTool::onActivated(%this)
|
|
|
{
|
|
|
- disableLinkData(NavEditorOptionsWindow-->TestProperties);
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %properties = NavEditorOptionsWindow->PropertiesBox;
|
|
|
+ %actions->TileActions.setVisible(true);
|
|
|
+ %properties->TileProperties.setVisible(true);
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::createCoverPoints(%this)
|
|
|
+function TileTool::onDeactivated(%this)
|
|
|
{
|
|
|
- if(isObject(%this.getMesh()))
|
|
|
+ NavInspector.setVisible(false);
|
|
|
+
|
|
|
+ %actions = NavEditorOptionsWindow->ActionsBox;
|
|
|
+ %actions->TileActions.setVisible(false);
|
|
|
+ %properties = NavEditorOptionsWindow->PropertiesBox;
|
|
|
+ %properties->TileProperties.setVisible(false);
|
|
|
+}
|
|
|
+
|
|
|
+function NavEditorGui::onEscapePressed(%this)
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+function NavEditorGui::deleteMesh(%this)
|
|
|
+{
|
|
|
+ if(isObject(%this.selectedObject))
|
|
|
{
|
|
|
- %this.getMesh().createCoverPoints();
|
|
|
- %this.isDirty = true;
|
|
|
+ %this.selectedObject.delete();
|
|
|
+ %this.selectObject(-1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::deleteCoverPoints(%this)
|
|
|
+function NavEditorGui::deleteSelected(%this)
|
|
|
+{
|
|
|
+ switch$(%this.getMode())
|
|
|
+ {
|
|
|
+ case "SelectMode":
|
|
|
+ // Try to delete the selected NavMesh.
|
|
|
+ if(isObject(NavEditorGui.selectedObject))
|
|
|
+ toolsMessageBoxYesNo("Warning",
|
|
|
+ "Are you sure you want to delete" SPC NavEditorGui.selectedObject.getName(),
|
|
|
+ "NavEditorGui.deleteMesh();");
|
|
|
+ // case "TestMode":
|
|
|
+ // %this.getPlayer().delete();
|
|
|
+ // %this.onPlayerDeselected();
|
|
|
+ // case "LinkMode":
|
|
|
+ // %this.deleteLink();
|
|
|
+ // %this.isDirty = true;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function NavEditorGui::buildSelectedMeshes(%this)
|
|
|
{
|
|
|
if(isObject(%this.getMesh()))
|
|
|
{
|
|
|
- %this.getMesh().deleteCoverPoints();
|
|
|
+ %this.getMesh().build(NavEditorGui.backgroundBuild, NavEditorGui.saveIntermediates);
|
|
|
%this.isDirty = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::findCover(%this)
|
|
|
+function NavEditorGui::buildLinks(%this)
|
|
|
{
|
|
|
- if(%this.getMode() $= "TestMode" && isObject(%this.getPlayer()))
|
|
|
+ if(isObject(%this.getMesh()))
|
|
|
{
|
|
|
- %pos = LocalClientConnection.getControlObject().getPosition();
|
|
|
- %text = NavEditorOptionsWindow-->TestProperties->CoverPosition.getText();
|
|
|
- if(%text !$= "")
|
|
|
- %pos = eval("return " @ %text);
|
|
|
- %this.getPlayer().getAIController().findCover(%pos, NavEditorOptionsWindow-->TestProperties->CoverRadius.getText());
|
|
|
+ %this.getMesh().buildLinks();
|
|
|
+ %this.isDirty = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::followObject(%this)
|
|
|
+function NavEditorGui::createCoverPoints(%this)
|
|
|
{
|
|
|
- if(%this.getMode() $= "TestMode" && isObject(%this.getPlayer()))
|
|
|
+ if(isObject(%this.getMesh()))
|
|
|
{
|
|
|
- %obj = LocalClientConnection.player;
|
|
|
- %text = NavEditorOptionsWindow-->TestProperties->FollowObject.getText();
|
|
|
- if(%text !$= "")
|
|
|
- {
|
|
|
- %command = "return " @ %text;
|
|
|
- if(!endsWith(%command, ";"))
|
|
|
- %command = %command @ ";";
|
|
|
-
|
|
|
- %obj = eval(%command);
|
|
|
- if(!isObject(%obj))
|
|
|
- toolsMessageBoxOk("Error", "Cannot find object" SPC %text);
|
|
|
- }
|
|
|
- if(isObject(%obj))
|
|
|
- %this.getPlayer().getAIController().followObject(%obj, NavEditorOptionsWindow-->TestProperties->FollowRadius.getText());
|
|
|
+ %this.getMesh().createCoverPoints();
|
|
|
+ %this.isDirty = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function NavEditorGui::stop(%this)
|
|
|
+function NavEditorGui::deleteCoverPoints(%this)
|
|
|
{
|
|
|
- if (isObject(%this.getPlayer().aiController))
|
|
|
- %this.getPlayer().aiController.stop();
|
|
|
- else
|
|
|
- {
|
|
|
- NavEditorGui.getPlayer().stop();
|
|
|
- }
|
|
|
+ if(isObject(%this.getMesh()))
|
|
|
+ {
|
|
|
+ %this.getMesh().deleteCoverPoints();
|
|
|
+ %this.isDirty = true;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
function NavInspector::inspect(%this, %obj)
|
|
|
{
|
|
|
%name = "";
|
|
|
@@ -598,13 +698,13 @@ function NavTreeView::onInspect(%this, %obj)
|
|
|
function NavTreeView::onSelect(%this, %obj)
|
|
|
{
|
|
|
NavInspector.inspect(%obj);
|
|
|
- NavEditorGui.onObjectSelected(%obj);
|
|
|
+
|
|
|
+ NavEditorGui.selectMesh(%obj);
|
|
|
}
|
|
|
|
|
|
function NavEditorGui::prepSelectionMode(%this)
|
|
|
{
|
|
|
- %this.setMode("SelectMode");
|
|
|
- ToolsPaletteArray-->NavEditorSelectMode.setStateOn(1);
|
|
|
+ NavEditorGui.setActiveTool(NavMeshTools->SelectTool);
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@@ -618,16 +718,6 @@ function ENavEditorPaletteButton::onClick(%this)
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
-function NavMeshLinkFlagButton::onClick(%this)
|
|
|
-{
|
|
|
- NavEditorGui.updateLinkFlags();
|
|
|
-}
|
|
|
-
|
|
|
-function NavMeshTestFlagButton::onClick(%this)
|
|
|
-{
|
|
|
- NavEditorGui.updateTestFlags();
|
|
|
-}
|
|
|
-
|
|
|
singleton GuiControlProfile(NavEditorProfile)
|
|
|
{
|
|
|
canKeyFocus = true;
|
|
|
@@ -635,3 +725,38 @@ singleton GuiControlProfile(NavEditorProfile)
|
|
|
fillColor = "192 192 192 192";
|
|
|
category = "Editor";
|
|
|
};
|
|
|
+
|
|
|
+function DrawModeSelector::init(%this)
|
|
|
+{
|
|
|
+ %this.clear();
|
|
|
+
|
|
|
+ %this.add("Draw NavMesh", 0);
|
|
|
+ %this.add("Draw NavMesh Transparent", 1);
|
|
|
+ %this.add("Draw NavMesh BVTree", 2);
|
|
|
+ %this.add("Draw NavMesh Nodes", 3);
|
|
|
+ %this.add("Draw NavMesh Portals", 4);
|
|
|
+ %this.add("Draw NavMesh Invis", 5);
|
|
|
+ %this.add("Draw Mesh", 6);
|
|
|
+ %this.add("Draw Voxels", 7);
|
|
|
+ %this.add("Draw Walkable Voxels", 8);
|
|
|
+ %this.add("Draw Compact Heightfield", 9);
|
|
|
+ %this.add("Draw Compact Distance", 10);
|
|
|
+ %this.add("Draw Compact Regions", 11);
|
|
|
+ %this.add("Draw Region Connections", 12);
|
|
|
+ %this.add("Draw Raw Contours", 13);
|
|
|
+ %this.add("Draw Both Contours", 14);
|
|
|
+ %this.add("Draw Contours", 15);
|
|
|
+ %this.add("Draw PolyMesh", 16);
|
|
|
+ %this.add("Draw PolyMesh Detail", 17);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function DrawModeSelector::selectDefault(%this)
|
|
|
+{
|
|
|
+ %this.setSelected(0);
|
|
|
+}
|
|
|
+
|
|
|
+function DrawModeSelector::onSelect(%this, %id)
|
|
|
+{
|
|
|
+ NavEditorGui.setDrawMode(%id);
|
|
|
+}
|