Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix several missing palletbars #1345

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Templates/BaseGame/game/tools/convexEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function ConvexEditorPlugin::onActivated( %this )
%this.setGridSnap( EWorldEditor.UseGridSnap );

Parent::onActivated( %this );
EditorGui.SetStandardPalletBar();
}

function ConvexEditorPlugin::onDeactivated( %this )
Expand Down
19 changes: 19 additions & 0 deletions Templates/BaseGame/game/tools/decalEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ function DecalEditorPlugin::onWorldEditorStartup( %this )
%this.paletteSelection = "AddDecalMode";
}

function EditorGui::SetDecalPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("SelectDecal", "ToolsModule:arrow_n_image", "DecalEditorGui.setMode(\"SelectDecalMode\");", "", "Select Decal", "1");
EWToolsPaletteWindow.addButton("MoveDecal", "ToolsModule:move_point_n_image", "DecalEditorGui.setMode(\"MoveDecalMode\");", "", "Move Decal", "2");
EWToolsPaletteWindow.addButton("RotateDecal", "ToolsModule:rotate_point_n_image", "DecalEditorGui.setMode(\"RotateDecalMode\");", "", "Rotate Decal", "3");
EWToolsPaletteWindow.addButton("ScaleDecal", "ToolsModule:scale_point_n_image", "DecalEditorGui.setMode(\"ScaleDecalMode\");", "", "Scale Decal", "4");
EWToolsPaletteWindow.addButton("AddDecal", "ToolsModule:add_decal_n_image", "DecalEditorGui.setMode(\"AddDecalMode\");", "", "Add Decal", "5");
EWToolsPaletteWindow.refresh();
}

function DecalEditorPlugin::onActivated( %this )
{
EditorGui.bringToFront( DecalEditorGui );
Expand Down Expand Up @@ -119,6 +137,7 @@ function DecalEditorPlugin::onActivated( %this )
//ShapeEdPropWindow.syncNodeDetails(-1);

Parent::onActivated(%this);
EditorGui.SetDecalPalletBar();
}

function DecalEditorPlugin::onDeactivated( %this )
Expand Down
23 changes: 22 additions & 1 deletion Templates/BaseGame/game/tools/forestEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ function ForestEditorPlugin::onWorldEditorShutdown( %this )
ForestDataManager.delete();
}

function EditorGui::SetForestPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("SelectItem", "ToolsModule:arrow_n_image", "GlobalGizmoProfile.mode = \"None\"; ForestEditorGui.setActiveTool(ForestTools->SelectionTool);", "", "Select Item", "1");
EWToolsPaletteWindow.addButton("MoveItem", "ToolsModule:translate_n_image", "GlobalGizmoProfile.mode = \"Move\"; ForestEditorGui.setActiveTool(ForestTools->SelectionTool);", "", "Move Item", "2");
EWToolsPaletteWindow.addButton("RotateItem", "ToolsModule:rotate_n_image", "GlobalGizmoProfile.mode = \"Rotate\"; ForestEditorGui.setActiveTool(ForestTools->SelectionTool);", "", "Rotate Item", "3");
EWToolsPaletteWindow.addButton("ScaleItem", "ToolsModule:scale_n_image", "GlobalGizmoProfile.mode = \"Scale\"; ForestEditorGui.setActiveTool(ForestTools->SelectionTool);", "", "Scale Item", "4");
EWToolsPaletteWindow.addButton("Paint", "ToolsModule:paint_forest_btn_n_image", "ForestEditorGui.setActiveTool( ForestTools->BrushTool ); ForestTools->BrushTool.mode = \"Paint\";", "", "Paint", "5");
EWToolsPaletteWindow.addButton("EraseAll", "ToolsModule:erase_all_btn_n_image", "ForestEditorGui.setActiveTool( ForestTools->BrushTool ); ForestTools->BrushTool.mode = \"Erase\";", "", "Erase All", "6");
EWToolsPaletteWindow.addButton("EraseSelected", "ToolsModule:erase_element_btn_n_image", "ForestEditorGui.setActiveTool( ForestTools->BrushTool ); ForestTools->BrushTool.mode = \"EraseSelected\";", "", "Erase Selected", "7");
EWToolsPaletteWindow.refresh();
}

function ForestEditorPlugin::onActivated( %this )
{
EditorGui.bringToFront( ForestEditorGui );
Expand All @@ -133,7 +153,8 @@ function ForestEditorPlugin::onActivated( %this )
}

%this.map.push();
Parent::onActivated(%this);
Parent::onActivated(%this);
EditorGui.SetForestPalletBar();

