Skip to content

Commit

Permalink
Merge pull request #1322 from Eikelenboom/development
Browse files Browse the repository at this point in the history
Windowed Console button close / open / resize
  • Loading branch information
Azaezel authored Sep 24, 2024
2 parents 5c83972 + 02b86ea commit b6efb96
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 8 deletions.
33 changes: 31 additions & 2 deletions Templates/BaseGame/game/tools/guiEditor/gui/guiEditor.ed.gui
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}

Expand Down Expand Up @@ -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" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b6efb96

Please sign in to comment.