From 265ce8429b60ef56759f615a2e33433e2d9cd82e Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 28 Jul 2024 05:51:03 -0500 Subject: [PATCH] fix guiwindowCTRL callback also set asset browser to use rows or columns depending on which dimension is longer --- Engine/source/gui/containers/guiWindowCtrl.cpp | 2 +- .../tools/assetBrowser/scripts/assetBrowser.tscript | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 875557a85..bda7b0bfc 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -66,7 +66,7 @@ IMPLEMENT_CALLBACK( GuiWindowCtrl, onCollapse, void, (), (), "Called when the window is collapsed by clicking its title bar." ); IMPLEMENT_CALLBACK( GuiWindowCtrl, onRestore, void, (), (), "Called when the window is restored from minimized, maximized, or collapsed state." ); -IMPLEMENT_CALLBACK(GuiWindowCtrl, onResize, void, (S32 posX, S32 posY, S32 width, S32 height), (0, 0, 0, 0), +IMPLEMENT_CALLBACK(GuiWindowCtrl, onResize, void, (S32 posX, S32 posY, S32 width, S32 height), (posX, posY, width, height), "Called when the window is resized in a regular manner by mouse manipulation."); IMPLEMENT_CALLBACK(GuiWindowCtrl, onMouseDragged, void, (), (), "Called when the height has changed."); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index a0a196a4e..861ae04af 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -2891,4 +2891,14 @@ function AssetBrowserWindow::releasePanel(%this) %this.resizing = false; EditorGui.updateSideBar(); +} + +function AssetBrowserWindow::onResize(%this, %posX, %posY, %width, %height) +{ + if (%width>%height) + AssetBrowser-->assetList.fillRowFirst = true; + else + AssetBrowser-->assetList.fillRowFirst = false; + + AssetBrowser.doRebuildAssetArray(); } \ No newline at end of file