ForestEditBrushTree.open( ForestBrushSet );
ForestEditMeshTree.open( ForestItemDataSet );
Expand Down
22 changes: 22 additions & 0 deletions Templates/BaseGame/game/tools/meshRoadEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,27 @@ function MeshRoadEditorPlugin::onWorldEditorStartup( %this )
ESettingsWindow.addEditorSettingsPage("MeshRoadEditor", "Mesh Road Editor");
}

function EditorGui::SetMeshRoadPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "MeshRoadEditorGui.prepSelectionMode();", "", "Select Arrow", "1");
EWToolsPaletteWindow.addButton("Move", "ToolsModule:translate_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorMoveMode\");", "", "Move Selection", "2");
EWToolsPaletteWindow.addButton("Rotate", "ToolsModule:rotate_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorRotateMode\");", "", "Rotate Selection", "3");
EWToolsPaletteWindow.addButton("Scale", "ToolsModule:Scale_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorScaleMode\");", "", "Scale Selection", "4");
EWToolsPaletteWindow.addButton("Add", "ToolsModule:add_mesh_road_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorAddRoadMode\");", "", "Create Road", "5");
EWToolsPaletteWindow.addButton("Insert", "ToolsModule:add_point_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorInsertPointMode\");", "", "Insert Point", "+");
EWToolsPaletteWindow.addButton("Remove", "ToolsModule:subtract_point_n_image", "MeshRoadEditorGui.setMode(\"MeshRoadEditorRemovePointMode\");", "", "Remove Point", "-");

EWToolsPaletteWindow.refresh();
}

function MeshRoadEditorPlugin::onActivated( %this )
{
%this.readSettings();
Expand Down Expand Up @@ -116,6 +137,7 @@ function MeshRoadEditorPlugin::onActivated( %this )
EditorGuiStatusBar.setSelection("");

Parent::onActivated(%this);
EditorGui.SetMeshRoadPalletBar();
}

function MeshRoadEditorPlugin::onDeactivated( %this )
Expand Down
19 changes: 19 additions & 0 deletions Templates/BaseGame/game/tools/navEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ function ENavEditorSettingsPage::init(%this)
%this-->SpawnClassOptions.setFirstSelected();
}

function EditorGui::SetNavPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

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");
EWToolsPaletteWindow.refresh();
}

function NavEditorPlugin::onActivated(%this)
{
%this.readSettings();
Expand Down Expand Up @@ -157,6 +175,7 @@ function NavEditorPlugin::onActivated(%this)
NavEditorGui.onEditorActivated();

Parent::onActivated(%this);
EditorGui.SetNavPalletBar();
}

function NavEditorPlugin::onDeactivated(%this)
Expand Down
21 changes: 21 additions & 0 deletions Templates/BaseGame/game/tools/riverEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ function RiverEditorPlugin::onWorldEditorStartup( %this )
ESettingsWindow.addEditorSettingsPage("RiverEditor", "River Editor");
}

function EditorGui::SetRiverPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "RiverEditorGui.prepSelectionMode();", "", "Select River", "1");
EWToolsPaletteWindow.addButton("MovePoint", "ToolsModule:move_point_n_image", "RiverEditorGui.setMode(\"RiverEditorMoveMode\");", "", "Move Point", "2");
EWToolsPaletteWindow.addButton("RotatePoint", "ToolsModule:rotate_point_n_image", "RiverEditorGui.setMode(\"RiverEditorRotateMode\");", "", "Rotate Point", "3");
EWToolsPaletteWindow.addButton("ScalePoint", "ToolsModule:scale_point_n_image", "RiverEditorGui.setMode(\"RiverEditorScaleMode\");", "", "Scale Point", "4");
EWToolsPaletteWindow.addButton("AddRoad", "ToolsModule:add_road_path_n_image", "RiverEditorGui.setMode(\"RiverEditorAddRiverMode\");", "", "Add River", "5");
EWToolsPaletteWindow.addButton("InsertPoint", "ToolsModule:add_point_n_image", "RiverEditorGui.setMode(\"RiverEditorInsertPointMode\");", "", "Insert Point", "+");
EWToolsPaletteWindow.addButton("RemovePoint", "ToolsModule:subtract_point_n_image", "RiverEditorGui.setMode(\"RiverEditorRemovePointMode\");", "", "Remove Point", "-");
EWToolsPaletteWindow.refresh();
}

