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

@ -41,6 +41,8 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
HoverNodeColor = "255 255 255 255";
new GuiWindowCollapseCtrl(RoadEditorTreeWindow) {
canCollapse = "0";
canMove = "0";
internalName = "";
canSaveDynamicFields = "0";
Enabled = "1";
@ -48,10 +50,10 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
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 200";
MinExtent = "300 200";
canSave = "1";
isDecoy = "0";
Visible = "1";
@ -71,7 +73,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Roads & Paths";
text = ":: Decal Road Editor - Roads & Paths";
/*
new GuiBitmapButtonCtrl() {
@ -122,7 +124,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
useMouseEvents = "0";
};
*/
new GuiContainer(){
new GuiContainer(RoadEditorTreeWPanel){
profile = "ToolsGuiDefaultProfile";
Position = "5 25";
Extent = "200 120";
@ -190,8 +192,103 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
};
};
};
// window / panel buttons
new GuiBitmapButtonCtrl(RoadEditorGui_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 = "RoadEditorGui.releaseSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Detach Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_undock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(RoadEditorGui_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 = "RoadEditorGui.dockSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Dock Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_dock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(RoadEditorGui_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 = "RoadEditorGui.hideSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Hide Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_hide_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(RoadEditorGui_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 = "RoadEditorGui.showSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Show Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_show_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
new GuiWindowCollapseCtrl(RoadEditorOptionsWindow) {
canCollapse = "0";
canMove = "0";
internalName = "Window";
canSaveDynamicFields = "0";
Enabled = "1";
@ -199,10 +296,10 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209 SPC
getWord(EditorGuiToolbar.extent, 1) + getWord(RoadEditorTreeWindow.extent, 1) - 2;
Extent = "210 530";
MinExtent = "210 298";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + getWord(RoadEditorTreeWindow.extent, 1) + 6;
Extent = "360" SPC getWord($pref::Video::mode, 1) - getWord(RoadEditorTreeWindow.extent, 1) - getWord(EditorGuiToolbar.extent, 1) - 65;
MinExtent = "300 300";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
@ -215,13 +312,12 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Properties";
text = ":: Decal Road Editor - Properties";
new GuiContainer(RoadEditorProperties){ //Node Properties
isContainer = "1";
@ -234,7 +330,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
Margin = "3 3 3 3";
new GuiTextCtrl(){
Profile = "ToolsGuiDefaultProfile";
Profile = "EditorTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "5 0";
@ -279,7 +375,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
AltCommand = "RoadEditorGui.editNodeDetails();";
};
};
new GuiContainer(){ //Decal Road Properties
new GuiContainer(RoadEditorPropPanel){ //Decal Road Properties
isContainer = "1";
Profile = "inspectorStyleRolloutDarkProfile";
HorizSizing = "width";
@ -290,7 +386,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
Margin = "0 0 3 3";
new GuiTextCtrl(){
Profile = "ToolsGuiDefaultProfile";
Profile = "EditorTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "5 0";
@ -299,7 +395,7 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
};
};
new GuiContainer(){
new GuiContainer(RoadEditorPropScroll){
profile = ToolsGuiDefaultProfile;
Position = "4 108";
Extent = "202 377";
@ -365,11 +461,11 @@ $guiContent = new GuiRoadEditorCtrl(RoadEditorGui) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorFieldInfoMLTextProfile";
position = "8" SPC getWord(RoadEditorOptionsWindow.extent, 1) - 40;
HorizSizing = "width";
VertSizing = "top";
Position = "1 485";
Extent = "202 42";
Extent = "330 42";
MinExtent = "8 2";
canSave = "1";
Visible = "1";

View file

@ -15,7 +15,7 @@ $guiContent = new GuiControl(RoadEditorSettingsTab,EditorGuiGroup) {
new GuiTabPageCtrl(ERoadEditorSettingsPage) {
fitBook = "1";
text = "Road Editor";
text = "Decal Road Editor";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";

View file

@ -82,7 +82,7 @@ function RoadEditorPlugin::onWorldEditorStartup( %this )
exec( "./RoadEditorSettingsTab.gui" );
//ESettingsWindow.addTabPage( ERoadEditorSettingsPage );
ESettingsWindow.addEditorSettingsPage("RoadEditor", "Road Editor");
ESettingsWindow.addEditorSettingsPage("RoadEditor", "Decal Road Editor");
}
function RoadEditorPlugin::onActivated( %this )
@ -105,7 +105,7 @@ function RoadEditorPlugin::onActivated( %this )
%this.map.push();
// Set the status bar here until all tool have been hooked up
EditorGuiStatusBar.setInfo("Road editor.");
EditorGuiStatusBar.setInfo("Decal Road Editor.");
EditorGuiStatusBar.setSelection("");
Parent::onActivated(%this);

View file

@ -24,6 +24,24 @@ function RoadEditorGui::onWake( %this )
{
$DecalRoad::EditorOpen = true;
%fixedWindow = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
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();
}
%count = EWorldEditor.getSelectionSize();
for ( %i = 0; %i < %count; %i++ )
{
@ -42,6 +60,246 @@ function RoadEditorGui::onSleep( %this )
$DecalRoad::EditorOpen = false;
}
//-----------------------------------------------------------------------------
function RoadEditorGui::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 = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
%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 RoadEditorTreeWindow::onMouseDragged(%this)
{
%parent = RoadEditorGui;
if(%parent.panelHidden == true)
{
%parent.showSidePanel();
}
if(%parent.resizing == false && %parent.docked == true)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}
function RoadEditorOptionsWindow::onMouseDragged(%this)
{
%parent = RoadEditorGui;
if(%parent.panelHidden == true)
{
%parent.showSidePanel();
}
if(%parent.resizing == false && %parent.docked == true)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}
function RoadEditorGui::onResize(%this, %newPosition, %newExtent)
{
// Window to focus on (mostly the fluid window)
%window = RoadEditorOptionsWindow;
if(%window.panelHidden == true)
{
%window.showSidePanel();
}
if(%this.resizing == false && %this.docked == true)
{
// Only resize once
%this.resizing = true;
%this.maxSize(%window);
}
}
function RoadEditorGui::dockSidePanel()
{
%parent = RoadEditorGui;
%fixedWindow = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
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";
RoadEditorGui_UnDockBtn.Visible = "1";
RoadEditorGui_DockBtn.Visible = "0";
RoadEditorGui_showBtn.Visible = "0";
RoadEditorGui_hideBtn.Visible = "1";
}
function RoadEditorGui::releaseSidePanel()
{
%parent = RoadEditorGui;
%fixedWindow = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
if(%parent.docked == false)
return;
// Unlock the windows so that be moved
%fixedWindow.canCollapse = "1";
%fixedWindow.canMove = "1";
%fluidWindow.canCollapse = "1";
%fluidWindow.canMove = "1";
RoadEditorGui_UnDockBtn.Visible = "0";
RoadEditorGui_DockBtn.Visible = "1";
RoadEditorGui_showBtn.Visible = "0";
RoadEditorGui_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 RoadEditorGui::hideSidePanel()
{
%parent = RoadEditorGui;
%fixedWindow = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
RoadEditorGui_showBtn.Visible = "1";
RoadEditorGui_hideBtn.Visible = "0";
// hide the content of the panels
%fixedWindow.titleText = %fixedWindow.text;
%fluidWindow.titleText = %fluidWindow.text;
%fixedWindow.text = "";
RoadEditorTreeWPanel.Visible = "0";
%fluidWindow.text = "";
RoadEditorProperties.Visible = "0";
RoadEditorPropPanel.Visible = "0";
RoadEditorPropScroll.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 RoadEditorGui::showSidePanel()
{
%parent = RoadEditorGui;
%fixedWindow = RoadEditorTreeWindow;
%fluidWindow = RoadEditorOptionsWindow;
RoadEditorGui_showBtn.Visible = "0";
RoadEditorGui_hideBtn.Visible = "1";
// show the content of the panels
// hide the content of the panels
%fixedWindow.text = %fixedWindow.titleText;
RoadEditorTreeWPanel.Visible = "1";
%fluidWindow.text = %fluidWindow.titleText;
RoadEditorProperties.Visible = "1";
RoadEditorPropPanel.Visible = "1";
RoadEditorPropScroll.Visible = "1";
%parent.resizing = true;
%parent.maxSize(%fluidWindow);
%parent.panelHidden = false;
}
//-----------------------------------------------------------------------------
function RoadEditorGui::paletteSync( %this, %mode )
{
%evalShortcut = "ToolsPaletteArray-->" @ %mode @ ".setStateOn(1);";
@ -182,7 +440,7 @@ function RoadInspector::onInspectorFieldModified( %this, %object, %fieldName, %a
function RoadInspector::onFieldSelected( %this, %fieldName, %fieldTypeStr, %fieldDoc )
{
RoadFieldInfoControl.setText( "<font:Arial Bold:14>" @ %fieldName @ "<font:Arial Italic:14> (" @ %fieldTypeStr @ ") " NL "<font:Arial:14>" @ %fieldDoc );
RoadFieldInfoControl.setText( "<font:" @ $Gui::fontTypeBold @ ":16>" @ %fieldName @ "<font:" @ $Gui::fontTypeItalic @ ":16> (" @ %fieldTypeStr @ ") " NL "<font:" @ $Gui::fontTypeRegular @ ":16>" @ %fieldDoc );
}
function RoadTreeView::onInspect(%this, %obj)