Skip to content

Commit

Permalink
fix several missing palletbars
Browse files Browse the repository at this point in the history
todos:
verify this doesn't mess with keybindings
need either a general spline variation, or bespoke per-tool module
  • Loading branch information
Azaezel committed Dec 29, 2024
1 parent 69fa4b3 commit 9cdc355
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
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
1 change: 1 addition & 0 deletions Templates/BaseGame/game/tools/decalEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function DecalEditorPlugin::onActivated( %this )
//ShapeEdPropWindow.syncNodeDetails(-1);

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

function DecalEditorPlugin::onDeactivated( %this )
Expand Down
3 changes: 2 additions & 1 deletion Templates/BaseGame/game/tools/forestEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ function ForestEditorPlugin::onActivated( %this )
}

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

ForestEditBrushTree.open( ForestBrushSet );
ForestEditMeshTree.open( ForestItemDataSet );
Expand Down
1 change: 1 addition & 0 deletions Templates/BaseGame/game/tools/navEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function NavEditorPlugin::onActivated(%this)
NavEditorGui.onEditorActivated();

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

function NavEditorPlugin::onDeactivated(%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 @@ -1231,6 +1236,7 @@ function TerrainEditorPlugin::onWorldEditorStartup( %this )
function TerrainEditorPlugin::onActivated( %this )
{
Parent::onActivated( %this );
WorldEditorInspectorPlugin::onActivated( %this );

EditorGui.readTerrainEditorSettings();

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

EditorGui.readTerrainEditorSettings();

Expand Down

0 comments on commit 9cdc355

Please sign in to comment.