From 0a8da4aa430c9c967c4e4f08b404996a08cff8f7 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 24 Oct 2023 13:17:41 +0200 Subject: [PATCH] FIRE-33305: Fix secondary inventory window being empty --- indra/newview/llsidepanelinventory.cpp | 13 ++++++++++++- indra/newview/llsidepanelinventory.h | 4 ++++ indra/newview/llviewerfloaterreg.cpp | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index d9abdfeb77..e114d8d7d5 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -260,7 +260,10 @@ BOOL LLSidepanelInventory::postBuild() //gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); LLFloater *floater = dynamic_cast(getParent()); - if (floater && floater->getKey().isUndefined() && !sLoginCompleted) + // Secondary inventory window + //if (floater && floater->getKey().isUndefined() && !sLoginCompleted) + if (floater && ((floater->getKey().isUndefined() && !sLoginCompleted) || (floater->getKey().has("is_secondary") && floater->getKey()["is_secondary"].asBoolean()))) + // { // Prefill inventory for primary inventory floater // Other floaters should fill on visibility change @@ -702,3 +705,11 @@ void LLSidepanelInventory::onReloadInboxClicked() } } // + +// Secondary inventory window +//static +LLFloater* LLSidepanelInventory::createSecondaryInventoryWindow(const LLSD& key) +{ + return LLFloaterReg::build(LLSD().with("is_secondary", true)); +} +// diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 2214f3a052..43ad980a25 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -39,6 +39,7 @@ class LLLayoutPanel; class LLPanelMainInventory; class LLSidepanelItemInfo; class LLSidepanelTaskInfo; +class LLFloater; // Secondary inventory window class LLSidepanelInventory : public LLPanel { @@ -87,6 +88,9 @@ public: static void cleanup(); + // Secondary inventory window + static LLFloater* createSecondaryInventoryWindow(const LLSD& key); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index ca5fa49ef6..3b1a1025b8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -221,6 +221,7 @@ #include "llfloaterscriptrecover.h" #include "llfloatersearchreplace.h" #include "llpanelgroup.h" +#include "llsidepanelinventory.h" #include "NACLfloaterexploresounds.h" #include "particleeditor.h" #include "quickprefs.h" @@ -633,10 +634,10 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("quickprefs", "floater_quickprefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("region_tracker", "floater_region_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("search_replace", "floater_search_replace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("secondary_inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("secondary_inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLSidepanelInventory::createSecondaryInventoryWindow); LLFloaterReg::add("script_recover", "floater_script_recover.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("sound_explorer", "floater_NACL_explore_sounds.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("vram_usage", "floater_fs_vram_usage.xml", static_cast( &LLFloaterReg::build< FSFloaterVRAMUsage >) ); + LLFloaterReg::add("vram_usage", "floater_fs_vram_usage.xml", static_cast(&LLFloaterReg::build)); LLFloaterReg::add("local_mesh_floater", "floater_vj_local_mesh.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); // local mesh LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving