Merge branch 'ModernEditorLayoutWIP' of https://github.com/Areloch/Torque3D into development

This commit is contained in:
Areloch 2019-05-13 00:28:23 -05:00
commit 3697737498
148 changed files with 3463 additions and 547 deletions

View file

@ -0,0 +1,213 @@
//-----------------------------------------------------------------------------
// Verve
// Copyright (C) - Violent Tulip
//-----------------------------------------------------------------------------
singleton GuiControlProfile( VEditorDefaultProfile )
{
opaque = true;
fillColor = "70 70 70";
fillColorHL = "90 90 90";
fillColorNA = "70 70 70";
border = 1;
borderColor = "120 120 120";
borderColorHL = "100 100 100";
borderColorNA = "240 240 240";
fontType = "Arial";
fontSize = 12;
fontCharset = ANSI;
fontColor = "255 255 255";
fontColorHL = "255 255 255";
fontColorNA = "255 255 255";
fontColorSEL = "255 255 255";
};
singleton GuiControlProfile( VEditorTestProfile )
{
opaque = true;
fillColor = "255 255 0";
fillColorHL = "255 255 0";
fillColorNA = "255 255 0";
};
singleton GuiControlProfile( VEditorNoFillProfile : VEditorDefaultProfile )
{
opaque = false;
};
singleton GuiControlProfile( VEditorNoBorderProfile : VEditorDefaultProfile )
{
border = false;
};
singleton GuiControlProfile( VEditorTransparentProfile : VEditorDefaultProfile )
{
opaque = false;
border = false;
};
//-----------------------------------------------------------------------------
singleton GuiControlProfile( VEditorTextProfile : VEditorDefaultProfile )
{
border = false;
opaque = false;
fontType = "Arial Bold";
};
singleton GuiControlProfile( VEditorTextEditProfile : VEditorDefaultProfile )
{
fillColor = "70 70 70";
fillColorHL = "90 90 90";
fillColorSEL = "0 0 0";
fillColorNA = "70 70 70";
fontColor = "255 255 255";
fontColorHL = "0 0 0";
fontColorSEL = "128 128 128";
fontColorNA = "128 128 128";
textOffset = "4 2";
autoSizeWidth = false;
autoSizeHeight = false;
justify = "left";
tab = true;
canKeyFocus = true;
};
singleton GuiControlProfile( VEditorPopupMenuProfile : GuiPopUpMenuProfile )
{
FillColorHL = "90 90 90";
FillColorSEL = "0 0 0";
FontColorHL = "255 255 255";
};
singleton GuiControlProfile ( VEditorBitmapButtonProfile : VEditorDefaultProfile )
{
justify = "center";
hasBitmapArray = true;
bitmap = "./Images/Button";
};
//-----------------------------------------------------------------------------
singleton GuiControlProfile( VEditorGroupHeaderProfile : VEditorDefaultProfile )
{
CanKeyFocus = true;
TextOffset = "23 0";
fontColor = "70 70 70";
};
singleton GuiControlProfile( VEditorGroupHeaderErrorProfile : VEditorGroupHeaderProfile )
{
fontColor = "255 70 70";
};
singleton GuiControlProfile( VEditorGroupTrackProfile : VEditorTransparentProfile )
{
CanKeyFocus = true;
};
singleton GuiControlProfile( VEditorTrackProfile : VEditorDefaultProfile )
{
CanKeyFocus = true;
TextOffset = "33 0";
opaque = true;
fillColor = "255 255 255 15";
fillColorHL = "151 166 191 60";
borderColor = "100 100 100";
};
singleton GuiControlProfile( VEditorTrackErrorProfile : VEditorTrackProfile )
{
fontColor = "255 70 70";
};
singleton GuiControlProfile( VEditorEventProfile : VEditorDefaultProfile )
{
CanKeyFocus = true;
Justify = "left";
TextOffset = "6 1";
fillColor = "81 81 81";
fillColorHL = "102 102 102";
borderColor = "255 255 255";
borderColorHL = "255 255 255";
borderColorNA = "100 100 100";
};
singleton GuiControlProfile( VEditorTimeLineProfile : VEditorDefaultProfile )
{
CanKeyFocus = true;
opaque = false;
fillColorHL = "255 255 255 15";
border = false;
borderColor = "100 100 100";
};
singleton GuiControlProfile( VEditorPropertyProfile : VEditorDefaultProfile )
{
fillColor = "102 102 102";
};
//-----------------------------------------------------------------------------
singleton GuiControlProfile ( VEditorScrollProfile : VEditorDefaultProfile )
{
opaque = false;
border = false;
hasBitmapArray = true;
bitmap = "./Images/ScrollBar";
};
singleton GuiControlProfile ( VEditorCheckBoxProfile : GuiCheckBoxProfile )
{
// Void.
};
//-----------------------------------------------------------------------------
singleton GuiControlProfile( VEditorPropertyRolloutProfile : GuiRolloutProfile )
{
border = 0;
hasBitmapArray = true;
bitmap = "./Images/PropertyRollout";
fontType = "Arial";
fontSize = 12;
fontCharset = ANSI;
fontColor = "255 255 255";
fontColorHL = "255 255 255";
fontColorNA = "255 255 255";
fontColorSEL = "255 255 255";
};
singleton GuiControlProfile( VEditorPropertyLabelProfile : VEditorTextProfile )
{
border = "1";
justify = "center";
};
//-----------------------------------------------------------------------------
singleton GuiControlProfile( VEditorPreferenceLabelProfile : GuiTextProfile )
{
opaque = true;
fillColor = "242 241 240";
fillColorHL = "242 241 240";
fillColorNA = "242 241 240";
};