function RiverEditorPlugin::onActivated( %this )
{
%this.readSettings();
Expand Down Expand Up @@ -123,6 +143,7 @@ function RiverEditorPlugin::onActivated( %this )
RiverEditorGui.onEditorActivated();

Parent::onActivated(%this);
EditorGui.SetRiverPalletBar();
}

function RiverEditorPlugin::onDeactivated( %this )
Expand Down
20 changes: 20 additions & 0 deletions Templates/BaseGame/game/tools/roadEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ function RoadEditorPlugin::onWorldEditorStartup( %this )
ESettingsWindow.addEditorSettingsPage("RoadEditor", "Decal Road Editor");
}

function EditorGui::SetRoadPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "RoadEditorGui.prepSelectionMode();", "", "Select Road", "1");
EWToolsPaletteWindow.addButton("MovePoint", "ToolsModule:move_point_n_image", "RoadEditorGui.setMode(\"RoadEditorMoveMode\");", "", "Move Point", "2");
EWToolsPaletteWindow.addButton("ScalePoint", "ToolsModule:scale_point_n_image", "RoadEditorGui.setMode(\"RoadEditorScaleMode\");", "", "Scale Point", "3");
EWToolsPaletteWindow.addButton("AddRoad", "ToolsModule:add_road_path_n_image", "RoadEditorGui.setMode(\"RoadEditorAddRoadMode\");", "", "Add Road", "4");
EWToolsPaletteWindow.addButton("InsertPoint", "ToolsModule:add_point_n_image", "RoadEditorGui.setMode(\"RoadEditorInsertPointMode\");", "", "Insert Point", "+");
EWToolsPaletteWindow.addButton("RemovePoint", "ToolsModule:subtract_point_n_image", "RoadEditorGui.setMode(\"RoadEditorRemovePointMode\");", "", "Remove Point", "-");
EWToolsPaletteWindow.refresh();
}

function RoadEditorPlugin::onActivated( %this )
{
%this.readSettings();
Expand All @@ -109,6 +128,7 @@ function RoadEditorPlugin::onActivated( %this )
EditorGuiStatusBar.setSelection("");

Parent::onActivated(%this);
EditorGui.SetRoadPalletBar();
}

function RoadEditorPlugin::onDeactivated( %this )
Expand Down
18 changes: 18 additions & 0 deletions Templates/BaseGame/game/tools/shapeEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,23 @@ function ShapeEditorPlugin::open(%this, %shapeAsset)
}
}

function EditorGui::SetShapePalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "GlobalGizmoProfile.mode = \"None\";", "", "Select Arrow", "1");
EWToolsPaletteWindow.addButton("MoveSelection", "ToolsModule:move_point_n_image", "GlobalGizmoProfile.mode = \"Move\";", "", "Move", "2");
EWToolsPaletteWindow.addButton("RotateSelection", "ToolsModule:rotate_point_n_image", "GlobalGizmoProfile.mode = \"Rotate\";", "", "Rotate", "3");
EWToolsPaletteWindow.addButton("RotateSun", "ToolsModule:sun_btn_n_image", "ShapeEdShapeView.editSun = !ShapeEdShapeView.editSun;", "", "Rotate sun", "4");
EWToolsPaletteWindow.refresh();
}

function ShapeEditorPlugin::onActivated(%this)
{
%this.open("");
Expand Down Expand Up @@ -255,6 +272,7 @@ function ShapeEditorPlugin::onActivated(%this)

EditorGuiToolbarStack.remove( EWorldEditorToolbar );
EditorGuiToolbarStack.add( ShapeEditorToolbar );
EditorGui.SetShapePalletBar();
}

function ShapeEditorPlugin::initStatusBar(%this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,24 @@ function EditorGui::syncCameraGui( %this )
/// @name EditorPlugin Methods
/// @{

function EditorGui::SetStandardPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "EWorldEditorNoneModeBtn::onClick();", "", "Select Arrow", "1");
EWToolsPaletteWindow.addButton("Move", "ToolsModule:translate_n_image", "EWorldEditorMoveModeBtn::onClick();", "", "Move Selection", "2");
EWToolsPaletteWindow.addButton("Rotate", "ToolsModule:rotate_n_image", "EWorldEditorRotateModeBtn::onClick();", "", "Rotate Selection", "3");
EWToolsPaletteWindow.addButton("Scale", "ToolsModule:Scale_n_image", "EWorldEditorScaleModeBtn::onClick();", "", "Scale Selection", "4");

EWToolsPaletteWindow.refresh();
}

//------------------------------------------------------------------------------
// WorldEditorPlugin
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -1038,6 +1056,8 @@ function WorldEditorPlugin::onActivated( %this )
SnapToBar-->objectGridSnapBtn.setStateOn( EWorldEditor.UseGridSnap );

