mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1322 from Eikelenboom/development
Windowed Console button close / open / resize
This commit is contained in:
commit
b6efb96191
|
|
@ -233,8 +233,37 @@ $guiContent = new GuiControl(GuiEditorGui, EditorGuiGroup) {
|
|||
internalName = "AssetBrowserBtn";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
|
||||
};
|
||||
new GuiIconButtonCtrl() {
|
||||
buttonMargin = "0 0";
|
||||
bitmapAsset = "ToolsModule:console_n_image";
|
||||
iconLocation = "Left";
|
||||
sizeIconToButton = "0";
|
||||
makeIconSquare = "0";
|
||||
textLocation = "Center";
|
||||
textMargin = "0";
|
||||
autoSize = "0";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "132 0";
|
||||
extent = "32 32";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "windowConsoleDlg.showWindow();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
tooltip = "Open the console log in a window.";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "ABwindowConsoleButton";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
buttonMargin = "-2 0";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
Enabled = "1";
|
||||
Profile = "ToolsGuiDefaultProfile";
|
||||
|
|
|
|||
|
|
@ -102,11 +102,24 @@ function windowConsoleDlg::hideWindow(%this)
|
|||
|
||||
function windowConsoleDlg::showWindow(%this)
|
||||
{
|
||||
$WindowConsole::Open = true;
|
||||
Canvas.pushDialog(%this);
|
||||
%this-->Scroll.setVisible(true);
|
||||
if($WindowConsole::Open)
|
||||
{
|
||||
// close the window when it's already opened
|
||||
windowConsoleDlg.hideWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
// open the console window
|
||||
$WindowConsole::Open = true;
|
||||
Canvas.pushDialog(%this);
|
||||
%this-->Scroll.setVisible(true);
|
||||
// update all the windows (position and size)
|
||||
EditorGui.updateSideBar();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function windowConsoleControl::setTab(%this, %tab, %text, %command)
|
||||
|
|
|
|||
|
|
@ -628,6 +628,7 @@ function EditorGui::updateSideBar(%this)
|
|||
{
|
||||
if(GuiEditorIsActive())
|
||||
{
|
||||
// Update the Asset Browser's size
|
||||
if(isObject(AssetBrowserWindow) && isObject(GuiEditorSidebar))
|
||||
{
|
||||
if(AssetBrowserWindow.docked == true)
|
||||
|
|
@ -639,6 +640,19 @@ function EditorGui::updateSideBar(%this)
|
|||
AssetBrowserWindow.resize(0, %browserPosY, %browserWidth, %browserHeight);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the Windowed Console's size
|
||||
if(isObject(windowConsoleControl) && isObject(GuiEditorSidebar))
|
||||
{
|
||||
if(windowConsoleControl.docked == true)
|
||||
{
|
||||
// The width is relative to the sidepanel
|
||||
%consoleWidth = Canvas.extent.x - GuiEditorSidebar.extent.x;
|
||||
%consoleHeight = windowConsoleControl.extent.y;
|
||||
%consolePosY = Canvas.extent.y - windowConsoleControl.extent.y - 33;
|
||||
windowConsoleControl.resize(0, %consolePosY, %consoleWidth, %consoleHeight);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2767,8 +2781,8 @@ function toggleSnappingOptions( %var )
|
|||
}
|
||||
else if( %var $= "grid" )
|
||||
{
|
||||
EWorldEditor.UseGridSnap = !EWorldEditor.UseGridSnap;
|
||||
EditorSettings.setValue("WorldEditor/Tools/UseGridSnap", EWorldEditor.UseGridSnap );
|
||||
EWorldEditor.UseGridSnap = !EWorldEditor.UseGridSnap;
|
||||
EditorSettings.setValue("WorldEditor/Tools/UseGridSnap", EWorldEditor.UseGridSnap );
|
||||
EWorldEditor.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
}
|
||||
else if( %var $= "byGroup" )
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ function TerrainPainterContainer::maxSize(%this, %window)
|
|||
// --- Windowed Console --------------------------------------------------
|
||||
if(isObject(windowConsoleControl))
|
||||
{
|
||||
// Only resize the AssetBrowser if it's docked
|
||||
// Only resize the console if it's docked
|
||||
if(windowConsoleControl.docked == true)
|
||||
{
|
||||
// The width is relative to the sidepanel
|
||||
|
|
|
|||
Loading…
Reference in a new issue