void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) { LLRect old_rect = getRect(); const LLFontGL* font = mParcelInfoText->getDefaultFont(); S32 new_text_width = font->getWidth(new_text); mParcelInfoText->setText(new_text); //MK if (gRRenabled && gAgent.mRRInterface.mContainsShowloc) { std::string dummy_text = "(Hidden)"; mParcelInfoText->setText(dummy_text); } //mk LLRect rect = mParcelInfoText->getRect(); rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight()); mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE); mParcelInfoText->setRect(rect); layoutParcelIcons(); if (old_rect != getRect()) { mResizeSignal(); } }
void LLStatusBar::updateParcelIcons() { LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance(); LLViewerRegion* agent_region = gAgent.getRegion(); LLParcel* agent_parcel = vpm->getAgentParcel(); if (!agent_region || !agent_parcel) return; if (gSavedSettings.getBOOL("NavBarShowParcelProperties")) { LLParcel* current_parcel; LLViewerRegion* selection_region = vpm->getSelectionRegion(); LLParcel* selected_parcel = vpm->getParcelSelection()->getParcel(); // If agent is in selected parcel we use its properties because // they are updated more often by LLViewerParcelMgr than agent parcel properties. // See LLViewerParcelMgr::processParcelProperties(). // This is needed to reflect parcel restrictions changes without having to leave // the parcel and then enter it again. See EXT-2987 if (selected_parcel && selected_parcel->getLocalID() == agent_parcel->getLocalID() && selection_region == agent_region) { current_parcel = selected_parcel; } else { current_parcel = agent_parcel; } bool allow_voice = vpm->allowAgentVoice(agent_region, current_parcel); bool allow_fly = vpm->allowAgentFly(agent_region, current_parcel); bool allow_push = vpm->allowAgentPush(agent_region, current_parcel); bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); //bool has_pwl = KCWindlightInterface::instance().WLset; // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); mParcelIcon[FLY_ICON]->setVisible( !allow_fly ); mParcelIcon[PUSH_ICON]->setVisible( !allow_push ); mParcelIcon[BUILD_ICON]->setVisible( !allow_build ); mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); //mPWLBtn->setVisible(has_pwl); //mPWLBtn->setEnabled(has_pwl); layoutParcelIcons(); } else { for (S32 i = 0; i < ICON_COUNT; ++i) { mParcelIcon[i]->setVisible(false); } mDamageText->setVisible(false); } }
void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) { const LLFontGL* font = mParcelInfoText->getDefaultFont(); S32 new_text_width = font->getWidth(new_text); mParcelInfoText->setText(new_text); LLRect rect = mParcelInfoText->getRect(); rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight()); mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE); mParcelInfoText->setRect(rect); layoutParcelIcons(); }