void LLFloaterAuction::initialize() { mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); childSetText("parcel_text", parcelp->getName()); childEnable("snapshot_btn"); childEnable("ok_btn"); } else { mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { childSetText("parcel_text", getString("already for sale")); } else { childSetText("parcel_text", LLStringUtil::null); } mParcelID = -1; childSetEnabled("snapshot_btn", false); childSetEnabled("ok_btn", false); } mImageID.setNull(); mImage = NULL; }
void LLPrefsIMImpl::setPersonalInfo( const std::string& visibility, bool im_via_email, const std::string& email) { mGotPersonalInfo = true; mOriginalIMViaEmail = im_via_email; mDirectoryVisibility = visibility; if(visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; childEnable("online_visibility"); } else if(visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; childEnable("online_visibility"); } else { mOriginalHideOnlineStatus = true; } childSetValue("online_visibility", mOriginalHideOnlineStatus); childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); childEnable("send_im_to_email"); childSetValue("send_im_to_email", im_via_email); childEnable("log_instant_messages"); childEnable("log_chat"); childEnable("busy_response"); //MK if (RRenabled && gAgent.mRRInterface.contains ("sendim")) { childDisable("busy_response"); } //mk childEnable("log_instant_messages_timestamp"); childEnable("log_chat_timestamp"); childEnable("log_chat_IM"); childEnable("log_date_timestamp"); //RN: get wide string so replace char can work (requires fixed-width encoding) LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") ); LLWString::replaceChar(busy_response, '^', '\n'); LLWString::replaceChar(busy_response, '%', ' '); childSetText("busy_response", wstring_to_utf8str(busy_response)); enableHistory(); // Truncate the e-mail address if it's too long (to prevent going off // the edge of the dialog). std::string display_email(email); if(display_email.size() > 30) { display_email.resize(30); display_email += "..."; } childSetLabelArg("send_im_to_email", "[EMAIL]", display_email); }
void LLPanelNetwork::refresh() { if (childGetValue("speed_rez_check").asBoolean()) { childEnable("speed_rez_interval_spinner"); childEnable("speed_rez_seconds_text"); } else { childDisable("speed_rez_interval_spinner"); childDisable("speed_rez_seconds_text"); } }
void LLFloaterAuction::initialize() { mParcelUpdateCapUrl.clear(); mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); childSetText("parcel_text", parcelp->getName()); childEnable("snapshot_btn"); childEnable("reset_parcel_btn"); childEnable("start_auction_btn"); LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (panel) { // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet U32 estate_id = panel->getEstateID(); childSetEnabled("sell_to_anyone_btn", (estate_id == ESTATE_TEEN || estate_id == 0)); } else { // Don't have the panel up, so don't know if we're on the teen grid or not. Default to enabling it childEnable("sell_to_anyone_btn"); } } else { mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { childSetText("parcel_text", getString("already for sale")); } else { childSetText("parcel_text", LLStringUtil::null); } mParcelID = -1; childSetEnabled("snapshot_btn", false); childSetEnabled("reset_parcel_btn", false); childSetEnabled("sell_to_anyone_btn", false); childSetEnabled("start_auction_btn", false); } mImageID.setNull(); mImage = NULL; }
void LLPrefsIMImpl::enableHistory() { if (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean()) { childEnable("log_show_history"); childEnable("log_path_button"); } else { childDisable("log_show_history"); childDisable("log_path_button"); } }
void LLPrefsAscentSysImpl::cancel() { //General ----------------------------------------------------------------------------- childSetValue("double_click_teleport_check", mDoubleClickTeleport); childSetValue("center_after_teleport_check", mResetCameraAfterTP); childSetValue("offset_teleport_check", mOffsetTPByUserHeight); childSetValue("preview_anim_in_world_check", mPreviewAnimInWorld); childSetValue("save_scripts_as_mono_check", mSaveScriptsAsMono); childSetValue("always_rez_in_group_check", mAlwaysRezInGroup); //Chat -------------------------------------------------------------------------------- childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat); childSetValue("play_typing_sound_check", mPlayTypingSound); childSetValue("hide_typing_check", mHideTypingNotification); childSetValue("seconds_in_chat_and_ims_check", mSecondsInChatAndIMs); childSetValue("allow_mu_pose_check", mEnableMUPose); childSetValue("close_ooc_check", mEnableOOCAutoClose); //Show Links //Time Format //Date Format childSetValue("seconds_in_chat_and_ims_check", mEnableOOCAutoClose); //Save Performance -------------------------------------------------------------------- childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); childSetValue("enable_wind", mEnableLLWind); childSetValue("enable_clouds", mEnableClouds); childSetValue("enable_classic_clouds", mEnableClassicClouds); childSetValue("speed_rez_check", mSpeedRez); if (mSpeedRez) { childEnable("speed_rez_interval"); childEnable("speed_rez_seconds"); } else { childDisable("speed_rez_interval"); childDisable("speed_rez_seconds"); } //Command Line ------------------------------------------------------------------------ //Privacy ----------------------------------------------------------------------------- childSetValue("broadcast_viewer_effects", mBroadcastViewerEffects); childSetValue("disable_point_at_and_beams_check", mDisablePointAtAndBeam); childSetValue("private_look_at_check", mPrivateLookAt); childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp); childSetValue("enable_clouds", mEnableClouds); childSetValue("enable_classic_clouds", mEnableClassicClouds); gLLWindEnabled = mEnableLLWind; }
void LLFloaterAvatarPicker::populateNearMe() { BOOL all_loaded = TRUE; BOOL empty = TRUE; LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe"); near_me_scroller->deleteAllItems(); std::vector<LLUUID> avatar_ids; LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); for(U32 i=0; i<avatar_ids.size(); i++) { LLUUID& av = avatar_ids[i]; if(av == gAgent.getID()) continue; LLSD element; element["id"] = av; // value std::string fullname; if(!gCacheName->getFullName(av, fullname)) { element["columns"][0]["value"] = LLCacheName::getDefaultName(); all_loaded = FALSE; } else { element["columns"][0]["value"] = fullname; } near_me_scroller->addElement(element); empty = FALSE; } if (empty) { childDisable("NearMe"); childDisable("Select"); near_me_scroller->addCommentText(getString("no_one_near")); } else { childEnable("NearMe"); childEnable("Select"); near_me_scroller->selectFirstItem(); onList(near_me_scroller, this); near_me_scroller->setFocus(TRUE); } if (all_loaded) { mNearMeListComplete = TRUE; } }
void LLPanelDirEvents::onDateModeCallback() { if (childGetValue("date_mode").asString() == "date") { childEnable("Today"); childEnable(">>"); childEnable("<<"); } else { childDisable("Today"); childDisable(">>"); childDisable("<<"); } }
void SLFloaterMediaFilter::onBlacklistAdd() { childDisable("clear_lists"); childDisable("show_ips"); childDisable("blacklist_list"); childDisable("whitelist_list"); childDisable("remove_whitelist"); childDisable("add_whitelist"); childDisable("remove_blacklist"); childDisable("add_blacklist"); childEnable("input_domain"); childEnable("commit_domain"); childSetText("add_text", std::string("Enter the domain/url to add to the black list:")); mIsWhitelist = false; }
void LLPanelDirClassified::onKeystrokeNameClassified(LLLineEditor* line) { S32 len = line->getLength(); if (len == 0 || len >= 3) { // no text searches are cheap, as are longer searches setDefaultBtn( "Search" ); childEnable("Search"); } else { setDefaultBtn(); childDisable("Search"); } // Change the Browse to Search or vice versa if (len > 0) { childSetVisible("Search", TRUE); childSetVisible("Browse", FALSE); } else { setDefaultBtn( "Browse" ); childSetVisible("Search", FALSE); childSetVisible("Browse", TRUE); } }
void LLPanelRegionTools::onChangeAnything() { if (gAgent.isGodlike()) { childEnable("Apply"); } }
void LLPanelGroups::enableButtons() { LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list) { group_id = group_list->getCurrentID(); } if(group_id != gAgent.getGroupID()) { childEnable("Activate"); } else { childDisable("Activate"); } if (group_id.notNull()) { childEnable("Info"); childEnable("IM"); childEnable("Leave"); } else { childDisable("Info"); childDisable("IM"); childDisable("Leave"); } if(gAgent.mGroups.count() < MAX_AGENT_GROUPS) { childEnable("Create"); } else { childDisable("Create"); } if (group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE)) { LLPanelGroups::childEnable("Invite..."); } else { LLPanelGroups::childDisable("Invite..."); } }
//----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- BOOL LLFloaterImagePreview::postBuild() { if (!LLFloaterNameDesc::postBuild()) { return FALSE; } childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); childSetAction("ok_btn", onBtnOK, this); LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); if (iface) { iface->selectFirstItem(); } childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this); mPreviewRect.set(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT, getRect().getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); childHide("bad_image_text"); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { mAvatarPreview = new LLImagePreviewAvatar(256, 256); mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, FALSE); mSculptedPreview = new LLImagePreviewSculpted(256, 256); mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) childEnable("lossless_check"); // <edit> gSavedSettings.setBOOL("TemporaryUpload",FALSE); childSetValue("temp_check",FALSE); // </edit> } else { mAvatarPreview = NULL; mSculptedPreview = NULL; childShow("bad_image_text"); childDisable("clothing_type_combo"); childDisable("ok_btn"); } return TRUE; }
void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line) { if (line->getLength() >= (S32)mMinSearchChars) { setDefaultBtn( "Search" ); childEnable("Search"); } else { setDefaultBtn(); childDisable("Search"); } }
void LLPanelObjectTools::enableAllWidgets() { childEnable("disable scripts"); childDisable("Apply"); // don't enable this one childEnable("Set Target"); childEnable("Delete Target's Scripted Objects On Others Land"); childEnable("Delete Target's Scripted Objects On *Any* Land"); childEnable("Delete *ALL* Of Target's Objects"); childEnable("Get Top Colliders"); childEnable("Get Top Scripts"); }
// virtual void LLPanelGroup::draw() { LLPanel::draw(); if (mRefreshTimer.hasExpired()) { mRefreshTimer.stop(); childEnable("btn_refresh"); childEnable("groups_accordion"); } LLButton* button_apply = findChild<LLButton>("btn_apply"); if(button_apply && button_apply->getVisible()) { bool enable = false; std::string mesg; for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin(); it!=mTabs.end(); ++it) enable = enable || (*it)->needsApply(mesg); childSetEnabled("btn_apply", enable); } }
void lggPanelIRC::enableButtons() { LLCtrlListInterface *irc_list = childGetListInterface("PhoenixIRC_list"); LLUUID irc_id; if (irc_list) { irc_id = irc_list->getCurrentID(); } if (irc_id.notNull()) { childEnable("PhoenixIRC_remove"); childEnable("PhoenixIRC_IM"); childEnable("PhoenixIRC_edit"); } else { childDisable("PhoenixIRC_IM"); childDisable("PhoenixIRC_edit"); childDisable("PhoenixIRC_remove"); } childEnable("PhoenixIRC_new"); refresh(); }
//----------------------------------------------------------------------------- // refresh() //----------------------------------------------------------------------------- void LLFloaterAnimPreview::refresh() { if (!mAnimPreview) { childShow("bad_animation_text"); mPlayButton->setEnabled(FALSE); mStopButton->setEnabled(FALSE); childDisable("ok_btn"); } else { childHide("bad_animation_text"); mPlayButton->setEnabled(TRUE); LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); if (avatarp->isMotionActive(mMotionID)) { mStopButton->setEnabled(TRUE); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (avatarp->areAnimationsPaused()) { mPlayButton->setImages(std::string("button_anim_play.tga"), std::string("button_anim_play_selected.tga")); } else { if (motionp) { F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); childSetValue("playback_slider", fraction_complete); } mPlayButton->setImages(std::string("button_anim_pause.tga"), std::string("button_anim_pause_selected.tga")); } } else { mPauseRequest = avatarp->requestPause(); mPlayButton->setImages(std::string("button_anim_play.tga"), std::string("button_anim_play_selected.tga")); mStopButton->setEnabled(TRUE); // stop also resets, leave enabled. } childEnable("ok_btn"); mAnimPreview->requestUpdate(); } }
void LLPanelMsgs::draw() { LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups"); if (disabled_popups.getFirstSelected()) { childEnable("enable_popup"); } else { childDisable("enable_popup"); } LLPanel::draw(); }
// virtual void LLPanelGroup::draw() { LLPanel::draw(); if (mRefreshTimer.hasExpired()) { mRefreshTimer.stop(); childEnable("btn_refresh"); } if (mCurrentTab) { std::string mesg; childSetEnabled("btn_apply", mCurrentTab->needsApply(mesg)); } }
BOOL LLFloaterGroupPicker::postBuild() { init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), mPowersMask); childSetAction("OK", onBtnOK, this); childSetAction("Cancel", onBtnCancel, this); setDefaultBtn("OK"); childSetDoubleClickCallback("group list", onBtnOK); childSetUserData("group list", this); childEnable("OK"); return TRUE; }
//----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- BOOL LLFloaterSculptPreview::postBuild() { childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); if (iface) { iface->selectFirstItem(); } childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this); mPreviewRect.set(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT, getRect().getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); childHide("bad_image_text"); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { mAvatarPreview = new LLPreviewAvatar(256, 256); mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, FALSE); mSculptedPreview = new LLPreviewSculpted(256, 256); mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) childEnable("lossless_check"); childSetValue("temp_check",FALSE); } else { mAvatarPreview = NULL; mSculptedPreview = NULL; childShow("bad_image_text"); childDisable("clothing_type_combo"); childDisable("ok_btn"); } return TRUE; }
void LLPanelDirBrowser::updateMaturityCheckbox() { BOOL godlike = gAgent.isGodlike(); // You only have a choice if your maturity is 'mature' or higher. // Logic: if you're not at least mature, hide the mature and adult options // After that, enable only the options you can legitimately choose. // If you're PG only, show you the checkbox but don't let you change it. // If you're God, you have everything. bool mature_enabled = gAgent.canAccessMature() || godlike; bool adult_enabled = gAgent.canAccessAdult() || godlike; // These check boxes can only be checked if you have the right access to use them std::string control_name_pg = getChild<LLCheckBoxCtrl>("incpg")->getControlName(); std::string control_name_mature = getChild<LLCheckBoxCtrl>("incmature")->getControlName(); std::string control_name_adult = getChild<LLCheckBoxCtrl>("incadult")->getControlName(); childSetValue("incpg", gSavedSettings.getBOOL(control_name_pg)); childSetValue("incmature", gSavedSettings.getBOOL(control_name_mature) && mature_enabled); childSetValue("incadult", gSavedSettings.getBOOL(control_name_adult) && adult_enabled); // Teens don't get mature/adult choices if (gAgent.wantsPGOnly()) { childHide("incmature"); childHide("incadult"); childSetValue("incpg", TRUE); childDisable("incpg"); } childSetEnabled("incmature", mature_enabled); childSetEnabled("incadult", adult_enabled); if (mature_enabled) { childEnable("incpg"); childSetVisible("incpg", TRUE); childSetVisible("incmature", TRUE); childSetVisible("incadult", TRUE); } }
// protected void LLPanelDirBrowser::updateResultCount() { LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results"); S32 result_count = list->getItemCount(); std::string result_text; if (!mHaveSearchResults) result_count = 0; if (childIsVisible("Next >")) { // Item count be off by a few if bogus items sent from database // Just use the number of results per page. JC result_text = llformat(">%d found", mResultsPerPage); } else { result_text = llformat("%d found", result_count); } childSetValue("result_text", result_text); if (result_count == 0) { // add none found response if (list->getItemCount() == 0) { list->addCommentText(std::string("None found.")); // *TODO: Translate list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } } else { childEnable("results"); } }
void LLFloaterSellLandUI::refreshUI() { LLParcel* parcelp = mParcelSelection->getParcel(); if (!parcelp) return; LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); if (snapshot) { snapshot->setImageAssetID(mParcelSnapshot); } childSetText("info_parcel", parcelp->getName()); childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); childSetTextArg("price_ld", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); std::string price_str = childGetValue("price").asString(); bool valid_price = false; valid_price = (price_str != "") && LLLineEditor::prevalidateNonNegativeS32(utf8str_to_wstring(price_str)); if (valid_price && mParcelActualArea > 0) { F32 per_meter_price = 0; per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea); childSetTextArg("price_per_m", "[PER_METER]", llformat("%0.2f", per_meter_price)); childShow("price_per_m"); setBadge("step_price", BADGE_OK); } else { childHide("price_per_m"); if ("" == price_str) { setBadge("step_price", BADGE_NOTE); } else { setBadge("step_price", BADGE_ERROR); } } if (mSellToBuyer) { childSetValue("sell_to", "user"); childShow("sell_to_agent"); childShow("sell_to_select_agent"); } else { if (mChoseSellTo) { childSetValue("sell_to", "anyone"); } else { childSetValue("sell_to", "select"); } childHide("sell_to_agent"); childHide("sell_to_select_agent"); } // Must select Sell To: Anybody, or User (with a specified username) std::string sell_to = childGetValue("sell_to").asString(); bool valid_sell_to = "select" != sell_to && ("user" != sell_to || mAuthorizedBuyer.notNull()); if (!valid_sell_to) { setBadge("step_sell_to", BADGE_NOTE); } else { setBadge("step_sell_to", BADGE_OK); } bool valid_sell_objects = ("none" != childGetValue("sell_objects").asString()); if (!valid_sell_objects) { setBadge("step_sell_objects", BADGE_NOTE); } else { setBadge("step_sell_objects", BADGE_OK); } if (valid_sell_to && valid_price && valid_sell_objects) { childEnable("sell_btn"); } else { childDisable("sell_btn"); } }
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) { mGotPersonalInfo = true; mOriginalIMViaEmail = im_via_email; mDirectoryVisibility = visibility; if(visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; childEnable("online_visibility"); } else if(visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; childEnable("online_visibility"); } else { mOriginalHideOnlineStatus = true; } childEnable("include_im_in_chat_history"); childEnable("show_timestamps_check_im"); childEnable("friends_online_notify_checkbox"); childSetValue("online_visibility", mOriginalHideOnlineStatus); childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); childEnable("send_im_to_email"); childSetValue("send_im_to_email", im_via_email); childEnable("plain_text_chat_history"); childSetValue("plain_text_chat_history", gSavedSettings.getBOOL("PlainTextChatHistory")); childEnable("log_instant_messages"); // childEnable("log_chat"); // childEnable("busy_response"); // childEnable("log_instant_messages_timestamp"); // childEnable("log_chat_timestamp"); childEnable("log_chat_IM"); childEnable("log_date_timestamp"); // childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2")); childEnable("log_nearby_chat"); childEnable("log_instant_messages"); childEnable("show_timestamps_check_im"); childDisable("log_path_string");// LineEditor becomes readonly in this case. childEnable("log_path_button"); std::string display_email(email); childSetText("email_address",display_email); }
void LLFloaterEditSky::syncControls() { bool err; LLWLParamManager * param_mgr = LLWLParamManager::getInstance(); LLWLParamSet& cur_params = param_mgr->mCurParams; // blue horizon param_mgr->mBlueHorizon = cur_params.getVector(param_mgr->mBlueHorizon.mName, err); setColorSwatch("WLBlueHorizon", param_mgr->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE); // haze density, horizon, mult, and altitude param_mgr->mHazeDensity = cur_params.getFloat(param_mgr->mHazeDensity.mName, err); childSetValue("WLHazeDensity", (F32) param_mgr->mHazeDensity); param_mgr->mHazeHorizon = cur_params.getFloat(param_mgr->mHazeHorizon.mName, err); childSetValue("WLHazeHorizon", (F32) param_mgr->mHazeHorizon); param_mgr->mDensityMult = cur_params.getFloat(param_mgr->mDensityMult.mName, err); childSetValue("WLDensityMult", ((F32) param_mgr->mDensityMult) * param_mgr->mDensityMult.mult); param_mgr->mMaxAlt = cur_params.getFloat(param_mgr->mMaxAlt.mName, err); childSetValue("WLMaxAltitude", (F32) param_mgr->mMaxAlt); // blue density param_mgr->mBlueDensity = cur_params.getVector(param_mgr->mBlueDensity.mName, err); setColorSwatch("WLBlueDensity", param_mgr->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE); // Lighting // sunlight param_mgr->mSunlight = cur_params.getVector(param_mgr->mSunlight.mName, err); setColorSwatch("WLSunlight", param_mgr->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE); // glow param_mgr->mGlow = cur_params.getVector(param_mgr->mGlow.mName, err); childSetValue("WLGlowR", 2 - param_mgr->mGlow.r / 20.0f); childSetValue("WLGlowB", -param_mgr->mGlow.b / 5.0f); // ambient param_mgr->mAmbient = cur_params.getVector(param_mgr->mAmbient.mName, err); setColorSwatch("WLAmbient", param_mgr->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE); F32 time24 = sun_pos_to_time24(param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE); getChild<LLTimeCtrl>("WLDayTime")->setTime24(time24); childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); // Clouds // Cloud Color param_mgr->mCloudColor = cur_params.getVector(param_mgr->mCloudColor.mName, err); setColorSwatch("WLCloudColor", param_mgr->mCloudColor, WL_CLOUD_SLIDER_SCALE); // Cloud param_mgr->mCloudMain = cur_params.getVector(param_mgr->mCloudMain.mName, err); childSetValue("WLCloudX", param_mgr->mCloudMain.r); childSetValue("WLCloudY", param_mgr->mCloudMain.g); childSetValue("WLCloudDensity", param_mgr->mCloudMain.b); // Cloud Detail param_mgr->mCloudDetail = cur_params.getVector(param_mgr->mCloudDetail.mName, err); childSetValue("WLCloudDetailX", param_mgr->mCloudDetail.r); childSetValue("WLCloudDetailY", param_mgr->mCloudDetail.g); childSetValue("WLCloudDetailDensity", param_mgr->mCloudDetail.b); // Cloud extras param_mgr->mCloudCoverage = cur_params.getFloat(param_mgr->mCloudCoverage.mName, err); param_mgr->mCloudScale = cur_params.getFloat(param_mgr->mCloudScale.mName, err); childSetValue("WLCloudCoverage", (F32) param_mgr->mCloudCoverage); childSetValue("WLCloudScale", (F32) param_mgr->mCloudScale); // cloud scrolling bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX(); bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); childSetValue("WLCloudLockX", lockX); childSetValue("WLCloudLockY", lockY); // disable if locked, enable if not if (lockX) { childDisable("WLCloudScrollX"); } else { childEnable("WLCloudScrollX"); } if (lockY) { childDisable("WLCloudScrollY"); } else { childEnable("WLCloudScrollY"); } // *HACK cloud scrolling is off my an additive of 10 childSetValue("WLCloudScrollX", param_mgr->mCurParams.getCloudScrollX() - 10.0f); childSetValue("WLCloudScrollY", param_mgr->mCurParams.getCloudScrollY() - 10.0f); param_mgr->mDistanceMult = cur_params.getFloat(param_mgr->mDistanceMult.mName, err); childSetValue("WLDistanceMult", (F32) param_mgr->mDistanceMult); // Tweak extras param_mgr->mWLGamma = cur_params.getFloat(param_mgr->mWLGamma.mName, err); childSetValue("WLGamma", (F32) param_mgr->mWLGamma); childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); }
void LLFloaterWindLight::syncMenu() { bool err; LLWLParamManager * param_mgr = LLWLParamManager::instance(); LLWLParamSet& currentParams = param_mgr->mCurParams; //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues; // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) // Fixes LL "bug" (preset name isn't kept synchronized) if (mSkyPresetCombo->getSelectedItemLabel() != LLEnvManagerNew::instance().getSkyPresetName()) { mSkyPresetCombo->selectByValue(LLEnvManagerNew::instance().getSkyPresetName()); } // [/RLVa:KB] // blue horizon param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); childSetValue("WLBlueHorizonG", param_mgr->mBlueHorizon.g / 2.0); childSetValue("WLBlueHorizonB", param_mgr->mBlueHorizon.b / 2.0); childSetValue("WLBlueHorizonI", std::max(param_mgr->mBlueHorizon.r / 2.0, std::max(param_mgr->mBlueHorizon.g / 2.0, param_mgr->mBlueHorizon.b / 2.0))); // haze density, horizon, mult, and altitude param_mgr->mHazeDensity = currentParams.getVector(param_mgr->mHazeDensity.mName, err); childSetValue("WLHazeDensity", param_mgr->mHazeDensity.r); param_mgr->mHazeHorizon = currentParams.getVector(param_mgr->mHazeHorizon.mName, err); childSetValue("WLHazeHorizon", param_mgr->mHazeHorizon.r); param_mgr->mDensityMult = currentParams.getVector(param_mgr->mDensityMult.mName, err); childSetValue("WLDensityMult", param_mgr->mDensityMult.x * param_mgr->mDensityMult.mult); param_mgr->mMaxAlt = currentParams.getVector(param_mgr->mMaxAlt.mName, err); childSetValue("WLMaxAltitude", param_mgr->mMaxAlt.x); // blue density param_mgr->mBlueDensity = currentParams.getVector(param_mgr->mBlueDensity.mName, err); childSetValue("WLBlueDensityR", param_mgr->mBlueDensity.r / 2.0); childSetValue("WLBlueDensityG", param_mgr->mBlueDensity.g / 2.0); childSetValue("WLBlueDensityB", param_mgr->mBlueDensity.b / 2.0); childSetValue("WLBlueDensityI", std::max(param_mgr->mBlueDensity.r / 2.0, std::max(param_mgr->mBlueDensity.g / 2.0, param_mgr->mBlueDensity.b / 2.0))); // Lighting // sunlight param_mgr->mSunlight = currentParams.getVector(param_mgr->mSunlight.mName, err); childSetValue("WLSunlightR", param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLSunlightG", param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLSunlightB", param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLSunlightI", std::max(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE, std::max(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE))); // glow param_mgr->mGlow = currentParams.getVector(param_mgr->mGlow.mName, err); childSetValue("WLGlowR", 2 - param_mgr->mGlow.r / 20.0f); childSetValue("WLGlowB", -param_mgr->mGlow.b / 5.0f); // ambient param_mgr->mAmbient = currentParams.getVector(param_mgr->mAmbient.mName, err); childSetValue("WLAmbientR", param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLAmbientG", param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLAmbientB", param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE); childSetValue("WLAmbientI", std::max(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE, std::max(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE))); childSetValue("WLSunAngle", param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); // Clouds // Cloud Color param_mgr->mCloudColor = currentParams.getVector(param_mgr->mCloudColor.mName, err); childSetValue("WLCloudColorR", param_mgr->mCloudColor.r); childSetValue("WLCloudColorG", param_mgr->mCloudColor.g); childSetValue("WLCloudColorB", param_mgr->mCloudColor.b); childSetValue("WLCloudColorI", std::max(param_mgr->mCloudColor.r, std::max(param_mgr->mCloudColor.g, param_mgr->mCloudColor.b))); // Cloud param_mgr->mCloudMain = currentParams.getVector(param_mgr->mCloudMain.mName, err); childSetValue("WLCloudX", param_mgr->mCloudMain.r); childSetValue("WLCloudY", param_mgr->mCloudMain.g); childSetValue("WLCloudDensity", param_mgr->mCloudMain.b); // Cloud Detail param_mgr->mCloudDetail = currentParams.getVector(param_mgr->mCloudDetail.mName, err); childSetValue("WLCloudDetailX", param_mgr->mCloudDetail.r); childSetValue("WLCloudDetailY", param_mgr->mCloudDetail.g); childSetValue("WLCloudDetailDensity", param_mgr->mCloudDetail.b); // Cloud extras param_mgr->mCloudCoverage = currentParams.getVector(param_mgr->mCloudCoverage.mName, err); param_mgr->mCloudScale = currentParams.getVector(param_mgr->mCloudScale.mName, err); childSetValue("WLCloudCoverage", param_mgr->mCloudCoverage.x); childSetValue("WLCloudScale", param_mgr->mCloudScale.x); // cloud scrolling bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX(); bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); childSetValue("WLCloudLockX", lockX); childSetValue("WLCloudLockY", lockY); childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds2")); // disable if locked, enable if not if(lockX) { childDisable("WLCloudScrollX"); } else { childEnable("WLCloudScrollX"); } if(lockY) { childDisable("WLCloudScrollY"); } else { childEnable("WLCloudScrollY"); } // *HACK cloud scrolling is off my an additive of 10 childSetValue("WLCloudScrollX", param_mgr->mCurParams.getCloudScrollX() - 10.0f); childSetValue("WLCloudScrollY", param_mgr->mCurParams.getCloudScrollY() - 10.0f); param_mgr->mDistanceMult = currentParams.getVector(param_mgr->mDistanceMult.mName, err); childSetValue("WLDistanceMult", param_mgr->mDistanceMult.x); // Tweak extras param_mgr->mWLGamma = currentParams.getVector(param_mgr->mWLGamma.mName, err); childSetValue("WLGamma", param_mgr->mWLGamma.x); childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); }
void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; sldr = getChild<LLSliderCtrl>("EnvTimeSlider"); // sync the clock F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); std::string timeStr = timeToString(val); LLTextBox* textBox; textBox = getChild<LLTextBox>("EnvTimeText"); textBox->setValue(timeStr); // sync time slider which starts at 6 AM val -= 0.25; if(val < 0) { val++; } sldr->setValue(val); // sync cloud coverage bool err; childSetValue("EnvCloudSlider", LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); // sync water params LLColor4 col = param_mgr->getFogColor(); LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor"); col.mV[3] = 1.0f; colCtrl->set(col); childSetValue("EnvWaterFogSlider", param_mgr->mFogDensity.mExp); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); // turn off Use Estate Time button if it's already being used if(LLWLParamManager::instance()->mAnimator.mUseLindenTime) { childDisable("EnvUseEstateTimeButton"); } else { childEnable("EnvUseEstateTimeButton"); } if(!gPipeline.canUseVertexShaders()) { childDisable("EnvWaterColor"); childDisable("EnvWaterColorText"); //childDisable("EnvAdvancedWaterButton"); } else { childEnable("EnvWaterColor"); childEnable("EnvWaterColorText"); //childEnable("EnvAdvancedWaterButton"); } // only allow access to these if they are using windlight if(!gPipeline.canUseWindLightShaders()) { childDisable("EnvCloudSlider"); childDisable("EnvCloudText"); //childDisable("EnvAdvancedSkyButton"); } else { childEnable("EnvCloudSlider"); childEnable("EnvCloudText"); //childEnable("EnvAdvancedSkyButton"); } }
void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, InventoryObjectList* inv, S32 serial_num, void* data) { if (!obj) { llwarns << "No object in LLFloaterBuyContents::inventoryChanged" << llendl; return; } if (!inv) { llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged" << llendl; removeVOInventoryListener(); return; } LLCtrlListInterface *item_list = childGetListInterface("item_list"); if (!item_list) { removeVOInventoryListener(); return; } // default to turning off the buy button. childDisable("buy_btn"); LLUUID owner_id; BOOL is_group_owned; LLAssetType::EType asset_type; LLInventoryType::EType inv_type; S32 wearable_count = 0; InventoryObjectList::const_iterator it = inv->begin(); InventoryObjectList::const_iterator end = inv->end(); for ( ; it != end; ++it ) { asset_type = (*it)->getType(); // Skip folders, so we know we have inventory items only if (asset_type == LLAssetType::AT_CATEGORY) continue; // Skip root folders, so we know we have inventory items only if (asset_type == LLAssetType::AT_ROOT_CATEGORY) continue; LLInventoryItem* inv_item = (LLInventoryItem*)((LLInventoryObject*)(*it)); inv_type = inv_item->getInventoryType(); // Count clothing items for later if (LLInventoryType::IT_WEARABLE == inv_type) { wearable_count++; } // Skip items the object's owner can't copy (and hence can't sell) if (!inv_item->getPermissions().getOwnership(owner_id, is_group_owned)) continue; if (!inv_item->getPermissions().allowCopyBy(owner_id, owner_id)) continue; // Skip items we can't transfer if (!inv_item->getPermissions().allowTransferTo(gAgent.getID())) continue; // There will be at least one item shown in the display, so go // ahead and enable the buy button. childEnable("buy_btn"); // Create the line in the list LLSD row; BOOL item_is_multi = FALSE; if ( inv_item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED ) { item_is_multi = TRUE; } std::string icon_name = get_item_icon_name(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), item_is_multi); row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = icon_name; // Append the permissions that you will acquire (not the current // permissions). U32 next_owner_mask = inv_item->getPermissions().getMaskNextOwner(); std::string text = (*it)->getName(); if (!(next_owner_mask & PERM_COPY)) { text.append(getString("no_copy_text")); } if (!(next_owner_mask & PERM_MODIFY)) { text.append(getString("no_modify_text")); } if (!(next_owner_mask & PERM_TRANSFER)) { text.append(getString("no_transfer_text")); } row["columns"][1]["column"] = "text"; row["columns"][1]["value"] = text; row["columns"][1]["font"] = "SANSSERIF"; item_list->addElement(row); } if (wearable_count > 0) { childEnable("wear_check"); childSetValue("wear_check", LLSD(false) ); } removeVOInventoryListener(); }