Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windowed Console button close / open / resize #1322

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2763,8 +2777,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
Loading