mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
added first tool
Added the tileTool with the ability to select tiles Abstraction layer for navmesh tools created.
This commit is contained in:
parent
ab83ecb591
commit
80473e10b5
12 changed files with 363 additions and 66 deletions
|
|
@ -422,7 +422,7 @@ $guiContent = new GuiNavEditorCtrl(NavEditorGui, EditorGuiGroup) {
|
|||
VertSizing = "bottom";
|
||||
Extent = "182 18";
|
||||
text = "Rebuild tile";
|
||||
command = "NavEditorGui.buildTile();";
|
||||
command = "NavMeshTools->TileTool.buildTile();";
|
||||
};
|
||||
};
|
||||
new GuiStackControl()
|
||||
|
|
|
|||
|
|
@ -57,6 +57,16 @@ function initializeNavEditor()
|
|||
editorGui = NavEditorGui;
|
||||
};
|
||||
|
||||
new SimSet(NavMeshTools)
|
||||
{
|
||||
new TileTool()
|
||||
{
|
||||
internalName = "TileTool";
|
||||
toolTip = "Tile selection tool";
|
||||
buttonImage = "ToolsModule:select_bounds_n_image";
|
||||
};
|
||||
};
|
||||
|
||||
// Bind shortcuts for the nav editor.
|
||||
%map = new ActionMap();
|
||||
%map.bindCmd(keyboard, "1", "ENavEditorSelectModeBtn.performClick();", "");
|
||||
|
|
@ -118,12 +128,13 @@ function EditorGui::SetNavPalletBar()
|
|||
EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);
|
||||
|
||||
//Adds a button to the pallete stack
|
||||
//Name Icon Click Command Tooltip text Keybind
|
||||
EWToolsPaletteWindow.addButton("ViewNavMesh", "ToolsModule:visibility_toggle_n_image", "NavEditorGui.prepSelectionMode();", "", "View NavMesh", "1");
|
||||
EWToolsPaletteWindow.addButton("LinkMode", "ToolsModule:nav_link_n_image", "NavEditorGui.setMode(\"LinkMode\");", "", "Create off-mesh links", "2");
|
||||
EWToolsPaletteWindow.addButton("CoverMode", "ToolsModule:nav_cover_n_image", "NavEditorGui.setMode(\"CoverMode\");", "", "Edit cover", "3");
|
||||
EWToolsPaletteWindow.addButton("TileMode", "ToolsModule:select_bounds_n_image", "NavEditorGui.setMode(\"TileMode\");", "", "View tiles", "4");
|
||||
EWToolsPaletteWindow.addButton("TestMode", "ToolsModule:3rd_person_camera_n_image", "NavEditorGui.setMode(\"TestMode\");", "", "Test pathfinding", "5");
|
||||
//Name Icon Click Command Tooltip text Keybind
|
||||
EWToolsPaletteWindow.addButton("ViewNavMesh", "ToolsModule:visibility_toggle_n_image", "NavEditorGui.prepSelectionMode();", "", "View NavMesh", "1");
|
||||
// EWToolsPaletteWindow.addButton("LinkMode", "ToolsModule:nav_link_n_image", "NavEditorGui.setMode(\"LinkMode\");", "", "Create off-mesh links", "2");
|
||||
// EWToolsPaletteWindow.addButton("CoverMode", "ToolsModule:nav_cover_n_image", "NavEditorGui.setMode(\"CoverMode\");", "","Edit cover", "3");
|
||||
// EWToolsPaletteWindow.addButton("TileMode", "ToolsModule:select_bounds_n_image", "NavEditorGui.setMode(\"TileMode\");", "", "View tiles", "4");
|
||||
// EWToolsPaletteWindow.addButton("TestMode", "ToolsModule:3rd_person_camera_n_image", "NavEditorGui.setMode(\"TestMode\");", "", "Test pathfinding", "5");
|
||||
EWToolsPaletteWindow.addButton("TileMode", "ToolsModule:select_bounds_n_image", "NavEditorGui.setActiveTool(NavMeshTools->TileTool);" , "", "View and Edit Tiles", "4");
|
||||
EWToolsPaletteWindow.refresh();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,6 +298,44 @@ function NavEditorGui::showSidePanel()
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function TileTool::onActivated(%this)
|
||||
{
|
||||
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);
|
||||
|
||||
%properties = NavEditorOptionsWindow->PropertiesBox;
|
||||
%properties->LinkProperties.setVisible(false);
|
||||
%properties->TileProperties.setVisible(false);
|
||||
%properties->TestProperties.setVisible(false);
|
||||
|
||||
%actions->TileActions.setVisible(true);
|
||||
%properties->TileProperties.setVisible(true);
|
||||
}
|
||||
|
||||
function TileTool::onDeactivated(%this)
|
||||
{
|
||||
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);
|
||||
|
||||
%properties = NavEditorOptionsWindow->PropertiesBox;
|
||||
%properties->LinkProperties.setVisible(false);
|
||||
%properties->TileProperties.setVisible(false);
|
||||
%properties->TestProperties.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
function NavEditorGui::onModeSet(%this, %mode)
|
||||
{
|
||||
// Callback when the nav editor changes mode. Set the appropriate dynamic
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue