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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 725 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 660 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 464 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

After

Width:  |  Height:  |  Size: 757 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 677 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 476 B

Before After
Before After

View file

@ -37,16 +37,19 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
currentDecalID = "175";
Docking = "None";
new GuiWindowCollapseCtrl(DecalEditorWindow) {
new GuiWindowCollapseCtrl(DecalEditorWindow) {
canCollapse = "0";
canMove = "0";
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209 SPC getWord(EditorGuiToolbar.extent, 1) -1;
Extent = "210 600";
MinExtent = "210 100";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + 6;
Extent = "360 300";
MinExtent = "300 180";
canSave = "1";
isDecoy = "0";
Visible = "1";
@ -60,14 +63,13 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "EditorGui.setEditor( WorldEditorInspectorPlugin );";
EdgeSnap = "1";
text = "Decal Editor";
text = ":: Decal Editor";
new GuiTabBookCtrl(DecalEditorTabBook) {
canSaveDynamicFields = "0";
@ -76,7 +78,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "202 502";
Extent = "340 502";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -100,7 +102,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "202 483";
Extent = "340 483";
Docking = "client";
MinExtent = "8 2";
canSave = "1";
@ -120,7 +122,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
Margin = "0 0 0 0";
Docking = "client";
MinExtent = "0 8";
@ -131,7 +133,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
MinExtent = "0 -500";
Profile = "ToolsGuiTabBorderProfile";
};
@ -144,7 +146,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -173,7 +175,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "474 48";
Extent = "340 48";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -195,7 +197,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "202 483";
Extent = "340 483";
Docking = "client";
MinExtent = "8 2";
canSave = "1";
@ -215,7 +217,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
Margin = "0 0 0 0";
Docking = "client";
MinExtent = "0 8";
@ -226,7 +228,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
MinExtent = "0 -500";
Profile = "ToolsGuiTabBorderProfile";
};
@ -239,7 +241,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "202 483";
Extent = "340 483";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -269,7 +271,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "right";
VertSizing = "bottom";
Position = "1 1";
Extent = "200 100";
Extent = "336 100";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
@ -289,99 +291,202 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
};
};
};
// Save Button
new GuiBitmapButtonCtrl(SaveDecalsButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
new GuiContainer(DecalsButtonsGroup){
HorizSizing = "left";
VertSizing = "bottom";
position = "137 26";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
Command = "DecalPMan.saveDirty(); DecalInspector::removeDirty();";
hovertime = "1000";
groupNum = "-1";
text ="";
tooltip = "Save All";
buttonType = "PushButton";
useMouseEvents = "0";
bitmapAsset = "ToolsModule:save_icon_n_image";
};
Position = "240 0";
Extent = "110 55";
Docking = "none";
new GuiBitmapButtonCtrl(RetargetDecalButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "157 26";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
tooltip = "Retarget missing decals to an existing decal datablock";
bitmapAsset = "ToolsModule:retarget_btn_n_image";
buttonType = "PushButton";
useMouseEvents = "0";
// Save Button
new GuiBitmapButtonCtrl(SaveDecalsButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "37 24";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
Command = "DecalPMan.saveDirty(); DecalInspector::removeDirty();";
hovertime = "1000";
groupNum = "-1";
text ="";
tooltip = "Save All";
buttonType = "PushButton";
useMouseEvents = "0";
bitmapAsset = "ToolsModule:save_icon_n_image";
};
new GuiBitmapButtonCtrl(RetargetDecalButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "57 24";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
tooltip = "Retarget missing decals to an existing decal datablock";
bitmapAsset = "ToolsModule:retarget_btn_n_image";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(NewDecalButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "76 24";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
tooltip = "Create New Decal Template";
bitmapAsset = "ToolsModule:new_n_image";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(DeleteDecalButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "92 24";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
text = "";
tooltip = "Delete Selected Decal Template";
bitmapAsset = "ToolsModule:delete_n_image";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
tabSelected = "0";
};
};
new GuiBitmapButtonCtrl(NewDecalButton) {
// window / panel buttons
new GuiBitmapButtonCtrl(DecalEditorGui_UnDockBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "177 26";
Extent = "16 16";
MinExtent = "8 2";
Position = "330 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
isDecoy = "0";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
tooltip = "Create New Decal Template";
bitmapAsset = "ToolsModule:new_n_image";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(DeleteDecalButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "190 26";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
Visible = "1";
Visible = "0";
Command = "DecalEditorGui.releaseSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Detach Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_undock_n_image";
text = "";
tooltip = "Delete Selected Decal Template";
bitmapAsset = "ToolsModule:delete_n_image";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
tabSelected = "0";
};
new GuiBitmapButtonCtrl(DecalEditorGui_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 = "DecalEditorGui.dockSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Dock Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_dock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(DecalEditorGui_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 = "DecalEditorGui.hideSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Hide Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_hide_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(DecalEditorGui_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 = "DecalEditorGui.showSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Show Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_show_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
new GuiWindowCollapseCtrl(DecalPreviewWindow) {
canCollapse = "0";
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
@ -389,9 +494,10 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209 SPC getWord(EditorGuiToolbar.extent, 1) + getWord(DecalEditorWindow.extent, 1) - 2;
Extent = "210 335";
MinExtent = "210 335";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + getWord(DecalEditorWindow.extent, 1) + 6;
Extent = "360" SPC getWord($pref::Video::mode, 1) - getWord(DecalEditorWindow.extent, 1) - getWord(EditorGuiToolbar.extent, 1) - 65;
MinExtent = "300 240";
canSave = "1";
Visible = "0";
hovertime = "1000";
@ -404,14 +510,14 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "152 235";
closeCommand = "EPainter.parentGroup.setVisible(false);";
EdgeSnap = "1";
text = "Decal Properties";
text = ":: Decal Properties";
new GuiScrollCtrl(DecalEditorTemplateProperties){
canSaveDynamicFields = "0";
@ -421,7 +527,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
VertSizing = "bottom";
HorizSizing = "width";
Position = "4 24";
Extent = "202 259";
Extent = "340 259";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -452,7 +558,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "189 0";
Extent = "340 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -467,7 +573,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "208 0";
Extent = "320 0";
Caption = "Decal Instance Preview";
Margin = "0 0 0 -3";
DragSizable = false;
@ -483,7 +589,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "208 0";
Extent = "320 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -495,7 +601,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "-1 0";
Extent = "202 187";
Extent = "320 258";
Docking = "none";
new GuiBitmapCtrl() {
@ -505,9 +611,9 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "center";
VertSizing = "height";
VertSizing = "bottom";
Position = "0 0";
Extent = "188 186";
Extent = "256 256";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -523,9 +629,9 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "center";
VertSizing = "height";
VertSizing = "bottom";
Position = "0 0";
Extent = "188 186";
Extent = "257 257";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -545,7 +651,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "202 0";
Extent = "340 0";
Caption = "Decal Instance Properties";
Margin = "0 0 0 0";
DragSizable = false;
@ -561,7 +667,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "208 0";
Extent = "340 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -661,7 +767,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
VertSizing = "bottom";
HorizSizing = "width";
Position = "4 24";
Extent = "202 259";
Extent = "340 259";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -692,7 +798,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "187 0";
Extent = "320 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -707,7 +813,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "208 0";
Extent = "320 0";
Caption = "Decal Template Preview";
Margin = "0 0 0 -3";
DragSizable = false;
@ -723,7 +829,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "208 0";
Extent = "320 0";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -735,7 +841,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "-1 0";
Extent = "202 187";
Extent = "320 258";
Docking = "none";
new GuiBitmapCtrl() {
@ -745,9 +851,9 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "center";
VertSizing = "height";
VertSizing = "bottom";
Position = "0 0";
Extent = "188 186";
Extent = "256 256";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -763,9 +869,9 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "center";
VertSizing = "height";
VertSizing = "bottom";
Position = "0 0";
Extent = "188 186";
Extent = "257 257";
MinExtent = "8 2";
canSave = "1";
isDecoy = "0";
@ -785,7 +891,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 0";
Extent = "202 0";
Extent = "340 0";
Caption = "Decal Template Properties";
Margin = "0 0 0 0";
DragSizable = false;
@ -803,7 +909,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) {
HorizSizing = "width";
VertSizing = "bottom";
Position = "1 1";
Extent = "200 257";
Extent = "320 257";
MinExtent = "16 16";
canSave = "1";
isDecoy = "0";

View file

@ -20,10 +20,264 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
function DecalEditorGui::onWake( %this )
{
//-----------------------------------------------------------------------------
function DecalEditorGui::onWake(%this)
{
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
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 DecalEditorGui::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;
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
%top = EditorGuiToolbar.extent.y + 6;
%bottom = %top + 65 - 6;
%maxHeight = Canvas.extent.y - %top - %bottom;
// --- Fixed window (top) ------------------------------------------------
// put it back if it moved
%fixedWindow.position.x = Canvas.extent.x - %fixedWindow.extent.x;
%fixedWindow.position.y = %top;
// don't go beyond the canvas
if(%fixedWindow.extent.y > %maxHeight)
%fixedWindow.extent.y = %maxHeight - %fluidWindow.extent.y;
%position = %fixedWindow.position.x SPC %fixedWindow.position.y;
%extent = %window.extent.x SPC %fixedWindow.extent.y;
%fixedWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
// --- Fluid window (bottom) ---------------------------------------------
// position is relative to the top window
%position = %fixedWindow.position.x SPC %fixedWindow.extent.y + %top;
%extent = %window.extent.x SPC Canvas.extent.y - %fixedWindow.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 DecalEditorWindow::onMouseDragged(%this)
{
%parent = DecalEditorGui;
if(%parent.panelHidden == true)
{
%parent.showSidePanel();
}
if(%parent.resizing == false && %parent.docked == true)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}
function DecalPreviewWindow::onMouseDragged(%this)
{
%parent = DecalEditorGui;
if(%parent.panelHidden == true)
{
%parent.showSidePanel();
}
if(%parent.resizing == false && %parent.docked == true)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}
function DecalEditorGui::onResize(%this, %newPosition, %newExtent)
{
// Window to focus on (mostly the fluid window)
%window = DecalPreviewWindow;
if(%window.panelHidden == true)
{
%window.showSidePanel();
}
if(%this.resizing == false && %this.docked == true)
{
// Only resize once
%this.resizing = true;
%this.maxSize(%window);
}
}
function DecalEditorGui::dockSidePanel()
{
%parent = DecalEditorGui;
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
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
%fixedWindow.canCollapse = "0";
%fixedWindow.canMove = "0";
%fluidWindow.canCollapse = "0";
%fluidWindow.canMove = "0";
DecalEditorGui_UnDockBtn.Visible = "1";
DecalEditorGui_DockBtn.Visible = "0";
DecalEditorGui_showBtn.Visible = "0";
DecalEditorGui_hideBtn.Visible = "1";
}
function DecalEditorGui::releaseSidePanel()
{
%parent = DecalEditorGui;
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
if(%parent.docked == false)
return;
// Unlock the windows so that be moved
%fixedWindow.canCollapse = "1";
%fixedWindow.canMove = "1";
%fluidWindow.canCollapse = "1";
%fluidWindow.canMove = "1";
DecalEditorGui_UnDockBtn.Visible = "0";
DecalEditorGui_DockBtn.Visible = "1";
DecalEditorGui_showBtn.Visible = "0";
DecalEditorGui_hideBtn.Visible = "0";
// Let's do a small resize so it's visually clear we're undocking
%position = %fixedWindow.position.x - 6 SPC %fixedWindow.position.y + 6;
%extent = %fixedWindow.extent.x SPC %fixedWindow.extent.y;
%fixedWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
%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 DecalEditorGui::hideSidePanel()
{
%parent = DecalEditorGui;
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
DecalEditorGui_showBtn.Visible = "1";
DecalEditorGui_hideBtn.Visible = "0";
// hide the content of the panels
%fixedWindow.titleText = %fixedWindow.text;
%fluidWindow.titleText = %fluidWindow.text;
%fixedWindow.text = "";
DecalEditorTabBook.Visible = "0";
%fluidWindow.text = "";
DecalEditorTemplateProperties.Visible = "0";
DecalEditorLibraryProperties.Visible = "0";
// Let's do a resize so that the panel is collapsed to the side
%position = Canvas.extent.x - 24 SPC %fixedWindow.position.y;
%extent = %fixedWindow.extent.x SPC %fixedWindow.extent.y;
%fixedWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
%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 DecalEditorGui::showSidePanel()
{
%parent = DecalEditorGui;
%fixedWindow = DecalEditorWindow;
%fluidWindow = DecalPreviewWindow;
DecalEditorGui_showBtn.Visible = "0";
DecalEditorGui_hideBtn.Visible = "1";
// show the content of the panels
%fixedWindow.text = %fixedWindow.titleText;
DecalEditorTabBook.Visible = "1";
%fluidWindow.text = %fluidWindow.titleText;
DecalEditorTemplateProperties.Visible = "1";
DecalEditorLibraryProperties.Visible = "1";
%parent.resizing = true;
%parent.maxSize(%fluidWindow);
%parent.panelHidden = false;
}
//-----------------------------------------------------------------------------
function DecalEditorGui::onSelectInstance( %this, %decalId, %lookupName )
{
if( DecalEditorGui.selDecalInstanceId == %decalId )
@ -232,7 +486,7 @@ function DecalEditorTabBook::onTabSelected( %this, %text, %idx )
{
if( %idx == 0)
{
DecalPreviewWindow.text = "Template Properties";
DecalPreviewWindow.text = ":: Decal Editor - Template Properties";
DecalEditorLibraryProperties.setVisible(true);
DecalEditorTemplateProperties.setVisible(false);
RetargetDecalButton.setVisible( true );
@ -242,7 +496,7 @@ function DecalEditorTabBook::onTabSelected( %this, %text, %idx )
}
else
{
DecalPreviewWindow.text = "Instance Properties";
DecalPreviewWindow.text = ":: Decal Editor - Instance Properties";
RetargetDecalButton.setVisible( false );
NewDecalButton.setVisible( false );
SaveDecalsButton.setVisible( false );