Reduce calls to LLTrans::getString per frame.
parent
29be06bbce
commit
240a78f7c0
|
|
@ -435,6 +435,12 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
|
|||
mEditLandmarkTooltip = LLTrans::getString("LocationCtrlEditLandmarkTooltip");
|
||||
mButton->setToolTip(LLTrans::getString("LocationCtrlComboBtnTooltip"));
|
||||
mInfoBtn->setToolTip(LLTrans::getString("LocationCtrlInfoBtnTooltip"));
|
||||
|
||||
// <FS:ND> Prevent querying LLTrans each frame
|
||||
mTooltips.push_back( LLTrans::getString("LocationCtrlGeneralIconTooltip") );
|
||||
mTooltips.push_back( LLTrans::getString("LocationCtrlAdultIconTooltip") );
|
||||
mTooltips.push_back( LLTrans::getString("LocationCtrlModerateIconTooltip") );
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
LLLocationInputCtrl::~LLLocationInputCtrl()
|
||||
|
|
@ -990,17 +996,32 @@ void LLLocationInputCtrl::refreshMaturityButton()
|
|||
{
|
||||
case SIM_ACCESS_PG:
|
||||
rating_image = mIconMaturityGeneral;
|
||||
rating_tooltip = LLTrans::getString("LocationCtrlGeneralIconTooltip");
|
||||
|
||||
// <FS:ND> Prevent querying LLTrans each frame
|
||||
// rating_tooltip = LLTrans::getString("LocationCtrlGeneralIconTooltip");
|
||||
rating_tooltip = mTooltips[eGeneral];
|
||||
// </FS:ND>
|
||||
|
||||
break;
|
||||
|
||||
case SIM_ACCESS_ADULT:
|
||||
rating_image = mIconMaturityAdult;
|
||||
rating_tooltip = LLTrans::getString("LocationCtrlAdultIconTooltip");
|
||||
|
||||
// <FS:ND> Prevent querying LLTrans each frame
|
||||
// rating_tooltip = LLTrans::getString("LocationCtrlAdultIconTooltip");
|
||||
rating_tooltip = mTooltips[eAdult];
|
||||
// </FS:ND>
|
||||
|
||||
break;
|
||||
|
||||
case SIM_ACCESS_MATURE:
|
||||
rating_image = mIconMaturityModerate;
|
||||
rating_tooltip = LLTrans::getString("LocationCtrlModerateIconTooltip");
|
||||
|
||||
// <FS:ND> Prevent querying LLTrans each frame
|
||||
// rating_tooltip = LLTrans::getString("LocationCtrlModerateIconTooltip");
|
||||
rating_tooltip = mTooltips[eModerate];
|
||||
// </FS:ND>
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -209,6 +209,11 @@ private:
|
|||
// <FS:Zi> Pathfinding rebake functions
|
||||
BOOL rebakeRegionCallback(const LLSD& notification,const LLSD& response);
|
||||
// </FS:Zi>
|
||||
|
||||
// <FS:ND> Prevent querying LLTrans each frame
|
||||
enum ETooltip{ eGeneral, eAdult, eModerate };
|
||||
std::vector< std::string > mTooltips;
|
||||
// </FS:ND>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue