Implementation of Nils' UI work for updated theming, functionality and style for the editors suite

This commit is contained in:
Areloch 2023-09-08 22:44:18 -05:00
parent dc1d6e7d9d
commit 33f35d35d4
908 changed files with 15381 additions and 3065 deletions

View file

@ -47,10 +47,10 @@ $guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) {
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209
SPC getWord(EditorGuiToolbar.extent, 1) - 1;
Extent = "210 167";
MinExtent = "210 100";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + 6;
Extent = "360 167";
MinExtent = "300 100";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
@ -70,12 +70,12 @@ $guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) {
minSize = "50 50";
closeCommand = "EditorGui.setEditor( WorldEditorInspectorPlugin );";
EdgeSnap = "1";
text = "ConvexShapes";
text = ":: Convex Shape Editor";
new GuiContainer(){
profile = "ToolsGuiDefaultProfile";
Position = "5 25";
Extent = "200 120";
Extent = "290 120";
Docking = "Client";
Margin = "3 1 3 3 ";
HorizSizing = "width";
@ -90,7 +90,7 @@ $guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "200 118";
Extent = "290 118";
MinExtent = "8 8";
canSave = "1";
isDecoy = "0";
@ -121,7 +121,7 @@ $guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) {
HorizSizing = "right";
VertSizing = "bottom";
Position = "1 1";
Extent = "193 21";
Extent = "283 21";
MinExtent = "8 8";
canSave = "1";
Visible = "1";

View file

@ -42,6 +42,23 @@ function ConvexEditorGui::onWake( %this )
ConvexEditorOptionsWindow.activeMaterial = %mat;
}
%fluidWindow = ConvexEditorOptionsWindow;
if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1)
{
// Let's dock the side panel to the right side
%this.docked = false;
%this.resizing = true;
%this.dockSidePanel();
}
else
{
// Let's release the side panel so it can be moved
%this.docked = true;
%this.resizing = false;
%this.releaseSidePanel();
}
}
function ConvexEditorGui::onSleep( %this )
@ -246,3 +263,183 @@ function ESettingsWindow::getConvexEditorSettings(%this)
"The default material when creating a convexShape");
SettingsInspector.endGroup();
}
//-----------------------------------------------------------------------------
function ConvexEditorGui::maxSize(%this, %window)
{
// Resize the windows to the max height
// and force these to the right side if set
if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1 && %this.resizing == true)
{
// prevent onResize after a resize
%this.resizing = false;
%fluidWindow = ConvexEditorOptionsWindow;
%top = EditorGuiToolbar.extent.y + 6;
%bottom = %top + 65 - 6;
%position = Canvas.extent.x - %fluidWindow.extent.x SPC %top;
%extent = %window.extent.x SPC Canvas.extent.y - %bottom;
%fluidWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
// --- AssetBrowser window ----------------------------------------------
if(isObject(AssetBrowserWindow))
{
// Only resize the AssetBrowser if it's docked
if(AssetBrowserWindow.docked == true)
{
// The width is relative to the sidepanel
%browserWidth = Canvas.extent.x - %extent.x;
%browserHeight = AssetBrowserWindow.extent.y;
%browserPosY = Canvas.extent.y - AssetBrowserWindow.extent.y - 33;
AssetBrowserWindow.resize(0, %browserPosY, %browserWidth, %browserHeight);
}
}
// --- Windowed Console --------------------------------------------------
if(isObject(windowConsoleControl))
{
// Only resize the AssetBrowser if it's docked
if(windowConsoleControl.docked == true)
{
// The width is relative to the sidepanel
%consoleWidth = Canvas.extent.x - %extent.x;
%consoleHeight = windowConsoleControl.extent.y;
%consolePosY = Canvas.extent.y - windowConsoleControl.extent.y - 33;
windowConsoleControl.resize(0, %consolePosY, %consoleWidth, %consoleHeight);
}
}
}
}
function ConvexEditorOptionsWindow::onMouseDragged(%this)
{
%parent = ConvexEditorGui;
if(%parent.panelHidden == true)
{
%parent.showSidePanel();
}
if(%parent.resizing == false && %parent.docked == true)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}
function ConvexEditorGui::onResize(%this, %newPosition, %newExtent)
{
// Window to focus on (mostly the fluid window)
%window = ConvexEditorOptionsWindow;
if(%window.panelHidden == true)
{
%window.showSidePanel();
}
if(%this.resizing == false && %this.docked == true)
{
// Only resize once
%this.resizing = true;
%this.maxSize(%window);
}
}
function ConvexEditorGui::dockSidePanel()
{
%parent = ConvexEditorGui;
%fluidWindow = ConvexEditorOptionsWindow;
if(%parent.docked == true)
return;
// Move and resize the window(s)
%parent.resizing = true;
%parent.maxSize(%fluidWindow);
%parent.docked = true;
%fluidWindow.onMouseDragged();
// Lock the windows in place
%fluidWindow.canCollapse = "0";
%fluidWindow.canMove = "0";
ConvexEditorGui_UnDockBtn.Visible = "1";
ConvexEditorGui_DockBtn.Visible = "0";
ConvexEditorGui_showBtn.Visible = "0";
ConvexEditorGui_hideBtn.Visible = "1";
}
function ConvexEditorGui::releaseSidePanel()
{
%parent = ConvexEditorGui;
%fluidWindow = ConvexEditorOptionsWindow;
if(%parent.docked == false)
return;
%fluidWindow.canCollapse = "1";
%fluidWindow.canMove = "1";
ConvexEditorGui_UnDockBtn.Visible = "0";
ConvexEditorGui_DockBtn.Visible = "1";
ConvexEditorGui_showBtn.Visible = "0";
ConvexEditorGui_hideBtn.Visible = "0";
// Let's do a small resize so it's visually clear we're undocking
%position = %fluidWindow.position.x - 6 SPC %fluidWindow.position.y + 6;
%extent = %fluidWindow.extent.x SPC %fluidWindow.extent.y - 12;
%fluidWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
%parent.docked = false;
%parent.resizing = false;
}
function ConvexEditorGui::hideSidePanel()
{
%parent = ConvexEditorGui;
%fluidWindow = ConvexEditorOptionsWindow;
ConvexEditorGui_showBtn.Visible = "1";
ConvexEditorGui_hideBtn.Visible = "0";
// hide the content of the panels
%fluidWindow.titleText = %fluidWindow.text;
%fluidWindow.text = "";
ConvexEditorOptionsPanel.Visible = "0";
ConvexEditorUVPanel.Visible = "0";
ConvexEditorAdvPanel.Visible = "0";
// Let's do a resize so that the panel is collapsed to the side
%position = Canvas.extent.x - 24 SPC %fluidWindow.position.y;
%extent = %fluidWindow.extent.x SPC %fluidWindow.extent.y;
%fluidWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
%parent.panelHidden = true;
}
function ConvexEditorGui::showSidePanel()
{
%parent = ConvexEditorGui;
%fluidWindow = ConvexEditorOptionsWindow;
ConvexEditorGui_showBtn.Visible = "0";
ConvexEditorGui_hideBtn.Visible = "1";
%fluidWindow.text = %fluidWindow.titleText;
ConvexEditorOptionsPanel.Visible = "1";
ConvexEditorUVPanel.Visible = "1";
ConvexEditorAdvPanel.Visible = "1";
%parent.resizing = true;
%parent.maxSize(%fluidWindow);
%parent.panelHidden = false;
}
//-----------------------------------------------------------------------------