View file

@ -0,0 +1,103 @@
function NewEditorGui::AddWindow(%this)
{
%page = new GuiTabPageCtrl()
{
fitBook = "1";
text = "Object Viewer";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "GuiTabPageProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
};
%page.add(ObjectViewer);
MainEditorBasePanel.add(%page);
//Ensure the sidebar is spaced sanely
%pos = MainEditorBasePanel.extent.x * 0.8;
ObjectViewer-->splitContainer.splitPoint.x = MainEditorBasePanel.extent.x * 0.8;
}
function AssetBrowserWindow::onMouseDragged(%this)
{
%payload = new GuiBitmapButtonCtrl();
%payload.assignFieldsFrom( %this );
%payload.className = "AssetPreviewControl";
%payload.position = "0 0";
%payload.dragSourceControl = %this;
%payload.bitmap = %this.icon;
%payload.extent.x /= 2;
%payload.extent.y /= 2;
%xOffset = getWord( %payload.extent, 0 ) / 2;
%yOffset = getWord( %payload.extent, 1 ) / 2;
// Compute the initial position of the GuiDragAndDrop control on the cavas based on the current
// mouse cursor position.
%cursorpos = Canvas.getCursorPos();
%xPos = getWord( %cursorpos, 0 ) - %xOffset;
%yPos = getWord( %cursorpos, 1 ) - %yOffset;
if(!isObject(EditorDragAndDropLayer))
{
new GuiControl(EditorDragAndDropLayer)
{
position = "0 0";
extent = Canvas.extent;
};
}
// Create the drag control.
%ctrl = new GuiDragAndDropControl()
{
canSaveDynamicFields = "0";
Profile = "GuiSolidDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = %xPos SPC %yPos;
extent = %payload.extent;
MinExtent = "4 4";
canSave = "1";
Visible = "1";
hovertime = "1000";
// Let the GuiDragAndDropControl delete itself on mouse-up. When the drag is aborted,
// this not only deletes the drag control but also our payload.
deleteOnMouseUp = true;
useWholeCanvas = true;
// To differentiate drags, use the namespace hierarchy to classify them.
// This will allow a color swatch drag to tell itself apart from a file drag, for example.
class = "AssetPreviewControlType_AssetDrop";
};
// Add the temporary color swatch to the drag control as the payload.
%ctrl.add( %payload );
// Start drag by adding the drag control to the canvas and then calling startDragging().
//Canvas.getContent().add( %ctrl );
EditorDragAndDropLayer.add(%ctrl);
Canvas.pushDialog(EditorDragAndDropLayer);
%ctrl.startDragging( %xOffset, %yOffset );
}