Parent::onActivated(%this);

EditorGui.SetStandardPalletBar();
}

function WorldEditorPlugin::onDeactivated( %this )
Expand Down Expand Up @@ -1096,21 +1116,6 @@ function WorldEditorInspectorPlugin::onActivated( %this )
{
Parent::onActivated( %this );

//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("Select", "ToolsModule:arrow_n_image", "EWorldEditorNoneModeBtn::onClick();", "", "Select Arrow", "1");
EWToolsPaletteWindow.addButton("Move", "ToolsModule:translate_n_image", "EWorldEditorMoveModeBtn::onClick();", "", "Move Selection", "2");
EWToolsPaletteWindow.addButton("Rotate", "ToolsModule:rotate_n_image", "EWorldEditorRotateModeBtn::onClick();", "", "Rotate Selection", "3");
EWToolsPaletteWindow.addButton("Scale", "ToolsModule:Scale_n_image", "EWorldEditorScaleModeBtn::onClick();", "", "Scale Selection", "4");

EWToolsPaletteWindow.refresh();

EditorGui-->InspectorWindow.setVisible( true );
EditorGui-->TreeWindow.setVisible( true );
EditorGui-->WorldEditorToolbar.setVisible( true );
Expand Down Expand Up @@ -1228,9 +1233,33 @@ function TerrainEditorPlugin::onWorldEditorStartup( %this )
};
}

function EditorGui::SetTerrainPalletBar()
{
//Clears the button pallete stack
EWToolsPaletteWindow.setStackCtrl(ToolsPaletteArray); //legacy ctrl adhereance
EWToolsPaletteWindow.clearButtons();

EWToolsPaletteWindow.setActionMap(WorldEditorInspectorPlugin.map);

//Adds a button to the pallete stack
//Name Icon Click Command Tooltip text Keybind
EWToolsPaletteWindow.addButton("AdjustHeight", "ToolsModule:brushAdjustHeight_n_image", "ETerrainEditor.switchAction( brushAdjustHeight );", "", "Grab Terrain", "1");
EWToolsPaletteWindow.addButton("RaiseHeight", "ToolsModule:raiseHeight_n_image", "ETerrainEditor.switchAction( raiseHeight );", "", "Raise Height", "2");
EWToolsPaletteWindow.addButton("LowerHeight", "ToolsModule:lowerHeight_n_image", "ETerrainEditor.switchAction( lowerHeight );", "", "Lower Height", "3");
EWToolsPaletteWindow.addButton("SmoothHeight", "ToolsModule:smoothHeight_n_image", "ETerrainEditor.switchAction( smoothHeight );", "", "Smooth Height", "4");
EWToolsPaletteWindow.addButton("SmoothSlope", "ToolsModule:softCurve_n_image", "ETerrainEditor.switchAction( smoothSlope );", "", "Smooth Slope", "5");
EWToolsPaletteWindow.addButton("PaintNoise", "ToolsModule:brushPaintNoise_n_image", "ETerrainEditor.switchAction( paintNoise );", "", "Paint Noise", "6");
EWToolsPaletteWindow.addButton("FlattenHeight", "ToolsModule:flattenHeight_n_image", "ETerrainEditor.switchAction( flattenHeight );", "", "Flatten Height", "7");
EWToolsPaletteWindow.addButton("SetHeight", "ToolsModule:setHeight_n_image", "ETerrainEditor.switchAction( setHeight );", "", "Set Height", "8");
EWToolsPaletteWindow.addButton("SetEmpty", "ToolsModule:setEmpty_n_image", "ETerrainEditor.switchAction( setEmpty );", "", "Set Empty", "9");
EWToolsPaletteWindow.addButton("ClearEmpty", "ToolsModule:clearEmpty_n_image", "ETerrainEditor.switchAction( clearEmpty );", "", "Clear Empty", "0");
EWToolsPaletteWindow.refresh();
}

function TerrainEditorPlugin::onActivated( %this )
{
Parent::onActivated( %this );
EditorGui.SetTerrainPalletBar();

EditorGui.readTerrainEditorSettings();

Expand Down Expand Up @@ -1372,6 +1401,7 @@ function TerrainPainterPlugin::onWorldEditorStartup( %this )
function TerrainPainterPlugin::onActivated( %this )
{
Parent::onActivated( %this );
WorldEditorInspectorPlugin::onActivated( %this );

EditorGui.readTerrainEditorSettings();

Expand Down
Loading