View file

@ -5,7 +5,7 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
extent = "800 600";
new GuiWindowCollapseCtrl(ConvexEditorOptionsWindow) {
text = "Properties";
text = ":: Sketch Tool - Properties";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
@ -21,10 +21,10 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
Position = Canvas.extent.x - 209
SPC getWord(EditorGuiToolbar.extent, 1) - 2;
Extent = "210 550";
minExtent = "210 298";
Position = firstWord($pref::Video::mode) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + 6;
Extent = "360" SPC getWord($pref::Video::mode, 1) - getWord(EditorGuiToolbar.extent, 1) - 65;
minExtent = "300 298";
horizSizing = "windowRelative";
vertSizing = "windowRelative";
profile = "ToolsGuiWindowProfile";
@ -36,10 +36,104 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
internalName = "window";
canSave = "1";
canSaveDynamicFields = "1";
enabled = "1";
minSize = "50 50";
enabled = "1";
minSize = "50 50";
// window / panel buttons
new GuiBitmapButtonCtrl(ConvexEditorGui_UnDockBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "330 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "0";
Command = "ConvexEditorGui.releaseSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Detach Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_undock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(ConvexEditorGui_DockBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "330 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "0";
Command = "ConvexEditorGui.dockSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Dock Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_dock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(ConvexEditorGui_HideBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "312 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "ConvexEditorGui.hideSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Hide Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_hide_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(ConvexEditorGui_ShowBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "4 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "ConvexEditorGui.showSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Show Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_show_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiContainer() {
new GuiContainer(ConvexEditorOptionsPanel) {
docking = "Top";
margin = "3 3 3 3";
padding = "0 0 0 0";
@ -259,7 +353,7 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
class = "ConvexEditorDefaultMaterialBtn";
};
};
new GuiContainer() {
new GuiContainer(ConvexEditorUVPanel) {
docking = "Top";
margin = "0 0 3 3";
padding = "0 0 0 0";
@ -745,8 +839,7 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
};
};
};
new GuiContainer() {
new GuiContainer(ConvexEditorAdvPanel) {
docking = "Top";
margin = "0 0 3 3";
padding = "0 0 0 0";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 678 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 633 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 417 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 443 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 466 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 407 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 428 B

Before After
Before After