diff --git a/.hgpatchinfo/UI-Base.dep b/.hgpatchinfo/UI-Base.dep new file mode 100644 index 0000000000..a60161cda9 --- /dev/null +++ b/.hgpatchinfo/UI-Base.dep @@ -0,0 +1 @@ +28f9e20165a4768971cab9ccfa0382f98aacd0ec \ No newline at end of file diff --git a/.hgpatchinfo/UI-Base.desc b/.hgpatchinfo/UI-Base.desc new file mode 100644 index 0000000000..1678043a31 --- /dev/null +++ b/.hgpatchinfo/UI-Base.desc @@ -0,0 +1,6 @@ +[UI/Base] +- added : static registration of an LLPanel derived class with a custom class creator + -> used in the UI-SidepanelOutfits patch branch +- added : registration of an LLFloater derived class with a callback for the XML filename + -> used in the Chat-Misc patch branch + -> used in the Chat-NearbyChat patch branch diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 0edfc8da2d..d40ddfe16e 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -56,6 +56,18 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con sGroupMap[groupname] = groupname; // for referencing directly by group name } +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g +//static +void LLFloaterReg::addWithFileCallback(const std::string& name, const LLFloaterFileFunc& fileFunc, + const LLFloaterBuildFunc& func, const std::string& groupname) +{ + sBuildMap[name].mFunc = func; + sBuildMap[name].mFileFunc = fileFunc; + sGroupMap[name] = groupname.empty() ? name : groupname; + sGroupMap[groupname] = groupname; // for referencing directly by group name +} +// [/SL:KB] + //static LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) { @@ -138,7 +150,10 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) if (!res) { const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc; - const std::string& xui_file = sBuildMap[name].mFile; +// const std::string& xui_file = sBuildMap[name].mFile; +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.5.0a + const std::string& xui_file = (!sBuildMap[name].mFileFunc) ? sBuildMap[name].mFile : sBuildMap[name].mFileFunc(); +// [/SL:KB] if (build_func) { const std::string& groupname = sGroupMap[name]; diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 534cf8b40a..736c5d03fb 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -41,6 +41,9 @@ class LLFloater; class LLUICtrl; typedef boost::function LLFloaterBuildFunc; +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g +typedef boost::function LLFloaterFileFunc; +// [/SL:KB] class LLFloaterReg { @@ -55,6 +58,9 @@ public: struct BuildData { LLFloaterBuildFunc mFunc; +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g + LLFloaterFileFunc mFileFunc; +// [/SL:KB] std::string mFile; }; typedef std::map build_map_t; @@ -85,6 +91,11 @@ public: static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func, const std::string& groupname = LLStringUtil::null); +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g + static void addWithFileCallback(const std::string& name, const LLFloaterFileFunc& fileFunc, const LLFloaterBuildFunc& func, + const std::string& groupname = LLStringUtil::null); +// [/SL:KB] + // Helpers static LLFloater* getLastFloaterInGroup(const std::string& name); static LLFloater* getLastFloaterCascading(); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index ab1c87caff..591adaa9ce 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -335,6 +335,9 @@ class LLRegisterPanelClassWrapper public: // reigister with either the provided builder, or the generic templated builder LLRegisterPanelClassWrapper(const std::string& tag); +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g + LLRegisterPanelClassWrapper(const std::string& tag, LLPanelClassCreatorFunc func); +// [/SL:KB] }; @@ -344,5 +347,12 @@ LLRegisterPanelClassWrapper::LLRegisterPanelClassWrapper(const std::string& t LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder); } +// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g +template +LLRegisterPanelClassWrapper::LLRegisterPanelClassWrapper(const std::string& tag, LLPanelClassCreatorFunc func) +{ + LLRegisterPanelClass::instance().addPanelClass(tag, func); +} +// [/SL:KB] #endif