commit
dd8df2a478
|
|
@ -0,0 +1 @@
|
|||
28f9e20165a4768971cab9ccfa0382f98aacd0ec
|
||||
|
|
@ -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
|
||||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ class LLFloater;
|
|||
class LLUICtrl;
|
||||
|
||||
typedef boost::function<LLFloater* (const LLSD& key)> LLFloaterBuildFunc;
|
||||
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g
|
||||
typedef boost::function<const std::string& (void)> 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<std::string, BuildData> 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();
|
||||
|
|
|
|||
|
|
@ -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<T>::LLRegisterPanelClassWrapper(const std::string& t
|
|||
LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g
|
||||
template<typename T>
|
||||
LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag, LLPanelClassCreatorFunc func)
|
||||
{
|
||||
LLRegisterPanelClass::instance().addPanelClass(tag, func);
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue