// virtual void LLFloaterWorldMap::draw() { // Hide/Show Mature Events controls childSetVisible("events_mature_icon", !gAgent.isTeen()); childSetVisible("events_mature_label", !gAgent.isTeen()); childSetVisible("event_mature_chk", !gAgent.isTeen()); // On orientation island, users don't have a home location yet, so don't // let them teleport "home". It dumps them in an often-crowed welcome // area (infohub) and they get confused. JC LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; childSetEnabled("Go Home", enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { childSetColor("avatar_icon", gTrackColor); } else { childSetColor("avatar_icon", gDisabledTrackColor); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { childSetColor("landmark_icon", gTrackColor); } else { childSetColor("landmark_icon", gDisabledTrackColor); } if (LLTracker::TRACKING_LOCATION == tracking_status) { childSetColor("location_icon", gTrackColor); } else { if (mCompletingRegionName != "") { F64 seconds = LLTimer::getElapsedSeconds(); double value = fmod(seconds, 2); value = 0.5 + 0.5*cos(value * 3.14159f); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); childSetColor("location_icon", loading_color); } else { childSetColor("location_icon", gDisabledTrackColor); } } // check for completion of tracking data if (mWaitingForTracker) { centerOnTarget(TRUE); } // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) { mZoomTimer.start(); } F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; if (interp > 1.f) { interp = 1.f; mZoomTimer.stop(); } mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); LLFloater::draw(); }
// virtual void LLFloaterWorldMap::draw() { static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white); static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white); // Hide/Show Mature Events controls childSetVisible("events_mature_icon", gAgent.canAccessMature()); childSetVisible("events_mature_label", gAgent.canAccessMature()); childSetVisible("event_mature_chk", gAgent.canAccessMature()); childSetVisible("events_adult_icon", gAgent.canAccessMature()); childSetVisible("events_adult_label", gAgent.canAccessMature()); childSetVisible("event_adult_chk", gAgent.canAccessMature()); bool adult_enabled = gAgent.canAccessAdult(); if (!adult_enabled) { childSetValue("event_adult_chk", FALSE); } childSetEnabled("event_adult_chk", adult_enabled); // On orientation island, users don't have a home location yet, so don't // let them teleport "home". It dumps them in an often-crowed welcome // area (infohub) and they get confused. JC LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; childSetEnabled("Go Home", enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { childSetColor("avatar_icon", map_track_color); } else { childSetColor("avatar_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { childSetColor("landmark_icon", map_track_color); } else { childSetColor("landmark_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LOCATION == tracking_status) { childSetColor("location_icon", map_track_color); } else { if (mCompletingRegionName != "") { F64 seconds = LLTimer::getElapsedSeconds(); double value = fmod(seconds, 2); value = 0.5 + 0.5*cos(value * F_PI); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); childSetColor("location_icon", loading_color); } else { childSetColor("location_icon", map_track_disabled_color); } } // check for completion of tracking data if (mWaitingForTracker) { centerOnTarget(TRUE); } childSetEnabled("Teleport", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) { mZoomTimer.start(); } F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; if (interp > 1.f) { interp = 1.f; mZoomTimer.stop(); } mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); // Enable/disable checkboxes depending on the zoom level // If above threshold level (i.e. low res) -> Disable all checkboxes // If under threshold level (i.e. high res) -> Enable all checkboxes bool enable = LLWorldMapView::showRegionInfo(); childSetEnabled("people_chk", enable); childSetEnabled("infohub_chk", enable); childSetEnabled("telehub_chk", enable); childSetEnabled("land_for_sale_chk", enable); childSetEnabled("event_chk", enable); childSetEnabled("event_mature_chk", enable); childSetEnabled("event_adult_chk", enable); LLFloater::draw(); }
void LLPreviewTexture::draw() { if (mUpdateDimensions) { updateDimensions(); } LLPreview::draw(); if (!isMinimized()) { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); const LLRect& border = mClientRect; LLRect interior = mClientRect; interior.stretch( -PREVIEW_BORDER_WIDTH ); // ...border gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f)); gl_rect_2d_checkerboard( calcScreenRect(), interior ); if ( mImage.notNull() ) { // Draw the texture gGL.diffuseColor3f( 1.f, 1.f, 1.f ); gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mImage); static const LLCachedControl<bool> use_rmse_auto_mask("SHUseRMSEAutoMask",false); static const LLCachedControl<F32> auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); if (mAlphaMaskResult != mImage->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f)) { mAlphaMaskResult = !mAlphaMaskResult; if (!mAlphaMaskResult) { childSetColor("alphanote", LLColor4::green); childSetText("alphanote", getString("No Alpha")); } else { childSetColor("alphanote", LLColor4::red); childSetText("alphanote", getString("Has Alpha")); } } // Pump the texture priority F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); mImage->addTextureStats( pixel_area ); if(pixel_area > 0.f) { //boost the previewed image priority to the highest to make it to get loaded first. mImage->setAdditionalDecodePriority(1.0f) ; } // Don't bother decoding more than we can display, unless // we're loading the full image. if (!mLoadingFullImage) { S32 int_width = interior.getWidth(); S32 int_height = interior.getHeight(); mImage->setKnownDrawSize(int_width, int_height); } else { // Don't use this feature mImage->setKnownDrawSize(0, 0); } if( mLoadingFullImage ) { LLFontGL::getFontSansSerif()->renderUTF8(LLTrans::getString("Receiving"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); F32 data_progress = mImage->getDownloadProgress(); // Draw the progress bar. const S32 BAR_HEIGHT = 12; const S32 BAR_LEFT_PAD = 80; S32 left = interior.mLeft + 4 + BAR_LEFT_PAD; S32 bar_width = getRect().getWidth() - left - RESIZE_HANDLE_WIDTH - 2; S32 top = interior.mBottom + 4 + BAR_HEIGHT; S32 right = left + bar_width; S32 bottom = top - BAR_HEIGHT; LLColor4 background_color(0.f, 0.f, 0.f, 0.75f); LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f); LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f); gl_rect_2d(left, top, right, bottom, background_color); if (data_progress > 0.0f) { // Downloaded bytes right = left + llfloor(data_progress * (F32)bar_width); if (right > left) { gl_rect_2d(left, top, right, bottom, downloaded_color); } } } else if(!mSavedFileTimer.hasExpired()) { LLFontGL::getFontSansSerif()->renderUTF8(LLTrans::getString("FileSaved"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } } } }
void LLMediaRemoteCtrl::enableMediaButtons() { // Media bool play_media_enabled = false; bool stop_media_enabled = false; bool play_music_enabled = false; bool stop_music_enabled = false; bool music_show_pause = false; bool media_show_pause = false; static LLCachedControl<LLColor4U> sIconDisabledColor(gColors, "IconDisabledColor"); LLColor4 music_icon_color = (LLColor4)sIconDisabledColor; LLColor4 media_icon_color = (LLColor4)sIconDisabledColor; std::string media_type = "none/none"; // Put this in xui file std::string media_url = mControls->getString("default_tooltip_label"); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (gSavedSettings.getBOOL("AudioStreamingVideo")) { if ( parcel && !parcel->getMediaURL().empty()) { // Set the tooltip // Put this text into xui file media_url = parcel->getMediaURL(); media_type = parcel->getMediaType(); play_media_enabled = true; media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus(); switch(status) { case LLViewerMediaImpl::MEDIA_NONE: media_show_pause = false; stop_media_enabled = false; break; case LLViewerMediaImpl::MEDIA_LOADING: case LLViewerMediaImpl::MEDIA_LOADED: case LLViewerMediaImpl::MEDIA_PLAYING: // HACK: only show the pause button for movie types media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false; stop_media_enabled = true; play_media_enabled = false; break; case LLViewerMediaImpl::MEDIA_PAUSED: media_show_pause = false; stop_media_enabled = true; break; default: // inherit defaults above break; } } } if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) { if ( parcel && !parcel->getMusicURL().empty()) { play_music_enabled = true; music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); if (gOverlayBar->musicPlaying()) { music_show_pause = true; stop_music_enabled = true; } else { music_show_pause = false; stop_music_enabled = false; } } // Don't test the mime-type: this is not updated in a consistent basis. The existence of a valid gAudiop is enough guarantee. } const std::string media_icon_name = LLMIMETypes::findIcon(media_type); LLButton* music_play_btn = getChild<LLButton>("music_play"); LLButton* music_stop_btn = getChild<LLButton>("music_stop"); LLButton* music_pause_btn = getChild<LLButton>("music_pause"); LLButton* media_play_btn = getChild<LLButton>("media_play"); LLButton* media_stop_btn = getChild<LLButton>("media_stop"); LLButton* media_pause_btn = getChild<LLButton>("media_pause"); LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); music_play_btn->setEnabled(play_music_enabled); music_stop_btn->setEnabled(stop_music_enabled); music_pause_btn->setEnabled(music_show_pause); music_pause_btn->setVisible(music_show_pause); music_play_btn->setVisible(! music_show_pause); childSetColor("music_icon", music_icon_color); if(!media_icon_name.empty()) { media_icon->setImage(media_icon_name); } media_play_btn->setEnabled(play_media_enabled); media_stop_btn->setEnabled(stop_media_enabled); media_pause_btn->setEnabled(media_show_pause); media_pause_btn->setVisible(media_show_pause); media_play_btn->setVisible(! media_show_pause); childSetColor("media_icon", media_icon_color); setToolTip(media_url); }
void LLMediaRemoteCtrl::enableMediaButtons() { // Media bool play_media_enabled = false; bool stop_media_enabled = false; bool play_music_enabled = false; bool stop_music_enabled = false; bool music_show_pause = false; bool media_show_pause = false; LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); std::string media_type = "none/none"; // Put this in xui file std::string media_url = mControls->getString("default_tooltip_label"); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (gSavedSettings.getBOOL("AudioStreamingVideo")) { if ( parcel && !parcel->getMediaURL().empty()) { // Set the tooltip // Put this text into xui file media_url = parcel->getMediaURL(); media_type = parcel->getMediaType(); play_media_enabled = true; media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus(); switch(status) { case LLViewerMediaImpl::MEDIA_NONE: media_show_pause = false; stop_media_enabled = false; break; case LLViewerMediaImpl::MEDIA_LOADING: case LLViewerMediaImpl::MEDIA_LOADED: case LLViewerMediaImpl::MEDIA_PLAYING: // HACK: only show the pause button for movie types media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false; stop_media_enabled = true; play_media_enabled = false; break; case LLViewerMediaImpl::MEDIA_PAUSED: media_show_pause = false; stop_media_enabled = true; break; default: // inherit defaults above break; } } } if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) { if ( parcel && !parcel->getMusicURL().empty()) { play_music_enabled = true; music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); if (gOverlayBar->musicPlaying()) { music_show_pause = true; stop_music_enabled = true; } else { music_show_pause = false; stop_music_enabled = false; } } // Don't test the mime-type: this is not updated in a consistent basis. The existence of a valid gAudiop is enough guarantee. } const std::string media_icon_name = LLMIMETypes::findIcon(media_type); LLButton* music_play_btn = getChild<LLButton>("music_play"); LLButton* music_stop_btn = getChild<LLButton>("music_stop"); LLButton* music_pause_btn = getChild<LLButton>("music_pause"); LLButton* media_play_btn = getChild<LLButton>("media_play"); LLButton* media_stop_btn = getChild<LLButton>("media_stop"); LLButton* media_pause_btn = getChild<LLButton>("media_pause"); LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); music_play_btn->setEnabled(play_music_enabled); music_stop_btn->setEnabled(stop_music_enabled); music_pause_btn->setEnabled(music_show_pause); music_pause_btn->setVisible(music_show_pause); music_play_btn->setVisible(! music_show_pause); if(music_show_pause) { LLStreamingAudioInterface *stream = gAudiop ? gAudiop->getStreamingAudioImpl() : NULL; if(stream && stream->getMetaData()) { std::string info_text = "Loading..."; const LLSD& metadata = *(stream->getMetaData()); LLSD artist = metadata.get("ARTIST"); LLSD title = metadata.get("TITLE"); if(artist.isDefined() && title.isDefined()) info_text = artist.asString() + " -- " + title.asString(); else if(title.isDefined()) info_text = std::string("Title: ") + title.asString(); else if(artist.isDefined()) info_text = std::string("Artist: ") + artist.asString(); music_pause_btn->setToolTip(info_text); } else music_pause_btn->setToolTip(mCachedPauseTip); } childSetColor("music_icon", music_icon_color); if(!media_icon_name.empty()) { media_icon->setImage(media_icon_name); } media_play_btn->setEnabled(play_media_enabled); media_stop_btn->setEnabled(stop_media_enabled); media_pause_btn->setEnabled(media_show_pause); media_pause_btn->setVisible(media_show_pause); media_play_btn->setVisible(! media_show_pause); childSetColor("media_icon", media_icon_color); setToolTip(media_url); }
void LLMediaRemoteCtrl::enableMediaButtons() { // Media bool play_media_enabled = false; bool stop_media_enabled = false; bool play_music_enabled = false; bool stop_music_enabled = false; bool music_show_pause = false; bool media_show_pause = false; LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); std::string media_type = "none/none"; // Put this in xui file std::string media_url = mControls->getString("default_tooltip_label"); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (gSavedSettings.getBOOL("AudioStreamingVideo")) { if ( parcel && parcel->getMediaURL()[0]) { // Set the tooltip // Put this text into xui file media_url = parcel->getObscureMedia() ? mControls->getString("media_hidden_label") : parcel->getMediaURL(); media_type = parcel->getMediaType(); play_media_enabled = true; media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); switch(status) { case LLMediaBase::STATUS_STOPPED: case LLMediaBase::STATUS_UNKNOWN: media_show_pause = false; stop_media_enabled = false; break; case LLMediaBase::STATUS_STARTED: case LLMediaBase::STATUS_NAVIGATING: case LLMediaBase::STATUS_RESETTING: // HACK: only show the pause button for movie types media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false; stop_media_enabled = true; play_media_enabled = false; break; case LLMediaBase::STATUS_PAUSED: media_show_pause = false; stop_media_enabled = true; break; default: // inherit defaults above break; } } } if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) { if ( parcel && parcel->getMusicURL()[0]) { play_music_enabled = true; music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); if (gOverlayBar->musicPlaying()) { music_show_pause = true; stop_music_enabled = true; } else { music_show_pause = false; stop_music_enabled = false; } } // if no mime type has been set disable play if( LLViewerMedia::getMimeType().empty() || LLViewerMedia::getMimeType() == "none/none") { play_media_enabled = false; stop_media_enabled = false; } } const std::string media_icon_name = LLMIMETypes::findIcon(media_type); LLButton* music_play_btn = getChild<LLButton>("music_play"); LLButton* music_stop_btn = getChild<LLButton>("music_stop"); LLButton* music_pause_btn = getChild<LLButton>("music_pause"); LLButton* media_play_btn = getChild<LLButton>("media_play"); LLButton* media_stop_btn = getChild<LLButton>("media_stop"); LLButton* media_pause_btn = getChild<LLButton>("media_pause"); LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); music_play_btn->setEnabled(play_music_enabled); music_stop_btn->setEnabled(stop_music_enabled); music_pause_btn->setEnabled(music_show_pause); music_pause_btn->setVisible(music_show_pause); music_play_btn->setVisible(! music_show_pause); childSetColor("music_icon", music_icon_color); if(!media_icon_name.empty()) { media_icon->setImage(media_icon_name); } media_play_btn->setEnabled(play_media_enabled); media_stop_btn->setEnabled(stop_media_enabled); media_pause_btn->setEnabled(media_show_pause); media_pause_btn->setVisible(media_show_pause); media_play_btn->setVisible(! media_show_pause); childSetColor("media_icon", media_icon_color); setToolTip(media_url); }