From 0afe1fd41dbc3ec593931e6626b210a29130fa0b Mon Sep 17 00:00:00 2001 From: Palmer Date: Fri, 26 Mar 2010 13:19:01 -0700 Subject: Applied (manually in places) diff from svn.lindenlab.com/svn/linden/branches/render-pipeline/render-pipeline-7@135361 to get deferred rendering changes from the svn branch. Bleh! --- .../shaders/class2/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class2/deferred/sunLightF.glsl | 4 +- indra/newview/llviewerdisplay.cpp | 6 - indra/newview/llviewerwindow.cpp | 134 --------------------- indra/newview/pipeline.cpp | 34 +++--- 5 files changed, 23 insertions(+), 157 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 651959413c..45884d5732 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -137,7 +137,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_ambient_lod); + vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index a0026edcd2..4333cc64a7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -224,11 +224,11 @@ void main() //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.1).x; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8).x; //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.1).x; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8).x; //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 5a2b901bd7..f09ae1f8f4 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -869,12 +869,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } - /// We copy the frame buffer straight into a texture here, - /// and then display it again with compositor effects. - /// Using render to texture would be faster/better, but I don't have a - /// grasp of their full display stack just yet. - // gPostProcess->apply(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.renderDeferredLighting(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6d2bbb27ee..11f9261297 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3892,140 +3892,6 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); - - // *TODO below code was broken in deferred pipeline - /* - if ((!raw) || preview_width < 10 || preview_height < 10) - { - return FALSE; - } - - if(gResizeScreenTexture) //the window is resizing - { - return FALSE ; - } - - setCursor(UI_CURSOR_WAIT); - - // Hide all the UI widgets first and draw a frame - BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); - - if ( prev_draw_ui != show_ui) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = FALSE; - } - - S32 render_name = gSavedSettings.getS32("RenderName"); - gSavedSettings.setS32("RenderName", 0); - LLVOAvatar::updateFreezeCounter(1) ; //pause avatar updating for one frame - - S32 w = preview_width ; - S32 h = preview_height ; - LLVector2 display_scale = mDisplayScale ; - mDisplayScale.setVec((F32)w / mWindowRectRaw.getWidth(), (F32)h / mWindowRectRaw.getHeight()) ; - LLRect window_rect = mWindowRectRaw; - mWindowRectRaw.set(0, h, w, 0); - - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - setup3DRender(); - - LLFontGL::setFontDisplay(FALSE) ; - LLHUDText::setDisplayText(FALSE) ; - if (type == SNAPSHOT_TYPE_OBJECT_ID) - { - gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); - } - else - { - display(do_rebuild, 1.0f, 0, TRUE); - render_ui(); - } - - S32 glformat, gltype, glpixel_length ; - if(SNAPSHOT_TYPE_DEPTH == type) - { - glpixel_length = 4 ; - glformat = GL_DEPTH_COMPONENT ; - gltype = GL_FLOAT ; - } - else - { - glpixel_length = 3 ; - glformat = GL_RGB ; - gltype = GL_UNSIGNED_BYTE ; - } - - raw->resize(w, h, glpixel_length); - glReadPixels(0, 0, w, h, glformat, gltype, raw->getData()); - - if(SNAPSHOT_TYPE_DEPTH == type) - { - LLViewerCamera* camerap = LLViewerCamera::getInstance(); - F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - - //calculate the depth - for (S32 y = 0 ; y < h ; y++) - { - for(S32 x = 0 ; x < w ; x++) - { - S32 i = (w * y + x) << 2 ; - - F32 depth_float_i = *(F32*)(raw->getData() + i); - - F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); - *(raw->getData() + i + 0) = depth_byte; - *(raw->getData() + i + 1) = depth_byte; - *(raw->getData() + i + 2) = depth_byte; - *(raw->getData() + i + 3) = 255; - } - } - } - - LLFontGL::setFontDisplay(TRUE) ; - LLHUDText::setDisplayText(TRUE) ; - mDisplayScale.setVec(display_scale) ; - mWindowRectRaw = window_rect; - setup3DRender(); - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - - // POST SNAPSHOT - if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = TRUE; - } - - setCursor(UI_CURSOR_ARROW); - - if (do_rebuild) - { - // If we had to do a rebuild, that means that the lists of drawables to be rendered - // was empty before we started. - // Need to reset these, otherwise we call state sort on it again when render gets called the next time - // and we stand a good chance of crashing on rebuild because the render drawable arrays have multiple copies of - // objects on them. - gPipeline.resetDrawOrders(); - } - - gSavedSettings.setS32("RenderName", render_name); - - return TRUE;*/ } // Saves the image from the screen to the specified filename and path. diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 685be043fc..8b48dd10d3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3404,26 +3404,14 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); - renderHighlights(); - mHighlightFaces.clear(); - - renderDebug(); - - LLVertexBuffer::unbind(); - - if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - gObjectList.resetObjectBeacons(); - } - if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); doOcclusion(camera); + gGLLastMatrix = NULL; + glLoadMatrix(gGLModelView); } } @@ -6893,6 +6881,24 @@ void LLPipeline::renderDeferredLighting() mRenderTypeMask = render_mask; } + { + //render highlights, etc. + renderHighlights(); + mHighlightFaces.clear(); + + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + LLHUDObject::renderAll(); + gObjectList.resetObjectBeacons(); + } + } + mScreen.flush(); } -- cgit v1.2.3 From eb35a7e167c6facaca8fd2596ae9fff8c8611d33 Mon Sep 17 00:00:00 2001 From: Palmer Date: Fri, 26 Mar 2010 13:55:35 -0700 Subject: Davep's LLDrawPoolBump changes from svn/linden/branches/viewer-mesh @ 114046 for deferred rendering --- indra/newview/lldrawpoolbump.cpp | 12 ++++++++++++ indra/newview/lldrawpoolbump.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index d09d4a412f..a4a8dc80b5 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -701,6 +701,18 @@ void LLDrawPoolBump::endBump() gGL.setSceneBlendType(LLRender::BT_ALPHA); } +S32 LLDrawPoolBump::getNumDeferredPasses() +{ + if (gSavedSettings.getBOOL("RenderObjectBump")) + { + return 1; + } + else + { + return 0; + } +} + void LLDrawPoolBump::beginDeferredPass(S32 pass) { if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index bf940cf1e4..2019f1df26 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -79,7 +79,7 @@ public: void renderBump(); void endBump(); - virtual S32 getNumDeferredPasses() { return 1; } + virtual S32 getNumDeferredPasses(); /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); /*virtual*/ void renderDeferred(S32 pass); -- cgit v1.2.3 From 1aa0161b230f01eea3f62b8baacce8a7acc18187 Mon Sep 17 00:00:00 2001 From: Palmer Date: Mon, 5 Apr 2010 16:53:44 -0700 Subject: One last small change from svn//branches/viewer-mesh @ 114046 for render bump --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index cb362d557c..346fc0c4e4 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3839,7 +3839,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - if (LLPipeline::sRenderDeferred && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) { registerFace(group, facep, LLRenderPass::PASS_BUMP); } -- cgit v1.2.3 From b5e12269e18bc9074b96f115085d5540ef1d7545 Mon Sep 17 00:00:00 2001 From: Palmer Date: Mon, 5 Apr 2010 19:37:09 -0700 Subject: applied render-pipeline-7 @ 137608. This fixes empty depth buffer during highlight render --- indra/newview/llviewerdisplay.cpp | 2 +- indra/newview/pipeline.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index f09ae1f8f4..f796fb5451 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1112,7 +1112,7 @@ void render_ui(F32 zoom_factor, int subfield) { gPipeline.renderBloom(gSnapshot, zoom_factor, subfield); } - + render_hud_elements(); render_hud_attachments(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8b48dd10d3..5e54d4ab78 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5803,6 +5803,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + + if (LLRenderTarget::sUseFBO) + { //copy depth buffer from mScreen to framebuffer + LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), + 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } } -- cgit v1.2.3 From 3892a84cfc1c9f7c99b3d1838b9d574a47b77900 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 16 Dec 2009 12:31:24 -0600 Subject: Tracking down stalls in llpumpio and agent updates. --- indra/newview/llappviewer.cpp | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 43c8c679c6..6ec4266925 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -922,6 +922,11 @@ static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares"); +static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service"); +static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); +static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); bool LLAppViewer::mainLoop() { @@ -1033,10 +1038,20 @@ bool LLAppViewer::mainLoop() LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP); pingMainloopTimeout("Main:ServicePump"); LLFastTimer t4(FTM_PUMP); - gAres->process(); - // this pump is necessary to make the login screen show up - gServicePump->pump(); - gServicePump->callback(); + { + LLFastTimer t(FTM_PUMP_ARES); + gAres->process(); + } + { + LLFastTimer t(FTM_PUMP_SERVICE); + // this pump is necessary to make the login screen show up + gServicePump->pump(); + + { + LLFastTimer t(FTM_SERVICE_CALLBACK); + gServicePump->callback(); + } + } } resumeMainloopTimeout(); @@ -3495,9 +3510,12 @@ void LLAppViewer::idle() gAgent.moveYaw(-1.f); } - // Handle automatic walking towards points - gAgentPilot.updateTarget(); - gAgent.autoPilot(&yaw); + { + LLFastTimer t(FTM_AGENT_AUTOPILOT); + // Handle automatic walking towards points + gAgentPilot.updateTarget(); + gAgent.autoPilot(&yaw); + } static LLFrameTimer agent_update_timer; static U32 last_control_flags; @@ -3508,6 +3526,7 @@ void LLAppViewer::idle() if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { + LLFastTimer t(FTM_AGENT_UPDATE); // Send avatar and camera info last_control_flags = gAgent.getControlFlags(); send_agent_update(TRUE); -- cgit v1.2.3 From 26b2556802c74fc5e480c497b905b45cc3636e1d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 18 Dec 2009 13:21:55 -0600 Subject: Timers to track time spent waiting on message system. --- indra/newview/llviewermessage.cpp | 2 ++ indra/newview/llworld.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c542459cdb..cb3f3c8edd 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3316,6 +3316,7 @@ const F32 THRESHOLD_HEAD_ROT_QDOT = 0.9997f; // ~= 2.5 degrees -- if its less th const F32 MAX_HEAD_ROT_QDOT = 0.99999f; // ~= 0.5 degrees -- if its greater than this then no need to update head_rot // between these values we delay the updates (but no more than one second) +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE_SEND("Send Message"); void send_agent_update(BOOL force_send, BOOL send_reliable) { @@ -3474,6 +3475,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) if (duplicate_count < DUP_MSGS && !gDisconnected) { + LLFastTimer t(FTM_AGENT_UPDATE_SEND); // Build the message msg->newMessageFast(_PREHASH_AgentUpdate); msg->nextBlockFast(_PREHASH_AgentData); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 0b63f5efbd..c7148f8826 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1028,9 +1028,11 @@ void LLWorld::disconnectRegions() } } +static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim"); void process_enable_simulator(LLMessageSystem *msg, void **user_data) { + LLFastTimer t(FTM_ENABLE_SIMULATOR); // enable the appropriate circuit for this simulator and // add its values into the gSimulator structure U64 handle; -- cgit v1.2.3 From ce7eb236fc3f0ed708899e2aa65dd9b876769850 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 4 Jan 2010 11:50:04 -0600 Subject: CTS-54 Fix for SSAO artifacts far away. --- .../shaders/class1/deferred/sunLightF.glsl | 82 ++++++++++++---------- .../shaders/class2/deferred/sunLightF.glsl | 82 ++++++++++++---------- 2 files changed, 92 insertions(+), 72 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 22bdd2c7f3..fafc2ae3cc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -53,51 +53,61 @@ vec4 getPosition(vec2 pos_screen) //calculate decreases in ambient lighting when crowded out (SSAO) float calcAmbientOcclusion(vec4 pos, vec3 norm) { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + float ret = 1.0; - float angle_hidden = 0.0; - int points = 0; + float dist = dot(pos.xyz,pos.xyz); - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) + if (dist < 64.0*64.0) { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); + float angle_hidden = 0.0; + int points = 0; - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); } - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); + return min(ret, 1.0); } void main() diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 4333cc64a7..74a948f584 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -55,51 +55,61 @@ vec4 getPosition(vec2 pos_screen) //calculate decreases in ambient lighting when crowded out (SSAO) float calcAmbientOcclusion(vec4 pos, vec3 norm) { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; + float ret = 1.0; - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + float dist = dot(pos.xyz,pos.xyz); - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) + if (dist < 64.0*64.0) { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); + float angle_hidden = 0.0; + int points = 0; - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); } - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); + return min(ret, 1.0); } float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -- cgit v1.2.3 From 5afb4373c4be036bd2f8e8aa7c3a192fbdf91c20 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 8 Jan 2010 13:31:04 -0600 Subject: Cleaned up visible edges of projector frustum in diffuse/specular/ambient lighting from projectors. --- .../shaders/class1/deferred/multiSpotLightF.glsl | 102 +++++++++++++++------ .../shaders/class2/deferred/multiSpotLightF.glsl | 58 +++++++++++- .../shaders/class2/deferred/spotLightF.glsl | 11 --- 3 files changed, 128 insertions(+), 43 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 28bcd720c0..2c8d90d1a6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -5,7 +5,6 @@ * $License$ */ - #version 120 #extension GL_ARB_texture_rectangle : enable @@ -15,6 +14,7 @@ uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform samplerCube environmentMap; +uniform sampler2DRect lightMap; uniform sampler2D noiseMap; uniform sampler2D lightFunc; uniform sampler2D projectionMap; @@ -26,12 +26,15 @@ uniform vec3 proj_n; uniform float proj_focus; //distance from plane to begin blurring uniform float proj_lod; //(number of mips in proj map) uniform float proj_range; //range between near clip and far clip plane of projection +uniform float proj_ambient_lod; uniform float proj_ambiance; uniform float near_clip; uniform float far_clip; uniform vec3 proj_origin; //origin of projection to be used for angular attenuation uniform float sun_wash; +uniform int proj_shadow_idx; +uniform float shadow_fade; varying vec4 vary_light; @@ -40,6 +43,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -68,7 +117,7 @@ void main() { discard; } - + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); @@ -83,7 +132,11 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = gl_Color.a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); + if (dist_atten <= 0.0) + { + discard; + } lv = proj_origin-pos.xyz; lv = normalize(lv); @@ -101,32 +154,32 @@ void main() proj_tc.y > 0.0) { float lit = 0.0; + float amb_da = proj_ambiance; + if (da > 0.0) { float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; col = lcol*lit*diff_tex; + amb_da += (da*0.5)*proj_ambiance; } - float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - //float amb_da = mix(proj_ambiance, proj_ambiance*max(-da, 0.0), max(da, 0.0)); - float amb_da = proj_ambiance; - + //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); + amb_da += (da*da*0.5+0.5)*proj_ambiance; - + amb_da *= dist_atten * noise; - + amb_da = min(amb_da, 1.0-lit); - + col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -144,35 +197,28 @@ void main() { vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - vec3 stc = (proj_mat * vec4(pfinal.xyz, 1.0)).xyz; + vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); if (stc.z > 0.0) { - stc.xy /= stc.z+proj_near; - + stc.xy /= stc.w; + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; } } } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 45884d5732..3e29c684e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -43,6 +43,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -126,7 +172,7 @@ void main() float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; @@ -137,7 +183,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_lod); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; @@ -167,13 +213,17 @@ void main() if (stc.z > 0.0) { stc.xy /= stc.w; - + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index d6534083cf..6617e33c0d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -179,17 +179,6 @@ void main() } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - //attenuate point light contribution by SSAO component col *= texture2DRect(lightMap, frag.xy).g; -- cgit v1.2.3 From adcfdfd8c00a04759833ef2ae9bb9d1f5084dc85 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 16:20:06 -0800 Subject: first dribble of directional lights for shaderless path. --- indra/newview/pipeline.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5940b354f4..060e8545ab 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4567,8 +4567,22 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); - glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + if (light->getLightTexture()) // directional (spot-)light + { + LLVector3 spotparams = light->getSpotLightParams(); + LLQuaternion quat = light->getRenderRotation(); + LLVector3 at_axis(0,0,-1); // todo: verify against deferred + at_axis *= quat; + llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); // fixme - focus + glLightf (gllight, GL_SPOT_CUTOFF, 22.0f); // fixme - fov + } + else // omnidirectional (point) light + { + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); + glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + } cur_light++; if (cur_light >= 8) { -- cgit v1.2.3 From 0467d0a62916f045c50c53e12719ca692271326c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 18:01:12 -0800 Subject: enable basic directional lighting for basic/atmospheric shaders - yay. next, needs the non-shader GL lighting model to be equally dumb (it's too smart - kill the spot angle. --- .../shaders/class1/lighting/lightFuncV.glsl | 21 +++++++++++++++++++++ .../shaders/class2/lighting/sumLightsV.glsl | 8 +++++--- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 3e8fdfb3e4..211de830fa 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -28,7 +28,28 @@ float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) //angular attenuation da *= calcDirectionalLight(n, lv); + + return da; +} + + +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) +{ + //get light vector + vec3 lv = lp.xyz-v; + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float da = clamp(1.0/(la * d), 0.0, 1.0); + + //angular attenuation + da *= dot(lv, -ln) * calcDirectionalLight(n, lv); + return da; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index f4c59734a4..fd264b9e74 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -7,6 +7,7 @@ float calcDirectionalLight(vec3 n, vec3 l); float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -18,9 +19,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation); col.rgb = scaleDownLight(col.rgb); // Add windlight lights -- cgit v1.2.3 From f00e311756bf499cde3d5273d0f2de39b1f21636 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 18:21:33 -0800 Subject: woo, dumb GL lights now match up to our dumb shader model pretty well. next: shader model needs to grok point vs directional, shader model needs to resurrect ambient which I seem to have broken --- indra/newview/pipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 060e8545ab..891f83e877 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4255,7 +4255,7 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) glLightf (GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.0f); glLightf (GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f); - glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f); + glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f); } else if (gAvatarBacklight) // Always true (unless overridden in a devs .ini) { @@ -4571,12 +4571,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); - LLVector3 at_axis(0,0,-1); // todo: verify against deferred + LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction at_axis *= quat; llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); // fixme - focus - glLightf (gllight, GL_SPOT_CUTOFF, 22.0f); // fixme - fov + glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product + glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere } else // omnidirectional (point) light { -- cgit v1.2.3 From 3e1cd883d59d93218edad7e8f3932d42bb9f0f82 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 18:36:04 -0800 Subject: fix the shader dp light going negative! --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 211de830fa..0f03e336be 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= dot(lv, -ln) * calcDirectionalLight(n, lv); + da *= calcDirectionalLight(-ln, lv) * calcDirectionalLight(n, lv); return da; } -- cgit v1.2.3 From c1ae6160a5f277176063f10d5cde39673aedd419 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 18:50:10 -0800 Subject: cheaply resurrect the difference between spotlight and omnidirectional, as far as the shader is concerned. not complete. --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 4 ++-- indra/newview/pipeline.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 0f03e336be..b2d6d23b1e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -33,7 +33,7 @@ float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) } -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional) { //get light vector vec3 lv = lp.xyz-v; @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la) float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= calcDirectionalLight(-ln, lv) * calcDirectionalLight(n, lv); + da *= clamp(dot(-ln, lv)+is_omnidirectional, 0.0, 1.0) * calcDirectionalLight(n, lv); return da; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 891f83e877..2a1ed1b5ab 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4563,7 +4563,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); @@ -4577,11 +4576,16 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere + glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } else // omnidirectional (point) light { glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + + // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight + const float specular = {0.f, 0.f, 0.f, 1.f}, + glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } cur_light++; if (cur_light >= 8) -- cgit v1.2.3 From c67c7ddd63c06e4e4f0a25a2ef23b941b85dd7bf Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 21:48:22 -0800 Subject: getting closer to point/spot interchangability --- indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl | 6 +++--- indra/newview/pipeline.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index fd264b9e74..e5bf76db55 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -20,9 +20,9 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2a1ed1b5ab..3dc175d723 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4584,8 +4584,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight - const float specular = {0.f, 0.f, 0.f, 1.f}, - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); + const float specular[] = {0.f, 0.f, 0.f, 1.f}; + glLightfv(gllight, GL_SPECULAR, specular); } cur_light++; if (cur_light >= 8) -- cgit v1.2.3 From c086f06be69e156c49a61bec1d13062cc50cfd09 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 21:49:31 -0800 Subject: cheaper, cuter way to deal with spot vs point in the shader --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index b2d6d23b1e..4525bf80b2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -48,7 +48,7 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnid float da = clamp(1.0/(la * d), 0.0, 1.0); //angular attenuation - da *= clamp(dot(-ln, lv)+is_omnidirectional, 0.0, 1.0) * calcDirectionalLight(n, lv); + da *= max(dot(-ln, lv),is_omnidirectional) * calcDirectionalLight(n, lv); return da; } -- cgit v1.2.3 From 817d1d755b72b531b4107a259e618131fad94c50 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 28 Jan 2010 23:58:50 -0800 Subject: cheap no-branch goodness for rendering both spotlights and pointlights with the same shader code. kill already-nerfed quadratic attenuation which it seems we won't be supporting any decade soon. --- .../shaders/class1/lighting/lightFuncV.glsl | 6 +++- .../shaders/class2/lighting/sumLightsV.glsl | 2 +- indra/newview/pipeline.cpp | 42 ++++++++-------------- 3 files changed, 21 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 4525bf80b2..2e41f24afe 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -47,8 +47,12 @@ float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnid //distance attenuation float da = clamp(1.0/(la * d), 0.0, 1.0); + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_omnidirectional); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + //angular attenuation - da *= max(dot(-ln, lv),is_omnidirectional) * calcDirectionalLight(n, lv); + da *= calcDirectionalLight(n, lv); return da; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index e5bf76db55..4577b4be55 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -7,7 +7,7 @@ float calcDirectionalLight(vec3 n, vec3 l); float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la); +float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3dc175d723..1ef5b5ded1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4543,40 +4543,30 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 atten, quad; -#if 0 //1.9.1 - if (pool->getVertexShaderLevel() > 0) - { - atten = light_radius; - quad = llmax(light->getLightFalloff(), 0.0001f); - } - else -#endif - { - F32 x = (3.f * (1.f + light->getLightFalloff())); - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = (3.f * (1.f + light->getLightFalloff())); + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[cur_light] = light_color; S32 gllight = GL_LIGHT0+cur_light; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); if (light->getLightTexture()) // directional (spot-)light { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction at_axis *= quat; - llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + //llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); - glLightf (gllight, GL_SPOT_EXPONENT, 1.0f); // 1.0 = good old dot product + glLightf (gllight, GL_SPOT_EXPONENT, 2.0f); // 2.0 = good old dot product ^ 2 glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); + const float specular[] = {0.f, 0.f, 0.f, 0.f}; + glLightfv(gllight, GL_SPECULAR, specular); } else // omnidirectional (point) light { @@ -4586,6 +4576,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight const float specular[] = {0.f, 0.f, 0.f, 1.f}; glLightfv(gllight, GL_SPECULAR, specular); + //llinfos << "boring light" << llendl; } cur_light++; if (cur_light >= 8) @@ -4613,13 +4604,10 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; - F32 atten, quad; - { - F32 x = 3.f; - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = 3.f; + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[2] = light_color; S32 gllight = GL_LIGHT2; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); @@ -4627,8 +4615,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); } -- cgit v1.2.3 From 0fcdf05366c604c66e11cf0b6cc26c5fdbe3265f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 29 Jan 2010 00:22:13 -0800 Subject: spot-aware light func usage in ALL shaders. --- .../shaders/class1/deferred/alphaV.glsl | 14 +++++++------- .../shaders/class1/deferred/avatarAlphaV.glsl | 14 +++++++------- .../shaders/class1/lighting/lightFuncV.glsl | 22 +--------------------- .../shaders/class2/deferred/alphaV.glsl | 14 +++++++------- .../shaders/class2/deferred/avatarAlphaV.glsl | 14 +++++++------- .../shaders/class2/lighting/sumLightsV.glsl | 9 ++++----- .../shaders/class3/lighting/sumLightsV.glsl | 15 ++++++++------- 7 files changed, 41 insertions(+), 61 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 1a7d58b07b..91793a29d3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -49,12 +49,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index c1988d3c78..e36564df10 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -55,12 +55,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 2e41f24afe..d0f58cc1a4 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -12,28 +12,8 @@ float calcDirectionalLight(vec3 n, vec3 l) return a; } -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = length(lv); - - //normalize light vector - lv *= 1.0/d; - - //distance attenuation - float da = clamp(1.0/(la * d), 0.0, 1.0); - - //angular attenuation - da *= calcDirectionalLight(n, lv); - - return da; -} - -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional) +float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 5991e1f3b5..eec655e3df 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -50,12 +50,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index a939499b17..488bd677e1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -61,12 +61,12 @@ void main() col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index 4577b4be55..19800d96dc 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -6,8 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); -float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_omnidirectional); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -20,9 +19,9 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 1c5234c450..0fdfdf2dde 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -24,12 +24,13 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); -- cgit v1.2.3 From 35ed9dd2986aac6471a9c089bad6ff6062e34177 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 29 Jan 2010 00:31:39 -0800 Subject: Don't scale windlight lights up just to scale them down again later. avoid this with rearrangement. not tested. --- .../app_settings/shaders/class1/deferred/alphaV.glsl | 10 ++++------ .../app_settings/shaders/class1/deferred/avatarAlphaV.glsl | 10 ++++------ .../app_settings/shaders/class2/deferred/alphaV.glsl | 10 ++++------ .../app_settings/shaders/class2/deferred/avatarAlphaV.glsl | 10 ++++------ .../app_settings/shaders/class3/lighting/sumLightsV.glsl | 14 +++++--------- 5 files changed, 21 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 91793a29d3..cb0d7b797b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,12 +41,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -58,6 +53,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index e36564df10..e34f6ba552 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -47,12 +47,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -64,6 +59,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index eec655e3df..05a32578c1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -42,12 +42,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -59,6 +54,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 488bd677e1..d63baeb913 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -53,12 +53,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -70,6 +65,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 0fdfdf2dde..371d6b526c 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -15,16 +15,9 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col; - col.a = color.a; + vec4 col(0.0, 0.0, 0.0, color.a); - // Add windlight lights - col.rgb = atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); - col.rgb += atmosAmbient(baseLight.rgb); - col.rgb = scaleUpLight(col.rgb); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); @@ -33,7 +26,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - + + // Add windlight lights + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAmbient(baseLight.rgb); col.rgb = min(col.rgb*color.rgb, 1.0); -- cgit v1.2.3 From 8be10456e8b92828ea95a41bea2cd297303b26c0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 29 Jan 2010 00:57:28 -0800 Subject: duh, use the proper param name. --- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index d0f58cc1a4..2b7e8b125b 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -28,7 +28,7 @@ float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa float da = clamp(1.0/(la * d), 0.0, 1.0); // spotlight coefficient. - float spot = max(dot(-ln, lv), is_omnidirectional); + float spot = max(dot(-ln, lv), is_pointlight); da *= spot*spot; // GL_SPOT_EXPONENT=2 //angular attenuation -- cgit v1.2.3 From a857a71e097f3778a167c88980dc59c6960958bd Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 29 Jan 2010 01:45:13 -0800 Subject: fix a variety of shader errors, mostly due to my confusing glsl with C++... again --- indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl | 3 ++- indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index cb0d7b797b..04e556c11a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,7 +41,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index e34f6ba552..650fbcc3f5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -47,7 +47,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 2b7e8b125b..da49e59b89 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -13,7 +13,7 @@ float calcDirectionalLight(vec3 n, vec3 l) } -float calcPointlightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 05a32578c1..1fae8c4da3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -42,7 +42,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index d63baeb913..f8dd1b7431 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -53,7 +53,8 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col(0.0, 0.0, 0.0, gl_Color.a); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 371d6b526c..f129a1517b 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -15,7 +15,7 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col(0.0, 0.0, 0.0, color.a); + vec4 col = vec4(0.0, 0.0, 0.0, color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); -- cgit v1.2.3 From 2581f9ba0a78416575e48a09616a0d5a8d0a360c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/newview/llpanelvolume.cpp | 4 ++-- indra/newview/llvovolume.cpp | 7 +++++++ indra/newview/llvovolume.h | 1 + indra/newview/pipeline.cpp | 6 +++--- 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index fbe68b4d92..8b01637239 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -574,7 +574,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (volobjp->getLightTextureID().isNull()) + if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); @@ -591,7 +591,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->getLightTextureID().notNull()) + else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); //self->childDisable("Light FOV"); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e6de33c459..b7b024fa1d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,6 +2451,13 @@ void LLVOVolume::updateSpotLightPriority() } +bool LLVOVolume::isLightSpotlight() +{ + LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + return params->isLightSpotlight(); +} + + LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a8bb597f93..fbae011ffc 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -215,6 +215,7 @@ public: LLColor3 getLightBaseColor() const; // not scaled by intensity LLColor3 getLightColor() const; // scaled by intensity LLUUID getLightTextureID() const; + bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; void updateSpotLightPriority(); F32 getSpotLightPriority() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1ef5b5ded1..cceb417634 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4555,7 +4555,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); - if (light->getLightTexture()) // directional (spot-)light + if (light->isLightSpotlight()) // directional (spot-)light { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); @@ -6647,7 +6647,7 @@ void LLPipeline::renderDeferredLighting() { //draw box if camera is outside box if (render_local) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); spot_lights.push_back(drawablep); @@ -6664,7 +6664,7 @@ void LLPipeline::renderDeferredLighting() } else if (render_fullscreen) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); fullscreen_spot_lights.push_back(drawablep); -- cgit v1.2.3 From ec05d08ed907755cce300f95e9f4ba75a782f582 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:50:55 +0000 Subject: const fix. --- indra/newview/llvovolume.cpp | 2 +- indra/newview/pipeline.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7b024fa1d..10160a4208 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,7 +2451,7 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() +bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); return params->isLightSpotlight(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cceb417634..3d700abd01 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4544,7 +4544,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 x = (3.f * (1.f + light->getLightFalloff())); + F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. float linatten = x / (light_radius); // % of brightness at radius mHWLightColors[cur_light] = light_color; -- cgit v1.2.3 From 6abecf1228010d83c2df8d14057950fb51e37320 Mon Sep 17 00:00:00 2001 From: palange Date: Mon, 1 Feb 2010 11:23:30 -0800 Subject: pushing to private repo to move to windows development. --- indra/newview/llappviewer.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index becc30832d..21d908035f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -324,10 +324,6 @@ const char *VFS_INDEX_FILE_BASE = "index.db2.x."; static std::string gWindowTitle; -std::string gLoginPage; -std::vector gLoginURIs; -static std::string gHelperURI; - LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; void idle_afk_check() -- cgit v1.2.3 From fa95084dd3e5af99d7a0944e8e3323b91ea85ee1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 2 Feb 2010 22:45:30 +0000 Subject: Probably the real fix for isLightSpotlight() - PARAMS_LIGHT_IMAGE isn't guaranteed, duh. --- indra/newview/llvovolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 10160a4208..8a77461369 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2454,7 +2454,11 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - return params->isLightSpotlight(); + if (params) + { + return params->isLightSpotlight(); + } + return false; } -- cgit v1.2.3 From 58f813a136a5a889e01b39e96714af91402321ba Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 2 Feb 2010 14:45:42 -0800 Subject: merge --- indra/newview/CMakeLists.txt | 38 +-- indra/newview/app_settings/ignorable_dialogs.xml | 15 +- indra/newview/app_settings/settings.xml | 87 +++---- indra/newview/character/avatar_lad.xml | 12 +- indra/newview/llagent.cpp | 27 ++- indra/newview/llagent.h | 1 + indra/newview/llagentwearables.cpp | 286 ++++++++++++++++++++--- indra/newview/llappearancemgr.cpp | 174 ++++++++++++-- indra/newview/llappearancemgr.h | 17 +- indra/newview/llappviewer.cpp | 59 ++--- indra/newview/llavataractions.cpp | 10 +- indra/newview/llavatariconctrl.cpp | 4 +- indra/newview/llavatarlist.cpp | 19 +- indra/newview/llavatarlist.h | 4 + indra/newview/llavatarlistitem.cpp | 266 +++++++++++++-------- indra/newview/llavatarlistitem.h | 71 ++++-- indra/newview/llbottomtray.cpp | 96 ++++++-- indra/newview/llbottomtray.h | 17 +- indra/newview/llcallfloater.cpp | 164 ++++--------- indra/newview/llcallfloater.h | 23 +- indra/newview/llchatbar.cpp | 3 +- indra/newview/llchathistory.cpp | 65 +++--- indra/newview/llchathistory.h | 1 + indra/newview/llchatitemscontainerctrl.cpp | 64 +++-- indra/newview/llchatitemscontainerctrl.h | 1 + indra/newview/llchiclet.cpp | 67 +++++- indra/newview/llchiclet.h | 21 +- indra/newview/llcompilequeue.cpp | 15 +- indra/newview/lldateutil.cpp | 7 +- indra/newview/lldrawpoolbump.cpp | 4 +- indra/newview/lldrawpoolwlsky.cpp | 21 +- indra/newview/lldrawpoolwlsky.h | 2 +- indra/newview/llfasttimerview.cpp | 6 +- indra/newview/llfavoritesbar.cpp | 38 +-- indra/newview/llfavoritesbar.h | 11 +- indra/newview/llfirstuse.cpp | 15 +- indra/newview/llfirstuse.h | 7 + indra/newview/llfloaterabout.cpp | 19 +- indra/newview/llfloaterbulkpermission.cpp | 1 - indra/newview/llfloatercamera.cpp | 25 +- indra/newview/llfloatercamera.h | 4 +- indra/newview/llfloaterchat.cpp | 33 ++- indra/newview/llfloaterchat.h | 2 +- indra/newview/llfloaterchatterbox.cpp | 28 +-- indra/newview/llfloatergesture.cpp | 12 +- indra/newview/llfloatergesture.h | 2 +- indra/newview/llfloatergroups.cpp | 9 +- indra/newview/llfloaterinventory.cpp | 4 +- indra/newview/llfloaterland.cpp | 7 +- indra/newview/llfloaterland.h | 1 - indra/newview/llfloatermediasettings.cpp | 10 +- indra/newview/llfloaterpreference.cpp | 60 ++++- indra/newview/llfloaterpreference.h | 6 +- indra/newview/llfloaterregioninfo.cpp | 7 +- indra/newview/llfloaterscriptlimits.cpp | 101 ++++++-- indra/newview/llfloaterscriptlimits.h | 14 +- indra/newview/llfloatersearch.cpp | 39 ++++ indra/newview/llfloatersettingsdebug.cpp | 2 +- indra/newview/llfloatersnapshot.cpp | 4 +- indra/newview/llfloatertools.cpp | 60 +++-- indra/newview/llfloatervoicedevicesettings.cpp | 38 +-- indra/newview/llfloaterworldmap.cpp | 76 +++--- indra/newview/llfloaterworldmap.h | 5 +- indra/newview/llfolderview.cpp | 36 +-- indra/newview/llfolderview.h | 2 +- indra/newview/llfoldervieweventlistener.h | 1 + indra/newview/llfolderviewitem.cpp | 133 ++++++----- indra/newview/llfolderviewitem.h | 20 +- indra/newview/llgesturemgr.cpp | 10 + indra/newview/llgesturemgr.h | 2 + indra/newview/llgroupactions.cpp | 10 +- indra/newview/llgrouplist.cpp | 5 +- indra/newview/llhudtext.cpp | 6 +- indra/newview/llimfloater.cpp | 130 +++++++---- indra/newview/llimfloater.h | 5 +- indra/newview/llimfloatercontainer.cpp | 11 + indra/newview/llimfloatercontainer.h | 6 +- indra/newview/llimpanel.cpp | 2 +- indra/newview/llimview.cpp | 112 +++++---- indra/newview/llimview.h | 17 +- indra/newview/llinspect.h | 2 +- indra/newview/llinspectavatar.cpp | 103 +++++--- indra/newview/llinspectobject.cpp | 20 +- indra/newview/llinventorybridge.cpp | 143 ++++-------- indra/newview/llinventorybridge.h | 1 + indra/newview/llinventoryfunctions.cpp | 3 +- indra/newview/llinventorymodel.cpp | 106 ++++++++- indra/newview/llinventorymodel.h | 33 +++ indra/newview/llinventoryobserver.cpp | 35 ++- indra/newview/llinventorypanel.cpp | 53 ++--- indra/newview/llinventorypanel.h | 2 +- indra/newview/lllandmarklist.cpp | 7 + indra/newview/lllocationhistory.cpp | 6 + indra/newview/lllogchat.cpp | 4 - indra/newview/llmanip.cpp | 2 +- indra/newview/llmediactrl.cpp | 272 +++++++++++---------- indra/newview/llmediactrl.h | 1 - indra/newview/llmenucommands.cpp | 3 +- indra/newview/llmorphview.cpp | 4 +- indra/newview/llmutelist.cpp | 7 +- indra/newview/llnamebox.cpp | 35 ++- indra/newview/llnamebox.h | 6 + indra/newview/llnamelistctrl.cpp | 80 +++++-- indra/newview/llnamelistctrl.h | 5 +- indra/newview/llnearbychat.cpp | 28 +-- indra/newview/llnearbychatbar.cpp | 252 +++++++++++++++----- indra/newview/llnearbychatbar.h | 47 ++-- indra/newview/llnearbychathandler.cpp | 23 +- indra/newview/llnotificationofferhandler.cpp | 4 +- indra/newview/lloutputmonitorctrl.cpp | 65 +++++- indra/newview/lloutputmonitorctrl.h | 29 ++- indra/newview/llpanelavatar.cpp | 20 +- indra/newview/llpanelclassified.cpp | 15 +- indra/newview/llpanelclassified.h | 1 + indra/newview/llpanelgroup.cpp | 79 ++++++- indra/newview/llpanelgroup.h | 4 + indra/newview/llpanelgroupgeneral.cpp | 11 +- indra/newview/llpanelgroupnotices.cpp | 2 +- indra/newview/llpanelgrouproles.cpp | 61 ++--- indra/newview/llpanelgrouproles.h | 13 +- indra/newview/llpanelhome.cpp | 2 +- indra/newview/llpanelimcontrolpanel.cpp | 9 +- indra/newview/llpanellandaudio.cpp | 62 ++--- indra/newview/llpanellandaudio.h | 4 +- indra/newview/llpanellandmarkinfo.cpp | 7 + indra/newview/llpanellandmarks.cpp | 57 ++++- indra/newview/llpanellandmarks.h | 16 ++ indra/newview/llpanelmaininventory.cpp | 6 +- indra/newview/llpanelobject.cpp | 4 +- indra/newview/llpanelobjectinventory.cpp | 2 +- indra/newview/llpaneloutfitsinventory.cpp | 175 ++++++++++++-- indra/newview/llpaneloutfitsinventory.h | 6 +- indra/newview/llpanelpeople.cpp | 27 ++- indra/newview/llpanelpeople.h | 2 +- indra/newview/llpanelpick.cpp | 100 ++++---- indra/newview/llpanelpick.h | 23 +- indra/newview/llpanelpicks.cpp | 14 +- indra/newview/llpanelpicks.h | 1 + indra/newview/llpanelplaces.cpp | 31 +++ indra/newview/llpanelplaces.h | 6 + indra/newview/llpanelprimmediacontrols.cpp | 120 +++++----- indra/newview/llpanelprimmediacontrols.h | 4 +- indra/newview/llpanelteleporthistory.cpp | 14 +- indra/newview/llpanelvolume.cpp | 4 +- indra/newview/llparticipantlist.cpp | 23 +- indra/newview/llparticipantlist.h | 2 +- indra/newview/llpreviewgesture.cpp | 6 + indra/newview/llpreviewnotecard.cpp | 1 - indra/newview/llpreviewscript.cpp | 1 - 149 files changed, 3417 insertions(+), 1714 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8918fc3018..5373556c20 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -63,8 +63,6 @@ include_directories( ) set(viewer_SOURCE_FILES - llaccordionctrl.cpp - llaccordionctrltab.cpp llagent.cpp llagentaccess.cpp llagentdata.cpp @@ -158,7 +156,6 @@ set(viewer_SOURCE_FILES llfloaterbuycurrency.cpp llfloaterbuyland.cpp llfloatercamera.cpp - llfloaterchat.cpp llfloaterchatterbox.cpp llfloatercolorpicker.cpp llfloatercustomize.cpp @@ -214,7 +211,6 @@ set(viewer_SOURCE_FILES llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp - llfloatervolumepulldown.cpp llfloaterwater.cpp llfloaterwhitelistentry.cpp llfloaterwindlight.cpp @@ -252,6 +248,7 @@ set(viewer_SOURCE_FILES llinspectgroup.cpp llinspectobject.cpp llinspectremoteobject.cpp + llinspecttoast.cpp llinventorybridge.cpp llinventoryclipboard.cpp llinventoryfilter.cpp @@ -349,6 +346,7 @@ set(viewer_SOURCE_FILES llpanelshower.cpp llpanelteleporthistory.cpp llpanelvolume.cpp + llpanelvolumepulldown.cpp llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp @@ -387,6 +385,7 @@ set(viewer_SOURCE_FILES llspatialpartition.cpp llspeakbutton.cpp llspeakers.cpp + llspeakingindicatormanager.cpp llsplitbutton.cpp llsprite.cpp llstartup.cpp @@ -569,8 +568,6 @@ endif (LINUX) set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake - llaccordionctrl.h - llaccordionctrltab.h llagent.h llagentaccess.h llagentdata.h @@ -667,7 +664,6 @@ set(viewer_HEADER_FILES llfloaterbuycurrency.h llfloaterbuyland.h llfloatercamera.h - llfloaterchat.h llfloaterchatterbox.h llfloatercolorpicker.h llfloatercustomize.h @@ -759,6 +755,7 @@ set(viewer_HEADER_FILES llinspectgroup.h llinspectobject.h llinspectremoteobject.h + llinspecttoast.h llinventorybridge.h llinventoryclipboard.h llinventoryfilter.h @@ -852,6 +849,7 @@ set(viewer_HEADER_FILES llpanelshower.h llpanelteleporthistory.h llpanelvolume.h + llpanelvolumepulldown.h llparcelselection.h llparticipantlist.h llpatchvertexarray.h @@ -892,6 +890,7 @@ set(viewer_HEADER_FILES llspatialpartition.h llspeakbutton.h llspeakers.h + llspeakingindicatormanager.h llsplitbutton.h llsprite.h llstartup.h @@ -1406,11 +1405,11 @@ if (WINDOWS) # Note the need to specify multiple names explicitly. set(GOOGLE_PERF_TOOLS_SOURCE ${SHARED_LIB_STAGING_DIR}/Release/libtcmalloc_minimal.dll - ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll - ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll - ) + ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll + ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll + ) endif(USE_GOOGLE_PERFTOOLS) - + set(COPY_INPUT_DEPENDECIES # The following commented dependencies are determined at variably at build time. Can't do this here. @@ -1499,15 +1498,16 @@ if (WINDOWS) --actions=copy --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --buildtype=${CMAKE_BUILD_TYPE} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - stage_third_party_libs - ${COPY_INPUT_DEPENDECIES} + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + stage_third_party_libs + ${COPY_INPUT_DEPENDECIES} COMMENT "Performing viewer_manifest copy" ) @@ -1569,6 +1569,7 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --buildtype=${CMAKE_BUILD_TYPE} --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} @@ -1650,6 +1651,7 @@ if (LINUX) --arch=${ARCH} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --buildtype=${CMAKE_BUILD_TYPE} --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged @@ -1695,6 +1697,7 @@ if (DARWIN) --actions=copy --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --buildtype=${CMAKE_BUILD_TYPE} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} @@ -1715,6 +1718,7 @@ if (DARWIN) ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --grid=${GRID} + --buildtype=${CMAKE_BUILD_TYPE} --configuration=${CMAKE_CFG_INTDIR} --channel=${VIEWER_CHANNEL} --login_channel=${VIEWER_LOGIN_CHANNEL} @@ -1734,6 +1738,7 @@ if (DARWIN) ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --grid=${GRID} + --buildtype=${CMAKE_BUILD_TYPE} --configuration=${CMAKE_CFG_INTDIR} --channel=${VIEWER_CHANNEL} --login_channel=${VIEWER_LOGIN_CHANNEL} @@ -1761,9 +1766,10 @@ if (LL_TESTS) llagentaccess.cpp lldateutil.cpp llmediadataclient.cpp - llviewerhelputil.cpp lllogininstance.cpp + llviewerhelputil.cpp ) + ################################################## # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS ################################################## diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml index ab18febccc..e825f13e82 100644 --- a/indra/newview/app_settings/ignorable_dialogs.xml +++ b/indra/newview/app_settings/ignorable_dialogs.xml @@ -177,21 +177,10 @@ Value 1 - FirstStreamingMusic + FirstStreamingMedia Comment - Enables FirstStreamingMusic warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - FirstStreamingVideo - - Comment - Enables FirstStreamingVideo warning dialog + Enables FirstStreamingMedia warning dialog Persist 1 Type diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e24e1a8605..a4fc095727 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -276,7 +276,7 @@ Value 0.5 - AudioSteamingMedia + AudioStreamingMedia Comment Enable streaming @@ -285,7 +285,7 @@ Type Boolean Value - 0 + 1 AudioStreamingMusic @@ -296,7 +296,7 @@ Type Boolean Value - 0 + 1 AudioStreamingVideo @@ -307,7 +307,7 @@ Type Boolean Value - 0 + 1 AuditTexture @@ -408,6 +408,17 @@ Value 1 + AvalinePhoneSeparator + + Comment + Separator of phone parts to have Avaline numbers human readable in Voice Control Panel + Persist + 1 + Type + String + Value + - + AvatarAxisDeadZone0 Comment @@ -1130,9 +1141,9 @@ Persist 1 Type - Boolean + S32 Value - 1 + 5 CameraAngle @@ -3246,17 +3257,6 @@ Value 0.75 - FolderIndentation - - Comment - Number of pixels to indent subfolders in inventory - Persist - 1 - Type - S32 - Value - 8 - FolderLoadingMessageWaitTime Comment @@ -3596,7 +3596,7 @@ Type String Value - http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC] + http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC][DEBUG_MODE] HomeSidePanelURL @@ -3607,7 +3607,7 @@ Type String Value - http://lecs.viewer-sidebar.secondlife.com.s3.amazonaws.com/sidebar.html + http://lecs.viewer-sidebar.secondlife.com.s3.amazonaws.com/sidebar.html?p=[AUTH_TOKEN]&lang=[LANGUAGE]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR] SearchURL @@ -3618,7 +3618,7 @@ Type String Value - http://int.searchwww-phx0.damballah.lindenlab.com/viewer/[CATEGORY]?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID] + http://search.secondlife.com/viewer/[CATEGORY]?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID] HighResSnapshot @@ -3653,17 +3653,6 @@ Value - IMInChat - - Comment - Copy IM into chat console - Persist - 1 - Type - Boolean - Value - 0 - IMShowTimestamps Comment @@ -4809,6 +4798,17 @@ Value 0 + MyOutfitsAutofill + + Comment + Always autofill My Outfits from library when empty (else happens just once). + Persist + 1 + Type + Boolean + Value + 0 + NearMeRange Comment @@ -5040,6 +5040,18 @@ Value 5 + ToastButtonWidth + + Comment + Default width of buttons in the toast. + Note if required width will be less then this one, a button will be reshaped to default size , otherwise to required + Persist + 1 + Type + S32 + Value + 90 + ChannelBottomPanelMargin Comment @@ -9320,18 +9332,7 @@ S32 Value 2 - - UILineEditorVPad - - Comment - UI Line Editor Vertical Pad - Persist - 1 - Type - S32 - Value - 5 - + UIMaxComboWidth Comment diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index ae89eb4413..448e20b382 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -5608,9 +5608,7 @@ + height="512"> + + + @@ -6620,6 +6625,7 @@ render_pass="bump"> local_texture="head_tattoo" /> + diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d2a56f65dd..da0e9238d6 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -43,7 +43,7 @@ #include "llcallingcard.h" #include "llchannelmanager.h" #include "llconsole.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llfloatercamera.h" #include "llfloatercustomize.h" #include "llfloaterreg.h" @@ -514,6 +514,8 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) } setFocusOnAvatar(TRUE, ANIMATE); + + mCameraFOVZoomFactor = 0.f; } mHUDTargetZoom = 1.f; @@ -2804,6 +2806,7 @@ void LLAgent::endAnimationUpdateUI() gStatusBar->setVisibleForMouselook(true); LLBottomTray::getInstance()->setVisible(TRUE); + LLBottomTray::getInstance()->onMouselookModeOut(); LLSideTray::getInstance()->getButtonsPanel()->setVisible(TRUE); LLSideTray::getInstance()->updateSidetrayVisibility(); @@ -2812,7 +2815,7 @@ void LLAgent::endAnimationUpdateUI() LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - LLFloaterCamera::toPrevModeIfInAvatarViewMode(); + LLFloaterCamera::onLeavingMouseLook(); // Only pop if we have pushed... if (TRUE == mViewsPushed) @@ -2902,6 +2905,7 @@ void LLAgent::endAnimationUpdateUI() LLNavigationBar::getInstance()->setVisible(FALSE); gStatusBar->setVisibleForMouselook(false); + LLBottomTray::getInstance()->onMouselookModeIn(); LLBottomTray::getInstance()->setVisible(FALSE); LLSideTray::getInstance()->getButtonsPanel()->setVisible(FALSE); @@ -2915,10 +2919,6 @@ void LLAgent::endAnimationUpdateUI() // JC - Added for always chat in third person option gFocusMgr.setKeyboardFocus(NULL); - //Making sure Camera Controls floater is in the right state - //when entering Mouse Look using wheel scrolling - LLFloaterCamera::updateIfNotInAvatarViewMode(); - LLToolMgr::getInstance()->setCurrentToolset(gMouselookToolset); mViewsPushed = TRUE; @@ -3588,7 +3588,7 @@ F32 LLAgent::calcCameraFOVZoomFactor() { return 0.f; } - else if (mFocusObject.notNull() && !mFocusObject->isAvatar()) + else if (mFocusObject.notNull() && !mFocusObject->isAvatar() && !mFocusOnAvatar) { // don't FOV zoom on mostly transparent objects LLVector3 focus_offset = mFocusObjectOffset; @@ -5161,6 +5161,11 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO return FALSE; } +BOOL LLAgent::canJoinGroups() const +{ + return mGroups.count() < MAX_AGENT_GROUPS; +} + LLQuaternion LLAgent::getHeadRotation() { if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp) @@ -5694,10 +5699,10 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **) } // Any control taken? If so, might be first time. - if (total_count > 0) - { - LLFirstUse::useOverrideKeys(); - } + //if (total_count > 0) + //{ + //LLFirstUse::useOverrideKeys(); + //} } else { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 2e95dc72be..beede7fbe3 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -972,6 +972,7 @@ public: BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); const std::string &getGroupName() const { return mGroupName; } + BOOL canJoinGroups() const; private: std::string mGroupName; LLUUID mGroupID; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index dc1598aacd..c21cdf9508 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -95,19 +95,38 @@ public: enum ELibraryOutfitFetchStep { LOFS_FOLDER = 0, LOFS_OUTFITS, + LOFS_LIBRARY, + LOFS_IMPORTED, LOFS_CONTENTS }; - LLLibraryOutfitsFetch() : mCurrFetchStep(LOFS_FOLDER), mOutfitsPopulated(false) {} + LLLibraryOutfitsFetch() : mCurrFetchStep(LOFS_FOLDER), mOutfitsPopulated(false) + { + mMyOutfitsID = LLUUID::null; + mClothingID = LLUUID::null; + mLibraryClothingID = LLUUID::null; + mImportedClothingID = LLUUID::null; + mImportedClothingName = "Imported Library Clothing"; + } ~LLLibraryOutfitsFetch() {} - virtual void done(); + virtual void done(); void doneIdle(); + LLUUID mMyOutfitsID; + void importedFolderFetch(); protected: void folderDone(void); void outfitsDone(void); + void libraryDone(void); + void importedFolderDone(void); void contentsDone(void); enum ELibraryOutfitFetchStep mCurrFetchStep; - std::vector< std::pair< LLUUID, std::string > > mOutfits; + typedef std::vector< std::pair< LLUUID, std::string > > cloth_folder_vec_t; + cloth_folder_vec_t mLibraryClothingFolders; + cloth_folder_vec_t mImportedClothingFolders; bool mOutfitsPopulated; + LLUUID mClothingID; + LLUUID mLibraryClothingID; + LLUUID mImportedClothingID; + std::string mImportedClothingName; }; LLAgentWearables gAgentWearables; @@ -116,6 +135,39 @@ BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; using namespace LLVOAvatarDefines; +// HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look" +// Some db items are corrupted, have inventory flags = 0, implying wearable type = shape, even though +// wearable type stored in asset is some other value. +// Calling this function whenever a wearable is added to increase visibility if this problem +// turns up in other inventories. +void checkWearableAgainstInventory(LLWearable *wearable) +{ + if (wearable->getItemID().isNull()) + return; + + // Check for wearable type consistent with inventory item wearable type. + LLViewerInventoryItem *item = gInventory.getItem(wearable->getItemID()); + if (item) + { + if (!item->isWearableType()) + { + llwarns << "wearable associated with non-wearable item" << llendl; + } + if (item->getWearableType() != wearable->getType()) + { + llwarns << "type mismatch: wearable " << wearable->getName() + << " has type " << wearable->getType() + << " but inventory item " << item->getName() + << " has type " << item->getWearableType() << llendl; + } + } + else + { + llwarns << "wearable inventory item not found" << wearable->getName() + << " itemID " << wearable->getItemID().asString() << llendl; + } +} + void LLAgentWearables::dump() { llinfos << "LLAgentWearablesDump" << llendl; @@ -657,6 +709,7 @@ LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearable *wearable) { + LLWearable *old_wearable = getWearable(type,index); if (!old_wearable) { @@ -680,6 +733,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab wearable_vec[index] = wearable; old_wearable->setLabelUpdated(); wearableUpdated(wearable); + checkWearableAgainstInventory(wearable); } } @@ -695,6 +749,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl { mWearableDatas[type].push_back(wearable); wearableUpdated(wearable); + checkWearableAgainstInventory(wearable); return mWearableDatas[type].size()-1; } return MAX_WEARABLES_PER_TYPE; @@ -875,7 +930,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) // then auto-populate outfits from the library into the My Outfits folder. - if (LLInventoryModel::getIsFirstTimeInViewer2()) + if (LLInventoryModel::getIsFirstTimeInViewer2() || gSavedSettings.getBOOL("MyOutfitsAutofill")) { gAgentWearables.populateMyOutfitsFolder(); } @@ -1309,15 +1364,15 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, } } -class LLAutoRenameFolder: public LLInventoryCallback +class LLShowCreatedOutfit: public LLInventoryCallback { public: - LLAutoRenameFolder(LLUUID& folder_id): + LLShowCreatedOutfit(LLUUID& folder_id): mFolderID(folder_id) { } - virtual ~LLAutoRenameFolder() + virtual ~LLShowCreatedOutfit() { LLSD key; LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); @@ -1327,13 +1382,15 @@ public: { outfit_panel->getRootFolder()->clearSelection(); outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE); - outfit_panel->getRootFolder()->setNeedsAutoRename(TRUE); } LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild("tab_outfits") : 0; if (tab_outfits && !tab_outfits->getDisplayChildren()) { tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren()); } + + LLAppearanceManager::instance().updateIsDirty(); + LLAppearanceManager::instance().updatePanelOutfitName(""); } virtual void fire(const LLUUID&) @@ -1358,9 +1415,10 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) LLFolderType::FT_OUTFIT, new_folder_name); - LLPointer cb = new LLAutoRenameFolder(folder_id); + LLPointer cb = new LLShowCreatedOutfit(folder_id); LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb); - + LLAppearanceManager::instance().createBaseOutfitLink(folder_id, cb); + return folder_id; } @@ -1705,6 +1763,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* n mWearableDatas[type].push_back(new_wearable); llinfos << "Added additional wearable for type " << type << " size is now " << mWearableDatas[type].size() << llendl; + checkWearableAgainstInventory(new_wearable); } else { @@ -2088,11 +2147,15 @@ void LLAgentWearables::populateMyOutfitsFolder(void) // Get the complete information on the items in the inventory and // setup an observer that will wait for that to happen. LLInventoryFetchDescendentsObserver::folder_ref_t folders; - const LLUUID my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + outfits->mMyOutfitsID = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - folders.push_back(my_outfits_id); + folders.push_back(outfits->mMyOutfitsID); gInventory.addObserver(outfits); outfits->fetchDescendents(folders); + if (outfits->isEverythingComplete()) + { + outfits->done(); + } } void LLLibraryOutfitsFetch::done() @@ -2106,13 +2169,24 @@ void LLLibraryOutfitsFetch::done() void LLLibraryOutfitsFetch::doneIdle() { gInventory.addObserver(this); // Add this back in since it was taken out during ::done() + switch (mCurrFetchStep) { case LOFS_FOLDER: folderDone(); + mCurrFetchStep = LOFS_OUTFITS; break; case LOFS_OUTFITS: outfitsDone(); + mCurrFetchStep = LOFS_LIBRARY; + break; + case LOFS_LIBRARY: + libraryDone(); + mCurrFetchStep = LOFS_IMPORTED; + break; + case LOFS_IMPORTED: + importedFolderDone(); + mCurrFetchStep = LOFS_CONTENTS; break; case LOFS_CONTENTS: contentsDone(); @@ -2134,67 +2208,217 @@ void LLLibraryOutfitsFetch::doneIdle() void LLLibraryOutfitsFetch::folderDone(void) { - // Early out if we already have items in My Outfits. LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; - gInventory.collectDescendents(mCompleteFolders.front(), cat_array, wearable_array, + gInventory.collectDescendents(mMyOutfitsID, cat_array, wearable_array, LLInventoryModel::EXCLUDE_TRASH); + + // Early out if we already have items in My Outfits. if (cat_array.count() > 0 || wearable_array.count() > 0) { mOutfitsPopulated = true; return; } - // Get the UUID of the library's clothing folder - const LLUUID library_clothing_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING, false, true); + mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING); + mLibraryClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING, false, true); mCompleteFolders.clear(); // Get the complete information on the items in the inventory. LLInventoryFetchDescendentsObserver::folder_ref_t folders; - folders.push_back(library_clothing_id); - mCurrFetchStep = LOFS_OUTFITS; + folders.push_back(mClothingID); + folders.push_back(mLibraryClothingID); fetchDescendents(folders); + if (isEverythingComplete()) + { + done(); + } } void LLLibraryOutfitsFetch::outfitsDone(void) { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; - gInventory.collectDescendents(mCompleteFolders.front(), cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH); - LLInventoryFetchDescendentsObserver::folder_ref_t folders; + // Collect the contents of the Library's Clothing folder + gInventory.collectDescendents(mLibraryClothingID, cat_array, wearable_array, + LLInventoryModel::EXCLUDE_TRASH); + llassert(cat_array.count() > 0); for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin(); iter != cat_array.end(); ++iter) { const LLViewerInventoryCategory *cat = iter->get(); + + // Get the names and id's of every outfit in the library, except for ruth and other "misc" outfits. if (cat->getName() != "More Outfits" && cat->getName() != "Ruth") { + // Get the name of every outfit in the library folders.push_back(cat->getUUID()); - mOutfits.push_back(std::make_pair(cat->getUUID(), cat->getName())); + mLibraryClothingFolders.push_back(std::make_pair(cat->getUUID(), cat->getName())); } } + + // Collect the contents of your Inventory Clothing folder + cat_array.clear(); + wearable_array.clear(); + gInventory.collectDescendents(mClothingID, cat_array, wearable_array, + LLInventoryModel::EXCLUDE_TRASH); + + // Check if you already have an "Imported Library Clothing" folder + for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin(); + iter != cat_array.end(); + ++iter) + { + const LLViewerInventoryCategory *cat = iter->get(); + if (cat->getName() == mImportedClothingName) + { + mImportedClothingID = cat->getUUID(); + } + } + mCompleteFolders.clear(); + + fetchDescendents(folders); + if (isEverythingComplete()) + { + done(); + } +} - mCurrFetchStep = LOFS_CONTENTS; +class LLLibraryOutfitsCopyDone: public LLInventoryCallback +{ +public: + LLLibraryOutfitsCopyDone(LLLibraryOutfitsFetch * fetcher): + mFireCount(0), mLibraryOutfitsFetcher(fetcher) + { + } + + virtual ~LLLibraryOutfitsCopyDone() + { + if (mLibraryOutfitsFetcher) + { + gInventory.addObserver(mLibraryOutfitsFetcher); + mLibraryOutfitsFetcher->done(); + } + } + + /* virtual */ void fire(const LLUUID& inv_item) + { + mFireCount++; + } +private: + U32 mFireCount; + LLLibraryOutfitsFetch * mLibraryOutfitsFetcher; +}; + +void LLLibraryOutfitsFetch::libraryDone(void) +{ + // Copy the clothing folders from the library into the imported clothing folder if necessary. + if (mImportedClothingID == LLUUID::null) + { + gInventory.removeObserver(this); + LLPointer copy_waiter = new LLLibraryOutfitsCopyDone(this); + mImportedClothingID = gInventory.createNewCategory(mClothingID, + LLFolderType::FT_NONE, + mImportedClothingName); + + for (cloth_folder_vec_t::const_iterator iter = mLibraryClothingFolders.begin(); + iter != mLibraryClothingFolders.end(); + ++iter) + { + LLUUID folder_id = gInventory.createNewCategory(mImportedClothingID, + LLFolderType::FT_NONE, + iter->second); + LLAppearanceManager::getInstance()->shallowCopyCategory(iter->first, folder_id, copy_waiter); + } + } + else + { + // Skip straight to fetching the contents of the imported folder + importedFolderFetch(); + } +} + +void LLLibraryOutfitsFetch::importedFolderFetch(void) +{ + // Fetch the contents of the Imported Clothing Folder + LLInventoryFetchDescendentsObserver::folder_ref_t folders; + folders.push_back(mImportedClothingID); + + mCompleteFolders.clear(); + fetchDescendents(folders); + if (isEverythingComplete()) + { + done(); + } } -void LLLibraryOutfitsFetch::contentsDone(void) +void LLLibraryOutfitsFetch::importedFolderDone(void) { - for(S32 i = 0; i < (S32)mOutfits.size(); ++i) + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t wearable_array; + LLInventoryFetchDescendentsObserver::folder_ref_t folders; + + // Collect the contents of the Imported Clothing folder + gInventory.collectDescendents(mImportedClothingID, cat_array, wearable_array, + LLInventoryModel::EXCLUDE_TRASH); + + for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin(); + iter != cat_array.end(); + ++iter) + { + const LLViewerInventoryCategory *cat = iter->get(); + + // Get the name of every imported outfit + folders.push_back(cat->getUUID()); + mImportedClothingFolders.push_back(std::make_pair(cat->getUUID(), cat->getName())); + } + + mCompleteFolders.clear(); + fetchDescendents(folders); + if (isEverythingComplete()) + { + done(); + } +} + +void LLLibraryOutfitsFetch::contentsDone(void) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t wearable_array; + + for (cloth_folder_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin(); + folder_iter != mImportedClothingFolders.end(); + ++folder_iter) { // First, make a folder in the My Outfits directory. - const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - LLUUID folder_id = gInventory.createNewCategory(parent_id, - LLFolderType::FT_OUTFIT, - mOutfits[i].second); - LLAppearanceManager::getInstance()->shallowCopyCategory(mOutfits[i].first, folder_id, NULL); + LLUUID new_outfit_folder_id = gInventory.createNewCategory(mMyOutfitsID, LLFolderType::FT_OUTFIT, folder_iter->second); + + cat_array.clear(); + wearable_array.clear(); + // Collect the contents of each imported clothing folder, so we can create new outfit links for it + gInventory.collectDescendents(folder_iter->first, cat_array, wearable_array, + LLInventoryModel::EXCLUDE_TRASH); + + for (LLInventoryModel::item_array_t::const_iterator wearable_iter = wearable_array.begin(); + wearable_iter != wearable_array.end(); + ++wearable_iter) + { + const LLViewerInventoryItem *item = wearable_iter->get(); + link_inventory_item(gAgent.getID(), + item->getLinkedUUID(), + new_outfit_folder_id, + item->getName(), + LLAssetType::AT_LINK, + NULL); + } } + mOutfitsPopulated = true; } @@ -2236,6 +2460,8 @@ void LLInitialWearablesFetch::processContents() } else { + // if we're constructing the COF from the wearables message, we don't have a proper outfit link + LLAppearanceManager::instance().setOutfitDirty(true); processWearablesMessage(); } delete this; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 43b2f34ecd..748d8bdfbf 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -364,7 +364,7 @@ LLUUID LLAppearanceManager::getCOF() } -const LLViewerInventoryItem* LLAppearanceManager::getCurrentOutfitLink() +const LLViewerInventoryItem* LLAppearanceManager::getBaseOutfitLink() { const LLUUID& current_outfit_cat = getCOF(); LLInventoryModel::cat_array_t cat_array; @@ -392,6 +392,21 @@ const LLViewerInventoryItem* LLAppearanceManager::getCurrentOutfitLink() return NULL; } +bool LLAppearanceManager::getBaseOutfitName(std::string& name) +{ + const LLViewerInventoryItem* outfit_link = getBaseOutfitLink(); + if(outfit_link) + { + const LLViewerInventoryCategory *cat = outfit_link->getLinkedCategory(); + if (cat) + { + name = cat->getName(); + return true; + } + } + return false; +} + // Update appearance from outfit folder. void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, bool append) { @@ -444,6 +459,28 @@ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID } } +void LLAppearanceManager::purgeBaseOutfitLink(const LLUUID& category) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(category, cats, items, + LLInventoryModel::EXCLUDE_TRASH); + for (S32 i = 0; i < items.count(); ++i) + { + LLViewerInventoryItem *item = items.get(i); + if (item->getActualType() != LLAssetType::AT_LINK_FOLDER) + continue; + if (item->getIsLinkType()) + { + LLViewerInventoryCategory* catp = item->getLinkedCategory(); + if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) + { + gInventory.purgeObject(item->getUUID()); + } + } + } +} + void LLAppearanceManager::purgeCategory(const LLUUID& category, bool keep_outfit_links) { LLInventoryModel::cat_array_t cats; @@ -578,17 +615,9 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) linkAll(cof, gest_items, link_waiter); // Add link to outfit if category is an outfit. - LLViewerInventoryCategory* catp = gInventory.getCategory(category); if (!append) { - std::string new_outfit_name = ""; - if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) - { - link_inventory_item(gAgent.getID(), category, cof, catp->getName(), - LLAssetType::AT_LINK_FOLDER, link_waiter); - new_outfit_name = catp->getName(); - } - updatePanelOutfitName(new_outfit_name); + createBaseOutfitLink(category, link_waiter); } } @@ -602,6 +631,23 @@ void LLAppearanceManager::updatePanelOutfitName(const std::string& name) } } +void LLAppearanceManager::createBaseOutfitLink(const LLUUID& category, LLPointer link_waiter) +{ + const LLUUID cof = getCOF(); + LLViewerInventoryCategory* catp = gInventory.getCategory(category); + std::string new_outfit_name = ""; + + purgeBaseOutfitLink(cof); + + if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) + { + link_inventory_item(gAgent.getID(), category, cof, catp->getName(), + LLAssetType::AT_LINK_FOLDER, link_waiter); + new_outfit_name = catp->getName(); + } + + updatePanelOutfitName(new_outfit_name); +} void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append) { @@ -644,6 +690,10 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, void LLAppearanceManager::updateAppearanceFromCOF() { + // update dirty flag to see if the state of the COF matches + // the saved outfit stored as a folder link + updateIsDirty(); + dumpCat(getCOF(),"COF, start"); bool follow_folder_links = true; @@ -693,14 +743,30 @@ void LLAppearanceManager::updateAppearanceFromCOF() LLDynamicArray found_container; for(S32 i = 0; i < wear_items.count(); ++i) { - found = new LLFoundData(wear_items.get(i)->getLinkedUUID(), // Wear the base item, not the link - wear_items.get(i)->getAssetUUID(), - wear_items.get(i)->getName(), - wear_items.get(i)->getType()); - holder->mFoundList.push_front(found); - found_container.put(found); + LLViewerInventoryItem *item = wear_items.get(i); + LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; + if (item && linked_item) + { + found = new LLFoundData(linked_item->getUUID(), + linked_item->getAssetUUID(), + linked_item->getName(), + linked_item->getType()); + holder->mFoundList.push_front(found); + found_container.put(found); + } + else + { + if (!item) + { + llwarns << "attempt to wear a null item " << llendl; + } + else if (!linked_item) + { + llwarns << "attempt to wear a broken link " << item->getName() << llendl; + } + } } - for(S32 i = 0; i < wear_items.count(); ++i) + for(S32 i = 0; i < found_container.count(); ++i) { holder->append = false; found = found_container.get(i); @@ -959,7 +1025,9 @@ void LLAppearanceManager::addCOFItemLink(const LLInventoryItem *item, bool do_up if (linked_already) { if (do_update) + { LLAppearanceManager::updateAppearanceFromCOF(); + } return; } else @@ -1013,6 +1081,75 @@ void LLAppearanceManager::removeCOFItemLinks(const LLUUID& item_id, bool do_upda } } +void LLAppearanceManager::updateIsDirty() +{ + LLUUID cof = getCOF(); + LLUUID base_outfit; + + // find base outfit link + const LLViewerInventoryItem* base_outfit_item = getBaseOutfitLink(); + LLViewerInventoryCategory* catp = NULL; + if (base_outfit_item && base_outfit_item->getIsLinkType()) + { + catp = base_outfit_item->getLinkedCategory(); + } + if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT) + { + base_outfit = catp->getUUID(); + } + + if(base_outfit.isNull()) + { + // no outfit link found, display "unsaved outfit" + mOutfitIsDirty = true; + } + else + { + LLInventoryModel::cat_array_t cof_cats; + LLInventoryModel::item_array_t cof_items; + gInventory.collectDescendents(cof, cof_cats, cof_items, + LLInventoryModel::EXCLUDE_TRASH); + + LLInventoryModel::cat_array_t outfit_cats; + LLInventoryModel::item_array_t outfit_items; + gInventory.collectDescendents(base_outfit, outfit_cats, outfit_items, + LLInventoryModel::EXCLUDE_TRASH); + + if(outfit_items.count() != cof_items.count() -1) + { + // Current outfit folder should have one more item than the outfit folder. + // this one item is the link back to the outfit folder itself. + mOutfitIsDirty = true; + } + else + { + typedef std::set item_set_t; + item_set_t cof_set; + item_set_t outfit_set; + + // sort COF items by UUID + for (S32 i = 0; i < cof_items.count(); ++i) + { + LLViewerInventoryItem *item = cof_items.get(i); + // don't add the base outfit link to the list of objects we're comparing + if(item != base_outfit_item) + { + cof_set.insert(item->getLinkedUUID()); + } + } + + // sort outfit folder by UUID + for (S32 i = 0; i < outfit_items.count(); ++i) + { + LLViewerInventoryItem *item = outfit_items.get(i); + outfit_set.insert(item->getLinkedUUID()); + } + + mOutfitIsDirty = (outfit_set != cof_set); + } + } +} + //#define DUMP_CAT_VERBOSE void LLAppearanceManager::dumpCat(const LLUUID& cat_id, const std::string& msg) @@ -1049,7 +1186,8 @@ void LLAppearanceManager::dumpItemArray(const LLInventoryModel::item_array_t& it } LLAppearanceManager::LLAppearanceManager(): - mAttachmentInvLinkEnabled(false) + mAttachmentInvLinkEnabled(false), + mOutfitIsDirty(false) { } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index b625d42a50..20745b70e4 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -62,11 +62,14 @@ public: LLUUID getCOF(); // Finds the folder link to the currently worn outfit - const LLViewerInventoryItem *getCurrentOutfitLink(); + const LLViewerInventoryItem *getBaseOutfitLink(); + bool getBaseOutfitName(std::string &name); // Update the displayed outfit name in UI. void updatePanelOutfitName(const std::string& name); + void createBaseOutfitLink(const LLUUID& category, LLPointer link_waiter); + void updateAgentWearables(LLWearableHoldingPattern* holder, bool append); // For debugging - could be moved elsewhere. @@ -94,6 +97,16 @@ public: // Add COF link to ensemble folder. void addEnsembleLink(LLInventoryCategory* item, bool do_update = true); + //has the current outfit changed since it was loaded? + bool isOutfitDirty() { return mOutfitIsDirty; } + + // set false if you just loaded the outfit, true otherwise + void setOutfitDirty(bool isDirty) { mOutfitIsDirty = isDirty; } + + // manually compare ouftit folder link to COF to see if outfit has changed. + // should only be necessary to do on initial login. + void updateIsDirty(); + protected: LLAppearanceManager(); ~LLAppearanceManager(); @@ -114,9 +127,11 @@ private: bool follow_folder_links); void purgeCategory(const LLUUID& category, bool keep_outfit_links); + void purgeBaseOutfitLink(const LLUUID& category); std::set mRegisteredAttachments; bool mAttachmentInvLinkEnabled; + bool mOutfitIsDirty; }; #define SUPPORT_ENSEMBLES 0 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 21d908035f..8507c62d27 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -71,7 +71,7 @@ #include "lluicolortable.h" #include "llurldispatcher.h" #include "llurlhistory.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llrender.h" #include "llteleporthistory.h" #include "lllocationhistory.h" @@ -313,6 +313,7 @@ void init_default_trans_args() { default_trans_args.insert("SECOND_LIFE"); // World default_trans_args.insert("APP_NAME"); + default_trans_args.insert("CAPITALIZED_APP_NAME"); default_trans_args.insert("SECOND_LIFE_GRID"); default_trans_args.insert("SUPPORT_SITE"); } @@ -921,7 +922,6 @@ bool LLAppViewer::mainLoop() { LLMemType mt1(LLMemType::MTYPE_MAIN); mMainloopTimeout = new LLWatchdogTimeout(); - // *FIX:Mani - Make this a setting, once new settings exist in this branch. //------------------------------------------- // Run main loop until time to quit @@ -931,12 +931,13 @@ bool LLAppViewer::mainLoop() gServicePump = new LLPumpIO(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); + LLCurl::setSSLVerify(! gSavedSettings.getBOOL("NoVerifySSLCert")); // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. LLVoiceChannel::initClass(); LLVoiceClient::init(gServicePump); - + LLTimer frameTimer,idleTimer; LLTimer debugTime; LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); @@ -1371,7 +1372,7 @@ bool LLAppViewer::cleanup() if( gViewerWindow) gViewerWindow->shutdownViews(); - llinfos << "Cleaning up Inevntory" << llendflush; + llinfos << "Cleaning up Inventory" << llendflush; // Cleanup Inventory after the UI since it will delete any remaining observers // (Deleted observers should have already removed themselves) @@ -1473,10 +1474,17 @@ bool LLAppViewer::cleanup() LLUIColorTable::instance().saveUserSettings(); - // PerAccountSettingsFile should be empty if no use has been logged on. + // PerAccountSettingsFile should be empty if no user has been logged on. // *FIX:Mani This should get really saved in a "logoff" mode. - gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); - llinfos << "Saved settings" << llendflush; + if (gSavedSettings.getString("PerAccountSettingsFile").empty()) + { + llinfos << "Not saving per-account settings; don't know the account name yet." << llendl; + } + else + { + gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); + llinfos << "Saved settings" << llendflush; + } std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults @@ -1910,26 +1918,25 @@ bool LLAppViewer::initConfiguration() // These are warnings that appear on the first experience of that condition. // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse // for disable/reset ability - LLFirstUse::addConfigVariable("FirstBalanceIncrease"); - LLFirstUse::addConfigVariable("FirstBalanceDecrease"); - LLFirstUse::addConfigVariable("FirstSit"); - LLFirstUse::addConfigVariable("FirstMap"); - LLFirstUse::addConfigVariable("FirstGoTo"); - LLFirstUse::addConfigVariable("FirstBuild"); +// LLFirstUse::addConfigVariable("FirstBalanceIncrease"); +// LLFirstUse::addConfigVariable("FirstBalanceDecrease"); +// LLFirstUse::addConfigVariable("FirstSit"); +// LLFirstUse::addConfigVariable("FirstMap"); +// LLFirstUse::addConfigVariable("FirstGoTo"); +// LLFirstUse::addConfigVariable("FirstBuild"); // LLFirstUse::addConfigVariable("FirstLeftClickNoHit"); - LLFirstUse::addConfigVariable("FirstTeleport"); - LLFirstUse::addConfigVariable("FirstOverrideKeys"); - LLFirstUse::addConfigVariable("FirstAttach"); - LLFirstUse::addConfigVariable("FirstAppearance"); - LLFirstUse::addConfigVariable("FirstInventory"); - LLFirstUse::addConfigVariable("FirstSandbox"); - LLFirstUse::addConfigVariable("FirstFlexible"); - LLFirstUse::addConfigVariable("FirstDebugMenus"); - LLFirstUse::addConfigVariable("FirstStreamingMusic"); - LLFirstUse::addConfigVariable("FirstStreamingVideo"); - LLFirstUse::addConfigVariable("FirstSculptedPrim"); - LLFirstUse::addConfigVariable("FirstVoice"); - LLFirstUse::addConfigVariable("FirstMedia"); +// LLFirstUse::addConfigVariable("FirstTeleport"); +// LLFirstUse::addConfigVariable("FirstOverrideKeys"); +// LLFirstUse::addConfigVariable("FirstAttach"); +// LLFirstUse::addConfigVariable("FirstAppearance"); +// LLFirstUse::addConfigVariable("FirstInventory"); +// LLFirstUse::addConfigVariable("FirstSandbox"); +// LLFirstUse::addConfigVariable("FirstFlexible"); +// LLFirstUse::addConfigVariable("FirstDebugMenus"); +// LLFirstUse::addConfigVariable("FirstStreamingMedia"); +// LLFirstUse::addConfigVariable("FirstSculptedPrim"); +// LLFirstUse::addConfigVariable("FirstVoice"); +// LLFirstUse::addConfigVariable("FirstMedia"); // - read command line settings. LLControlGroupCLP clp; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 2a8c55e5db..40c9bb6afa 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -168,8 +168,10 @@ void LLAvatarActions::offerTeleport(const LLUUID& invitee) // static void LLAvatarActions::offerTeleport(const std::vector& ids) { - if (ids.size() > 0) - handle_lure(ids); + if (ids.size() == 0) + return; + + handle_lure(ids); } // static @@ -595,9 +597,11 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri LLSD args; args["TO_NAME"] = target_name; + LLSD payload; + payload["from_id"] = target_id; payload["SESSION_NAME"] = target_name; - payload["SUPPRES_TOST"] = true; + payload["SUPPRESS_TOAST"] = true; LLNotificationsUtil::add("FriendshipOffered", args, payload); } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 42ae122ff9..87b8d807c4 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -64,7 +64,7 @@ void LLAvatarIconIDCache::load () llinfos << "Loading avatar icon id cache." << llendl; // build filename for each user - std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); llifstream file(resolved_filename); if (!file.is_open()) @@ -97,7 +97,7 @@ void LLAvatarIconIDCache::load () void LLAvatarIconIDCache::save () { - std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); // open a file for writing llofstream file (resolved_filename); diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 5df73a994e..6784e6693b 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -82,7 +82,7 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible) getItems(items); for( std::vector::const_iterator it = items.begin(); it != items.end(); it++) { - static_cast(*it)->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + static_cast(*it)->showSpeakingIndicator(mShowSpeakingIndicator); } } @@ -320,21 +320,25 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi return mRefreshCompleteSignal.connect(cb); } +boost::signals2::connection LLAvatarList::setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb) +{ + return mItemDoubleClickSignal.connect(cb); +} + void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->showInfoBtn(true); - item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); - item->childSetVisible("info_btn", false); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); - item->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + item->showSpeakingIndicator(mShowSpeakingIndicator); + + item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoucleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); } @@ -403,6 +407,11 @@ void LLAvatarList::updateLastInteractionTimes() } } +void LLAvatarList::onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +{ + mItemDoubleClickSignal(ctrl, x, y, mask); +} + bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const { const LLAvatarListItem* avatar_item1 = dynamic_cast(item1); diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 0d2ce884ae..a58a562378 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -92,6 +92,8 @@ public: boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb); + boost::signals2::connection setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb); + protected: void refresh(); @@ -101,6 +103,7 @@ protected: std::vector& vadded, std::vector& vremoved); void updateLastInteractionTimes(); + void onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); private: @@ -120,6 +123,7 @@ private: LLAvatarListItem::ContextMenu* mContextMenu; commit_signal_t mRefreshCompleteSignal; + mouse_signal_t mItemDoubleClickSignal; }; /** Abstract comparator for avatar items */ diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 6945ac6932..66ab32f3e8 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -44,10 +44,10 @@ #include "llbutton.h" bool LLAvatarListItem::sStaticInitialized = false; -S32 LLAvatarListItem::sIconWidth = 0; -S32 LLAvatarListItem::sInfoBtnWidth = 0; -S32 LLAvatarListItem::sProfileBtnWidth = 0; -S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; +S32 LLAvatarListItem::sLeftPadding = 0; +S32 LLAvatarListItem::sRightNamePadding = 0; +S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; + LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -91,43 +91,25 @@ BOOL LLAvatarListItem::postBuild() mProfileBtn->setVisible(false); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this)); - // Remember avatar icon width including its padding from the name text box, - // so that we can hide and show the icon again later. if (!sStaticInitialized) { - sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + // Remember children widths including their padding from the next sibling, + // so that we can hide and show them again later. + initChildrenWidths(this); sStaticInitialized = true; } -/* - if(!p.buttons.profile) - { - delete mProfile; - mProfile = NULL; - - LLRect rect; - - rect.setLeftTopAndSize(mName->getRect().mLeft, mName->getRect().mTop, mName->getRect().getWidth() + 30, mName->getRect().getHeight()); - mName->setRect(rect); - - if(mLocator) - { - rect.setLeftTopAndSize(mLocator->getRect().mLeft + 30, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); - mLocator->setRect(rect); - } + return TRUE; +} - if(mInfo) - { - rect.setLeftTopAndSize(mInfo->getRect().mLeft + 30, mInfo->getRect().mTop, mInfo->getRect().getWidth(), mInfo->getRect().getHeight()); - mInfo->setRect(rect); - } +S32 LLAvatarListItem::notifyParent(const LLSD& info) +{ + if (info.has("visibility_changed")) + { + updateChildren(); } -*/ - return TRUE; + return 0; } void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) @@ -137,6 +119,8 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(mShowProfileBtn); LLPanel::onMouseEnter(x, y, mask); + + updateChildren(); } void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) @@ -146,6 +130,8 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); + + updateChildren(); } // virtual, called by LLAvatarTracker @@ -215,12 +201,8 @@ void LLAvatarListItem::showLastInteractionTime(bool show) if (show) return; - LLRect name_rect = mAvatarName->getRect(); - LLRect time_rect = mLastInteractionTime->getRect(); - mLastInteractionTime->setVisible(false); - name_rect.mRight += (time_rect.mRight - name_rect.mRight); - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::setLastInteractionTime(U32 secs_since) @@ -234,12 +216,6 @@ void LLAvatarListItem::setShowInfoBtn(bool show) if(mShowInfoBtn == show) return; mShowInfoBtn = show; - S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setShowProfileBtn(bool show) @@ -248,24 +224,17 @@ void LLAvatarListItem::setShowProfileBtn(bool show) if(mShowProfileBtn == show) return; mShowProfileBtn = show; - S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } -void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) +void LLAvatarListItem::showSpeakingIndicator(bool visible) { // Already done? Then do nothing. if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; - mSpeakingIndicator->setVisible(visible); - S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth; - - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); +// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976 +// probably this method should be totally removed. +// mSpeakingIndicator->setVisible(visible); +// updateChildren(); } void LLAvatarListItem::setAvatarIconVisible(bool visible) @@ -276,36 +245,12 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) // Show/hide avatar icon. mAvatarIcon->setVisible(visible); - - // Move the avatar name horizontally by icon size + its distance from the avatar name. - LLRect name_rect = mAvatarName->getRect(); - name_rect.mLeft += visible ? sIconWidth : -sIconWidth; - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::onInfoBtnClick() { LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); - - /* TODO fix positioning of inspector - localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); - - - LLRect rect; - - // *TODO Vadim: rewrite this. "+= -" looks weird. - S32 delta = mYPos - inspector->getRect().getHeight(); - if(delta < 0) - { - mYPos += -delta; - } - - rect.setLeftTopAndSize(mXPos, mYPos, - inspector->getRect().getWidth(), inspector->getRect().getHeight()); - inspector->setRect(rect); - inspector->setFrontmost(true); - inspector->setVisible(true); - */ } void LLAvatarListItem::onProfileBtnClick() @@ -313,6 +258,21 @@ void LLAvatarListItem::onProfileBtnClick() LLAvatarActions::showProfile(mAvatarId); } +BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + if(mInfoBtn->getRect().pointInRect(x, y)) + { + onInfoBtnClick(); + return TRUE; + } + if(mProfileBtn->getRect().pointInRect(x, y)) + { + onProfileBtnClick(); + return TRUE; + } + return LLPanel::handleDoubleClick(x, y, mask); +} + void LLAvatarListItem::setValue( const LLSD& value ) { if (!value.isMap()) return;; @@ -344,21 +304,6 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str setName(name); } -void LLAvatarListItem::reshapeAvatarName() -{ - S32 width_delta = 0; - width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; - width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; - width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0; - width_delta += mShowInfoBtn ? sInfoBtnWidth : 0; - width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; - - S32 height = mAvatarName->getRect().getHeight(); - S32 width = getRect().getWidth() - width_delta; - - mAvatarName->reshape(width, height); -} - // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", // taking i18n into account. The format string to use is taken from the panel XML. std::string LLAvatarListItem::formatSeconds(U32 secs) @@ -492,4 +437,133 @@ LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() return item_icon_color_map; } +// static +void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) +{ + //profile btn width + padding + S32 profile_btn_width = avatar_item->getRect().getWidth() - avatar_item->mProfileBtn->getRect().mLeft; + + //info btn width + padding + S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft; + + //speaking indicator width + padding + S32 speaking_indicator_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mSpeakingIndicator->getRect().mLeft; + + // last interaction time textbox width + padding + S32 last_interaction_time_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; + + // icon width + padding + S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; + + sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; + sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight; + + S32 index = ALIC_COUNT; + sChildrenWidths[--index] = icon_width; + sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" + sChildrenWidths[--index] = last_interaction_time_width; + sChildrenWidths[--index] = speaking_indicator_width; + sChildrenWidths[--index] = info_btn_width; + sChildrenWidths[--index] = profile_btn_width; +} + +void LLAvatarListItem::updateChildren() +{ + LL_DEBUGS("AvatarItemReshape") << LL_ENDL; + LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL; + + S32 name_new_width = getRect().getWidth(); + S32 ctrl_new_left = name_new_width; + S32 name_new_left = sLeftPadding; + + // iterate through all children and set them into correct position depend on each child visibility + // assume that child indexes are in back order: the first in Enum is the last (right) in the item + // iterate & set child views starting from right to left + for (S32 i = 0; i < ALIC_COUNT; ++i) + { + // skip "name" textbox, it will be processed out of loop later + if (ALIC_NAME == i) continue; + + LLView* control = getItemChildView((EAvatarListItemChildIndex)i); + + LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL; + // skip invisible views + if (!control->getVisible()) continue; + + S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls + + // decrease available for + name_new_width -= ctrl_width; + LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL; + + LLRect control_rect = control->getRect(); + LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL; + + if (ALIC_ICON == i) + { + // assume that this is the last iteration, + // so it is not necessary to save "ctrl_new_left" value calculated on previous iterations + ctrl_new_left = sLeftPadding; + name_new_left = ctrl_new_left + ctrl_width; + } + else + { + ctrl_new_left -= ctrl_width; + } + + LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL; + + control_rect.setLeftTopAndSize( + ctrl_new_left, + control_rect.mTop, + control_rect.getWidth(), + control_rect.getHeight()); + + LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL; + control->setShape(control_rect); + } + + // set size and position of the "name" child + LLView* name_view = getItemChildView(ALIC_NAME); + LLRect name_view_rect = name_view->getRect(); + LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL; + + // apply paddings + name_new_width -= sLeftPadding; + name_new_width -= sRightNamePadding; + + name_view_rect.setLeftTopAndSize( + name_new_left, + name_view_rect.mTop, + name_new_width, + name_view_rect.getHeight()); + + name_view->setShape(name_view_rect); + + LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL; +} + +LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) +{ + LLView* child_view = mAvatarName; + if (child_view_index < 0 || ALIC_COUNT <= child_view_index) + { + LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; + return child_view; + } + switch (child_view_index) + { + case ALIC_ICON: child_view = mAvatarIcon; break; + case ALIC_NAME: child_view = mAvatarName; break; + case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; + case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; + case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; + case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; + default: + LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + } + + return child_view; +} + // EOF diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 96097bc9b5..479a4833cb 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -74,6 +74,11 @@ public: virtual ~LLAvatarListItem(); virtual BOOL postBuild(); + + /** + * Processes notification from speaker indicator to update children when indicator's visibility is changed. + */ + virtual S32 notifyParent(const LLSD& info); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void setValue(const LLSD& value); @@ -88,7 +93,8 @@ public: //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); - void setSpeakingIndicatorVisible(bool visible); + void showSpeakingIndicator(bool show); + void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; @@ -97,16 +103,7 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); - void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } - void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); } - void showLastInteractionTime(bool show); - - /** - * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) - * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons - * *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed - */ - void reshapeAvatarName(); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); protected: /** @@ -124,6 +121,23 @@ private: E_UNKNOWN, } EOnlineStatus; + /** + * Enumeration of item elements in order from right to left. + * + * updateChildren() assumes that indexes are in the such order to process avatar icon easier. + * + * @see updateChildren() + */ + typedef enum e_avatar_item_child { + ALIC_PROFILE_BUTTON, + ALIC_INFO_BUTTON, + ALIC_SPEAKER_INDICATOR, + ALIC_INTERACTION_TIME, + ALIC_NAME, + ALIC_ICON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + void setNameInternal(const std::string& name, const std::string& highlight); void onNameCache(const std::string& first_name, const std::string& last_name); @@ -135,6 +149,26 @@ private: typedef std::map icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); + /** + * Initializes widths of all children to use them while changing visibility of any of them. + * + * @see updateChildren() + */ + static void initChildrenWidths(LLAvatarListItem* self); + + /** + * Updates position and rectangle of visible children to fit all available item's width. + */ + void updateChildren(); + + /** + * Gets child view specified by index. + * + * This method implemented via switch by all EAvatarListItemChildIndex values. + * It is used to not store children in array or vector to avoid of increasing memory usage. + */ + LLView* getItemChildView(EAvatarListItemChildIndex child_index); + LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; LLStyle::Params mAvatarNameStyle; @@ -151,10 +185,17 @@ private: bool mShowProfileBtn; static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sIconWidth; // icon width + padding - static S32 sInfoBtnWidth; //info btn width + padding - static S32 sProfileBtnWidth; //profile btn width + padding - static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding + static S32 sLeftPadding; // padding to first left visible child (icon or name) + static S32 sRightNamePadding; // right padding from name to next visible child + + /** + * Contains widths of each child specified by EAvatarListItemChildIndex + * including padding to the next right one. + * + * @see initChildrenWidths() + */ + static S32 sChildrenWidths[ALIC_COUNT]; + }; #endif //LL_LLAVATARLISTITEM_H diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 976b312509..bd68d52868 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -48,10 +48,20 @@ #include "llsyswellwindow.h" #include "llfloatercamera.h" #include "lltexteditor.h" +#include "llnotifications.h" // Build time optimization, generate extern template once in .cpp file template class LLBottomTray* LLSingleton::getInstance(); +namespace +{ + const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel"; + const std::string& PANEL_CHATBAR_NAME = "chat_bar"; + const std::string& PANEL_MOVEMENT_NAME = "movement_panel"; + const std::string& PANEL_CAMERA_NAME = "cam_panel"; + const std::string& PANEL_GESTURE_NAME = "gesture_panel"; +} + LLBottomTray::LLBottomTray(const LLSD&) : mChicletPanel(NULL), mSpeakPanel(NULL), @@ -161,6 +171,9 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam { chiclet->setIMSessionName(name); chiclet->setOtherParticipantId(other_participant_id); + + LLIMFloater::onIMChicletCreated(session_id); + } else { @@ -233,6 +246,61 @@ void LLBottomTray::onFocusLost() } } +void LLBottomTray::savePanelsShape() +{ + mSavedShapeList.clear(); + for (child_list_const_iter_t + child_it = mToolbarStack->beginChild(), + child_it_end = mToolbarStack->endChild(); + child_it != child_it_end; ++child_it) + { + mSavedShapeList.push_back( (*child_it)->getRect() ); + } +} + +void LLBottomTray::restorePanelsShape() +{ + if (mSavedShapeList.size() != mToolbarStack->getChildCount()) + return; + int i = 0; + for (child_list_const_iter_t + child_it = mToolbarStack->beginChild(), + child_it_end = mToolbarStack->endChild(); + child_it != child_it_end; ++child_it) + { + (*child_it)->setShape(mSavedShapeList[i++]); + } +} + +void LLBottomTray::onMouselookModeOut() +{ + // Apply the saved settings when we are not in mouselook mode, see EXT-3988. + { + setTrayButtonVisibleIfPossible (RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton"), false); + setTrayButtonVisibleIfPossible (RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton"), false); + setTrayButtonVisibleIfPossible (RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton"), false); + setTrayButtonVisibleIfPossible (RS_BUTTON_SNAPSHOT, gSavedSettings.getBOOL("ShowSnapshotButton"),false); + } + // HACK: To avoid usage the LLLayoutStack logic of resizing, we force the updateLayout + // and then restore children saved shapes. See EXT-4309. + BOOL saved_anim = mToolbarStack->getAnimate(); + mToolbarStack->updatePanelAutoResize(PANEL_CHATBAR_NAME, FALSE); + // Disable animation to prevent layout updating in several frames. + mToolbarStack->setAnimate(FALSE); + // Force the updating of layout to reset panels collapse factor. + mToolbarStack->updateLayout(); + // Restore animate state. + mToolbarStack->setAnimate(saved_anim); + // Restore saved shapes. + restorePanelsShape(); +} + +void LLBottomTray::onMouselookModeIn() +{ + savePanelsShape(); + mToolbarStack->updatePanelAutoResize(PANEL_CHATBAR_NAME, TRUE); +} + //virtual // setVisible used instead of onVisibilityChange, since LLAgent calls it on entering/leaving mouselook mode. // If bottom tray is already visible in mouselook mode, then onVisibilityChange will not be called from setVisible(true), @@ -251,8 +319,10 @@ void LLBottomTray::setVisible(BOOL visible) { LLView* viewp = *child_it; std::string name = viewp->getName(); - - if ("chat_bar" == name || "movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name) + + // Chat bar and gesture button are shown even in mouselook mode. + // But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988. + if ("chat_bar" == name || "gesture_panel" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name))) continue; else { @@ -260,6 +330,11 @@ void LLBottomTray::setVisible(BOOL visible) } } } + + if(visible) + gFloaterView->setSnapOffsetBottom(getRect().getHeight()); + else + gFloaterView->setSnapOffsetBottom(0); } void LLBottomTray::showBottomTrayContextMenu(S32 x, S32 y, MASK mask) @@ -324,15 +399,6 @@ void LLBottomTray::showSnapshotButton(BOOL visible) setTrayButtonVisibleIfPossible(RS_BUTTON_SNAPSHOT, visible); } -namespace -{ - const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel"; - const std::string& PANEL_CHATBAR_NAME = "chat_bar"; - const std::string& PANEL_MOVEMENT_NAME = "movement_panel"; - const std::string& PANEL_CAMERA_NAME = "cam_panel"; - const std::string& PANEL_GESTURE_NAME = "gesture_panel"; -} - BOOL LLBottomTray::postBuild() { @@ -1005,7 +1071,7 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis panel->setVisible(visible); } -void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible) +void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification) { bool can_be_set = true; @@ -1045,7 +1111,11 @@ void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type { // mark this button to show it while future bottom tray extending mResizeState |= shown_object_type; - LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown"); + if ( raise_notification ) + LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown", + LLSD(), + LLSD(), + LLNotificationFunctorRegistry::instance().DONOTHING); } } diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 9be0e5810f..562ee56912 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -92,7 +92,10 @@ public: void showMoveButton(BOOL visible); void showCameraButton(BOOL visible); void showSnapshotButton(BOOL visible); - + + void onMouselookModeIn(); + void onMouselookModeOut(); + /** * Creates IM Chiclet based on session type (IM chat or Group chat) */ @@ -167,7 +170,14 @@ private: * - if hidden via context menu button should be shown but there is no enough room for now * it will be shown while extending. */ - void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible); + void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification = true); + + /** + * Save and restore children shapes. + * Used to avoid the LLLayoutStack resizing logic between mouse look mode switching. + */ + void savePanelsShape(); + void restorePanelsShape(); MASK mResizeState; @@ -177,6 +187,9 @@ private: typedef std::map state_object_width_map_t; state_object_width_map_t mObjectDefaultWidthMap; + typedef std::vector shape_list_t; + shape_list_t mSavedShapeList; + protected: LLBottomTray(const LLSD& key = LLSD()); diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index a402f59fa1..f346a4b8c2 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -47,11 +47,13 @@ #include "llfloaterreg.h" #include "llparticipantlist.h" #include "llspeakers.h" +#include "lltextutil.h" #include "lltransientfloatermgr.h" #include "llviewerwindow.h" #include "llvoicechannel.h" static void get_voice_participants_uuids(std::vector& speakers_uuids); +void reshape_floater(LLCallFloater* floater, S32 delta_height); class LLNonAvatarCaller : public LLAvatarListItem { @@ -76,6 +78,12 @@ public: return rv; } + void setName(const std::string& name) + { + const std::string& formatted_phone = LLTextUtil::formatPhoneNumber(name); + LLAvatarListItem::setName(formatted_phone); + } + void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); } }; @@ -217,16 +225,6 @@ void LLCallFloater::onChange() } } -S32 LLCallFloater::notifyParent(const LLSD& info) -{ - if("size_changes" == info["action"]) - { - reshapeToFitContent(); - return 1; - } - return LLDockableFloater::notifyParent(info); -} - ////////////////////////////////////////////////////////////////////////// /// PRIVATE SECTION ////////////////////////////////////////////////////////////////////////// @@ -270,6 +268,11 @@ void LLCallFloater::updateSession() case IM_NOTHING_SPECIAL: case IM_SESSION_P2P_INVITE: mVoiceType = VC_PEER_TO_PEER; + + if (!im_session->mOtherParticipantIsAvatar) + { + mVoiceType = VC_PEER_TO_PEER_AVALINE; + } break; case IM_SESSION_CONFERENCE_START: case IM_SESSION_GROUP_START: @@ -302,8 +305,8 @@ void LLCallFloater::updateSession() //hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_call_btn", !is_local_chat); - + childSetVisible("leave_call_btn_panel", !is_local_chat); + refreshParticipantList(); updateAgentModeratorState(); @@ -321,16 +324,13 @@ void LLCallFloater::updateSession() void LLCallFloater::refreshParticipantList() { - bool non_avatar_caller = false; - if (VC_PEER_TO_PEER == mVoiceType) + bool non_avatar_caller = VC_PEER_TO_PEER_AVALINE == mVoiceType; + + if (non_avatar_caller) { LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSpeakerManager->getSessionID()); - non_avatar_caller = !session->mOtherParticipantIsAvatar; - if (non_avatar_caller) - { - mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID); - mNonAvatarCaller->setName(session->mName); - } + mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID); + mNonAvatarCaller->setName(session->mName); } mNonAvatarCaller->setVisible(non_avatar_caller); @@ -390,9 +390,17 @@ void LLCallFloater::updateTitle() title = getString("title_nearby"); break; case VC_PEER_TO_PEER: + case VC_PEER_TO_PEER_AVALINE: { + title = voice_channel->getSessionName(); + + if (VC_PEER_TO_PEER_AVALINE == mVoiceType) + { + title = LLTextUtil::formatPhoneNumber(title); + } + LLStringUtil::format_map_t args; - args["[NAME]"] = voice_channel->getSessionName(); + args["[NAME]"] = title; title = getString("title_peer_2_peer", args); } break; @@ -706,13 +714,28 @@ void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) { - if (mVoiceType != VC_LOCAL_CHAT) - return true; + bool is_valid = true; + switch (mVoiceType) + { + case VC_LOCAL_CHAT: + { + // A nearby chat speaker is considered valid it it's known to LLVoiceClient (i.e. has enabled voice). + std::vector speakers; + get_voice_participants_uuids(speakers); + is_valid = std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); + } + break; + case VC_GROUP_CHAT: + // if participant had left this call before do not allow add her again. See EXT-4216. + // but if she Join she will be added into the list from the LLCallFloater::onChange() + is_valid = STATE_LEFT != getState(speaker_id); + break; + default: + // do nothing. required for Linux build + break; + } - // A nearby chat speaker is considered valid it it's known to LLVoiceClient (i.e. has enabled voice). - std::vector speakers; - get_voice_participants_uuids(speakers); - return std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); + return is_valid; } void LLCallFloater::connectToChannel(LLVoiceChannel* channel) @@ -765,91 +788,4 @@ void LLCallFloater::reset() mSpeakerManager = NULL; } -void reshape_floater(LLCallFloater* floater, S32 delta_height) -{ - // Try to update floater top side if it is docked(to bottom bar). - // Try to update floater bottom side or top side if it is un-docked. - // If world rect is too small, floater will not be reshaped at all. - - LLRect floater_rect = floater->getRect(); - LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - - // floater is docked to bottom bar - if(floater->isDocked()) - { - // can update floater top side - if(floater_rect.mTop + delta_height < world_rect.mTop) - { - floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, - floater_rect.mRight, floater_rect.mBottom); - } - } - // floater is un-docked - else - { - // can update floater bottom side - if( floater_rect.mBottom - delta_height >= world_rect.mBottom ) - { - floater_rect.set(floater_rect.mLeft, floater_rect.mTop, - floater_rect.mRight, floater_rect.mBottom - delta_height); - } - // could not update floater bottom side, check if we can update floater top side - else if( floater_rect.mTop + delta_height < world_rect.mTop ) - { - floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, - floater_rect.mRight, floater_rect.mBottom); - } - } - - floater->reshape(floater_rect.getWidth(), floater_rect.getHeight()); - floater->setRect(floater_rect); -} - -void LLCallFloater::reshapeToFitContent() -{ - const S32 ITEM_HEIGHT = getParticipantItemHeight(); - static const S32 MAX_VISIBLE_ITEMS = getMaxVisibleItems(); - - static S32 items_pad = mAvatarList->getItemsPad(); - S32 list_height = mAvatarList->getRect().getHeight(); - S32 items_height = mAvatarList->getItemsRect().getHeight(); - if(items_height <= 0) - { - // make "no one near" text visible - items_height = ITEM_HEIGHT + items_pad; - } - S32 max_list_height = MAX_VISIBLE_ITEMS * ITEM_HEIGHT + items_pad * (MAX_VISIBLE_ITEMS - 1); - max_list_height += 2* mAvatarList->getBorderWidth(); - - S32 delta = items_height - list_height; - // too many items, don't reshape floater anymore, let scroll bar appear. - if(items_height > max_list_height) - { - delta = max_list_height - list_height; - } - - reshape_floater(this, delta); -} - -S32 LLCallFloater::getParticipantItemHeight() -{ - std::vector items; - mAvatarList->getItems(items); - if(items.size() > 0) - { - return items[0]->getRect().getHeight(); - } - else - { - return getChild("non_avatar_caller")->getRect().getHeight(); - } -} - -S32 LLCallFloater::getMaxVisibleItems() -{ - S32 value = 5; // default value, in case convertToS32() fails. - LLStringUtil::convertToS32(getString("max_visible_items"), value); - return value; -} - //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 8aba93fc43..096594aaa2 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -75,11 +75,6 @@ public: */ /*virtual*/ void onChange(); - /** - * Will reshape floater when participant list size changes - */ - /*virtual*/ S32 notifyParent(const LLSD& info); - static void sOnCurrentChannelChanged(const LLUUID& session_id); private: @@ -88,7 +83,8 @@ private: VC_LOCAL_CHAT, VC_GROUP_CHAT, VC_AD_HOC_CHAT, - VC_PEER_TO_PEER + VC_PEER_TO_PEER, + VC_PEER_TO_PEER_AVALINE }EVoiceControls; typedef enum e_speaker_state @@ -220,21 +216,6 @@ private: */ void reset(); - /** - * Reshapes floater to fit participant list height - */ - void reshapeToFitContent(); - - /** - * Returns height of participant list item - */ - S32 getParticipantItemHeight(); - - /** - * Returns predefined max visible participants. - */ - S32 getMaxVisibleItems(); - private: speaker_state_map_t mSpeakerStateMap; LLSpeakerMgr* mSpeakerManager; diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 442dc660cd..b32a955038 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -48,7 +48,6 @@ #include "llcombobox.h" #include "llcommandhandler.h" // secondlife:///app/chat/ support #include "llviewercontrol.h" -#include "llfloaterchat.h" #include "llgesturemgr.h" #include "llkeyboard.h" #include "lllineeditor.h" @@ -548,7 +547,7 @@ void LLChatBar::onInputEditorFocusLost() // static void LLChatBar::onInputEditorGainFocus() { - LLFloaterChat::setHistoryCursorAndScrollToEnd(); + //LLFloaterChat::setHistoryCursorAndScrollToEnd(); } void LLChatBar::onClickSay( LLUICtrl* ctrl ) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 21cadda6e3..a46cd84b60 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -499,7 +499,24 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.name(font_name); style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - + + std::string prefix = chat.mText.substr(0, 4); + + //IRC styled /me messages. + bool irc_me = prefix == "/me " || prefix == "/me'"; + + // Delimiter after a name in header copy/past and in plain text mode + std::string delimiter = (chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER) + ? ": " + : " "; + + // Don't add any delimiter after name in irc styled messages + if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) + { + delimiter = LLStringUtil::null; + style_params.font.style = "ITALIC"; + } + if (use_plain_text_chat_history) { mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params); @@ -512,11 +529,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ LLStyle::Params link_params(style_params); link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); // Convert the name to a hotlink and add to message. - mEditor->appendText(chat.mFromName + ": ", false, link_params); + mEditor->appendText(chat.mFromName + delimiter, false, link_params); } else { - mEditor->appendText(chat.mFromName + ": ", false, style_params); + mEditor->appendText(chat.mFromName + delimiter, false, style_params); } } } @@ -560,39 +577,25 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); - std::string header_text = "[" + chat.mTimeStr + "] "; + std::string widget_associated_text = "\n[" + chat.mTimeStr + "] "; if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; + widget_associated_text += chat.mFromName + delimiter; - mEditor->appendWidget(p, header_text, false); + mEditor->appendWidget(p, widget_associated_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; } - //Handle IRC styled /me messages. - std::string prefix = chat.mText.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") - { - style_params.font.style = "ITALIC"; - if (chat.mFromName.size() > 0) - mEditor->appendText(chat.mFromName + " ", TRUE, style_params); - // Ensure that message ends with NewLine, to avoid losing of new lines - // while copy/paste from text chat. See EXT-3263. - mEditor->appendText(chat.mText.substr(4) + NEW_LINE, FALSE, style_params); - } - else + std::string message = irc_me ? chat.mText.substr(3) : chat.mText; + mEditor->appendText(message, FALSE, style_params); + mEditor->blockUndo(); + + // automatically scroll to end when receiving chat from myself + if (chat.mFromID == gAgentID) { - std::string message(chat.mText); - if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) ) - { - // Ensure that message ends with NewLine, to avoid losing of new lines - // while copy/paste from text chat. See EXT-3263. - message += NEW_LINE; - } - mEditor->appendText(message, FALSE, style_params); + mEditor->setCursorAndScrollToEnd(); } - mEditor->blockUndo(); } void LLChatHistory::draw() @@ -606,3 +609,11 @@ void LLChatHistory::draw() LLUICtrl::draw(); } +void LLChatHistory::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + bool is_scrolled_to_end = mEditor->scrolledToEnd(); + LLUICtrl::reshape( width, height, called_from_parent ); + // update scroll + if (is_scrolled_to_end) + mEditor->setCursorAndScrollToEnd(); +} diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index 260015e2dc..f2d403f639 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -119,6 +119,7 @@ class LLChatHistory : public LLUICtrl */ void appendMessage(const LLChat& chat, const bool use_plain_text_chat_history = false, const LLStyle::Params& input_append_params = LLStyle::Params()); /*virtual*/ void clear(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); private: std::string mLastFromName; diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 92df281307..f7f7ee83af 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -168,30 +168,30 @@ void LLNearbyChatToastPanel::init(LLSD& notification) msg_text->setText(std::string("")); - std::string str_sender; - - if(gAgentID != mFromID) + if ( notification["chat_style"].asInteger() != CHAT_STYLE_IRC ) + { + std::string str_sender; + str_sender = fromName; - else - str_sender = LLTrans::getString("You"); - str_sender+=" "; + str_sender+=" "; - //append user name - { - LLStyle::Params style_params_name; + //append user name + { + LLStyle::Params style_params_name; - LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); + LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); - style_params_name.color(userNameColor); - - std::string font_name = LLFontGL::nameFromFont(messageFont); - std::string font_style_size = LLFontGL::sizeFromFont(messageFont); - style_params_name.font.name(font_name); - style_params_name.font.size(font_style_size); - - msg_text->appendText(str_sender, FALSE, style_params_name); - + style_params_name.color(userNameColor); + + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params_name.font.name(font_name); + style_params_name.font.size(font_style_size); + + msg_text->appendText(str_sender, FALSE, style_params_name); + + } } //append text @@ -252,11 +252,33 @@ void LLNearbyChatToastPanel::onMouseEnter (S32 x, S32 y, MASK mask) } BOOL LLNearbyChatToastPanel::handleMouseDown (S32 x, S32 y, MASK mask) +{ + return LLPanel::handleMouseDown(x,y,mask); +} + +BOOL LLNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) - return LLPanel::handleMouseDown(x,y,mask); + return LLPanel::handleMouseUp(x,y,mask); + + LLChatMsgBox* text_box = getChild("msg_text", false); + S32 local_x = x - text_box->getRect().mLeft; + S32 local_y = y - text_box->getRect().mBottom; + + //if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat. + if (text_box->pointInView(local_x, local_y) ) + { + if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE) + return TRUE; + else + { + LLFloaterReg::showInstance("nearby_chat",LLSD()); + return FALSE; + } + } + LLFloaterReg::showInstance("nearby_chat",LLSD()); - return LLPanel::handleMouseDown(x,y,mask); + return LLPanel::handleMouseUp(x,y,mask); } void LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e) diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 0a85c52401..f4b8655054 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -68,6 +68,7 @@ public: void onMouseLeave (S32 x, S32 y, MASK mask); void onMouseEnter (S32 x, S32 y, MASK mask); BOOL handleMouseDown (S32 x, S32 y, MASK mask); + BOOL handleMouseUp (S32 x, S32 y, MASK mask); virtual BOOL postBuild(); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index dc2e22f899..8da207f887 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -47,6 +47,7 @@ #include "llnotificationsutil.h" #include "lloutputmonitorctrl.h" #include "llscriptfloater.h" +#include "llspeakers.h" #include "lltextbox.h" #include "llvoiceclient.h" #include "llgroupmgr.h" @@ -453,6 +454,7 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) , mNewMessagesIcon(NULL) , mSpeakerCtrl(NULL) , mCounterCtrl(NULL) +, mChicletButton(NULL) { enableCounterControl(p.enable_counter); } @@ -540,6 +542,11 @@ void LLIMChiclet::toggleSpeakerControl() void LLIMChiclet::setCounter(S32 counter) { + if (mCounterCtrl->getCounter() == counter) + { + return; + } + mCounterCtrl->setCounter(counter); setShowCounter(counter); setShowNewMessagesIcon(counter); @@ -571,6 +578,11 @@ void LLIMChiclet::onMouseDown() setCounter(0); } +void LLIMChiclet::setToggleState(bool toggle) +{ + mChicletButton->setToggleState(toggle); +} + BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask) { onMouseDown(); @@ -629,6 +641,7 @@ LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id) LLIMP2PChiclet::Params::Params() : avatar_icon("avatar_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -641,6 +654,10 @@ LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create(new_msg_params); addChild(mNewMessagesIcon); @@ -755,6 +772,7 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) LLAdHocChiclet::Params::Params() : avatar_icon("avatar_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -768,6 +786,10 @@ LLAdHocChiclet::LLAdHocChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create(new_msg_params); addChild(mNewMessagesIcon); @@ -882,6 +904,7 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") +, chiclet_button("chiclet_button") , unread_notifications("unread_notifications") , speaker("speaker") , new_message_icon("new_message_icon") @@ -895,6 +918,10 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) , mChicletIconCtrl(NULL) , mPopupMenu(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create(new_msg_params); addChild(mNewMessagesIcon); @@ -1267,10 +1294,12 @@ void LLChicletPanel::onChicletClick(LLUICtrl*ctrl,const LLSD¶m) void LLChicletPanel::removeChiclet(chiclet_list_t::iterator it) { - mScrollArea->removeChild(*it); + LLChiclet* chiclet = *it; + mScrollArea->removeChild(chiclet); mChicletList.erase(it); arrange(); + chiclet->die(); } void LLChicletPanel::removeChiclet(S32 index) @@ -1409,6 +1438,32 @@ S32 LLChicletPanel::notifyParent(const LLSD& info) return LLPanel::notifyParent(info); } +void LLChicletPanel::setChicletToggleState(const LLUUID& session_id, bool toggle) +{ + if(session_id.isNull()) + { + llwarns << "Null Session ID" << llendl; + } + + // toggle off all chiclets, except specified + S32 size = getChicletCount(); + for(int n = 0; n < size; ++n) + { + LLIMChiclet* chiclet = getChiclet(n); + if(chiclet && chiclet->getSessionId() != session_id) + { + chiclet->setToggleState(false); + } + } + + // toggle specified chiclet + LLIMChiclet* chiclet = findChiclet(session_id); + if(chiclet) + { + chiclet->setToggleState(toggle); + } +} + void LLChicletPanel::arrange() { if(mChicletList.empty()) @@ -1801,6 +1856,7 @@ LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) LLScriptChiclet::Params::Params() : icon("icon") + , chiclet_button("chiclet_button") , new_message_icon("new_message_icon") { } @@ -1809,6 +1865,10 @@ LLScriptChiclet::LLScriptChiclet(const Params&p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create(new_msg_params); addChild(mNewMessagesIcon); @@ -1857,6 +1917,7 @@ static const std::string INVENTORY_USER_OFFER ("UserGiveItem"); LLInvOfferChiclet::Params::Params() : icon("icon") + , chiclet_button("chiclet_button") , new_message_icon("new_message_icon") { } @@ -1865,6 +1926,10 @@ LLInvOfferChiclet::LLInvOfferChiclet(const Params&p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) { + LLButton::Params button_params = p.chiclet_button; + mChicletButton = LLUICtrlFactory::create(button_params); + addChild(mChicletButton); + LLIconCtrl::Params new_msg_params = p.new_message_icon; mNewMessagesIcon = LLUICtrlFactory::create(new_msg_params); addChild(mNewMessagesIcon); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 3665e4d093..bb4846aa57 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -325,7 +325,7 @@ public: }; - /*virtual*/ ~LLIMChiclet() {}; + virtual ~LLIMChiclet() {}; /** * Sets IM session name. This name will be displayed in chiclet tooltip. @@ -422,6 +422,8 @@ public: */ virtual void onMouseDown(); + virtual void setToggleState(bool toggle); + protected: LLIMChiclet(const LLIMChiclet::Params& p); @@ -438,7 +440,7 @@ protected: LLIconCtrl* mNewMessagesIcon; LLChicletNotificationCounterCtrl* mCounterCtrl; LLChicletSpeakerCtrl* mSpeakerCtrl; - + LLButton* mChicletButton; /** the id of another participant, either an avatar id or a group id*/ LLUUID mOtherParticipantId; @@ -473,6 +475,8 @@ class LLIMP2PChiclet : public LLIMChiclet public: struct Params : public LLInitParam::Block { + Optional chiclet_button; + Optional avatar_icon; Optional unread_notifications; @@ -538,6 +542,8 @@ class LLAdHocChiclet : public LLIMChiclet public: struct Params : public LLInitParam::Block { + Optional chiclet_button; + Optional avatar_icon; Optional unread_notifications; @@ -614,6 +620,8 @@ public: struct Params : public LLInitParam::Block { + Optional chiclet_button; + Optional icon; Optional new_message_icon; @@ -656,6 +664,8 @@ public: struct Params : public LLInitParam::Block { + Optional chiclet_button; + Optional icon; Optional new_message_icon; @@ -697,6 +707,8 @@ public: struct Params : public LLInitParam::Block { + Optional chiclet_button; + Optional group_icon; Optional unread_notifications; @@ -1040,6 +1052,11 @@ public: S32 notifyParent(const LLSD& info); + /** + * Toggle chiclet by session id ON and toggle OFF all other chiclets. + */ + void setChicletToggleState(const LLUUID& session_id, bool toggle); + protected: LLChicletPanel(const Params&p); friend class LLUICtrlFactory; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index eb9a2fec2f..47f1b7c9f5 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -59,7 +59,6 @@ #include "llbutton.h" #include "lldir.h" -#include "llfloaterchat.h" #include "llnotificationsutil.h" #include "llviewerstats.h" #include "llvfile.h" @@ -447,14 +446,20 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { - LLChat chat(LLTrans::getString("CompileQueueScriptNotFound")); - LLFloaterChat::addChat(chat); + //TODO* CHAT: how to show this? + //LLSD args; + //args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound); + //LLNotificationsUtil::add("SystemMessage", args); + buffer = LLTrans::getString("CompileQueueProblemDownloading") + (": ") + data->mScriptName; } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLChat chat(LLTrans::getString("CompileQueueInsufficientPermDownload")); - LLFloaterChat::addChat(chat); + //TODO* CHAT: how to show this? + //LLSD args; + //args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound); + //LLNotificationsUtil::add("SystemMessage", args); + buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + (": ") + data->mScriptName; } else diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 10b7935caf..abb2fdeb9a 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -44,15 +44,18 @@ static S32 DAYS_PER_MONTH_LEAP[] = static S32 days_from_month(S32 year, S32 month) { + llassert_always(1 <= month); + llassert_always(month <= 12); + if (year % 4 == 0 && year % 100 != 0) { // leap year - return DAYS_PER_MONTH_LEAP[month]; + return DAYS_PER_MONTH_LEAP[month - 1]; } else { - return DAYS_PER_MONTH_NOLEAP[month]; + return DAYS_PER_MONTH_NOLEAP[month - 1]; } } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 5f845c3721..03a8b108e2 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1149,14 +1149,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI if (!LLPipeline::sRenderDeferred) { bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); - bump->createGLTexture(bump->getDiscardLevel(), dst_image); + bump->createGLTexture(0, dst_image); } else { LLPointer nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4); generateNormalMapFromAlpha(src, nrm_image); bump->setExplicitFormat(GL_RGBA, GL_RGBA); - bump->createGLTexture(bump->getDiscardLevel(), nrm_image); + bump->createGLTexture(0, nrm_image); } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index c14ca2473b..c7cd77cb65 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -159,15 +159,10 @@ void LLDrawPoolWLSky::renderStars(void) const // *NOTE: have to have bound the cloud noise texture already since register // combiners blending below requires something to be bound // and we might as well only bind once. - //gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); gPipeline.disableLights(); - - if (!LLPipeline::sReflectionRender) - { - glPointSize(2.f); - } - + // *NOTE: we divide by two here and GL_ALPHA_SCALE by two below to avoid // clamping and allow the star_alpha param to brighten the stars. bool error; @@ -175,16 +170,20 @@ void LLDrawPoolWLSky::renderStars(void) const star_alpha.mV[3] = LLWLParamManager::instance()->mCurParams.getFloat("star_brightness", error) / 2.f; llassert_always(!error); + gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex()); + + gGL.pushMatrix(); + glRotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); // gl_FragColor.rgb = gl_Color.rgb; // gl_FragColor.a = gl_Color.a * star_alpha.a; - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_PREV_ALPHA, LLTexUnit::TBS_CONST_ALPHA); + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR); + gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_CONST_ALPHA, LLTexUnit::TBS_TEX_ALPHA); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, star_alpha.mV); gSky.mVOWLSkyp->drawStars(); - glPointSize(1.f); - + gGL.popMatrix(); + // and disable the combiner states gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index 7ff760ac39..9059f6382f 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -43,7 +43,7 @@ public: static const U32 SKY_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0; static const U32 STAR_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_COLOR; + LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0; LLDrawPoolWLSky(void); /*virtual*/ ~LLDrawPoolWLSky(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index effa57b1ef..4fa97e789b 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -314,7 +314,7 @@ void LLFastTimerView::draw() S32 left, top, right, bottom; S32 x, y, barw, barh, dx, dy; S32 texth, textw; - LLPointer box_imagep = LLUI::getUIImage("rounded_square.tga"); + LLPointer box_imagep = LLUI::getUIImage("Rounded_Square"); // Draw the window background gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -323,7 +323,9 @@ void LLFastTimerView::draw() S32 xleft = margin; S32 ytop = margin; - mAverageCyclesPerTimer = llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); + mAverageCyclesPerTimer = LLFastTimer::sTimerCalls == 0 + ? 0 + : llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); LLFastTimer::sTimerCycles = 0; LLFastTimer::sTimerCalls = 0; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6ae6b4877a..fb94657278 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -483,6 +483,10 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, if (drop) { + if (mItems.empty()) + { + setLandingTab(NULL); + } handleNewFavoriteDragAndDrop(item, favorites_id, x, y); showDragMarker(FALSE); } @@ -508,14 +512,14 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) if (dest) { - updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId()); + LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId()); } else { mItems.push_back(gInventory.getItem(mDragItemId)); } - saveItemsOrder(mItems); + gInventory.saveItemsOrder(mItems); LLToggleableMenu* menu = (LLToggleableMenu*) mPopupMenuHandle.get(); @@ -644,7 +648,7 @@ LLXMLNodePtr LLFavoritesBarCtrl::getButtonXMLNode() bool success = LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", buttonXMLNode); if (!success) { - llwarns << "Unable to read xml file with button for Favorites Bar: favorites_bar_button.xml" << llendl; + llwarns << "Failed to create Favorites Bar button from favorites_bar_button.xml" << llendl; buttonXMLNode = NULL; } return buttonXMLNode; @@ -1193,25 +1197,6 @@ BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array return result; } -void LLFavoritesBarCtrl::saveItemsOrder(LLInventoryModel::item_array_t& items) -{ - int sortField = 0; - - // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) - { - LLViewerInventoryItem* item = *i; - - item->setSortField(++sortField); - item->setComplete(TRUE); - item->updateServer(FALSE); - - gInventory.updateItem(item); - } - - gInventory.notifyObservers(); -} - LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) { LLInventoryModel::item_array_t::iterator result = items.end(); @@ -1228,15 +1213,6 @@ LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLIn return result; } -void LLFavoritesBarCtrl::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId) -{ - LLViewerInventoryItem* srcItem = gInventory.getItem(srcItemId); - LLViewerInventoryItem* destItem = gInventory.getItem(destItemId); - - items.erase(findItemByUUID(items, srcItem->getUUID())); - items.insert(findItemByUUID(items, destItem->getUUID()), srcItem); -} - void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem) { LLViewerInventoryItem* beforeItem = gInventory.getItem(beforeItemId); diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 9ac734baff..40dd551eef 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -126,16 +126,7 @@ private: // checks if the current order of the favorites items must be saved BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items); - // saves current order of the favorites items - void saveItemsOrder(LLInventoryModel::item_array_t& items); - - /* - * changes favorites items order by insertion of the item identified by srcItemId - * BEFORE the item identified by destItemId. both items must exist in items array. - */ - void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId); - - /* + /** * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId. * this function assumes that an item identified by insertedItemId doesn't exist in items array. */ diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 7fd0e070be..b3fdf60b11 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -45,6 +45,7 @@ #include "llappviewer.h" #include "lltracker.h" +/* // static std::set LLFirstUse::sConfigVariables; @@ -75,7 +76,8 @@ void LLFirstUse::resetFirstUse() gWarningSettings.setBOOL(*iter, TRUE); } } - +*/ +/* // Called whenever the viewer detects that your balance went up void LLFirstUse::useBalanceIncrease(S32 delta) @@ -145,6 +147,8 @@ void LLFirstUse::useBuild() LLNotificationsUtil::add("FirstBuild"); } } + + */ /* // static void LLFirstUse::useLeftClickNoHit() @@ -157,6 +161,7 @@ void LLFirstUse::useLeftClickNoHit() } } */ +/* // static void LLFirstUse::useTeleport() { @@ -171,7 +176,7 @@ void LLFirstUse::useTeleport() } } } - +*/ // static void LLFirstUse::useOverrideKeys() { @@ -187,7 +192,7 @@ void LLFirstUse::useOverrideKeys() } } } - +/* // static void LLFirstUse::useAttach() { @@ -216,6 +221,7 @@ void LLFirstUse::useInventory() } } +*/ // static void LLFirstUse::useSandbox() @@ -230,7 +236,7 @@ void LLFirstUse::useSandbox() LLNotificationsUtil::add("FirstSandbox", args); } } - +/* // static void LLFirstUse::useFlexible() { @@ -277,3 +283,4 @@ void LLFirstUse::useMedia() //LLNotificationsUtil::add("FirstMedia"); } } +*/ diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 7b4f9f516f..3c7551f6cb 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -79,6 +79,7 @@ object or from inventory. class LLFirstUse { public: +/* // Add a config variable to be reset on resetFirstUse() static void addConfigVariable(const std::string& var); @@ -97,11 +98,16 @@ public: static void useBuild(); // static void useLeftClickNoHit(); static void useTeleport(); +*/ static void useOverrideKeys(); +/* static void useAttach(); static void useAppearance(); static void useInventory(); + */ static void useSandbox(); + +/* static void useFlexible(); static void useDebugMenus(); static void useSculptedPrim(); @@ -109,6 +115,7 @@ public: protected: static std::set sConfigVariables; +*/ }; #endif diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index e80499688e..ef69f39ad2 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -167,20 +167,21 @@ BOOL LLFloaterAbout::postBuild() // Now build the various pieces support << getString("AboutHeader", args); - if (info.has("COMPILER")) - { - support << "\n\n" << getString("AboutCompiler", args); - } if (info.has("REGION")) { support << "\n\n" << getString("AboutPosition", args); } support << "\n\n" << getString("AboutSystem", args); + support << "\n"; if (info.has("GRAPHICS_DRIVER_VERSION")) { - support << "\n\n" << getString("AboutDriver", args); + support << "\n" << getString("AboutDriver", args); + } + support << "\n" << getString("AboutLibs", args); + if (info.has("COMPILER")) + { + support << "\n" << getString("AboutCompiler", args); } - support << "\n\n" << getString("AboutLibs", args); if (info.has("PACKETS_IN")) { support << '\n' << getString("AboutTraffic", args); @@ -193,11 +194,11 @@ BOOL LLFloaterAbout::postBuild() support_widget->blockUndo(); // Fix views - support_widget->setCursorPos(0); support_widget->setEnabled(FALSE); + support_widget->startOfDoc(); - credits_widget->setCursorPos(0); credits_widget->setEnabled(FALSE); + credits_widget->startOfDoc(); return TRUE; } @@ -268,7 +269,7 @@ LLSD LLFloaterAbout::getInfo() info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected"); // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)"; + info["QT_WEBKIT_VERSION"] = "4.6 (version number hard-coded)"; if (gPacketsIn > 0) { diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 538b44c056..5c3a54e34b 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -48,7 +48,6 @@ #include "llresmgr.h" #include "llbutton.h" #include "lldir.h" -#include "llfloaterchat.h" #include "llviewerstats.h" #include "lluictrlfactory.h" #include "llselectmgr.h" diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 764aff68c9..9496e94780 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -144,6 +144,11 @@ void LLPanelCameraZoom::onSliderValueChanged() mSavedSliderVal = val; } +void activate_camera_tool() +{ + LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance()); +}; + // // Member functions // @@ -151,7 +156,7 @@ void LLPanelCameraZoom::onSliderValueChanged() /*static*/ bool LLFloaterCamera::inFreeCameraMode() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); - if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA) + if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA && gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK) { return true; } @@ -177,27 +182,17 @@ void LLFloaterCamera::update() } -/*static*/ void LLFloaterCamera::updateIfNotInAvatarViewMode() -{ - LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); - if (floater_camera && !floater_camera->inAvatarViewMode()) - { - floater_camera->update(); - } -} - - void LLFloaterCamera::toPrevMode() { switchMode(mPrevMode); } -/*static*/ void LLFloaterCamera::toPrevModeIfInAvatarViewMode() +/*static*/ void LLFloaterCamera::onLeavingMouseLook() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); - if (floater_camera && floater_camera->inAvatarViewMode()) + if (floater_camera && floater_camera->inFreeCameraMode()) { - floater_camera->toPrevMode(); + activate_camera_tool(); } } @@ -325,7 +320,7 @@ void LLFloaterCamera::switchMode(ECameraControlMode mode) break; case CAMERA_CTRL_MODE_FREE_CAMERA: - LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance()); + activate_camera_tool(); break; case CAMERA_CTRL_MODE_AVATAR_VIEW: diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 5d44b4944d..45d5e9a845 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -61,7 +61,7 @@ public: /* callback for camera presets changing */ static void onClickCameraPresets(const LLSD& param); - static void toPrevModeIfInAvatarViewMode(); + static void onLeavingMouseLook(); /** resets current camera mode to orbit mode */ static void resetCameraMode(); @@ -69,8 +69,6 @@ public: /* determines actual mode and updates ui */ void update(); - static void updateIfNotInAvatarViewMode(); - virtual void onOpen(const LLSD& key); virtual void onClose(bool app_quitting); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index b9e0f928f1..cdb9b8edb8 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -37,8 +37,6 @@ #include "llviewerprecompiledheaders.h" -#include "llfloaterchat.h" - // project include #include "llagent.h" #include "llappviewer.h" @@ -190,7 +188,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT) + { + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + } + else + { + LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText); + } } LLColor4 color = get_text_color(chat); @@ -306,27 +311,17 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) } // Put a line of chat in all the right places -void LLFloaterChat::addChat(const LLChat& chat, BOOL from_instant_message, BOOL local_agent) +void LLFloaterChat::addChat(const LLChat& chat, BOOL local_agent) { triggerAlerts(chat.mText); // Add the sender to the list of people with which we've recently interacted. - if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) - LLRecentPeople::instance().add(chat.mFromID); + // this is not the best place to add _all_ messages to recent list + // comment this for now, may remove later on code cleanup + //if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) + // LLRecentPeople::instance().add(chat.mFromID); - bool add_chat = true; - bool log_chat = true; - if(from_instant_message) - { - if (!gSavedSettings.getBOOL("IMInChat")) - add_chat = false; - //log_chat = false; -} - - if (add_chat) - { - addChatHistory(chat, log_chat); - } + addChatHistory(chat, true); } // Moved from lltextparser.cpp to break llui/llaudio library dependency. diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 84fc199bfa..4437a0a5c2 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -61,7 +61,7 @@ public: // *TODO:Skinning - move these to LLChat (or LLViewerChat?) // Add chat to console and history list. // Color based on source, type, distance. - static void addChat(const LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE); + static void addChat(const LLChat& chat, BOOL local_agent = FALSE); // Add chat to history alone. static void addChatHistory(const LLChat& chat, bool log_to_file = true); diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 9108cfb72b..84b423399e 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -38,7 +38,6 @@ #include "llfloaterreg.h" #include "llfloaterchatterbox.h" #include "lluictrlfactory.h" -#include "llfloaterchat.h" #include "llfloaterfriends.h" #include "llfloatergroups.h" #include "llviewercontrol.h" @@ -134,22 +133,6 @@ BOOL LLFloaterChatterBox::postBuild() addFloater(LLFloaterMyFriends::getInstance(), TRUE); } - if (gSavedSettings.getBOOL("ChatHistoryTornOff")) - { - LLFloaterChat* floater_chat = LLFloaterChat::getInstance(); - if(floater_chat) - { - // add then remove to set up relationship for re-attach - addFloater(floater_chat, FALSE); - removeFloater(floater_chat); - // reparent to floater view - gFloaterView->addChild(floater_chat); - } - } - else - { - addFloater(LLFloaterChat::getInstance(), FALSE); - } mTabContainer->lockTabs(); return TRUE; } @@ -230,8 +213,6 @@ void LLFloaterChatterBox::onOpen(const LLSD& key) //*TODO:Skinning show the session id associated with key if (key.asString() == "local") { - LLFloaterChat* chat = LLFloaterReg::findTypedInstance("chat"); - chat->openFloater(); } else if (key.isDefined()) { @@ -245,12 +226,6 @@ void LLFloaterChatterBox::onOpen(const LLSD& key) void LLFloaterChatterBox::onVisibilityChange ( const LLSD& new_visibility ) { - // HACK: potentially need to toggle console - LLFloaterChat* instance = LLFloaterChat::getInstance(); - if(instance) - { - instance->updateConsoleVisibility(); - } } void LLFloaterChatterBox::removeFloater(LLFloater* floaterp) @@ -349,8 +324,7 @@ LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater() } if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel()) { - // show near me tab if in proximal channel - return LLFloaterChat::getInstance(); + return NULL; } else { diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 5072bc8c82..de65c6f876 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -110,7 +110,7 @@ LLFloaterGesture::LLFloaterGesture(const LLSD& key) mCommitCallbackRegistrar.add("Gesture.Action.ToogleActiveState", boost::bind(&LLFloaterGesture::onActivateBtnClick, this)); mCommitCallbackRegistrar.add("Gesture.Action.ShowPreview", boost::bind(&LLFloaterGesture::onClickEdit, this)); - mCommitCallbackRegistrar.add("Gesture.Action.CopyPast", boost::bind(&LLFloaterGesture::onCopyPastAction, this, _2)); + mCommitCallbackRegistrar.add("Gesture.Action.CopyPaste", boost::bind(&LLFloaterGesture::onCopyPasteAction, this, _2)); mCommitCallbackRegistrar.add("Gesture.Action.SaveToCOF", boost::bind(&LLFloaterGesture::addToCurrentOutFit, this)); mEnableCallbackRegistrar.add("Gesture.EnableAction", boost::bind(&LLFloaterGesture::isActionEnabled, this, _2)); @@ -245,6 +245,7 @@ void LLFloaterGesture::refreshAll() void LLFloaterGesture::buildGestureList() { + S32 scroll_pos = mGestureList->getScrollPos(); std::vector selected_items; getSelectedIds(selected_items); LL_DEBUGS("Gesture")<< "Rebuilding gesture list "<< LL_ENDL; @@ -274,13 +275,14 @@ void LLFloaterGesture::buildGestureList() } } } + // attempt to preserve scroll position through re-builds - // since we do re-build any time anything dirties + // since we do re-build whenever something gets dirty for(std::vector::iterator it = selected_items.begin(); it != selected_items.end(); it++) { mGestureList->selectByID(*it); } - mGestureList->scrollToShowSelected(); + mGestureList->setScrollPos(scroll_pos); } void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gesture,LLCtrlListInterface * list ) @@ -415,7 +417,7 @@ void LLFloaterGesture::onClickPlay() LL_DEBUGS("Gesture")<<" Trying to play gesture id: "<< item_id <refresh(); mPanelMedia->refresh(); mPanelAccess->refresh(); + mPanelCovenant->refresh(); } @@ -2795,12 +2796,6 @@ LLPanelLandCovenant::~LLPanelLandCovenant() { } -BOOL LLPanelLandCovenant::postBuild() -{ - refresh(); - return TRUE; -} - // virtual void LLPanelLandCovenant::refresh() { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index d7d02ba1a3..a4785e8f5b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -391,7 +391,6 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle& parcelp); virtual ~LLPanelLandCovenant(); - virtual BOOL postBuild(); void refresh(); static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 5cfd56193e..976af121ae 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -192,6 +192,9 @@ void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editab sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues ); sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues ); sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues ); + + sInstance->mApplyBtn->setEnabled(editable); + sInstance->mOKBtn->setEnabled(editable); } //////////////////////////////////////////////////////////////////////////////// @@ -266,8 +269,11 @@ const std::string LLFloaterMediaSettings::getHomeUrl() // virtual void LLFloaterMediaSettings::draw() { - // Set the enabled state of the "Apply" button if values changed - childSetEnabled( "Apply", haveValuesChanged() ); + if (NULL != mApplyBtn) + { + // Set the enabled state of the "Apply" button if values changed + mApplyBtn->setEnabled( haveValuesChanged() ); + } LLFloater::draw(); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 11dd48056c..fc036cb354 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -51,7 +51,7 @@ #include "lldirpicker.h" #include "llfeaturemanager.h" #include "llfocusmgr.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llfloaterreg.h" #include "llfloaterabout.h" #include "llfloaterhardwaresettings.h" @@ -185,8 +185,8 @@ void handleNameTagOptionChanged(const LLSD& newvalue); viewer_media_t get_web_media(); bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); -bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); -bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); +//bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); +//bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); @@ -236,7 +236,7 @@ void handleNameTagOptionChanged(const LLSD& newvalue) } } -bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) +/*bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option && floater ) @@ -244,7 +244,7 @@ bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFlo if ( floater ) { floater->setAllIgnored(); - LLFirstUse::disableFirstUse(); + // LLFirstUse::disableFirstUse(); floater->buildPopupLists(); } } @@ -259,13 +259,13 @@ bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFl if ( floater ) { floater->resetAllIgnored(); - LLFirstUse::resetFirstUse(); + //LLFirstUse::resetFirstUse(); floater->buildPopupLists(); } } return false; } - +*/ void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator) { @@ -313,8 +313,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.SelectSkin", boost::bind(&LLFloaterPreference::onSelectSkin, this)); mCommitCallbackRegistrar.add("Pref.VoiceSetKey", boost::bind(&LLFloaterPreference::onClickSetKey, this)); mCommitCallbackRegistrar.add("Pref.VoiceSetMiddleMouse", boost::bind(&LLFloaterPreference::onClickSetMiddleMouse, this)); - mCommitCallbackRegistrar.add("Pref.ClickSkipDialogs", boost::bind(&LLFloaterPreference::onClickSkipDialogs, this)); - mCommitCallbackRegistrar.add("Pref.ClickResetDialogs", boost::bind(&LLFloaterPreference::onClickResetDialogs, this)); +// mCommitCallbackRegistrar.add("Pref.ClickSkipDialogs", boost::bind(&LLFloaterPreference::onClickSkipDialogs, this)); +// mCommitCallbackRegistrar.add("Pref.ClickResetDialogs", boost::bind(&LLFloaterPreference::onClickResetDialogs, this)); mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); @@ -325,6 +325,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2)); mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this)); + mCommitCallbackRegistrar.add("Pref.ParcelMediaAutoPlayEnable", boost::bind(&LLFloaterPreference::onCommitParcelMediaAutoPlayEnable, this)); + mCommitCallbackRegistrar.add("Pref.MediaEnabled", boost::bind(&LLFloaterPreference::onCommitMediaEnabled, this)); mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); @@ -601,8 +603,8 @@ void LLFloaterPreference::onBtnOK() apply(); closeFloater(false); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); LLUIColorTable::instance().saveUserSettings(); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults gCrashSettings.saveToFile(crash_settings_filename, FALSE); @@ -986,6 +988,27 @@ void LLFloaterPreference::onCommitAutoDetectAspect() } } +void LLFloaterPreference::onCommitParcelMediaAutoPlayEnable() +{ + BOOL autoplay = getChild("autoplay_enabled")->get(); + + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, autoplay); + + lldebugs << "autoplay now = " << int(autoplay) << llendl; +} + +void LLFloaterPreference::onCommitMediaEnabled() +{ + LLCheckBoxCtrl *media_enabled_ctrl = getChild("media_enabled"); + bool enabled = media_enabled_ctrl->get(); + gSavedSettings.setBOOL("AudioStreamingVideo", enabled); + gSavedSettings.setBOOL("AudioStreamingMusic", enabled); + gSavedSettings.setBOOL("AudioStreamingMedia", enabled); + media_enabled_ctrl->setTentative(false); + // Update enabled state of the "autoplay" checkbox + getChild("autoplay_enabled")->setEnabled(enabled); +} + void LLFloaterPreference::refresh() { LLPanel::refresh(); @@ -1050,7 +1073,7 @@ void LLFloaterPreference::onClickSetMiddleMouse() // update the control right away since we no longer wait for apply getChild("modifier_combo")->onCommit(); } - +/* void LLFloaterPreference::onClickSkipDialogs() { LLNotificationsUtil::add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, this)); @@ -1060,6 +1083,7 @@ void LLFloaterPreference::onClickResetDialogs() { LLNotificationsUtil::add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, this)); } + */ void LLFloaterPreference::onClickEnablePopup() { @@ -1399,6 +1423,20 @@ BOOL LLPanelPreference::postBuild() refresh(); } + //////////////////////PanelPrivacy /////////////////// + if(hasChild("media_enabled")) + { + bool video_enabled = gSavedSettings.getBOOL("AudioStreamingVideo"); + bool music_enabled = gSavedSettings.getBOOL("AudioStreamingMusic"); + bool media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); + bool enabled = video_enabled || music_enabled || media_enabled; + + LLCheckBoxCtrl *media_enabled_ctrl = getChild("media_enabled"); + media_enabled_ctrl->set(enabled); + media_enabled_ctrl->setTentative(!(video_enabled == music_enabled == media_enabled)); + getChild("autoplay_enabled")->setEnabled(enabled); + } + apply(); return true; } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 74a53d673c..6f382620ee 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -110,8 +110,8 @@ public: void onClickSetKey(); void setKey(KEY key); void onClickSetMiddleMouse(); - void onClickSkipDialogs(); - void onClickResetDialogs(); +// void onClickSkipDialogs(); +// void onClickResetDialogs(); void onClickEnablePopup(); void onClickDisablePopup(); void resetAllIgnored(); @@ -132,6 +132,8 @@ public: // void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); void onCommitAutoDetectAspect(); + void onCommitParcelMediaAutoPlayEnable(); + void onCommitMediaEnabled(); void applyResolution(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c4b87c1b2d..03ff2cc370 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -406,6 +406,11 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) { + if (!region) + { + return; + } + // call refresh from region on all panels std::for_each( mInfoPanels.begin(), @@ -1598,7 +1603,7 @@ std::string all_estates_text() } else if (region && region->getOwner() == gAgent.getID()) { - return LLTrans::getString("AllEstatesYouOwn"); + return LLTrans::getString("RegionInfoAllEstatesYouOwn"); } else if (region && region->isEstateManager()) { diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 3042fbc6ec..0964ad7f91 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -64,6 +64,8 @@ // summary which only shows available & correct information #define USE_SIMPLE_SUMMARY +const S32 SIZE_OF_ONE_KB = 1024; + LLFloaterScriptLimits::LLFloaterScriptLimits(const LLSD& seed) : LLFloater(seed) { @@ -130,7 +132,6 @@ void LLFloaterScriptLimits::refresh() } } - ///---------------------------------------------------------------------------- // Base class for panels ///---------------------------------------------------------------------------- @@ -331,6 +332,57 @@ void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::stri llerrs << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<("scripts_list"); + std::vector::iterator id_itor; + for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) + { + LLSD element = *id_itor; + if(element["owner_id"].asUUID() == id) + { + LLScrollListItem* item = list->getItem(element["id"].asUUID()); + + if(item) + { + item->getColumn(2)->setValue(LLSD(name)); + element["columns"][2]["value"] = name; + } + } + } + + // fill in the url's tab if needed, all urls must have memory so we can do it all here + LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance("script_limits"); + if(instance) + { + LLTabContainer* tab = instance->getChild("scriptlimits_panels"); + LLPanelScriptLimitsRegionMemory* panel = (LLPanelScriptLimitsRegionMemory*)tab->getChild("script_limits_region_urls_panel"); + + LLScrollListCtrl *list = panel->getChild("scripts_list"); + std::vector::iterator id_itor; + for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) + { + LLSD element = *id_itor; + if(element["owner_id"].asUUID() == id) + { + LLScrollListItem* item = list->getItem(element["id"].asUUID()); + + if(item) + { + item->getColumn(2)->setValue(LLSD(name)); + element["columns"][2]["value"] = name; + } + } + } + } +} + void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) { LLScrollListCtrl *list = getChild("scripts_list"); @@ -345,22 +397,40 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) S32 total_objects = 0; S32 total_size = 0; + std::vector names_requested; + for(S32 i = 0; i < number_parcels; i++) { std::string parcel_name = content["parcels"][i]["name"].asString(); - + LLUUID parcel_id = content["parcels"][i]["id"].asUUID(); S32 number_objects = content["parcels"][i]["objects"].size(); for(S32 j = 0; j < number_objects; j++) { - S32 size = content["parcels"][i]["objects"][j]["resources"]["memory"].asInteger() / 1024; + S32 size = content["parcels"][i]["objects"][j]["resources"]["memory"].asInteger() / SIZE_OF_ONE_KB; total_size += size; std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString(); LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID(); + LLUUID owner_id = content["parcels"][i]["objects"][j]["owner_id"].asUUID(); + + std::string owner_buf; + + BOOL name_is_cached = gCacheName->getFullName(owner_id, owner_buf); + if(!name_is_cached) + { + if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end()) + { + names_requested.push_back(owner_id); + gCacheName->get(owner_id, TRUE, + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, + this, _1, _2, _3)); + } + } LLSD element; element["id"] = task_id; + element["owner_id"] = owner_id; element["columns"][0]["column"] = "size"; element["columns"][0]["value"] = llformat("%d", size); element["columns"][0]["font"] = "SANSSERIF"; @@ -368,18 +438,18 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) element["columns"][1]["value"] = name_buf; element["columns"][1]["font"] = "SANSSERIF"; element["columns"][2]["column"] = "owner"; - element["columns"][2]["value"] = ""; + element["columns"][2]["value"] = owner_buf; element["columns"][2]["font"] = "SANSSERIF"; element["columns"][3]["column"] = "location"; element["columns"][3]["value"] = parcel_name; element["columns"][3]["font"] = "SANSSERIF"; - list->addElement(element); - mObjectListIDs.push_back(task_id); + list->addElement(element, ADD_SORTED); + mObjectListItems.push_back(element); total_objects++; } } - + mParcelMemoryUsed =total_size; mGotParcelMemoryUsed = TRUE; populateParcelMemoryText(); @@ -556,7 +626,7 @@ void LLPanelScriptLimitsRegionMemory::clearList() childSetValue("memory_used", LLSD(msg_empty_string)); childSetValue("parcels_listed", LLSD(msg_empty_string)); - mObjectListIDs.clear(); + mObjectListItems.clear(); } // static @@ -728,7 +798,7 @@ void LLPanelScriptLimitsRegionURLs::setRegionDetails(LLSD content) S32 total_objects = 0; S32 total_size = 0; - + for(S32 i = 0; i < number_parcels; i++) { std::string parcel_name = content["parcels"][i]["name"].asString(); @@ -744,6 +814,10 @@ void LLPanelScriptLimitsRegionURLs::setRegionDetails(LLSD content) std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString(); LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID(); + LLUUID owner_id = content["parcels"][i]["objects"][j]["owner_id"].asUUID(); + + std::string owner_buf; + gCacheName->getFullName(owner_id, owner_buf); //dont care if this fails as the memory tab will request and fill the field LLSD element; @@ -755,14 +829,14 @@ void LLPanelScriptLimitsRegionURLs::setRegionDetails(LLSD content) element["columns"][1]["value"] = name_buf; element["columns"][1]["font"] = "SANSSERIF"; element["columns"][2]["column"] = "owner"; - element["columns"][2]["value"] = ""; + element["columns"][2]["value"] = owner_buf; element["columns"][2]["font"] = "SANSSERIF"; element["columns"][3]["column"] = "location"; element["columns"][3]["value"] = parcel_name; element["columns"][3]["font"] = "SANSSERIF"; list->addElement(element); - mObjectListIDs.push_back(task_id); + mObjectListItems.push_back(element); total_objects++; } } @@ -868,7 +942,7 @@ void LLPanelScriptLimitsRegionURLs::clearList() childSetValue("urls_used", LLSD(msg_empty_string)); childSetValue("parcels_listed", LLSD(msg_empty_string)); - mObjectListIDs.clear(); + mObjectListItems.clear(); } // static @@ -982,7 +1056,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentDetails(LLSD content) S32 size = 0; if(content["attachments"][i]["objects"][j]["resources"].has("memory")) { - size = content["attachments"][i]["objects"][j]["resources"]["memory"].asInteger(); + size = content["attachments"][i]["objects"][j]["resources"]["memory"].asInteger() / SIZE_OF_ONE_KB; } S32 urls = 0; if(content["attachments"][i]["objects"][j]["resources"].has("urls")) @@ -1059,3 +1133,4 @@ void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata) return; } } + diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index 88239136e3..7e2b536eb6 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -54,12 +54,12 @@ public: // from LLPanel virtual void refresh(); - + private: - + LLFloaterScriptLimits(const LLSD& seed); ~LLFloaterScriptLimits(); - + protected: LLTabContainer* mTab; @@ -167,13 +167,17 @@ public: private: + void onNameCache( const LLUUID& id, + const std::string& first_name, + const std::string& last_name); + LLUUID mParcelId; BOOL mGotParcelMemoryUsed; BOOL mGotParcelMemoryMax; S32 mParcelMemoryMax; S32 mParcelMemoryUsed; - std::vector mObjectListIDs; + std::vector mObjectListItems; protected: @@ -218,7 +222,7 @@ private: S32 mParcelURLsMax; S32 mParcelURLsUsed; - std::vector mObjectListIDs; + std::vector mObjectListItems; protected: diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index c6d9fee630..a7401fdb6f 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -32,6 +32,9 @@ */ #include "llviewerprecompiledheaders.h" + +#include "llcommandhandler.h" +#include "llfloaterreg.h" #include "llfloatersearch.h" #include "llmediactrl.h" #include "lllogininstance.h" @@ -41,6 +44,42 @@ #include "llviewercontrol.h" #include "llweb.h" +// support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps +class LLSearchHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + const size_t parts = tokens.size(); + + // get the (optional) category for the search + std::string category; + if (parts > 0) + { + category = tokens[0].asString(); + } + + // get the (optional) search string + std::string search_text; + if (parts > 1) + { + search_text = tokens[1].asString(); + } + + // create the LLSD arguments for the search floater + LLSD args; + args["category"] = category; + args["id"] = LLURI::unescape(search_text); + + // open the search floater and perform the requested search + LLFloaterReg::showInstance("search", args); + return true; + } +}; +LLSearchHandler gSearchHandler; + LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), LLViewerMediaObserver(), diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 8979575ef7..a6ffa5ec09 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -34,7 +34,7 @@ #include "llfloatersettingsdebug.h" #include "llfloater.h" #include "lluictrlfactory.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llcombobox.h" #include "llspinctrl.h" #include "llcolorswatch.h" diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index f53b62e490..afb58c9407 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2078,8 +2078,10 @@ void LLFloaterSnapshot::draw() { if(previewp->getThumbnailImage()) { + LLRect thumbnail_rect = getChild("thumbnail_placeholder")->getRect(); + S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ; - S32 offset_y = getRect().getHeight() - 205 + (90 - previewp->getThumbnailHeight()) / 2 ; + S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ; glMatrixMode(GL_MODELVIEW); gl_draw_scaled_image(offset_x, offset_y, diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index babef5b63d..241497aeaf 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1134,7 +1134,8 @@ void LLFloaterTools::getMediaState() } // XXX DISABLE this for now, because when the fetch finally // does come in, the state of this floater doesn't properly - // update. This needs more thought. + // update. Re-selecting fixes the problem, but there is + // contention as to whether this is a sufficient solution. // if (object->isMediaDataBeingFetched()) // { // LL_INFOS("LLFloaterTools: media") @@ -1221,10 +1222,10 @@ void LLFloaterTools::getMediaState() mNeedMediaTitle = false; } - childSetEnabled("media_tex", bool_has_media & editable); - childSetEnabled( "edit_media", bool_has_media & editable ); - childSetEnabled( "delete_media", bool_has_media & editable ); - childSetEnabled( "add_media", ( ! bool_has_media ) & editable ); + childSetEnabled("media_tex", bool_has_media && editable); + childSetEnabled( "edit_media", bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); + childSetEnabled( "delete_media", bool_has_media && editable ); + childSetEnabled( "add_media", ( ! bool_has_media ) && editable ); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1252,7 +1253,7 @@ void LLFloaterTools::getMediaState() } childSetEnabled("media_tex", TRUE); - childSetEnabled( "edit_media", TRUE); + childSetEnabled( "edit_media", LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); childSetEnabled( "delete_media", TRUE); childSetEnabled( "add_media", FALSE ); } @@ -1269,18 +1270,15 @@ void LLFloaterTools::getMediaState() // called when a user wants to add media to a prim or prim face void LLFloaterTools::onClickBtnAddMedia() { - // check for the edit tool and now many faces are selected - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if((tool != LLToolFace::getInstance()) || LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) + // check if multiple faces are selected + if(LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { - LLNotificationsUtil::add("MultipleFacesSelected",LLSD(), LLSD(), multipleFacesSelectedConfirm); - + LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm); } else { onClickBtnEditMedia(); } - } // static @@ -1423,7 +1421,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getControls(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_controls(default_media_data); identical = selected_objects->getSelectedTEValue( &func_controls, value_u8 ); @@ -1446,7 +1444,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getFirstClickInteract(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_first_click(default_media_data); identical = selected_objects->getSelectedTEValue( &func_first_click, value_bool ); @@ -1469,7 +1467,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getHomeURL(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_home_url(default_media_data); identical = selected_objects->getSelectedTEValue( &func_home_url, value_str ); @@ -1492,7 +1490,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getCurrentURL(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_current_url(default_media_data); identical = selected_objects->getSelectedTEValue( &func_current_url, value_str ); @@ -1516,7 +1514,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getAutoZoom(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_auto_zoom(default_media_data); identical = selected_objects->getSelectedTEValue( &func_auto_zoom, value_bool ); @@ -1539,7 +1537,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getAutoPlay(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_auto_play(default_media_data); identical = selected_objects->getSelectedTEValue( &func_auto_play, value_bool ); @@ -1563,7 +1561,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getAutoScale();; }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_auto_scale(default_media_data); identical = selected_objects->getSelectedTEValue( &func_auto_scale, value_bool ); @@ -1586,7 +1584,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getAutoLoop(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_auto_loop(default_media_data); identical = selected_objects->getSelectedTEValue( &func_auto_loop, value_bool ); @@ -1609,7 +1607,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getWidthPixels(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_width_pixels(default_media_data); identical = selected_objects->getSelectedTEValue( &func_width_pixels, value_int ); @@ -1632,7 +1630,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getHeightPixels(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_height_pixels(default_media_data); identical = selected_objects->getSelectedTEValue( &func_height_pixels, value_int ); @@ -1655,7 +1653,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getAltImageEnable(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_enable_alt_image(default_media_data); identical = selected_objects->getSelectedTEValue( &func_enable_alt_image, value_bool ); @@ -1678,7 +1676,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_OWNER ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_owner_interact(default_media_data); identical = selected_objects->getSelectedTEValue( &func_perms_owner_interact, value_bool ); @@ -1701,7 +1699,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_OWNER ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_owner_control(default_media_data); identical = selected_objects ->getSelectedTEValue( &func_perms_owner_control, value_bool ); @@ -1724,7 +1722,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_GROUP ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_group_interact(default_media_data); identical = selected_objects->getSelectedTEValue( &func_perms_group_interact, value_bool ); @@ -1747,7 +1745,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_GROUP ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_group_control(default_media_data); identical = selected_objects->getSelectedTEValue( &func_perms_group_control, value_bool ); @@ -1770,7 +1768,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_ANYONE ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_anyone_interact(default_media_data); identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func_perms_anyone_interact, value_bool ); @@ -1793,7 +1791,7 @@ void LLFloaterTools::updateMediaSettings() return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_ANYONE ); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_perms_anyone_control(default_media_data); identical = selected_objects->getSelectedTEValue( &func_perms_anyone_control, value_bool ); @@ -1816,7 +1814,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getWhiteListEnable(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_whitelist_enable(default_media_data); identical = selected_objects->getSelectedTEValue( &func_whitelist_enable, value_bool ); @@ -1839,7 +1837,7 @@ void LLFloaterTools::updateMediaSettings() return mMediaEntry.getWhiteList(); }; - const LLMediaEntry & mMediaEntry; + const LLMediaEntry &mMediaEntry; } func_whitelist_urls(default_media_data); identical = selected_objects->getSelectedTEValue( &func_whitelist_urls, value_vector_str ); diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 43024a4bd0..638c9f1b8c 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -110,32 +110,33 @@ void LLPanelVoiceDeviceSettings::draw() LLPanel::draw(); - F32 voice_power = gVoiceClient->tuningGetEnergy(); - S32 discrete_power = 0; - - if (!is_in_tuning_mode) - { - discrete_power = 0; - } - else - { - discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f)); - } - if (is_in_tuning_mode) { - for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) + const S32 num_bars = 5; + F32 voice_power = gVoiceClient->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + S32 discrete_power = llmin(num_bars, llfloor(voice_power * (F32)num_bars + 0.1f)); + + for(S32 power_bar_idx = 0; power_bar_idx < num_bars; power_bar_idx++) { std::string view_name = llformat("%s%d", "bar", power_bar_idx); LLView* bar_view = getChild(view_name); if (bar_view) { + gl_rect_2d(bar_view->getRect(), LLColor4::grey, TRUE); + + LLColor4 color; if (power_bar_idx < discrete_power) { - LLColor4 color = (power_bar_idx >= 3) ? LLUIColorTable::instance().getColor("OverdrivenColor") : LLUIColorTable::instance().getColor("SpeakingColor"); - gl_rect_2d(bar_view->getRect(), color, TRUE); + color = (power_bar_idx >= 3) ? LLUIColorTable::instance().getColor("OverdrivenColor") : LLUIColorTable::instance().getColor("SpeakingColor"); + } + else + { + color = LLUIColorTable::instance().getColor("PanelFocusBackgroundColor"); } - gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE); + + LLRect color_rect = bar_view->getRect(); + color_rect.stretch(-1); + gl_rect_2d(color_rect, color, TRUE); } } } @@ -276,7 +277,10 @@ void LLPanelVoiceDeviceSettings::initialize() void LLPanelVoiceDeviceSettings::cleanup() { - gVoiceClient->tuningStop(); + if (gVoiceClient) + { + gVoiceClient->tuningStop(); + } LLVoiceChannel::resume(); } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 98f9171237..f4d4ea3553 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -47,7 +47,7 @@ #include "llviewercontrol.h" #include "llcommandhandler.h" #include "lldraghandle.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" #include "llinventorymodel.h" @@ -100,8 +100,6 @@ enum EPanDirection // Values in pixels per region static const F32 ZOOM_MAX = 128.f; -static const F32 SIM_COORD_DEFAULT = 128.f; - //--------------------------------------------------------------------------- // Globals //--------------------------------------------------------------------------- @@ -118,9 +116,12 @@ public: { if (params.size() == 0) { - return false; + // support the secondlife:///app/worldmap SLapp + LLFloaterReg::showInstance("world_map", "center"); + return true; } + // support the secondlife:///app/worldmap/{LOCATION}/{COORDS} SLapp const std::string region_name = params[0].asString(); S32 x = (params.size() > 1) ? params[1].asInteger() : 128; S32 y = (params.size() > 2) ? params[2].asInteger() : 128; @@ -189,7 +190,8 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mInventory(NULL), mInventoryObserver(NULL), mFriendObserver(NULL), - mCompletingRegionName(""), + mCompletingRegionName(), + mCompletingRegionPos(), mWaitingForTracker(FALSE), mIsClosing(FALSE), mSetToUserPosition(TRUE), @@ -205,7 +207,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mCommitCallbackRegistrar.add("WMap.AvatarCombo", boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this)); mCommitCallbackRegistrar.add("WMap.Landmark", boost::bind(&LLFloaterWorldMap::onLandmarkComboCommit, this)); mCommitCallbackRegistrar.add("WMap.SearchResult", boost::bind(&LLFloaterWorldMap::onCommitSearchResult, this)); - mCommitCallbackRegistrar.add("WMap.CommitLocation", boost::bind(&LLFloaterWorldMap::onCommitLocation, this)); mCommitCallbackRegistrar.add("WMap.GoHome", boost::bind(&LLFloaterWorldMap::onGoHome, this)); mCommitCallbackRegistrar.add("WMap.Teleport", boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); mCommitCallbackRegistrar.add("WMap.ShowTarget", boost::bind(&LLFloaterWorldMap::onShowTargetBtn, this)); @@ -316,7 +317,7 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) adjustZoomSliderBounds(); // Could be first show - LLFirstUse::useMap(); + //LLFirstUse::useMap(); // Start speculative download of landmarks const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); @@ -664,10 +665,6 @@ void LLFloaterWorldMap::updateLocation() S32 agent_y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); S32 agent_z = llround( (F32)agentPos.mdV[VZ] ); - childSetValue("spin x", LLSD(agent_x) ); - childSetValue("spin y", LLSD(agent_y) ); - childSetValue("spin z", LLSD(agent_z) ); - // Set the current SLURL mSLURL = LLSLURL::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); } @@ -699,9 +696,6 @@ void LLFloaterWorldMap::updateLocation() F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); - childSetValue("spin x", LLSD(region_x) ); - childSetValue("spin y", LLSD(region_y) ); - childSetValue("spin z", LLSD((F32)pos_global.mdV[VZ]) ); // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) @@ -733,9 +727,11 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 { // fill in UI based on URL gFloaterWorldMap->childSetValue("location", region_name); - childSetValue("spin x", LLSD((F32)x_coord)); - childSetValue("spin y", LLSD((F32)y_coord)); - childSetValue("spin z", LLSD((F32)z_coord)); + + // Save local coords to highlight position after region global + // position is returned. + gFloaterWorldMap->mCompletingRegionPos.set( + (F32)x_coord, (F32)y_coord, (F32)z_coord); // pass sim name to combo box gFloaterWorldMap->mCompletingRegionName = region_name; @@ -899,18 +895,6 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); } - if (!childHasKeyboardFocus("spin x")) - { - childSetValue("spin x", SIM_COORD_DEFAULT); - } - if (!childHasKeyboardFocus("spin y")) - { - childSetValue("spin y", SIM_COORD_DEFAULT); - } - if (!childHasKeyboardFocus("spin z")) - { - childSetValue("spin z", 0); - } LLWorldMap::getInstance()->cancelTracking(); mCompletingRegionName = ""; } @@ -1466,21 +1450,6 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } } -void LLFloaterWorldMap::onCommitLocation() -{ - LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); - if ( LLTracker::TRACKING_LOCATION == tracking_status) - { - LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); - F64 local_x = childGetValue("spin x"); - F64 local_y = childGetValue("spin y"); - F64 local_z = childGetValue("spin z"); - pos_global.mdV[VX] += -fmod(pos_global.mdV[VX], 256.0) + local_x; - pos_global.mdV[VY] += -fmod(pos_global.mdV[VY], 256.0) + local_y; - pos_global.mdV[VZ] = local_z; - trackLocation(pos_global); - } -} void LLFloaterWorldMap::onCommitSearchResult() { @@ -1503,12 +1472,19 @@ void LLFloaterWorldMap::onCommitSearchResult() if (info->isName(sim_name)) { LLVector3d pos_global = info->getGlobalOrigin(); - F64 local_x = childGetValue("spin x"); - F64 local_y = childGetValue("spin y"); - F64 local_z = childGetValue("spin z"); - pos_global.mdV[VX] += local_x; - pos_global.mdV[VY] += local_y; - pos_global.mdV[VZ] = local_z; + + const F64 SIM_COORD_DEFAULT = 128.0; + LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f); + + // Did this value come from a trackURL() request? + if (!mCompletingRegionPos.isExactlyZero()) + { + pos_local = mCompletingRegionPos; + mCompletingRegionPos.clear(); + } + pos_global.mdV[VX] += (F64)pos_local.mV[VX]; + pos_global.mdV[VY] += (F64)pos_local.mV[VY]; + pos_global.mdV[VZ] = (F64)pos_local.mV[VZ]; childSetValue("location", sim_name); trackLocation(pos_global); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 7feebb583d..00f5e788fb 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -148,7 +148,6 @@ protected: void updateSearchEnabled(); void onLocationFocusChanged( LLFocusableElement* ctrl ); void onLocationCommit(); - void onCommitLocation(); void onCommitSearchResult(); void cacheLandmarkPosition(); @@ -170,6 +169,10 @@ private: LLFriendObserver* mFriendObserver; std::string mCompletingRegionName; + // Local position from trackURL() request, used to select final + // position once region lookup complete. + LLVector3 mCompletingRegionPos; + std::string mLastRegionName; BOOL mWaitingForTracker; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 112b23d2df..a63fb73032 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -78,7 +78,7 @@ ///---------------------------------------------------------------------------- const S32 RENAME_WIDTH_PAD = 4; -const S32 RENAME_HEIGHT_PAD = 2; +const S32 RENAME_HEIGHT_PAD = 1; const S32 AUTO_OPEN_STACK_DEPTH = 16; const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH + LLFolderViewItem::ICON_PAD @@ -206,7 +206,9 @@ LLFolderView::LLFolderView(const Params& p) mAutoOpenCandidate = NULL; mAutoOpenTimer.stop(); mKeyboardSelection = FALSE; - static LLUICachedControl indentation("FolderIndentation", 0); + const LLFolderViewItem::Params& item_params = + LLUICtrlFactory::getDefaultParams(); + S32 indentation = item_params.folder_indentation(); mIndentation = -indentation; // children start at indentation 0 gIdleCallbacks.addFunction(idle, this); @@ -395,7 +397,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen getRoot()->getFilter()->getShowFolderState(); S32 total_width = LEFT_PAD; - S32 running_height = mDebugFilters ? llceil(sSmallFont->getLineHeight()) : 0; + S32 running_height = mDebugFilters ? llceil(LLFontGL::getFontMonospace()->getLineHeight()) : 0; S32 target_height = running_height; S32 parent_item_height = getRect().getHeight(); @@ -569,6 +571,8 @@ LLFolderViewItem* LLFolderView::getCurSelectedItem( void ) BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus) { + mSignalSelectCallback = take_keyboard_focus ? SIGNAL_KEYBOARD_FOCUS : SIGNAL_NO_KEYBOARD_FOCUS; + if( selection == this ) { return FALSE; @@ -596,8 +600,6 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem, llassert(mSelectedItems.size() <= 1); - mSignalSelectCallback = take_keyboard_focus ? SIGNAL_KEYBOARD_FOCUS : SIGNAL_NO_KEYBOARD_FOCUS; - return rv; } @@ -820,10 +822,11 @@ void LLFolderView::clearSelection() mSelectThisID.setNull(); } -BOOL LLFolderView::getSelectionList(std::set &selection) +BOOL LLFolderView::getSelectionList(std::set &selection) const { - selected_items_t::iterator item_it; - for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) + for (selected_items_t::const_iterator item_it = mSelectedItems.begin(); + item_it != mSelectedItems.end(); + ++item_it) { selection.insert((*item_it)->getListener()->getUUID()); } @@ -866,8 +869,8 @@ void LLFolderView::draw() { std::string current_filter_string = llformat("Current Filter: %d, Least Filter: %d, Auto-accept Filter: %d", mFilter->getCurrentGeneration(), mFilter->getMinRequiredGeneration(), mFilter->getMustPassGeneration()); - sSmallFont->renderUTF8(current_filter_string, 0, 2, - getRect().getHeight() - sSmallFont->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f), + LLFontGL::getFontMonospace()->renderUTF8(current_filter_string, 0, 2, + getRect().getHeight() - LLFontGL::getFontMonospace()->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f), LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } @@ -1882,8 +1885,8 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr S32 icon_height = mIcon.isNull() ? 0 : mIcon->getHeight(); S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); - // when navigating with keyboard, only move top of folders on screen, otherwise show whole folder - S32 max_height_to_show = mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight(); + // when navigating with keyboard, only move top of opened folder on screen, otherwise show whole folder + S32 max_height_to_show = item->isOpen() && mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight(); // get portion of item that we want to see... LLRect item_local_rect = LLRect(item->getIndentation(), @@ -2218,10 +2221,9 @@ void LLFolderView::updateRenamerPosition() { if(mRenameItem) { - LLFontGL* font = getLabelFontForStyle(mLabelStyle); - - S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD - 1 + mRenameItem->getIndentation(); - S32 y = llfloor(mRenameItem->getRect().getHeight() - font->getLineHeight()-2); + // See also LLFolderViewItem::draw() + S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mRenameItem->getIndentation(); + S32 y = mRenameItem->getRect().getHeight() - mRenameItem->getItemHeight() - RENAME_HEIGHT_PAD; mRenameItem->localPointToScreen( x, y, &x, &y ); screenPointToLocal( x, y, &x, &y ); mRenamer->setOrigin( x, y ); @@ -2233,7 +2235,7 @@ void LLFolderView::updateRenamerPosition() } S32 width = llmax(llmin(mRenameItem->getRect().getWidth() - x, scroller_rect.getWidth() - x - getRect().mLeft), MINIMUM_RENAMER_WIDTH); - S32 height = llfloor(font->getLineHeight() + RENAME_HEIGHT_PAD); + S32 height = mRenameItem->getItemHeight() - RENAME_HEIGHT_PAD; mRenamer->reshape( width, height, TRUE ); } } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 2598af4df4..89e1865e35 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -162,7 +162,7 @@ public: virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray& items); - virtual BOOL getSelectionList(std::set &selection); + virtual BOOL getSelectionList(std::set &selection) const; // make sure if ancestor is selected, descendents are not void sanitizeSelection(); diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 473d0be912..d6c4459e6f 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -62,6 +62,7 @@ public: virtual PermissionMask getPermissionMask() const = 0; virtual LLFolderType::EType getPreferredType() const = 0; virtual LLPointer getIcon() const = 0; + virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const = 0; virtual std::string getLabelSuffix() const = 0; virtual void openItem( void ) = 0; diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 9d54aafd67..4b48626b22 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -51,11 +51,10 @@ /// Class LLFolderViewItem ///---------------------------------------------------------------------------- +static LLDefaultChildRegistry::Register r("folder_view_item"); + // statics std::map LLFolderViewItem::sFonts; // map of styles to fonts -const LLFontGL* LLFolderViewItem::sSmallFont = NULL; -LLUIImagePtr LLFolderViewItem::sArrowImage; -LLUIImagePtr LLFolderViewItem::sBoxImage; // only integers can be initialized in header const F32 LLFolderViewItem::FOLDER_CLOSE_TIME_CONSTANT = 0.02f; @@ -84,33 +83,34 @@ LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style) //static void LLFolderViewItem::initClass() { - sSmallFont = LLFontGL::getFontMonospace(); - sArrowImage = LLUI::getUIImage("folder_arrow.tga"); - sBoxImage = LLUI::getUIImage("rounded_square.tga"); } //static void LLFolderViewItem::cleanupClass() { sFonts.clear(); - sArrowImage = NULL; - sBoxImage = NULL; } // NOTE: Optimize this, we call it a *lot* when opening a large inventory LLFolderViewItem::Params::Params() -: icon("icon"), - folder_arrow_image("folder_arrow_image", LLUI::getUIImage("folder_arrow.tga")), - selection_image("selection_image", LLUI::getUIImage("rounded_square.tga")) +: icon(), + icon_open(), + root(), + listener(), + folder_arrow_image("folder_arrow_image"), + folder_indentation("folder_indentation"), + selection_image("selection_image"), + item_height("item_height"), + item_top_pad("item_top_pad"), + creation_date() { mouse_opaque(true); follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT); - // JAMESDEBUG tab_stop(false); } // Default constructor -LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) +LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) : LLView(p), mLabelWidth(0), mLabelWidthDirty(false), @@ -121,6 +121,7 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mLabelStyle( LLFontGL::NORMAL ), mHasVisibleChildren(FALSE), mIndentation(0), + mItemHeight(p.item_height), mNumDescendantsSelected(0), mPassedFilter(FALSE), mLastFilterGeneration(-1), @@ -134,8 +135,6 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mIcon(p.icon), mIconOpen(p.icon_open), mListener(p.listener), - mArrowImage(p.folder_arrow_image), - mBoxImage(p.selection_image), mHidden(false), mShowLoadStatus(false) { @@ -392,10 +391,11 @@ BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* roo // makes sure that this view and it's children are the right size. S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) { - static LLUICachedControl indentation("FolderIndentation", 0); + const Params& p = LLUICtrlFactory::getDefaultParams(); + S32 indentation = p.folder_indentation(); + // Only indent deeper items in hierarchy mIndentation = (getParentFolder() - && getParentFolder()->getParentFolder() - && getParentFolder()->getParentFolder()->getParentFolder()) + && getParentFolder()->getParentFolder() ) ? mParentFolder->getIndentation() + indentation : 0; if (mLabelWidthDirty) @@ -421,9 +421,10 @@ S32 LLFolderViewItem::getItemHeight() { if (mHidden) return 0; - S32 icon_height = mIcon->getHeight(); - S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); - return llmax( icon_height, label_height ) + ICON_PAD; + //S32 icon_height = mIcon->getHeight(); + //S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); + //return llmax( icon_height, label_height ) + ICON_PAD; + return mItemHeight; } void LLFolderViewItem::filter( LLInventoryFilter& filter) @@ -829,11 +830,16 @@ void LLFolderViewItem::draw() static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = + LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); static LLUIColor sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemSuffixColor", DEFAULT_WHITE); static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); + const Params& default_params = LLUICtrlFactory::getDefaultParams(); + const S32 TOP_PAD = default_params.item_top_pad; + bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter... @@ -843,13 +849,13 @@ void LLFolderViewItem::draw() } if(/*mControlLabel[0] != '\0' && */possibly_has_children) { - if (sArrowImage) - { - gl_draw_scaled_rotated_image(mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD, - ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, sArrowImage->getImage(), sFgColor); - } + LLUIImage* arrow_image = default_params.folder_arrow_image; + gl_draw_scaled_rotated_image( + mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD - TOP_PAD, + ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, arrow_image->getImage(), sFgColor); } + // See also LLFolderView::updateRenamerPosition() F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); LLFontGL* font = getLabelFontForStyle(mLabelStyle); @@ -857,6 +863,10 @@ void LLFolderViewItem::draw() // If we have keyboard focus, draw selection filled BOOL show_context = getRoot()->getShowSelectionContext(); BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus()); + const S32 FOCUS_LEFT = 1; + S32 focus_top = getRect().getHeight(); + S32 focus_bottom = getRect().getHeight() - mItemHeight; + bool folder_open = (getRect().getHeight() > mItemHeight + 4); // always render "current" item, only render other selected items if // mShowSingleSelection is FALSE @@ -864,7 +874,6 @@ void LLFolderViewItem::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLColor4 bg_color = sHighlightBgColor; - //const S32 TRAILING_PAD = 5; // It just looks better with this. if (!mIsCurSelection) { // do time-based fade of extra objects @@ -882,35 +891,35 @@ void LLFolderViewItem::draw() } gl_rect_2d( - 0, - getRect().getHeight(), + FOCUS_LEFT, + focus_top, getRect().getWidth() - 2, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD), + focus_bottom, bg_color, filled); if (mIsCurSelection) { gl_rect_2d( - 0, - getRect().getHeight(), + FOCUS_LEFT, + focus_top, getRect().getWidth() - 2, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD), - sHighlightFgColor, FALSE); + focus_bottom, + sFocusOutlineColor, FALSE); } - if (getRect().getHeight() > llround(font->getLineHeight()) + ICON_PAD + 4) + if (folder_open) { gl_rect_2d( - 0, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4, + FOCUS_LEFT, + focus_bottom + 1, // overlap with bottom edge of above rect getRect().getWidth() - 2, - 2, - sHighlightFgColor, FALSE); + 0, + sFocusOutlineColor, FALSE); if (show_context) { gl_rect_2d( - 0, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4, + FOCUS_LEFT, + focus_bottom + 1, getRect().getWidth() - 2, - 2, + 0, sHighlightBgColor, TRUE); } } @@ -919,32 +928,32 @@ void LLFolderViewItem::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d( - 0, - getRect().getHeight(), + FOCUS_LEFT, + focus_top, getRect().getWidth() - 2, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD), + focus_bottom, sHighlightBgColor, FALSE); - - if (getRect().getHeight() > llround(font->getLineHeight()) + ICON_PAD + 2) + if (folder_open) { gl_rect_2d( - 0, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 2, + FOCUS_LEFT, + focus_bottom + 1, // overlap with bottom edge of above rect getRect().getWidth() - 2, - 2, + 0, sHighlightBgColor, FALSE); } mDragAndDropTarget = FALSE; } + S32 icon_x = mIndentation + ARROW_SIZE + TEXT_PAD; // First case is used for open folders if (!mIconOpen.isNull() && (llabs(mControlLabelRotation) > 80)) { - mIconOpen->draw(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight()); + mIconOpen->draw(icon_x, getRect().getHeight() - mIconOpen->getHeight() - TOP_PAD + 1); } else if(mIcon) { - mIcon->draw(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight()); + mIcon->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1); } if (!mLabel.empty()) @@ -953,7 +962,7 @@ void LLFolderViewItem::draw() BOOL debug_filters = getRoot()->getDebugFilters(); LLColor4 color = ( (mIsSelected && filled) ? sHighlightFgColor : sFgColor ); F32 right_x; - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD; + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; if (debug_filters) { @@ -963,7 +972,8 @@ void LLFolderViewItem::draw() } LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f); - sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color, + LLFontGL::getFontMonospace()->renderUTF8( + mStatusText, 0, text_left, y, filter_color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); text_left = right_x; @@ -1004,7 +1014,7 @@ void LLFolderViewItem::draw() S32_MAX, S32_MAX, &right_x, FALSE ); } - if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos) + if (mStringMatchOffset != std::string::npos) { // don't draw backgrounds for zero-length strings S32 filter_string_length = getRoot()->getFilterSubString().size(); @@ -1013,14 +1023,15 @@ void LLFolderViewItem::draw() std::string combined_string = mLabel + mLabelSuffix; S32 left = llround(text_left) + font->getWidth(combined_string, 0, mStringMatchOffset) - 1; S32 right = left + font->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; - S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3); - S32 top = getRect().getHeight(); - + S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); + S32 top = getRect().getHeight() - TOP_PAD; + + LLUIImage* box_image = default_params.selection_image; LLRect box_rect(left, top, right, bottom); - sBoxImage->draw(box_rect, sFilterBGColor); + box_image->draw(box_rect, sFilterBGColor); F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mStringMatchOffset); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD; - font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, + F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; + font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, yy, sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, filter_string_length, S32_MAX, &right_x, FALSE ); } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 6f8c738a59..be8e73a5a9 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -101,7 +101,10 @@ public: Optional listener; Optional folder_arrow_image; + Optional folder_indentation; // pixels Optional selection_image; + Optional item_height; // pixels + Optional item_top_pad; // pixels Optional creation_date; //UTC seconds @@ -110,7 +113,7 @@ public: // layout constants static const S32 LEFT_PAD = 5; - // LEFT_INDENTATION is set via settings.xml FolderIndentation + // LEFT_INDENTATION is set via folder_indentation above static const S32 ICON_PAD = 2; static const S32 ICON_WIDTH = 16; static const S32 TEXT_PAD = 1; @@ -127,11 +130,7 @@ protected: friend class LLUICtrlFactory; friend class LLFolderViewEventListener; - LLFolderViewItem(Params p = LLFolderViewItem::Params()); - - static const LLFontGL* sSmallFont; - static LLUIImagePtr sArrowImage; - static LLUIImagePtr sBoxImage; + LLFolderViewItem(const Params& p); std::string mLabel; std::string mSearchableLabel; @@ -150,6 +149,7 @@ protected: LLUIImagePtr mIconOpen; BOOL mHasVisibleChildren; S32 mIndentation; + S32 mItemHeight; S32 mNumDescendantsSelected; BOOL mPassedFilter; S32 mLastFilterGeneration; @@ -157,8 +157,6 @@ protected: F32 mControlLabelRotation; LLFolderView* mRoot; BOOL mDragAndDropTarget; - LLUIImagePtr mArrowImage; - LLUIImagePtr mBoxImage; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; bool mHidden; @@ -237,7 +235,7 @@ public: virtual void recursiveDeselect(BOOL deselect_self); // gets multiple-element selection - virtual BOOL getSelectionList(std::set &selection){return TRUE;} + virtual BOOL getSelectionList(std::set &selection) const {return TRUE;} // Returns true is this object and all of its children can be removed (deleted by user) virtual BOOL isRemovable(); @@ -304,7 +302,7 @@ public: // Show children (unfortunate that this is called "open") virtual void setOpen(BOOL open = TRUE) {}; - virtual BOOL isOpen() { return FALSE; } + virtual BOOL isOpen() const { return FALSE; } virtual LLFolderView* getRoot(); BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor ); @@ -499,7 +497,7 @@ public: virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse = RECURSE_NO); // Get the current state of the folder. - virtual BOOL isOpen() { return mIsOpen; } + virtual BOOL isOpen() const { return mIsOpen; } // special case if an object is dropped on the child. BOOL handleDragAndDropFromChild(MASK mask, diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index df7aa9eabf..82293b4aa0 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -417,6 +417,16 @@ BOOL LLGestureManager::isGesturePlaying(const LLUUID& item_id) return gesture->mPlaying; } +BOOL LLGestureManager::isGesturePlaying(LLMultiGesture* gesture) +{ + if(!gesture) + { + return FALSE; + } + + return gesture->mPlaying; +} + void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_gesture, const LLUUID& asset_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index e80eea9ae9..c562587c6f 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -103,6 +103,8 @@ public: BOOL isGesturePlaying(const LLUUID& item_id); + BOOL isGesturePlaying(LLMultiGesture* gesture); + const item_map_t& getActiveGestures() const { return mActive; } // Force a gesture to be played, for example, if it is being // previewed. diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 7dd8ea694e..d6e2bb0445 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -146,6 +146,12 @@ void LLGroupActions::startCall(const LLUUID& group_id) // static void LLGroupActions::join(const LLUUID& group_id) { + if (!gAgent.canJoinGroups()) + { + LLNotificationsUtil::add("JoinedTooManyGroups"); + return; + } + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); @@ -226,7 +232,9 @@ void LLGroupActions::activate(const LLUUID& group_id) static bool isGroupUIVisible() { - LLPanel* panel = LLSideTray::getInstance()->findChild("panel_group_info_sidetray"); + static LLPanel* panel = 0; + if(!panel) + panel = LLSideTray::getInstance()->findChild("panel_group_info_sidetray"); if(!panel) return false; return panel->isInVisibleChain(); diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 3ca459a403..e75d35bea4 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -210,7 +210,6 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->setGroupID(id); item->setName(name, mNameFilter); item->setGroupIconID(icon_id); -// item->setContextMenu(mContextMenu); item->childSetVisible("info_btn", false); item->childSetVisible("profile_btn", false); @@ -268,8 +267,9 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata) LLUUID selected_group_id = getSelectedUUID(); bool real_group_selected = selected_group_id.notNull(); // a "real" (not "none") group is selected + // each group including "none" can be activated if (userdata.asString() == "activate") - return real_group_selected && gAgent.getGroupID() != selected_group_id; + return gAgent.getGroupID() != selected_group_id; return real_group_selected; } @@ -283,7 +283,6 @@ LLGroupListItem::LLGroupListItem() mGroupIcon(NULL), mGroupNameBox(NULL), mInfoBtn(NULL), -//mContextMenu(NULL), //TODO: mGroupID(LLUUID::null) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_list_item.xml"); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 0b5da40be4..8ad94b957d 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -287,7 +287,7 @@ void LLHUDText::renderText(BOOL for_select) mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); // *TODO: cache this image - LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); // *TODO: make this a per-text setting LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor"); @@ -606,7 +606,7 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo U32 line_length = 0; do { - S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), TRUE); + S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); mTextSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), style, color)); line_length += segment_length; } @@ -642,7 +642,7 @@ void LLHUDText::setLabel(const LLWString &wlabel) U32 line_length = 0; do { - S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), TRUE); + S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); mLabelSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor)); line_length += segment_length; } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 259f629bdd..e06e0c94ec 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -42,7 +42,6 @@ #include "llbottomtray.h" #include "llchannelmanager.h" #include "llchiclet.h" -#include "llfloaterchat.h" #include "llfloaterreg.h" #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container #include "lllayoutstack.h" @@ -59,6 +58,7 @@ #include "llinventorymodel.h" #include "llrootview.h" +#include "llspeakers.h" LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -115,11 +115,21 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) void LLIMFloater::onFocusLost() { LLIMModel::getInstance()->resetActiveSessionID(); + + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, false); } void LLIMFloater::onFocusReceived() { LLIMModel::getInstance()->setActiveSessionID(mSessionID); + + // return focus to the input field when active tab in the multitab container is clicked. + if (isChatMultiTab() && mInputEditor) + { + mInputEditor->setFocus(TRUE); + } + + LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true); } // virtual @@ -341,13 +351,15 @@ void* LLIMFloater::createPanelAdHocControl(void* userdata) void LLIMFloater::onSlide() { - LLPanel* im_control_panel = getChild("panel_im_control_panel"); - im_control_panel->setVisible(!im_control_panel->getVisible()); + mControlPanel->setVisible(!mControlPanel->getVisible()); + + gSavedSettings.setBOOL("IMShowControlPanel", mControlPanel->getVisible()); - gSavedSettings.setBOOL("IMShowControlPanel", im_control_panel->getVisible()); + getChild("slide_left_btn")->setVisible(mControlPanel->getVisible()); + getChild("slide_right_btn")->setVisible(!mControlPanel->getVisible()); - getChild("slide_left_btn")->setVisible(im_control_panel->getVisible()); - getChild("slide_right_btn")->setVisible(!im_control_panel->getVisible()); + LLLayoutStack* stack = getChild("im_panels"); + if (stack) stack->setAnimate(true); } //static @@ -355,35 +367,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { if (!gIMMgr->hasSession(session_id)) return NULL; - // we should make sure all related chiclets are in place when the session is a voice call - // chiclets come firts, then comes IM window - if (gIMMgr->isVoiceCall(session_id)) - { - LLIMModel* im_model = LLIMModel::getInstance(); - LLBottomTray* b_tray = LLBottomTray::getInstance(); - - //*TODO hide that into Bottom tray - if (!b_tray->getChicletPanel()->findChiclet(session_id)) - { - LLIMChiclet* chiclet = b_tray->createIMChiclet(session_id); - if(chiclet) - { - chiclet->setIMSessionName(im_model->getName(session_id)); - chiclet->setOtherParticipantId(im_model->getOtherParticipantID(session_id)); - } - } - - LLIMWellWindow::getInstance()->addIMRow(session_id); - } - - bool not_existed = true; - - if(isChatMultiTab()) - { - LLIMFloater* target_floater = findInstance(session_id); - not_existed = NULL == target_floater; - } - else + if(!isChatMultiTab()) { //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); @@ -398,19 +382,33 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } } - LLIMFloater* floater = LLFloaterReg::showTypedInstance("impanel", session_id); + bool exist = findInstance(session_id); + + LLIMFloater* floater = getInstance(session_id); + if (!floater) return NULL; if(isChatMultiTab()) { + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + // do not add existed floaters to avoid adding torn off instances - if (not_existed) + if (!exist) { // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + + if (floater_container) + { + floater_container->addFloater(floater, TRUE, i_pt); + } + } - LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance("im_container"); - floater_container->addFloater(floater, TRUE, i_pt); + if (floater_container) + { + //selecting the panel resets a chiclet's counter + floater_container->selectFloater(floater); + floater_container->setVisible(TRUE); } } else @@ -437,8 +435,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } // window is positioned, now we can show it. - floater->setVisible(true); } + floater->setVisible(TRUE); return floater; } @@ -478,16 +476,6 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) } } -void LLIMFloater::setTornOff(bool torn_off) -{ - // When IM Floater isn't torn off, "close" button should be hidden. - // This call will just disables it, since there is a hack in LLFloater::updateButton, - // which prevents hiding of close button in that case. - setCanClose(torn_off); - - LLTransientDockableFloater::setTornOff(torn_off); -} - void LLIMFloater::setVisible(BOOL visible) { LLNotificationsUI::LLScreenChannel* channel = dynamic_cast @@ -508,6 +496,15 @@ void LLIMFloater::setVisible(BOOL visible) updateMessages(); mInputEditor->setFocus(TRUE); } + + if(!visible) + { + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet(mSessionID); + if(chiclet) + { + chiclet->setToggleState(false); + } + } } //static @@ -542,6 +539,11 @@ LLIMFloater* LLIMFloater::findInstance(const LLUUID& session_id) return LLFloaterReg::findTypedInstance("impanel", session_id); } +LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id) +{ + return LLFloaterReg::getTypedInstance("impanel", session_id); +} + void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) { mSessionInitialized = true; @@ -589,7 +591,7 @@ void LLIMFloater::updateMessages() std::string time = msg["time"].asString(); LLUUID from_id = msg["from_id"].asUUID(); - std::string from = from_id != gAgentID ? msg["from"].asString() : LLTrans::getString("You"); + std::string from = msg["from"].asString(); std::string message = msg["message"].asString(); LLChat chat; @@ -618,6 +620,15 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* //in disconnected state IM input editor should be disabled self->mInputEditor->setEnabled(!gDisconnected); } + + // when IM Floater is a part of the multitab container LLTabContainer set focus to the first + // child on tab button's mouse up. This leads input field lost focus. See EXT-3852. + if (isChatMultiTab()) + { + // So, clear control captured mouse to prevent LLTabContainer set focus on the panel's first child. + // do not pass self->mInputEditor, this leads to have "Edit Text" mouse pointer wherever it is. + gFocusMgr.setMouseCapture(NULL); + } } // static @@ -1011,3 +1022,20 @@ void LLIMFloater::sRemoveTypingIndicator(const LLSD& data) floater->removeTypingIndicator(); } + +void LLIMFloater::onIMChicletCreated( const LLUUID& session_id ) +{ + + if (isChatMultiTab()) + { + LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance(); + if (!im_box) return; + + if (LLIMFloater::findInstance(session_id)) return; + + LLIMFloater* new_tab = LLIMFloater::getInstance(session_id); + + im_box->addFloater(new_tab, FALSE, LLTabContainer::END); + } + +} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index bc7a43e852..d9db385d06 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -64,7 +64,6 @@ public: // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - /*virtual*/ void setTornOff(bool torn_off); // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -75,6 +74,8 @@ public: static LLIMFloater* findInstance(const LLUUID& session_id); + static LLIMFloater* getInstance(const LLUUID& session_id); + void sessionInitReplyReceived(const LLUUID& im_session_id); // get new messages from LLIMModel @@ -113,6 +114,8 @@ public: //used as a callback on receiving new IM message static void sRemoveTypingIndicator(const LLSD& data); + static void onIMChicletCreated(const LLUUID& session_id); + private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 2d7333f7e4..6cc985aef4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llimfloatercontainer.h" +#include "llfloaterreg.h" // // LLIMFloaterContainer @@ -93,4 +94,14 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, } } +LLIMFloaterContainer* LLIMFloaterContainer::findInstance() +{ + return LLFloaterReg::findTypedInstance("im_container"); +} + +LLIMFloaterContainer* LLIMFloaterContainer::getInstance() +{ + return LLFloaterReg::getTypedInstance("im_container"); +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ead7cf4730..d4a542dfc2 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -52,7 +52,11 @@ public: LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); static LLFloater* getCurrentVoiceFloater(); - + + static LLIMFloaterContainer* findInstance(); + + static LLIMFloaterContainer* getInstance(); + protected: LLFloater* mActiveVoiceFloater; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 029ddbaf2c..4bdf5f42dc 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -40,6 +40,7 @@ #include "llfontgl.h" #include "llrect.h" #include "llerror.h" +#include "llmultifloater.h" #include "llstring.h" #include "message.h" #include "lltextbox.h" @@ -59,7 +60,6 @@ #include "llinventory.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" -#include "llfloaterchat.h" #include "lliconctrl.h" #include "llkeyboard.h" #include "lllineeditor.h" diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 40227539d0..ff20a55358 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -42,46 +42,30 @@ #include "llhttpclient.h" #include "llsdutil_math.h" #include "llstring.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llagent.h" +#include "llagentui.h" +#include "llappviewer.h" #include "llavatariconctrl.h" #include "llbottomtray.h" #include "llcallingcard.h" #include "llchat.h" -#include "llchiclet.h" -#include "llresmgr.h" -#include "llfloaterchat.h" #include "llfloaterchatterbox.h" -#include "llavataractions.h" -#include "llhttpnode.h" #include "llimfloater.h" -#include "llimpanel.h" #include "llgroupiconctrl.h" -#include "llresizebar.h" -#include "lltabcontainer.h" -#include "llviewercontrol.h" -#include "llfloater.h" #include "llmutelist.h" -#include "llresizehandle.h" -#include "llkeyboard.h" -#include "llui.h" -#include "llviewermenu.h" -#include "llcallingcard.h" -#include "lltoolbar.h" +#include "llrecentpeople.h" #include "llviewermessage.h" #include "llviewerwindow.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llnearbychat.h" -#include "llviewerregion.h" -#include "llvoicechannel.h" -#include "lltrans.h" -#include "llrecentpeople.h" -#include "llsyswellwindow.h" +#include "llspeakers.h" //for LLIMSpeakerMgr +#include "lltextutil.h" +#include "llviewercontrol.h" -#include "llfirstuse.h" -#include "llagentui.h" const static std::string IM_TIME("time"); const static std::string IM_TEXT("message"); @@ -92,6 +76,7 @@ const static std::string NO_SESSION("(IM Session Doesn't Exist)"); const static std::string ADHOC_NAME_SUFFIX(" Conference"); std::string LLCallDialogManager::sPreviousSessionlName = ""; +LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION; std::string LLCallDialogManager::sCurrentSessionlName = ""; LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL; LLVoiceChannel::EState LLCallDialogManager::sOldState = LLVoiceChannel::STATE_READY; @@ -178,6 +163,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type) { mVoiceChannel = new LLVoiceChannelP2P(session_id, name, other_participant_id); + mOtherParticipantIsAvatar = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID); // check if it was AVALINE call if (!mOtherParticipantIsAvatar) @@ -208,7 +194,10 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); // All participants will be added to the list of people we've recently interacted with. - mSpeakers->addListener(&LLRecentPeople::instance(), "add"); + + // we need to add only _active_ speakers...so comment this. + // may delete this later on cleanup + //mSpeakers->addListener(&LLRecentPeople::instance(), "add"); //we need to wait for session initialization for outgoing ad-hoc and group chat session //correct session id for initiated ad-hoc chat will be received from the server @@ -224,7 +213,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& { mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID); mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionID); - mOtherParticipantIsAvatar = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID); } if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) @@ -675,6 +663,12 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file); if (!session) return false; + //good place to add some1 to recent list + //other places may be called from message history. + if( !from_id.isNull() && + ( session->isP2PSessionType() || session->isAdHocSessionType() ) ) + LLRecentPeople::instance().add(from_id); + // notify listeners LLSD arg; arg["session_id"] = session_id; @@ -781,7 +775,7 @@ LLIMSpeakerMgr* LLIMModel::getSpeakerManager( const LLUUID& session_id ) const LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return NULL; } @@ -1360,8 +1354,15 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) sCurrentSessionlName = ""; // Empty string results in "Nearby Voice Chat" after substitution return; } + + if (sSession) + { + // store previous session type to process Avaline calls in dialogs + sPreviousSessionType = sSession->mSessionType; + } + sSession = session; - sSession->mVoiceChannel->setStateChangedCallback(LLCallDialogManager::onVoiceChannelStateChanged); + sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3)); if(sCurrentSessionlName != session->mName) { sPreviousSessionlName = sCurrentSessionlName; @@ -1378,6 +1379,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) mCallDialogPayload["session_name"] = sSession->mName; mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID; mCallDialogPayload["old_channel_name"] = sPreviousSessionlName; + mCallDialogPayload["old_session_type"] = sPreviousSessionType; mCallDialogPayload["state"] = LLVoiceChannel::STATE_CALL_STARTED; mCallDialogPayload["disconnected_channel_name"] = sSession->mName; mCallDialogPayload["session_type"] = sSession->mSessionType; @@ -1407,6 +1409,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat mCallDialogPayload["session_name"] = sSession->mName; mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID; mCallDialogPayload["old_channel_name"] = sPreviousSessionlName; + mCallDialogPayload["old_session_type"] = sPreviousSessionType; mCallDialogPayload["state"] = new_state; mCallDialogPayload["disconnected_channel_name"] = sSession->mName; mCallDialogPayload["session_type"] = sSession->mSessionType; @@ -1421,6 +1424,11 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat } break; + case LLVoiceChannel::STATE_HUNG_UP: + // this state is coming before session is changed, so, put it into payload map + mCallDialogPayload["old_session_type"] = sSession->mSessionType; + break; + case LLVoiceChannel::STATE_CONNECTED : ocd = LLFloaterReg::findTypedInstance("outgoing_call", LLOutgoingCallDialog::OCD_KEY); if (ocd) @@ -1561,7 +1569,15 @@ void LLOutgoingCallDialog::show(const LLSD& key) // tell the user which voice channel they are leaving if (!mPayload["old_channel_name"].asString().empty()) { - childSetTextArg("leaving", "[CURRENT_CHAT]", mPayload["old_channel_name"].asString()); + bool was_avaline_call = LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["old_session_type"].asInteger(); + + std::string old_caller_name = mPayload["old_channel_name"].asString(); + if (was_avaline_call) + { + old_caller_name = LLTextUtil::formatPhoneNumber(old_caller_name); + } + + childSetTextArg("leaving", "[CURRENT_CHAT]", old_caller_name); } else { @@ -1570,15 +1586,28 @@ void LLOutgoingCallDialog::show(const LLSD& key) if (!mPayload["disconnected_channel_name"].asString().empty()) { - childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + std::string channel_name = mPayload["disconnected_channel_name"].asString(); + if (LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["session_type"].asInteger()) + { + channel_name = LLTextUtil::formatPhoneNumber(channel_name); + } + childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); } std::string callee_name = mPayload["session_name"].asString(); + + LLUUID session_id = mPayload["session_id"].asUUID(); + bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); + if (callee_name == "anonymous") { callee_name = getString("anonymous"); } + else if (!is_avatar) + { + callee_name = LLTextUtil::formatPhoneNumber(callee_name); + } setTitle(callee_name); @@ -1728,16 +1757,21 @@ BOOL LLIncomingCallDialog::postBuild() call_type = getString(mPayload["notify_box_type"]); } + + // check to see if this is an Avaline call + bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); + childSetVisible("Start IM", is_avatar); // no IM for avaline + if (caller_name == "anonymous") { caller_name = getString("anonymous"); } - - setTitle(caller_name + " " + call_type); + else if (!is_avatar) + { + caller_name = LLTextUtil::formatPhoneNumber(caller_name); + } - // check to see if this is an Avaline call - bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); - childSetVisible("Start IM", is_avatar); // no IM for avaline + setTitle(caller_name + " " + call_type); LLUICtrl* caller_name_widget = getChild("caller name"); caller_name_widget->setValue(caller_name + " " + call_type); @@ -1805,7 +1839,7 @@ void LLIncomingCallDialog::onStartIM(void* user_data) void LLIncomingCallDialog::processCallResponse(S32 response) { - if (!gIMMgr) + if (!gIMMgr || gDisconnected) return; LLUUID session_id = mPayload["session_id"].asUUID(); @@ -2185,7 +2219,6 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChatHistory(chat); LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); if(nearby_chat) @@ -2353,7 +2386,9 @@ LLUUID LLIMMgr::addSession( //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions if (!new_session) return session_id; - noteOfflineUsers(session_id, floater, ids); + //Per Plan's suggestion commented "explicit offline status warning" out to make Dessie happier (see EXT-3609) + //*TODO After February 2010 remove this commented out line if no one will be missing that warning + //noteOfflineUsers(session_id, floater, ids); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) @@ -3085,9 +3120,6 @@ public: ll_vector3_from_sd(message_params["position"]), true); - chat.mText = std::string("IM: ") + name + separator_string + saved + message; - LLFloaterChat::addChat(chat, TRUE, is_this_agent); - //K now we want to accept the invitation std::string url = gAgent.getRegion()->getCapability( "ChatSessionRequest"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 11860d0efb..a226d66b12 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -33,22 +33,19 @@ #ifndef LL_LLIMVIEW_H #define LL_LLIMVIEW_H -#include "lldarray.h" -#include "lldockablefloater.h" -#include "llspeakers.h" //for LLIMSpeakerMgr -#include "llimpanel.h" //for voice channels -#include "llmodaldialog.h" #include "lldockablefloater.h" #include "llinstantmessage.h" -#include "lluuid.h" -#include "llmultifloater.h" + #include "lllogchat.h" +#include "llvoicechannel.h" class LLFloaterChatterBox; class LLUUID; class LLFloaterIMPanel; class LLFriendObserver; class LLCallDialogManager; +class LLIMSpeakerMgr; + class LLIMModel : public LLSingleton { @@ -78,6 +75,11 @@ public: bool isP2P(); bool isOtherParticipantAvaline(); + bool isP2PSessionType() const { return mSessionType == P2P_SESSION;} + bool isAdHocSessionType() const { return mSessionType == ADHOC_SESSION;} + bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;} + bool isAvalineSessionType() const { return mSessionType == AVALINE_SESSION;} + LLUUID mSessionID; std::string mName; EInstantMessage mType; @@ -475,6 +477,7 @@ public: protected: static std::string sPreviousSessionlName; + static LLIMModel::LLIMSession::SType sPreviousSessionType; static std::string sCurrentSessionlName; static LLIMModel::LLIMSession* sSession; static LLVoiceChannel::EState sOldState; diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h index 731e99534b..a1cb9cd71c 100644 --- a/indra/newview/llinspect.h +++ b/indra/newview/llinspect.h @@ -55,7 +55,7 @@ public: /// Inspectors close themselves when they lose focus /*virtual*/ void onFocusLost(); -private: +protected: LLFrameTimer mCloseTimer; LLFrameTimer mOpenTimer; }; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index dae980feb1..0374a1d25b 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -93,6 +93,10 @@ public: // Update view based on information from avatar properties processor void processAvatarData(LLAvatarData* data); + // override the inspector mouse leave so timer is only paused if + // gear menu is not open + /* virtual */ void onMouseLeave(S32 x, S32 y, MASK mask); + private: // Make network requests for all the data to display in this view. // Used on construction and if avatar id changes. @@ -112,6 +116,7 @@ private: void onClickAddFriend(); void onClickViewProfile(); void onClickIM(); + void onClickCall(); void onClickTeleport(); void onClickInviteToGroup(); void onClickPay(); @@ -204,6 +209,7 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) mCommitCallbackRegistrar.add("InspectAvatar.AddFriend", boost::bind(&LLInspectAvatar::onClickAddFriend, this)); mCommitCallbackRegistrar.add("InspectAvatar.IM", boost::bind(&LLInspectAvatar::onClickIM, this)); + mCommitCallbackRegistrar.add("InspectAvatar.Call", boost::bind(&LLInspectAvatar::onClickCall, this)); mCommitCallbackRegistrar.add("InspectAvatar.Teleport", boost::bind(&LLInspectAvatar::onClickTeleport, this)); mCommitCallbackRegistrar.add("InspectAvatar.InviteToGroup", boost::bind(&LLInspectAvatar::onClickInviteToGroup, this)); mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this)); @@ -257,8 +263,6 @@ BOOL LLInspectAvatar::postBuild(void) } - - // Multiple calls to showInstance("inspect_avatar", foo) will provide different // LLSD for foo, which we will catch here. //virtual @@ -274,7 +278,7 @@ void LLInspectAvatar::onOpen(const LLSD& data) getChild("gear_self_btn")->setVisible(self); getChild("gear_btn")->setVisible(!self); - + // Position the inspector relative to the mouse cursor // Similar to how tooltips are positioned // See LLToolTipMgr::createToolTip @@ -382,11 +386,25 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data) mPropertiesRequest = NULL; } +// For the avatar inspector, we only want to unpause the fade timer +// if neither the gear menu or self gear menu are open +void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLMenuGL* gear_menu = getChild("gear_btn")->getMenu(); + LLMenuGL* gear_menu_self = getChild("gear_self_btn")->getMenu(); + if ( !(gear_menu && gear_menu->getVisible()) && + !(gear_menu_self && gear_menu_self->getVisible())) + { + mOpenTimer.unpause(); + } +} + void LLInspectAvatar::updateModeratorPanel() { bool enable_moderator_panel = false; - if (LLVoiceChannel::getCurrentVoiceChannel()) + if (LLVoiceChannel::getCurrentVoiceChannel() && + mAvatarID != gAgent.getID()) { LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID(); @@ -400,6 +418,7 @@ void LLInspectAvatar::updateModeratorPanel() LLPointer selected_speakerp = speaker_mgr->findSpeaker(mAvatarID); if(speaker_mgr->isVoiceActive() && selected_speakerp && + selected_speakerp->isInVoiceChannel() && ((self_speakerp && self_speakerp->mIsModerator) || gAgent.isGodlike())) { getChild("enable_voice")->setVisible(selected_speakerp->mModeratorMutedVoice); @@ -497,42 +516,58 @@ void LLInspectAvatar::toggleSelectedVoice(bool enabled) void LLInspectAvatar::updateVolumeSlider() { - // By convention, we only display and toggle voice mutes, not all mutes - bool is_muted = LLMuteList::getInstance()-> - isMuted(mAvatarID, LLMute::flagVoiceChat); - bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); - LLUICtrl* mute_btn = getChild("mute_btn"); - mute_btn->setEnabled( voice_enabled ); - mute_btn->setValue( is_muted ); + bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); - LLUICtrl* volume_slider = getChild("volume_slider"); - volume_slider->setEnabled( voice_enabled && !is_muted ); - const F32 DEFAULT_VOLUME = 0.5f; - F32 volume; - if (is_muted) + // Do not display volume slider and mute button if it + // is ourself or we are not in a voice channel together + if (!voice_enabled || (mAvatarID == gAgent.getID())) { - // it's clearer to display their volume as zero - volume = 0.f; + getChild("mute_btn")->setVisible(false); + getChild("volume_slider")->setVisible(false); } - else if (!voice_enabled) - { - // use nominal value rather than 0 - volume = DEFAULT_VOLUME; - } - else + + else { - // actual volume - volume = gVoiceClient->getUserVolume(mAvatarID); + getChild("mute_btn")->setVisible(true); + getChild("volume_slider")->setVisible(true); - // *HACK: Voice client doesn't have any data until user actually - // says something. - if (volume == 0.f) + // By convention, we only display and toggle voice mutes, not all mutes + bool is_muted = LLMuteList::getInstance()-> + isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLUICtrl* mute_btn = getChild("mute_btn"); + + bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + + mute_btn->setEnabled( !is_linden); + mute_btn->setValue( is_muted ); + + LLUICtrl* volume_slider = getChild("volume_slider"); + volume_slider->setEnabled( !is_muted ); + + const F32 DEFAULT_VOLUME = 0.5f; + F32 volume; + if (is_muted) { - volume = DEFAULT_VOLUME; + // it's clearer to display their volume as zero + volume = 0.f; } + else + { + // actual volume + volume = gVoiceClient->getUserVolume(mAvatarID); + + // *HACK: Voice client doesn't have any data until user actually + // says something. + if (volume == 0.f) + { + volume = DEFAULT_VOLUME; + } + } + volume_slider->setValue( (F64)volume ); } - volume_slider->setValue( (F64)volume ); + } void LLInspectAvatar::onClickMuteVolume() @@ -611,6 +646,12 @@ void LLInspectAvatar::onClickIM() closeFloater(); } +void LLInspectAvatar::onClickCall() +{ + LLAvatarActions::startCall(mAvatarID); + closeFloater(); +} + void LLInspectAvatar::onClickTeleport() { LLAvatarActions::offerTeleport(mAvatarID); diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index cb35a287e9..dd313c528d 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -41,6 +41,7 @@ #include "llslurl.h" #include "llviewermenu.h" // handle_object_touch(), handle_buy() #include "llviewermedia.h" +#include "llviewermediafocus.h" #include "llviewerobjectlist.h" // to select the requested object // Linden libraries @@ -82,6 +83,10 @@ public: // Release the selection and do other cleanup /*virtual*/ void onClose(bool app_quitting); + // override the inspector mouse leave so timer is only paused if + // gear menu is not open + /* virtual */ void onMouseLeave(S32 x, S32 y, MASK mask); + private: // Refresh displayed data with information from selection manager void update(); @@ -181,7 +186,6 @@ BOOL LLInspectObject::postBuild(void) return TRUE; } - // Multiple calls to showInstance("inspect_avatar", foo) will provide different // LLSD for foo, which we will catch here. //virtual @@ -214,6 +218,10 @@ void LLInspectObject::onOpen(const LLSD& data) LLViewerObject* obj = gObjectList.findObject( mObjectID ); if (obj) { + // Media focus and this code fight over the select manager. + // Make sure any media is unfocused before changing the selection here. + LLViewerMediaFocus::getInstance()->clearFocus(); + LLSelectMgr::instance().deselectAll(); mObjectSelection = LLSelectMgr::instance().selectObjectAndFamily(obj); @@ -562,6 +570,16 @@ void LLInspectObject::updateSecureBrowsing() getChild("secure_browsing")->setVisible(is_secure_browsing); } +// For the object inspector, only unpause the fade timer +// if the gear menu is not open +void LLInspectObject::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLMenuGL* gear_menu = getChild("gear_btn")->getMenu(); + if ( !(gear_menu && gear_menu->getVisible())) + { + mOpenTimer.unpause(); + } +} void LLInspectObject::onClickBuy() { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d70221b22a..099f863dc9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2074,7 +2074,12 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model { if ("open" == action) { - openItem(); + LLFolderViewFolder *f = dynamic_cast(folder->getItemByID(mUUID)); + if (f) + { + f->setOpen(TRUE); + } + return; } else if ("paste" == action) @@ -2228,9 +2233,22 @@ LLUIImagePtr LLFolderBridge::getIcon() const LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) { // we only have one folder image now + if (preferred_type == LLFolderType::FT_OUTFIT) + { + return LLUI::getUIImage("Inv_LookFolderClosed"); + } return LLUI::getUIImage("Inv_FolderClosed"); } +LLUIImagePtr LLFolderBridge::getOpenIcon() const +{ + if (getPreferredType() == LLFolderType::FT_OUTFIT) + { + return LLUI::getUIImage("Inv_LookFolderOpen"); + } + return LLUI::getUIImage("Inv_FolderOpen"); +} + BOOL LLFolderBridge::renameItem(const std::string& new_name) { if(!isItemRenameable()) @@ -2430,7 +2448,7 @@ void LLFolderBridge::folderOptionsMenu() const LLInventoryCategory* category = model->getCategory(mUUID); LLFolderType::EType type = category->getPreferredType(); - const bool is_default_folder = category && LLFolderType::lookupIsProtectedType(type); + const bool is_system_folder = category && LLFolderType::lookupIsProtectedType(type); // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = category && (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); @@ -2444,8 +2462,8 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back("Delete"); } - // Only enable calling-card related options for non-default folders. - if (!is_sidepanel && !is_default_folder) + // Only enable calling-card related options for non-system folders. + if (!is_sidepanel && !is_system_folder) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) @@ -2479,10 +2497,14 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Folder Wearables Separator")); } - // Only enable add/replace outfit for non-default folders. - if (!is_default_folder) + // Only enable add/replace outfit for non-system folders. + if (!is_system_folder) { - mItems.push_back(std::string("Add To Outfit")); + // Adding an outfit onto another (versus replacing) doesn't make sense. + if (type != LLFolderType::FT_OUTFIT) + { + mItems.push_back(std::string("Add To Outfit")); + } mItems.push_back(std::string("Replace Outfit")); } if (is_ensemble) @@ -2614,6 +2636,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mItems.push_back(std::string("Rename")); mItems.push_back(std::string("Delete")); + + // EXT-4030: disallow deletion of currently worn outfit + const LLViewerInventoryItem *base_outfit_link = LLAppearanceManager::instance().getBaseOutfitLink(); + if (base_outfit_link && (cat == base_outfit_link->getLinkedCategory())) + { + mDisabledItems.push_back(std::string("Delete")); + } } } @@ -2902,80 +2931,6 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response return false; } -/* -Next functions intended to reorder items in the inventory folder and save order on server -Is now used for Favorites folder. - -*TODO: refactoring is needed with Favorites Bar functionality. Probably should be moved in LLInventoryModel -*/ -void saveItemsOrder(LLInventoryModel::item_array_t& items) -{ - int sortField = 0; - - // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) - { - LLViewerInventoryItem* item = *i; - - item->setSortField(++sortField); - item->setComplete(TRUE); - item->updateServer(FALSE); - - gInventory.updateItem(item); - - // Tell the parent folder to refresh its sort order. - gInventory.addChangedMask(LLInventoryObserver::SORT, item->getParentUUID()); - } - - gInventory.notifyObservers(); -} - -LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) -{ - LLInventoryModel::item_array_t::iterator result = items.end(); - - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) - { - if ((*i)->getUUID() == id) - { - result = i; - break; - } - } - - return result; -} - -// See also LLInventorySort where landmarks in the Favorites folder are sorted. -class LLViewerInventoryItemSort -{ -public: - bool operator()(const LLPointer& a, const LLPointer& b) - { - return a->getSortField() < b->getSortField(); - } -}; - -/** - * Sorts passed items by LLViewerInventoryItem sort field. - * - * @param[in, out] items - array of items, not sorted. - */ -void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items) -{ - static LLViewerInventoryItemSort sort_functor; - std::sort(items.begin(), items.end(), sort_functor); -} - -void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& srcItemId, const LLUUID& destItemId) -{ - LLViewerInventoryItem* srcItem = gInventory.getItem(srcItemId); - LLViewerInventoryItem* destItem = gInventory.getItem(destItemId); - - items.erase(findItemByUUID(items, srcItem->getUUID())); - items.insert(findItemByUUID(items, destItem->getUUID()), srcItem); -} - BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop) { @@ -3058,36 +3013,34 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // if dragging from/into favorites folder only reorder items if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder) { - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLIsType is_type(LLAssetType::AT_LANDMARK); - model->collectDescendentsIf(mUUID, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); - LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; if (itemp) { LLUUID srcItemId = inv_item->getUUID(); LLUUID destItemId = itemp->getListener()->getUUID(); - - // ensure items are sorted properly before changing order. EXT-3498 - rearrange_item_order_by_sort_field(items); - - // update order - updateItemsOrder(items, srcItemId, destItemId); - - saveItemsOrder(items); + gInventory.rearrangeFavoriteLandmarks(srcItemId, destItemId); } } else if (favorites_id == mUUID) // if target is the favorites folder we use copy { + // use callback to rearrange favorite landmarks after adding + // to have new one placed before target (on which it was dropped). See EXT-4312. + LLPointer cb = new AddFavoriteLandmarkCallback(); + LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); + LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; + if (drag_over_item && drag_over_item->getListener()) + { + cb.get()->setTargetLandmarkId(drag_over_item->getListener()->getUUID()); + } + copy_inventory_item( gAgent.getID(), inv_item->getPermissions().getOwner(), inv_item->getUUID(), mUUID, std::string(), - LLPointer(NULL)); + cb); } else if (move_is_into_current_outfit || move_is_into_outfit) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index cc1fa45b26..fced0047e8 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -289,6 +289,7 @@ public: virtual LLFolderType::EType getPreferredType() const; virtual LLUIImagePtr getIcon() const; + virtual LLUIImagePtr getOpenIcon() const; static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); virtual BOOL renameItem(const std::string& new_name); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8f4136c01f..2885ba13fa 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -50,8 +50,7 @@ // newview includes #include "llappearancemgr.h" #include "llappviewer.h" -#include "llfirstuse.h" -#include "llfloaterchat.h" +//#include "llfirstuse.h" #include "llfloatercustomize.h" #include "llfocusmgr.h" #include "llfolderview.h" diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 711114173c..e44adfb511 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1994,21 +1994,23 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const descendents_actual += update.mDescendentDelta; cat->setDescendentCount(descendents_actual); cat->setVersion(++version); - llinfos << "accounted: '" << cat->getName() << "' " - << version << " with " << descendents_actual - << " descendents." << llendl; + lldebugs << "accounted: '" << cat->getName() << "' " + << version << " with " << descendents_actual + << " descendents." << llendl; } } if(!accounted) { - lldebugs << "No accounting for: '" << cat->getName() << "' " + // Error condition, this means that the category did not register that + // it got new descendents (perhaps because it is still being loaded) + // which means its descendent count will be wrong. + llwarns << "Accounting failed for '" << cat->getName() << "' version:" << version << llendl; } } else { - llwarns << "No category found for update " << update.mCategoryID - << llendl; + llwarns << "No category found for update " << update.mCategoryID << llendl; } } @@ -3620,6 +3622,98 @@ BOOL LLInventoryModel::getIsFirstTimeInViewer2() return sFirstTimeInViewer2; } +static LLInventoryModel::item_array_t::iterator find_item_iter_by_uuid(LLInventoryModel::item_array_t& items, const LLUUID& id) +{ + LLInventoryModel::item_array_t::iterator result = items.end(); + + for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + { + if ((*i)->getUUID() == id) + { + result = i; + break; + } + } + + return result; +} + +// static +void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id) +{ + LLInventoryModel::item_array_t::iterator it_src = find_item_iter_by_uuid(items, src_item_id); + LLInventoryModel::item_array_t::iterator it_dest = find_item_iter_by_uuid(items, dest_item_id); + + if (it_src == items.end() || it_dest == items.end()) return; + + LLViewerInventoryItem* src_item = *it_src; + items.erase(it_src); + + // target iterator can not be valid because the container was changed, so update it. + it_dest = find_item_iter_by_uuid(items, dest_item_id); + items.insert(it_dest, src_item); +} + +void LLInventoryModel::saveItemsOrder(const LLInventoryModel::item_array_t& items) +{ + int sortField = 0; + + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (item_array_t::const_iterator i = items.begin(); i != items.end(); ++i) + { + LLViewerInventoryItem* item = *i; + + item->setSortField(++sortField); + item->setComplete(TRUE); + item->updateServer(FALSE); + + updateItem(item); + + // Tell the parent folder to refresh its sort order. + addChangedMask(LLInventoryObserver::SORT, item->getParentUUID()); + } + + notifyObservers(); +} + +// See also LLInventorySort where landmarks in the Favorites folder are sorted. +class LLViewerInventoryItemSort +{ +public: + bool operator()(const LLPointer& a, const LLPointer& b) + { + return a->getSortField() < b->getSortField(); + } +}; + +/** + * Sorts passed items by LLViewerInventoryItem sort field. + * + * @param[in, out] items - array of items, not sorted. + */ +static void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items) +{ + static LLViewerInventoryItemSort sort_functor; + std::sort(items.begin(), items.end(), sort_functor); +} + +void LLInventoryModel::rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLIsType is_type(LLAssetType::AT_LANDMARK); + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + gInventory.collectDescendentsIf(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + + // ensure items are sorted properly before changing order. EXT-3498 + rearrange_item_order_by_sort_field(items); + + // update order + updateItemsOrder(items, source_item_id, target_item_id); + + saveItemsOrder(items); +} + //---------------------------------------------------------------------------- // *NOTE: DEBUG functionality diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 39377b4ae2..2a2b48ce3c 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -384,6 +384,39 @@ public: void setLibraryOwnerID(const LLUUID& id); void setLibraryRootFolderID(const LLUUID& id); + + /** + * Changes items order by insertion of the item identified by src_item_id + * BEFORE the item identified by dest_item_id. Both items must exist in items array. + * + * Sorting is stored after method is finished. Only src_item_id is moved before dest_item_id. + * + * @param[in, out] items - vector with items to be updated. It should be sorted in a right way + * before calling this method. + * @param src_item_id - LLUUID of inventory item to be moved in new position + * @param dest_item_id - LLUUID of inventory item before which source item should be placed. + */ + static void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id); + + /** + * Saves current order of the passed items using inventory item sort field. + * + * It reset items' sort fields and saves them on server. + * Is used to save order for Favorites folder. + * + * @param[in] items vector of items in order to be saved. + */ + void saveItemsOrder(const LLInventoryModel::item_array_t& items); + + /** + * Rearranges Landmarks inside Favorites folder. + * Moves source landmark before target one. + * + * @param source_item_id - LLUUID of the source item to be moved into new position + * @param target_item_id - LLUUID of the target item before which source item should be placed. + */ + void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id); + protected: // Internal methods which add inventory and make sure that all of diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2d9ea21b5f..2fb8aea4e9 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -311,10 +311,10 @@ bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) { - S32 version = cat->getVersion(); - S32 descendents = cat->getDescendentCount(); - if((LLViewerInventoryCategory::VERSION_UNKNOWN == version) - || (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents)) + const S32 version = cat->getVersion(); + const S32 expected_num_descendents = cat->getDescendentCount(); + if ((version == LLViewerInventoryCategory::VERSION_UNKNOWN) || + (expected_num_descendents == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)) { return false; } @@ -325,15 +325,28 @@ bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items); if(!cats || !items) { - // bit of a hack - pretend we're done if they are gone or - // incomplete. should never know, but it would suck if this - // kept tight looping because of a corrupt memory state. + llwarns << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << llendl; + // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // that the cat just doesn't have any items or subfolders). + // Unrecoverable, so just return done so that this observer can be cleared + // from memory. return true; } - S32 known = cats->count() + items->count(); - if(descendents == known) + const S32 current_num_known_descendents = cats->count() + items->count(); + + // Got the number of descendents that we were expecting, so we're done. + if (current_num_known_descendents == expected_num_descendents) + { + return true; + } + + // Error condition, but recoverable. This happens if something was added to the + // category before it was initialized, so accountForUpdate didn't update descendent + // count and thus the category thinks it has fewer descendents than it actually has. + if (current_num_known_descendents >= expected_num_descendents) { - // hey - we're done. + llwarns << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << llendl; + cat->setDescendentCount(current_num_known_descendents); return true; } return false; @@ -352,7 +365,7 @@ void LLInventoryFetchComboObserver::changed(U32 mask) continue; } if(item->isComplete()) - { + { mCompleteItems.push_back(*it); it = mIncompleteItems.erase(it); continue; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 164e72e621..9141d50829 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -98,10 +98,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2)); mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); - setBackgroundColor(LLUIColorTable::instance().getColor("InventoryBackgroundColor")); - setBackgroundVisible(TRUE); - setBackgroundOpaque(TRUE); - if (mStartFolderString != "") { mBuildDefaultHierarchy = false; @@ -433,11 +429,10 @@ void LLInventoryPanel::initializeViews() { mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); } - llinfos << this << " Generating views for start folder " << mStartFolderString << llendl; rebuildViewsFor(mStartFolderID); mViewsInitialized = true; - defaultOpenInventory(); + openStartFolderOrMyInventory(); } void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) @@ -491,13 +486,14 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { - LLFolderViewFolder::Params p; - p.name = new_listener->getDisplayName(); - p.icon = new_listener->getIcon(); - p.root = mFolders; - p.listener = new_listener; - p.tool_tip = p.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create(p); + LLFolderViewFolder::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + params.root = mFolders; + params.listener = new_listener; + params.tool_tip = params.name; + LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); folderp->setItemSortOrder(mFolders->getSortOrder()); itemp = folderp; @@ -523,12 +519,13 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { LLFolderViewItem::Params params; - params.name(new_listener->getDisplayName()); - params.icon(new_listener->getIcon()); - params.creation_date(new_listener->getCreationDate()); - params.root(mFolders); - params.listener(new_listener); - params.rect(LLRect (0, 0, 0, 0)); + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + params.creation_date = new_listener->getCreationDate(); + params.root = mFolders; + params.listener = new_listener; + params.rect = LLRect (0, 0, 0, 0); params.tool_tip = params.name; itemp = LLUICtrlFactory::create (params); } @@ -575,7 +572,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } // bit of a hack to make sure the inventory is open. -void LLInventoryPanel::defaultOpenInventory() +void LLInventoryPanel::openStartFolderOrMyInventory() { if (mStartFolderString != "") { @@ -583,13 +580,17 @@ void LLInventoryPanel::defaultOpenInventory() } else { - // Get the first child (it should be "My Inventory") and - // open it up by name (just to make sure the first child is actually a folder). - LLView* first_child = mFolders->getFirstChild(); - if (first_child) + // Find My Inventory folder and open it up by name + for (LLView *child = mFolders->getFirstChild(); child; child = mFolders->findNextSibling(child)) { - const std::string& first_child_name = first_child->getName(); - mFolders->openFolder(first_child_name); + LLFolderViewFolder *fchild = dynamic_cast(child); + if (fchild && fchild->getListener() && + (fchild->getListener()->getUUID() == gInventory.getRootFolderID())) + { + const std::string& child_name = child->getName(); + mFolders->openFolder(child_name); + break; + } } } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 4f7f0a79f6..09533b52f1 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -167,7 +167,7 @@ public: static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); protected: - void defaultOpenInventory(); // open the first level of inventory + void openStartFolderOrMyInventory(); // open the first level of inventory LLInventoryModel* mInventory; LLInventoryObserver* mInventoryObserver; diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index bd9d22c327..ce84474c05 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -59,6 +59,13 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t LLLandmark* landmark = get_ptr_in_map(mList, asset_uuid); if(landmark) { + LLVector3d dummy; + if(cb && !landmark->getGlobalPos(dummy)) + { + // landmark is not completely loaded yet + loaded_callback_map_t::value_type vt(asset_uuid, cb); + mLoadedCallbackMap.insert(vt); + } return landmark; } else diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index d910dbf718..ae1b8f8540 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -123,6 +123,12 @@ void LLLocationHistory::save() const // build filename for each user std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + if (resolved_filename.empty()) + { + llinfos << "can't get path to location history filename - probably not logged in yet." << llendl; + return; + } + // open a file for writing llofstream file (resolved_filename); if (!file.is_open()) diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index fc9654e9ad..4e5aaeb66a 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -35,7 +35,6 @@ #include "llagent.h" #include "llagentui.h" #include "lllogchat.h" -#include "llfloaterchat.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -59,9 +58,6 @@ const static std::string NEW_LINE_SPACE_PREFIX("\n "); const static std::string TWO_SPACES(" "); const static std::string MULTI_LINE_PREFIX(" "); -//viewer 1.23 may have used "You" for Agent's entries -const static std::string YOU("You"); - /** * Chat log lines - timestamp and name are optional but message text is mandatory. * diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index f30821cacf..a96240e31c 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -436,7 +436,7 @@ void LLManip::renderXYZ(const LLVector3 &vec) glPushMatrix(); { - LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); gViewerWindow->setup2DRender(); const LLVector2& display_scale = gViewerWindow->getDisplayScale(); glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 93f926b5d0..87ebce1d34 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -84,7 +84,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHomePageUrl( "" ), mIgnoreUIScale( true ), mAlwaysRefresh( false ), - mExternalUrl( "" ), mMediaSource( 0 ), mTakeFocusOnClick( true ), mCurrentNavUrl( "" ), @@ -632,6 +631,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() mMediaSource->setHomeURL(mHomePageUrl); mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); + mMediaSource->setBackgroundColor( getBackgroundColor() ); if(mClearCache) { mMediaSource->clearCache(); @@ -671,34 +671,12 @@ LLPluginClassMedia* LLMediaCtrl::getMediaPlugin() // void LLMediaCtrl::draw() { - LLPluginClassMedia* media_plugin = NULL; - - if(mMediaSource && mMediaSource->hasMedia()) - { - media_plugin = mMediaSource->getMediaPlugin(); - } - else - { - return; - } - - if(!media_plugin || (!media_plugin->textureValid())) - { - // Don't try to draw without a valid texture - return; - } - - LLViewerMediaTexture* media_texture = LLViewerTextureManager::findMediaTexture(mMediaTextureID); - - if (!media_texture ) - return; - if ( gRestoreGL == 1 ) { LLRect r = getRect(); reshape( r.getWidth(), r.getHeight(), FALSE ); return; - }; + } // NOTE: optimization needed here - probably only need to do this once // unless tearoffs change the parent which they probably do. @@ -712,125 +690,161 @@ void LLMediaCtrl::draw() setFrequentUpdates( false ); }; + bool draw_media = false; + + LLPluginClassMedia* media_plugin = NULL; + LLViewerMediaTexture* media_texture = NULL; + + if(mMediaSource && mMediaSource->hasMedia()) + { + media_plugin = mMediaSource->getMediaPlugin(); + + if(media_plugin && (media_plugin->textureValid())) + { + media_texture = LLViewerTextureManager::findMediaTexture(mMediaTextureID); + if(media_texture) + { + draw_media = true; + } + } + } + if(mHidingInitialLoad) { // If we're hiding loading, don't draw at all. - return; + draw_media = false; } - // alpha off for this - LLGLSUIDefault gls_ui; - LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - - gGL.pushMatrix(); + bool background_visible = isBackgroundVisible(); + bool background_opaque = isBackgroundOpaque(); + + if(draw_media) { - if (mIgnoreUIScale) + // alpha off for this + LLGLSUIDefault gls_ui; + LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); + + gGL.pushMatrix(); { - glLoadIdentity(); - // font system stores true screen origin, need to scale this by UI scale factor - // to get render origin for this view (with unit scale) - gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), - floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), - LLFontGL::sCurOrigin.mZ); - } + if (mIgnoreUIScale) + { + glLoadIdentity(); + // font system stores true screen origin, need to scale this by UI scale factor + // to get render origin for this view (with unit scale) + gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), + floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), + LLFontGL::sCurOrigin.mZ); + } - // scale texture to fit the space using texture coords - gGL.getTexUnit(0)->bind(media_texture); - gGL.color4fv( LLColor4::white.mV ); - F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); - F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); + // scale texture to fit the space using texture coords + gGL.getTexUnit(0)->bind(media_texture); + gGL.color4fv( LLColor4::white.mV ); + F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); + F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); - LLRect r = getRect(); - S32 width, height; - S32 x_offset = 0; - S32 y_offset = 0; - - if(mStretchToFill) - { - if(mMaintainAspectRatio) + LLRect r = getRect(); + S32 width, height; + S32 x_offset = 0; + S32 y_offset = 0; + + if(mStretchToFill) { - F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight()); - F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); - if(media_aspect > view_aspect) + if(mMaintainAspectRatio) { - // max width, adjusted height - width = r.getWidth(); - height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); + F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight()); + F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); + if(media_aspect > view_aspect) + { + // max width, adjusted height + width = r.getWidth(); + height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); + } + else + { + // max height, adjusted width + height = r.getHeight(); + width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); + } } else { - // max height, adjusted width + width = r.getWidth(); height = r.getHeight(); - width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); } } else { - width = r.getWidth(); - height = r.getHeight(); + width = llmin(media_plugin->getWidth(), r.getWidth()); + height = llmin(media_plugin->getHeight(), r.getHeight()); } - } - else - { - width = llmin(media_plugin->getWidth(), r.getWidth()); - height = llmin(media_plugin->getHeight(), r.getHeight()); - } - - x_offset = (r.getWidth() - width) / 2; - y_offset = (r.getHeight() - height) / 2; + + x_offset = (r.getWidth() - width) / 2; + y_offset = (r.getHeight() - height) / 2; - if(mIgnoreUIScale) - { - x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]); - y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]); - width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); - height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); - } + if(mIgnoreUIScale) + { + x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]); + y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]); + width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); + height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); + } - // draw the browser - gGL.setSceneBlendType(LLRender::BT_REPLACE); - gGL.begin( LLRender::QUADS ); - if (! media_plugin->getTextureCoordsOpenGL()) - { - // render using web browser reported width and height, instead of trying to invert GL scale - gGL.texCoord2f( max_u, 0.f ); - gGL.vertex2i( x_offset + width, y_offset + height ); + // draw the browser + gGL.setSceneBlendType(LLRender::BT_REPLACE); + gGL.begin( LLRender::QUADS ); + if (! media_plugin->getTextureCoordsOpenGL()) + { + // render using web browser reported width and height, instead of trying to invert GL scale + gGL.texCoord2f( max_u, 0.f ); + gGL.vertex2i( x_offset + width, y_offset + height ); - gGL.texCoord2f( 0.f, 0.f ); - gGL.vertex2i( x_offset, y_offset + height ); + gGL.texCoord2f( 0.f, 0.f ); + gGL.vertex2i( x_offset, y_offset + height ); - gGL.texCoord2f( 0.f, max_v ); - gGL.vertex2i( x_offset, y_offset ); + gGL.texCoord2f( 0.f, max_v ); + gGL.vertex2i( x_offset, y_offset ); - gGL.texCoord2f( max_u, max_v ); - gGL.vertex2i( x_offset + width, y_offset ); - } - else - { - // render using web browser reported width and height, instead of trying to invert GL scale - gGL.texCoord2f( max_u, max_v ); - gGL.vertex2i( x_offset + width, y_offset + height ); + gGL.texCoord2f( max_u, max_v ); + gGL.vertex2i( x_offset + width, y_offset ); + } + else + { + // render using web browser reported width and height, instead of trying to invert GL scale + gGL.texCoord2f( max_u, max_v ); + gGL.vertex2i( x_offset + width, y_offset + height ); - gGL.texCoord2f( 0.f, max_v ); - gGL.vertex2i( x_offset, y_offset + height ); + gGL.texCoord2f( 0.f, max_v ); + gGL.vertex2i( x_offset, y_offset + height ); - gGL.texCoord2f( 0.f, 0.f ); - gGL.vertex2i( x_offset, y_offset ); + gGL.texCoord2f( 0.f, 0.f ); + gGL.vertex2i( x_offset, y_offset ); - gGL.texCoord2f( max_u, 0.f ); - gGL.vertex2i( x_offset + width, y_offset ); + gGL.texCoord2f( max_u, 0.f ); + gGL.vertex2i( x_offset + width, y_offset ); + } + gGL.end(); + gGL.setSceneBlendType(LLRender::BT_ALPHA); } - gGL.end(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); + gGL.popMatrix(); + } - gGL.popMatrix(); - + else + { + // Setting these will make LLPanel::draw draw the opaque background color. + setBackgroundVisible(true); + setBackgroundOpaque(true); + } + // highlight if keyboard focus here. (TODO: this needs some work) if ( mBorder && mBorder->getVisible() ) mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) ); LLPanel::draw(); + + // Restore the previous values + setBackgroundVisible(background_visible); + setBackgroundOpaque(background_opaque); } //////////////////////////////////////////////////////////////////////////////// @@ -862,9 +876,27 @@ bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option ) { - // open in external browser because we don't support - // creation of our own secondary browser windows - LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() ); + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + S32 target_type = payload["target_type"].asInteger(); + + switch (target_type) + { + case LLPluginClassMedia::TARGET_EXTERNAL: + // load target in an external browser + LLWeb::loadURLExternal(url); + break; + + case LLPluginClassMedia::TARGET_BLANK: + // load target in the user's preferred browser + LLWeb::loadURL(url); + break; + + default: + // unsupported link target - shouldn't happen + LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; + break; + } } return false; } @@ -978,20 +1010,18 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) { // retrieve the event parameters - std::string target = self->getClickTarget(); std::string url = self->getClickURL(); + U32 target_type = self->getClickTargetType(); - // if there is a value for the target - if ( !target.empty() ) + // is there is a target specified for the link? + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || + target_type == LLPluginClassMedia::TARGET_BLANK) { - if ( target == "_external" ) - { - mExternalUrl = url; - LLSD payload; - payload["external_url"] = mExternalUrl; - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - return; - } + LLSD payload; + payload["url"] = url; + payload["target_type"] = LLSD::Integer(target_type); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + return; } const std::string protocol1( "http://" ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 8f9e6e7179..b0aca3cfa4 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -182,7 +182,6 @@ public: bool mOpenLinksInInternalBrowser; bool mTrusted; std::string mHomePageUrl; - std::string mExternalUrl; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index a2aef9ba63..8d950f072d 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -45,8 +45,7 @@ #include "llagent.h" #include "llcallingcard.h" #include "llviewercontrol.h" -#include "llfirstuse.h" -#include "llfloaterchat.h" +//#include "llfirstuse.h" #include "llfloaterworldmap.h" #include "lllineeditor.h" #include "llstatusbar.h" diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index f562e45770..b95e8bd3a2 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -40,7 +40,7 @@ #include "lldrawable.h" #include "lldrawpoolavatar.h" #include "llface.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llfloatercustomize.h" #include "llfloatertools.h" #include "llresmgr.h" @@ -143,7 +143,7 @@ void LLMorphView::setVisible(BOOL visible) initialize(); // First run dialog - LLFirstUse::useAppearance(); + //LLFirstUse::useAppearance(); } else { diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index b520bc1c2d..7ee4c64f8f 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -64,7 +64,7 @@ #include "llviewerwindow.h" #include "llworld.h" //for particle system banning #include "llchat.h" -#include "llfloaterchat.h" +#include "llimpanel.h" #include "llimview.h" #include "llnotifications.h" #include "lluistring.h" @@ -258,7 +258,7 @@ LLMuteList::~LLMuteList() { // If we quit from the login screen we will not have an SL account // name. Don't try to save, otherwise we'll dump a file in - // C:\Program Files\SecondLife\ JC + // C:\Program Files\SecondLife\ or similar. JC std::string user_dir = gDirUtilp->getLindenUserDir(); if (!user_dir.empty()) { @@ -532,9 +532,6 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n LLIMModel::getInstance()->addMessage(agent_id, SYSTEM_FROM, LLUUID::null, message); } - - LLChat auto_chat(message); - LLFloaterChat::addChat(auto_chat, FALSE, FALSE); } } diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 2f4a266198..cd810b9793 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -52,6 +52,8 @@ LLNameBox::LLNameBox(const Params& p) : LLTextBox(p) { mNameID = LLUUID::null; + mLink = p.link; + mInitialValue = p.initial_value().asString(); LLNameBox::sInstances.insert(this); setText(LLStringUtil::null); } @@ -66,17 +68,23 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) mNameID = name_id; std::string name; + BOOL got_name = FALSE; if (!is_group) { - gCacheName->getFullName(name_id, name); + got_name = gCacheName->getFullName(name_id, name); } else { - gCacheName->getGroupName(name_id, name); + got_name = gCacheName->getGroupName(name_id, name); } - setText(name); + // Got the name already? Set it. + // Otherwise it will be set later in refresh(). + if (got_name) + setName(name, is_group); + else + setText(mInitialValue); } void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, @@ -93,7 +101,7 @@ void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, { name = firstname; } - setText(name); + setName(name, is_group); } } @@ -109,3 +117,22 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, box->refresh(id, firstname, lastname, is_group); } } + +void LLNameBox::setName(const std::string& name, BOOL is_group) +{ + if (mLink) + { + std::string url; + + if (is_group) + url = "[secondlife:///app/group/" + LLURI::escape(name) + "/about " + name + "]"; + else + url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]"; + + setText(url); + } + else + { + setText(name); + } +} diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 3edb36883f..48b54faec8 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -47,9 +47,11 @@ public: struct Params : public LLInitParam::Block { Optional is_group; + Optional link; Params() : is_group("is_group", false) + , link("link", false) {} }; @@ -67,10 +69,14 @@ protected: friend class LLUICtrlFactory; private: + void setName(const std::string& name, BOOL is_group); + static std::set sInstances; private: LLUUID mNameID; + BOOL mLink; + std::string mInitialValue; }; diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 7e6145f578..6375362ae2 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -74,12 +74,12 @@ void LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, { //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; - std::string fullname; - gCacheName->getFullName(agent_id, fullname); - - fullname.append(suffix); + NameItem item; + item.value = agent_id; + item.enabled = enabled; + item.target = INDIVIDUAL; - addStringUUIDItem(fullname, agent_id, pos, enabled); + addNameItemRow(item, pos); } // virtual, public @@ -130,11 +130,12 @@ BOOL LLNameListCtrl::handleDragAndDrop( return handled; } -void LLNameListCtrl::showAvatarInspector(const LLUUID& avatar_id) +void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group) { - LLSD key; - key["avatar_id"] = avatar_id; - LLFloaterReg::showInstance("inspect_avatar", key); + if (is_group) + LLFloaterReg::showInstance("inspect_group", LLSD().with("group_id", avatar_id)); + else + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", avatar_id)); } //virtual @@ -147,7 +148,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) && column_index == mNameColumnIndex) { // ...this is the column with the avatar name - LLUUID avatar_id = hit_item->getValue().asUUID(); + LLUUID avatar_id = getItemId(hit_item); if (avatar_id.notNull()) { // ...valid avatar id @@ -164,9 +165,12 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop ); LLPointer icon = LLUI::getUIImage("Info_Small"); + // Should we show a group or an avatar inspector? + bool is_group = hit_item->getValue()["is_group"].asBoolean(); + LLToolTip::Params params; params.background_visible( false ); - params.click_callback( boost::bind(&LLNameListCtrl::showAvatarInspector, this, avatar_id) ); + params.click_callback( boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group) ); params.delay_time(0.0f); // spawn instantly on hover params.image( icon ); params.message(""); @@ -220,9 +224,22 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p } -LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& name_item, EAddPosition pos) +LLScrollListItem* LLNameListCtrl::addNameItemRow( + const LLNameListCtrl::NameItem& name_item, + EAddPosition pos, + std::string& suffix) { - LLScrollListItem* item = LLScrollListCtrl::addRow(name_item, pos); + LLUUID id = name_item.value().asUUID(); + LLScrollListItem* item = NULL; + + // Store item type so that we can invoke the proper inspector. + // *TODO Vadim: Is there a more proper way of storing additional item data? + { + LLNameListCtrl::NameItem name_item_(name_item); + name_item_.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP); + item = LLScrollListCtrl::addRow(name_item_, pos); + } + if (!item) return NULL; // use supplied name by default @@ -230,7 +247,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& switch(name_item.target) { case GROUP: - gCacheName->getGroupName(name_item.value().asUUID(), fullname); + gCacheName->getGroupName(id, fullname); // fullname will be "nobody" if group not found break; case SPECIAL: @@ -239,7 +256,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& case INDIVIDUAL: { std::string name; - if (gCacheName->getFullName(name_item.value().asUUID(), name)) + if (gCacheName->getFullName(id, name)) { fullname = name; } @@ -249,6 +266,12 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& break; } + // Append optional suffix. + if (!suffix.empty()) + { + fullname.append(suffix); + } + LLScrollListCell* cell = item->getColumn(mNameColumnIndex); if (cell) { @@ -270,15 +293,24 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& // public void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) { - BOOL item_exists = selectByID( agent_id ); - if(item_exists) + // Find the item specified with agent_id. + S32 idx = -1; + for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) { - S32 index = getItemIndex(getFirstSelected()); - if(index >= 0) + LLScrollListItem* item = *it; + if (getItemId(item) == agent_id) { - deleteSingleItem(index); + idx = getItemIndex(item); + break; } } + + // Remove it. + if (idx >= 0) + { + selectNthItem(idx); // not sure whether this is needed, taken from previous implementation + deleteSingleItem(idx); + } } // public @@ -303,7 +335,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, for (iter = getItemList().begin(); iter != getItemList().end(); iter++) { LLScrollListItem* item = *iter; - if (item->getUUID() == id) + if (getItemId(item) == id) { LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0); cell = item->getColumn(mNameColumnIndex); @@ -343,3 +375,9 @@ void LLNameListCtrl::updateColumns() } } } + +// static +LLUUID LLNameListCtrl::getItemId(LLScrollListItem* item) +{ + return item->getValue()["uuid"].asUUID(); +} diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index d0f0ec4d21..192a3a5afa 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -94,7 +94,7 @@ public: void addNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); - LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM); + LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM, std::string& suffix = LLStringUtil::null); // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. @@ -121,7 +121,8 @@ public: /*virtual*/ void updateColumns(); private: - void showAvatarInspector(const LLUUID& avatar_id); + void showInspector(const LLUUID& avatar_id, bool is_group); + static LLUUID getItemId(LLScrollListItem* item); private: S32 mNameColumnIndex; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 2ad82d3e8e..a7c1e73328 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -63,7 +63,7 @@ static const S32 RESIZE_BAR_THICKNESS = 3; LLNearbyChat::LLNearbyChat(const LLSD& key) - : LLDockableFloater(NULL, false, key) + : LLDockableFloater(NULL, false, false, key) ,mChatHistory(NULL) { @@ -137,7 +137,7 @@ std::string appendTime() time_t utc_time; utc_time = time_corrected(); std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; + +LLTrans::getString("TimeMin")+"]"; LLSD substitution; @@ -178,28 +178,8 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) if (!chat.mMuted) { - tmp_chat.mFromName = chat.mFromID != gAgentID ? chat.mFromName : LLTrans::getString("You"); - - if (chat.mChatStyle == CHAT_STYLE_IRC) - { - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); - LLStyle::Params append_style_params; - append_style_params.color(txt_color); - append_style_params.readonly_color(txt_color); - append_style_params.font.name(font_name); - append_style_params.font.size(font_size); - append_style_params.font.style = "ITALIC"; - - mChatHistory->appendMessage(chat, use_plain_text_chat_history, append_style_params); - } - else - { - mChatHistory->appendMessage(chat, use_plain_text_chat_history); - } + tmp_chat.mFromName = chat.mFromName; + mChatHistory->appendMessage(chat, use_plain_text_chat_history); } if(archive) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 8dbaa5ac53..6cf8bcb417 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -48,13 +48,16 @@ #include "llcommandhandler.h" #include "llviewercontrol.h" #include "llnavigationbar.h" +#include "llwindow.h" +#include "llviewerwindow.h" +#include "llrootview.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; // legacy callback glue void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -static LLDefaultChildRegistry::Register r("gesture_combo_box"); +static LLDefaultChildRegistry::Register r("gesture_combo_list"); struct LLChatTypeTrigger { std::string name; @@ -66,13 +69,42 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; -LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) - : LLComboBox(p) - , mGestureLabelTimer() +LLGestureComboList::Params::Params() +: combo_button("combo_button"), + combo_list("combo_list") +{ +} + +LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) +: LLUICtrl(p) , mLabel(p.label) , mViewAllItemIndex(0) { - setCommitCallback(boost::bind(&LLGestureComboBox::onCommitGesture, this)); + LLButton::Params button_params = p.combo_button; + button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); + + mButton = LLUICtrlFactory::create(button_params); + mButton->reshape(getRect().getWidth(),getRect().getHeight()); + mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this)); + + addChild(mButton); + + LLScrollListCtrl::Params params = p.combo_list; + params.name("GestureComboList"); + params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2)); + params.visible(false); + params.commit_on_keyboard_movement(false); + + mList = LLUICtrlFactory::create(params); + + // *HACK: adding list as a child to NonSideTrayView to make it fully visible without + // making it top control (because it would cause problems). + gViewerWindow->getNonSideTrayView()->addChild(mList); + mList->setVisible(FALSE); + + //****************************Gesture Part********************************/ + + setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this)); // now register us as observer since we have a place to put the results LLGestureManager::instance().addObserver(this); @@ -80,23 +112,139 @@ LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) // refresh list from current active gestures refreshGestures(); - // This forces using of halign from xml, since LLComboBox - // sets it to LLFontGL::LEFT, if text entry is disabled - mButton->setHAlign(p.drop_down_button.font_halign); + setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this)); } -LLGestureComboBox::~LLGestureComboBox() +BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) { - LLGestureManager::instance().removeObserver(this); + BOOL handled = FALSE; + + if (key == KEY_ESCAPE && mask == MASK_NONE ) + { + hideList(); + handled = TRUE; + } + else + { + handled = mList->handleKey(key, mask, called_from_parent); + } + + return handled; +} + +void LLGestureComboList::showList() +{ + LLRect rect = mList->getRect(); + LLRect screen; + mButton->localRectToScreen(getRect(), &screen); + + // Calculating amount of space between the navigation bar and gestures combo + LLNavigationBar* nb = LLNavigationBar::getInstance(); + + S32 x, nb_bottom; + nb->localPointToScreen(0, 0, &x, &nb_bottom); + + S32 max_height = nb_bottom - screen.mTop; + mList->calcColumnWidths(); + rect.setOriginAndSize(screen.mLeft, screen.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); + + mList->setRect(rect); + mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); + + gFocusMgr.setKeyboardFocus(this); + + // Show the list and push the button down + mButton->setToggleState(TRUE); + mList->setVisible(TRUE); +} + +void LLGestureComboList::onButtonCommit() +{ + if (!mList->getVisible()) + { + // highlight the last selected item from the original selection before potentially selecting a new item + // as visual cue to original value of combo box + LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); + if (last_selected_item) + { + mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); + } + + if (mList->getItemCount() != 0) + { + showList(); + } + } + else + { + hideList(); + } +} + +void LLGestureComboList::hideList() +{ + if (mList->getVisible()) + { + mButton->setToggleState(FALSE); + mList->setVisible(FALSE); + mList->mouseOverHighlightNthItem(-1); + gFocusMgr.setKeyboardFocus(NULL); + } +} + +S32 LLGestureComboList::getCurrentIndex() const +{ + LLScrollListItem* item = mList->getFirstSelected(); + if( item ) + { + return mList->getItemIndex( item ); + } + return -1; +} + +void LLGestureComboList::onItemSelected(const LLSD& data) +{ + const std::string name = mList->getSelectedItemLabel(); + + S32 cur_id = getCurrentIndex(); + mLastSelectedIndex = cur_id; + if (cur_id != mList->getItemCount()-1 && cur_id != -1) + { + mButton->setLabel(name); + } + + // hiding the list reasserts the old value stored in the text editor/dropdown button + hideList(); + + // commit does the reverse, asserting the value in the list + onCommit(); +} + +void LLGestureComboList::sortByName(bool ascending) +{ + mList->sortOnce(0, ascending); +} + +LLSD LLGestureComboList::getValue() const +{ + LLScrollListItem* item = mList->getFirstSelected(); + if( item ) + { + return item->getValue(); + } + else + { + return LLSD(); + } } -void LLGestureComboBox::refreshGestures() +void LLGestureComboList::refreshGestures() { //store current selection so we can maintain it LLSD cur_gesture = getValue(); - selectFirstItem(); - // clear - clearRows(); + + mList->selectFirstItem(); + mList->clearRows(); mGestures.clear(); LLGestureManager::item_map_t::const_iterator it; @@ -107,7 +255,7 @@ void LLGestureComboBox::refreshGestures() LLMultiGesture* gesture = (*it).second; if (gesture) { - addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); + mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx)); mGestures.push_back(gesture); idx++; } @@ -117,23 +265,42 @@ void LLGestureComboBox::refreshGestures() // store index followed by the last added Gesture and add View All item at bottom mViewAllItemIndex = idx; - addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); + + mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); // Insert label after sorting, at top, with separator below it - addSeparator(ADD_TOP); - addSimpleElement(mLabel, ADD_TOP); + mList->addSeparator(ADD_TOP); + mList->addSimpleElement(mLabel, ADD_TOP); if (cur_gesture.isDefined()) { - selectByValue(cur_gesture); + mList->selectByValue(cur_gesture); + } else { - selectFirstItem(); + mList->selectFirstItem(); } + + LLCtrlListInterface* gestures = getListInterface(); + LLMultiGesture* gesture = NULL; + + if (gestures) + { + S32 index = gestures->getSelectedValue().asInteger(); + if(index > 0) + gesture = mGestures.at(index); + } + + if(gesture && LLGestureManager::instance().isGesturePlaying(gesture)) + { + return; + } + + mButton->setLabel(mLabel); } -void LLGestureComboBox::onCommitGesture() +void LLGestureComboList::onCommitGesture() { LLCtrlListInterface* gestures = getListInterface(); if (gestures) @@ -164,50 +331,11 @@ void LLGestureComboBox::onCommitGesture() } } } - - mGestureLabelTimer.start(); - // free focus back to chat bar - setFocus(FALSE); } -//virtual -void LLGestureComboBox::draw() +LLGestureComboList::~LLGestureComboList() { - // HACK: Leave the name of the gesture in place for a few seconds. - const F32 SHOW_GESTURE_NAME_TIME = 2.f; - if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) - { - LLCtrlListInterface* gestures = getListInterface(); - if (gestures) gestures->selectFirstItem(); - mGestureLabelTimer.stop(); - } - - LLComboBox::draw(); -} - -//virtual -void LLGestureComboBox::showList() -{ - LLComboBox::showList(); - - // Calculating amount of space between the navigation bar and gestures combo - LLNavigationBar* nb = LLNavigationBar::getInstance(); - S32 x, nb_bottom; - nb->localPointToScreen(0, 0, &x, &nb_bottom); - - S32 list_bottom; - mList->localPointToScreen(0, 0, &x, &list_bottom); - - S32 max_height = nb_bottom - list_bottom; - - LLRect rect = mList->getRect(); - // List overlapped navigation bar, downsize it - if (rect.getHeight() > max_height) - { - rect.setOriginAndSize(rect.mLeft, rect.mBottom, rect.getWidth(), max_height); - mList->setRect(rect); - mList->reshape(rect.getWidth(), rect.getHeight()); - } + LLGestureManager::instance().removeObserver(this); } LLNearbyChatBar::LLNearbyChatBar() diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 224118e088..d9a7403611 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -42,33 +42,52 @@ #include "llspeakers.h" -class LLGestureComboBox - : public LLComboBox - , public LLGestureManagerObserver +class LLGestureComboList + : public LLGestureManagerObserver + , public LLUICtrl { public: - struct Params : public LLInitParam::Block { }; + struct Params : public LLInitParam::Block + { + Optional combo_button; + Optional combo_list; + + Params(); + }; + protected: - LLGestureComboBox(const Params&); + friend class LLUICtrlFactory; + LLGestureComboList(const Params&); + std::vector mGestures; + std::string mLabel; + LLSD::Integer mViewAllItemIndex; + public: - ~LLGestureComboBox(); + ~LLGestureComboList(); + + LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)mList; }; + virtual void showList(); + virtual void hideList(); + virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + + S32 getCurrentIndex() const; + void onItemSelected(const LLSD& data); + void sortByName(bool ascending = true); void refreshGestures(); void onCommitGesture(); - virtual void draw(); + void onButtonCommit(); + virtual LLSD getValue() const; // LLGestureManagerObserver trigger virtual void changed() { refreshGestures(); } -protected: - - virtual void showList(); +private: - LLFrameTimer mGestureLabelTimer; - std::vector mGestures; - std::string mLabel; - LLSD::Integer mViewAllItemIndex; + LLButton* mButton; + LLScrollListCtrl* mList; + S32 mLastSelectedIndex; }; class LLNearbyChatBar diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 9e13a626b4..c50e049d4c 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -302,7 +302,6 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i channel->setCreatePanelCallback(callback); mChannel = LLChannelManager::getInstance()->addChannel(channel); - mChannel->setOverflowFormatString("You have %d unread nearby chat messages"); } LLNearbyChatHandler::~LLNearbyChatHandler() @@ -332,25 +331,25 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) LLChat& tmp_chat = const_cast(chat_msg); - if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) - { - if(!tmp_chat.mFromName.empty()) - tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); - else - tmp_chat.mText = tmp_chat.mText.substr(3); - } - + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); { //sometimes its usefull to have no name at all... //if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null) // tmp_chat.mFromName = tmp_chat.mFromID.asString(); } - - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); nearby_chat->addMessage(chat_msg); if(nearby_chat->getVisible()) return;//no need in toast if chat is visible - + + // Handle irc styled messages for toast panel + if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) + { + if(!tmp_chat.mFromName.empty()) + tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); + else + tmp_chat.mText = tmp_chat.mText.substr(3); + } + // arrange a channel on a screen if(!mChannel->getVisible()) { diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index dd66a6c507..fad0c6a91e 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -112,8 +112,8 @@ bool LLOfferHandler::processNotification(const LLSD& notify) LLHandlerUtil::spawnIMSession(name, from_id); } - if (notification->getPayload().has("SUPPRES_TOST") - && notification->getPayload()["SUPPRES_TOST"]) + if (notification->getPayload().has("SUPPRESS_TOAST") + && notification->getPayload()["SUPPRESS_TOAST"]) { LLNotificationsUtil::cancel(notification); } diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 63803469dd..f816dc589d 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -77,7 +77,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), - mIsAgentControl(false) + mIsAgentControl(false), + mIsSwitchDirty(false), + mShouldSwitchOn(false) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); @@ -108,6 +110,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) LLOutputMonitorCtrl::~LLOutputMonitorCtrl() { LLMuteList::getInstance()->removeObserver(this); + LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this); } void LLOutputMonitorCtrl::setPower(F32 val) @@ -117,6 +120,26 @@ void LLOutputMonitorCtrl::setPower(F32 val) void LLOutputMonitorCtrl::draw() { + // see also switchIndicator() + if (mIsSwitchDirty) + { + mIsSwitchDirty = false; + if (mShouldSwitchOn) + { + // just notify parent visibility may have changed + notifyParentVisibilityChanged(); + } + else + { + // make itself invisible and notify parent about this + setVisible(FALSE); + notifyParentVisibilityChanged(); + + // no needs to render for invisible element + return; + } + } + // Copied from llmediaremotectrl.cpp // *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then // call directly into gVoiceClient to ask if that agent-id is muted, is @@ -229,6 +252,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) if (speaker_id.isNull() || speaker_id == mSpeakerId) return; mSpeakerId = speaker_id; + LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); //mute management if (mAutoUpdate) @@ -251,3 +275,42 @@ void LLOutputMonitorCtrl::onChange() // check only blocking on voice. EXT-3542 setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat)); } + +// virtual +void LLOutputMonitorCtrl::switchIndicator(bool switch_on) +{ + // ensure indicator is visible in case it is not in visible chain + // to be called when parent became visible next time to notify parent that visibility is changed. + setVisible(TRUE); + + // if parent is in visible chain apply switch_on state and notify it immediately + if (getParent() && getParent()->isInVisibleChain()) + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL; + setVisible((BOOL)switch_on); + notifyParentVisibilityChanged(); + } + + // otherwise remember necessary state and mark itself as dirty. + // State will be applied i next draw when parents chain became visible. + else + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; + mIsSwitchDirty = true; + mShouldSwitchOn = switch_on; + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +void LLOutputMonitorCtrl::notifyParentVisibilityChanged() +{ + LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL; + + LLSD params = LLSD().with("visibility_changed", getVisible()); + + notifyParent(params); +} + +// EOF diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 85ea552a57..2bbfa251e9 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -36,6 +36,7 @@ #include "v4color.h" #include "llview.h" #include "llmutelist.h" +#include "llspeakingindicatormanager.h" class LLTextBox; class LLUICtrlFactory; @@ -45,7 +46,7 @@ class LLUICtrlFactory; // class LLOutputMonitorCtrl -: public LLView, LLMuteListObserver +: public LLView, public LLSpeakingIndicator, LLMuteListObserver { public: struct Params : public LLInitParam::Block @@ -90,7 +91,29 @@ public: //called by mute list virtual void onChange(); + /** + * Implementation of LLSpeakingIndicator interface. + * Behavior is implemented via changing visibility. + * + * If instance is in visible chain now (all parents are visible) it changes visibility + * and notify parent about this. + * + * Otherwise it marks an instance as dirty and stores necessary visibility. + * It will be applied in next draw and parent will be notified. + */ + virtual void switchIndicator(bool switch_on); + private: + + /** + * Notifies parent about changed visibility. + * + * Passes LLSD with "visibility_changed" => value. + * For now it is processed by LLAvatarListItem to update (reshape) its children. + * Implemented fo complete EXT-3976 + */ + void notifyParentVisibilityChanged(); + //static LLColor4 sColorMuted; //static LLColor4 sColorNormal; //static LLColor4 sColorOverdriven; @@ -117,6 +140,10 @@ private: /** uuid of a speaker being monitored */ LLUUID mSpeakerId; + + /** indicates if the instance is dirty and should notify parent */ + bool mIsSwitchDirty; + bool mShouldSwitchOn; }; #endif diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index f3d6dbbb46..85e95ca1d6 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -52,6 +52,7 @@ #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" +#include "llnamebox.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -594,8 +595,11 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g if (it != mGroups.begin()) groups += ", "; - - std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + it->first + "]"; + std::string group_name = LLURI::escape(it->first); + std::string group_url= it->second.notNull() + ? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]" + : getString("no_group_text"); + groups += group_url; } @@ -621,19 +625,15 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) { + LLNameBox* name_box = getChild("partner_text"); if (avatar_data->partner_id.notNull()) { - std::string first, last; - BOOL found = gCacheName->getName(avatar_data->partner_id, first, last); - if (found) - { - childSetTextArg("partner_text", "[FIRST]", first); - childSetTextArg("partner_text", "[LAST]", last); - } + name_box->setNameID(avatar_data->partner_id, FALSE); } else { - childSetTextArg("partner_text", "[FIRST]", getString("no_partner_text")); + name_box->setNameID(LLUUID::null, FALSE); + name_box->setText(getString("no_partner_text")); } } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index e29320ffc2..3f5d80c123 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -72,6 +72,7 @@ #include "llviewerwindow.h" // for window width, height #include "llappviewer.h" // abortQuit() #include "lltrans.h" +#include "llstatusbar.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ const S32 MATURE_UNDEFINED = -1; @@ -1364,6 +1365,7 @@ static const S32 CB_ITEM_PG = 1; LLPanelClassifiedEdit::LLPanelClassifiedEdit() : LLPanelClassifiedInfo() , mIsNew(false) + , mCanClose(false) { } @@ -1559,7 +1561,7 @@ void LLPanelClassifiedEdit::resetControls() bool LLPanelClassifiedEdit::canClose() { - return isValidName(); + return mCanClose; } void LLPanelClassifiedEdit::sendUpdate() @@ -1676,12 +1678,23 @@ void LLPanelClassifiedEdit::onChange() void LLPanelClassifiedEdit::onSaveClick() { + mCanClose = false; + if(!isValidName()) { notifyInvalidName(); return; } + if(isNew()) + { + if(gStatusBar->getBalance() < getPriceForListing()) + { + LLNotificationsUtil::add("ClassifiedInsufficientFunds"); + return; + } + } + mCanClose = true; sendUpdate(); resetDirty(); } diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 10fdf60bbe..e46806f576 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -340,6 +340,7 @@ protected: private: bool mIsNew; + bool mCanClose; }; #endif // LL_LLPANELCLASSIFIED_H diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index fff2575893..569d3001bf 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -151,6 +151,11 @@ BOOL LLPanelGroup::postBuild() button->setVisible(true); button->setEnabled(false); + button = getChild("btn_call"); + button->setClickedCallback(onBtnGroupCallClicked, this); + + button = getChild("btn_chat"); + button->setClickedCallback(onBtnGroupChatClicked, this); button = getChild("btn_join"); button->setVisible(false); @@ -215,6 +220,8 @@ void LLPanelGroup::reposButtons() reposButton("btn_create"); reposButton("btn_refresh"); reposButton("btn_cancel"); + reposButton("btn_chat"); + reposButton("btn_call"); } void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) @@ -262,6 +269,18 @@ void LLPanelGroup::onBtnApply(void* user_data) self->apply(); } +void LLPanelGroup::onBtnGroupCallClicked(void* user_data) +{ + LLPanelGroup* self = static_cast(user_data); + self->callGroup(); +} + +void LLPanelGroup::onBtnGroupChatClicked(void* user_data) +{ + LLPanelGroup* self = static_cast(user_data); + self->chatGroup(); +} + void LLPanelGroup::onBtnJoin() { lldebugs << "joining group: " << mID << llendl; @@ -349,6 +368,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLButton* button_create = findChild("btn_create"); LLButton* button_join = findChild("btn_join"); LLButton* button_cancel = findChild("btn_cancel"); + LLButton* button_call = findChild("btn_call"); + LLButton* button_chat = findChild("btn_chat"); bool is_null_group_id = group_id == LLUUID::null; @@ -362,6 +383,11 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(button_cancel) button_cancel->setVisible(!is_null_group_id); + if(button_call) + button_call->setVisible(!is_null_group_id); + if(button_chat) + button_chat->setVisible(!is_null_group_id); + getChild("prepend_founded_by")->setVisible(!is_null_group_id); LLAccordionCtrl* tab_ctrl = findChild("group_accordion"); @@ -393,12 +419,17 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(tab_land->getDisplayChildren()) tab_land->changeOpenClose(tab_land->getDisplayChildren()); - tab_roles->canOpenClose(false); - tab_notices->canOpenClose(false); - tab_land->canOpenClose(false); + tab_roles->setVisible(false); + tab_notices->setVisible(false); + tab_land->setVisible(false); getChild("group_name")->setVisible(false); getChild("group_name_editor")->setVisible(true); + + if(button_call) + button_call->setVisible(false); + if(button_chat) + button_chat->setVisible(false); } else { @@ -413,19 +444,29 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(tab_land->getDisplayChildren()) tab_land->changeOpenClose(tab_land->getDisplayChildren()); } + + LLGroupData agent_gdatap; + bool is_member = gAgent.getGroupData(mID,agent_gdatap); - tab_roles->canOpenClose(true); - tab_notices->canOpenClose(true); - tab_land->canOpenClose(true); + tab_roles->setVisible(is_member); + tab_notices->setVisible(is_member); + tab_land->setVisible(is_member); getChild("group_name")->setVisible(true); getChild("group_name_editor")->setVisible(false); + + if(button_apply) + button_apply->setVisible(is_member); + if(button_call) + button_call->setVisible(is_member); + if(button_chat) + button_chat->setVisible(is_member); } reposButtons(); } -bool LLPanelGroup::apply(LLPanelGroupTab* tab) +bool LLPanelGroup::apply(LLPanelGroupTab* tab) { if(!tab) return false; @@ -468,12 +509,17 @@ void LLPanelGroup::draw() childEnable("btn_refresh"); } - bool enable = false; - std::string mesg; - for(std::vector::iterator it = mTabs.begin();it!=mTabs.end();++it) - enable = enable || (*it)->needsApply(mesg); + LLButton* button_apply = findChild("btn_apply"); + + if(button_apply && button_apply->getVisible()) + { + bool enable = false; + std::string mesg; + for(std::vector::iterator it = mTabs.begin();it!=mTabs.end();++it) + enable = enable || (*it)->needsApply(mesg); - childSetEnabled("btn_apply", enable); + childSetEnabled("btn_apply", enable); + } } void LLPanelGroup::refreshData() @@ -488,6 +534,15 @@ void LLPanelGroup::refreshData() mRefreshTimer.setTimerExpirySec(5); } +void LLPanelGroup::callGroup() +{ + LLGroupActions::startCall(getID()); +} + +void LLPanelGroup::chatGroup() +{ + LLGroupActions::startIM(getID()); +} void LLPanelGroup::showNotice(const std::string& subject, const std::string& message, diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index f6aefdb676..7ea5e67b44 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -74,6 +74,8 @@ public: bool apply(); void refreshData(); + void callGroup(); + void chatGroup(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -103,6 +105,8 @@ protected: static void onBtnApply(void*); static void onBtnRefresh(void*); + static void onBtnGroupCallClicked(void*); + static void onBtnGroupChatClicked(void*); void reposButton(const std::string& name); void reposButtons(); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 31dfdde887..21b253223f 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -580,7 +580,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } } - mComboActiveTitle->resetDirty(); } // If this was just a titles update, we are done. @@ -595,8 +594,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlShowInGroupList->set(gdatap->mShowInList); mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident); - mCtrlShowInGroupList->resetDirty(); - } if (mComboMature) { @@ -610,19 +607,16 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } mComboMature->setEnabled(mAllowEdit && can_change_ident); mComboMature->setVisible( !gAgent.isTeen() ); - mComboMature->resetDirty(); } if (mCtrlOpenEnrollment) { mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment); mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlOpenEnrollment->resetDirty(); } if (mCtrlEnrollmentFee) { mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0); mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlEnrollmentFee->resetDirty(); } if (mSpinEnrollmentFee) @@ -632,7 +626,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mSpinEnrollmentFee->setEnabled( mAllowEdit && (fee > 0) && can_change_member_opts); - mSpinEnrollmentFee->resetDirty(); } if (mCtrlReceiveNotices) { @@ -641,7 +634,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlReceiveNotices->setEnabled(mAllowEdit); } - mCtrlReceiveNotices->resetDirty(); } @@ -665,7 +657,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) { mEditCharter->setText(gdatap->mCharter); - mEditCharter->resetDirty(); } if (mListVisibleMembers) @@ -693,6 +684,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mListVisibleMembers->addElement(row); } } + + resetDirty(); } void LLPanelGroupGeneral::updateMembers() diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 6210973dae..45fc3d4688 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -614,7 +614,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, mViewInventoryIcon->setVisible(TRUE); std::stringstream ss; - ss << " " << inventory_name; + ss << " " << LLViewerInventoryItem::getDisplayName(inventory_name); mViewInventoryName->setText(ss.str()); mBtnOpenAttachment->setEnabled(TRUE); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 29b647415c..0e55ff3214 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -460,17 +460,8 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab() { } -BOOL LLPanelGroupSubTab::postBuild() -{ - // Hook up the search widgets. - bool recurse = true; - mSearchEditor = getChild("filter_input", recurse); - - if (!mSearchEditor) - return FALSE; - - mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); - +BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) +{ // Get icons for later use. mActionIcons.clear(); @@ -488,6 +479,19 @@ BOOL LLPanelGroupSubTab::postBuild() { mActionIcons["partial"] = getString("power_partial_icon"); } + return TRUE; +} + +BOOL LLPanelGroupSubTab::postBuild() +{ + // Hook up the search widgets. + bool recurse = true; + mSearchEditor = getChild("filter_input", recurse); + + if (!mSearchEditor) + return FALSE; + + mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); return LLPanelGroupTab::postBuild(); } @@ -567,7 +571,6 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action) void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -588,7 +591,6 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, allowed_by_some, allowed_by_all, (*ras_it), - icons, commit_callback, show_all, filter, @@ -600,7 +602,6 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -614,26 +615,26 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, LLSD row; row["columns"][0]["column"] = "icon"; - icon_map_t::iterator iter = icons.find("folder"); - if (iter != icons.end()) + row["columns"][0]["type"] = "icon"; + + icon_map_t::iterator iter = mActionIcons.find("folder"); + if (iter != mActionIcons.end()) { - row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = (*iter).second; } row["columns"][1]["column"] = "action"; + row["columns"][1]["type"] = "text"; row["columns"][1]["value"] = action_set->mActionSetData->mName; row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL"; - row["columns"][1]["font"]["style"] = "BOLD"; + LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData); - LLScrollListText* name_textp = dynamic_cast(title_row->getColumn(1)); + LLScrollListText* name_textp = dynamic_cast(title_row->getColumn(2)); //?? I have no idea fix getColumn(1) return column spacer... if (name_textp) name_textp->setFontStyle(LLFontGL::BOLD); - - bool category_matches_filter = (filter) ? matchesActionSearchFilter(action_set->mActionSetData->mName) : true; std::vector::iterator ra_it = action_set->mActions.begin(); @@ -686,8 +687,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, { if (show_full_strength) { - icon_map_t::iterator iter = icons.find("full"); - if (iter != icons.end()) + icon_map_t::iterator iter = mActionIcons.find("full"); + if (iter != mActionIcons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -697,8 +698,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, } else { - icon_map_t::iterator iter = icons.find("partial"); - if (iter != icons.end()) + icon_map_t::iterator iter = mActionIcons.find("partial"); + if (iter != mActionIcons.end()) { row["columns"][column_index]["column"] = "checkbox"; row["columns"][column_index]["type"] = "icon"; @@ -792,6 +793,8 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab() BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -888,7 +891,6 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() buildActionsList(mAllowedActionsList, allowed_by_some, allowed_by_all, - mActionIcons, NULL, FALSE, FALSE, @@ -1211,7 +1213,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, buildActionsList(mAllowedActionsList, powers_some_have, powers_all_have, - mActionIcons, NULL, FALSE, FALSE, @@ -1684,6 +1685,8 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab() BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -1994,7 +1997,6 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() buildActionsList(mAllowedActionsList, rd.mRolePowers, 0LL, - mActionIcons, boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), TRUE, FALSE, @@ -2381,6 +2383,8 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab() BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) { + LLPanelGroupSubTab::postBuildSubTab(root); + // Upcast parent so we can ask it for sibling controls. LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root; @@ -2448,7 +2452,6 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc) buildActionsList(mActionList, GP_ALL_POWERS, GP_ALL_POWERS, - mActionIcons, NULL, FALSE, TRUE, diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index bb3c9096cf..2f81900e60 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -108,7 +108,7 @@ public: virtual BOOL postBuild(); // This allows sub-tabs to collect child widgets from a higher level in the view hierarchy. - virtual BOOL postBuildSubTab(LLView* root) { return TRUE; } + virtual BOOL postBuildSubTab(LLView* root); virtual void setSearchFilter( const std::string& filter ); @@ -117,10 +117,15 @@ public: // Helper functions bool matchesActionSearchFilter(std::string action); + + + void setFooterEnabled(BOOL enable); + + virtual void setGroupID(const LLUUID& id); +protected: void buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, @@ -129,15 +134,11 @@ public: U64 allowed_by_some, U64 allowed_by_all, LLRoleActionSet* action_set, - icon_map_t& icons, LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role); - void setFooterEnabled(BOOL enable); - - virtual void setGroupID(const LLUUID& id); protected: LLPanel* mHeader; LLPanel* mFooter; diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index 92b6d2f619..713d2d79b4 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -37,7 +37,7 @@ #include "llmediactrl.h" #include "llviewerhome.h" -static LLRegisterPanelClassWrapper t_people("panel_sidetray_home"); +static LLRegisterPanelClassWrapper t_home("panel_sidetray_home"); LLPanelHome::LLPanelHome() : LLPanel(), diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 279818d52f..b1cdb4d81f 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -46,6 +46,7 @@ #include "llimview.h" #include "llvoicechannel.h" #include "llsidetray.h" +#include "llspeakers.h" #include "lltrans.h" void LLPanelChatControlPanel::onCallButtonClicked() @@ -70,9 +71,9 @@ void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::E void LLPanelChatControlPanel::updateButtons(bool is_call_started) { - childSetVisible("end_call_btn", is_call_started); - childSetVisible("voice_ctrls_btn", is_call_started); - childSetVisible("call_btn", ! is_call_started); + childSetVisible("end_call_btn_panel", is_call_started); + childSetVisible("voice_ctrls_btn_panel", is_call_started); + childSetVisible("call_btn_panel", ! is_call_started); } LLPanelChatControlPanel::~LLPanelChatControlPanel() @@ -302,7 +303,7 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); + mGroupID = session_id; // for group and Ad-hoc chat we need to include agent into list if(!mParticipantList) diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index 920fca66f2..6a4c909759 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -37,6 +37,7 @@ // viewer includes #include "llmimetypes.h" #include "llviewerparcelmgr.h" +#include "llviewerregion.h" #include "lluictrlfactory.h" // library includes @@ -83,8 +84,14 @@ BOOL LLPanelLandAudio::postBuild() mCheckSoundLocal = getChild("check sound local"); childSetCommitCallback("check sound local", onCommitAny, this); - mRadioVoiceChat = getChild("parcel_voice_channel"); - childSetCommitCallback("parcel_voice_channel", onCommitAny, this); + mCheckParcelEnableVoice = getChild("parcel_enable_voice_channel"); + childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this); + + // This one is always disabled so no need for a commit callback + mCheckEstateDisabledVoice = getChild("parcel_enable_voice_channel_is_estate_disabled"); + + mCheckParcelVoiceLocal = getChild("parcel_enable_voice_channel_local"); + childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this); mMusicURLEdit = getChild("music_url"); childSetCommitCallback("music_url", onCommitAny, this); @@ -118,19 +125,33 @@ void LLPanelLandAudio::refresh() mMusicUrlCheck->set( parcel->getObscureMusic() ); mMusicUrlCheck->setEnabled( can_change_media ); - if(parcel->getParcelFlagAllowVoice()) + bool allow_voice = parcel->getParcelFlagAllowVoice(); + + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + if (region && region->isVoiceEnabled()) { - if(parcel->getParcelFlagUseEstateVoiceChannel()) - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); - else - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate); + mCheckEstateDisabledVoice->setVisible(false); + + mCheckParcelEnableVoice->setVisible(true); + mCheckParcelEnableVoice->setEnabled( can_change_media ); + mCheckParcelEnableVoice->set(allow_voice); + + mCheckParcelVoiceLocal->setEnabled( can_change_media && allow_voice ); } else { - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); + // Voice disabled at estate level, overrides parcel settings + // Replace the parcel voice checkbox with a disabled one + // labelled with an explanatory message + mCheckEstateDisabledVoice->setVisible(true); + + mCheckParcelEnableVoice->setVisible(false); + mCheckParcelEnableVoice->setEnabled(false); + mCheckParcelVoiceLocal->setEnabled(false); } - mRadioVoiceChat->setEnabled( can_change_media ); + mCheckParcelEnableVoice->set(allow_voice); + mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel()); mMusicURLEdit->setText(parcel->getMusicURL()); mMusicURLEdit->setEnabled( can_change_media ); @@ -149,30 +170,11 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) // Extract data from UI BOOL sound_local = self->mCheckSoundLocal->get(); - int voice_setting = self->mRadioVoiceChat->getSelectedIndex(); std::string music_url = self->mMusicURLEdit->getText(); U8 obscure_music = self->mMusicUrlCheck->get(); - - BOOL voice_enabled; - BOOL voice_estate_chan; - - switch(voice_setting) - { - default: - case kRadioVoiceChatEstate: - voice_enabled = TRUE; - voice_estate_chan = TRUE; - break; - case kRadioVoiceChatPrivate: - voice_enabled = TRUE; - voice_estate_chan = FALSE; - break; - case kRadioVoiceChatDisable: - voice_enabled = FALSE; - voice_estate_chan = FALSE; - break; - } + BOOL voice_enabled = self->mCheckParcelEnableVoice->get(); + BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get(); // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(music_url); diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index de5da95fa4..19766a40b6 100644 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -52,7 +52,9 @@ private: private: LLCheckBoxCtrl* mCheckSoundLocal; - LLRadioGroup* mRadioVoiceChat; + LLCheckBoxCtrl* mCheckParcelEnableVoice; + LLCheckBoxCtrl* mCheckEstateDisabledVoice; + LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLLineEditor* mMusicURLEdit; LLCheckBoxCtrl* mMusicUrlCheck; diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 597b8bdb2d..9654e17659 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -185,6 +185,13 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) region_z = llround(mPosRegion.mV[VZ]); } + LLSD info; + info["update_verbs"] = true; + info["global_x"] = parcel_data.global_x; + info["global_y"] = parcel_data.global_y; + info["global_z"] = parcel_data.global_z; + notifyParent(info); + if (mInfoType == CREATE_LANDMARK) { if (parcel_data.name.empty()) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 30acf37f82..47feef496a 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -35,6 +35,7 @@ #include "llbutton.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llsdutil.h" #include "llsdutil_math.h" #include "llregionhandle.h" @@ -304,6 +305,29 @@ void LLLandmarksPanel::updateShowFolderState() ); } +void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) +{ + if (selectItemInAccordionTab(mFavoritesInventoryPanel, "tab_favorites", obj_id, take_keyboard_focus)) + { + return; + } + + if (selectItemInAccordionTab(mLandmarksInventoryPanel, "tab_landmarks", obj_id, take_keyboard_focus)) + { + return; + } + + if (selectItemInAccordionTab(mMyInventoryPanel, "tab_inventory", obj_id, take_keyboard_focus)) + { + return; + } + + if (selectItemInAccordionTab(mLibraryInventoryPanel, "tab_library", obj_id, take_keyboard_focus)) + { + return; + } +} + ////////////////////////////////////////////////////////////////////////// // PROTECTED METHODS ////////////////////////////////////////////////////////////////////////// @@ -349,6 +373,36 @@ LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem() const return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : NULL; } +LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, + const std::string& tab_name, + const LLUUID& obj_id, + BOOL take_keyboard_focus) const +{ + if (!inventory_list) + return NULL; + + LLFolderView* folder_view = inventory_list->getRootFolder(); + + LLFolderViewItem* item = folder_view->getItemByID(obj_id); + if (!item) + return NULL; + + LLAccordionCtrlTab* tab = getChild(tab_name); + if (!tab->isExpanded()) + { + tab->changeOpenClose(false); + } + + folder_view->setSelection(item, FALSE, take_keyboard_focus); + + LLAccordionCtrl* accordion = getChild("landmarks_accordion"); + LLRect screen_rc; + localRectToScreen(item->getRect(), &screen_rc); + accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue())); + + return item; +} + void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) { if(!panel) return; @@ -632,8 +686,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); if(landmark) { - LLSideTray::getInstance()->showPanel("panel_places", - LLSD().with("type", "landmark").with("id",landmark->getUUID())); + LLNotificationsUtil::add("LandmarkAlreadyExists"); } else { diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 569739237d..96b790844c 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -73,6 +73,11 @@ public: */ void updateShowFolderState(); + /** + * Selects item with "obj_id" in one of accordion tabs. + */ + void setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark @@ -81,6 +86,17 @@ protected: bool isReceivedFolderSelected() const; void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb); LLFolderViewItem* getCurSelectedItem() const; + + /** + * Selects item with "obj_id" in "inventory_list" and scrolls accordion + * scrollbar to show the item. + * Returns pointer to the item if it is found in "inventory_list", otherwise NULL. + */ + LLFolderViewItem* selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, + const std::string& tab_name, + const LLUUID& obj_id, + BOOL take_keyboard_focus) const; + void updateSortOrder(LLInventoryPanel* panel, bool byDate); //LLRemoteParcelInfoObserver interface diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e74a39c85c..a5a61f0c7b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -51,6 +51,8 @@ #include "llviewermenu.h" #include "llviewertexturelist.h" +const std::string FILTERS_FILENAME("filters.xml"); + static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); void on_file_loaded_for_save(BOOL success, @@ -160,7 +162,7 @@ BOOL LLPanelMainInventory::postBuild() // Now load the stored settings from disk, if available. std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "filters.xml"); + filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); llinfos << "LLPanelMainInventory::init: reading from " << filterSaveName << llendl; llifstream file(filterSaveName.str()); LLSD savedFilterState; @@ -230,7 +232,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) } std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "filters.xml"); + filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); llofstream filtersFile(filterSaveName.str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 6a61e0f02f..d17c287cc7 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -73,7 +73,7 @@ #include "pipeline.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "lldrawpool.h" @@ -682,7 +682,7 @@ void LLPanelObject::getState( ) if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) { selected_item = MI_SCULPT; - LLFirstUse::useSculptedPrim(); + //LLFirstUse::useSculptedPrim(); } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 43366ef814..d4376550d6 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -445,7 +445,7 @@ bool remove_task_inventory_callback(const LLSD& notification, const LLSD& respon } // helper for remove -// ! REFACTOR ! two_uuids_list_t is also defined in llinevntorybridge.h, but differently. +// ! REFACTOR ! two_uuids_list_t is also defined in llinventorybridge.h, but differently. typedef std::pair > panel_two_uuids_list_t; typedef std::pair remove_data_t; BOOL LLTaskInvFVBridge::removeItem() diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 8e14074de1..fd5ce7a46d 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llagentwearables.h" +#include "llappearancemgr.h" #include "llbutton.h" #include "llfloaterreg.h" @@ -44,6 +45,8 @@ #include "llinventoryfunctions.h" #include "llinventorypanel.h" #include "lllandmark.h" +#include "lllineeditor.h" +#include "llmodaldialog.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltabcontainer.h" @@ -61,12 +64,75 @@ static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); bool LLPanelOutfitsInventory::sShowDebugEditor = false; +class LLOutfitSaveAsDialog : public LLModalDialog +{ +private: + std::string mItemName; + std::string mTempItemName; + + boost::signals2::signal mSaveAsSignal; + +public: + LLOutfitSaveAsDialog( const LLSD& key ) + : LLModalDialog( key ), + mTempItemName(key.asString()) + { + } + + BOOL postBuild() + { + getChild("Save")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onSave, this )); + getChild("Cancel")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onCancel, this )); + + childSetTextArg("name ed", "[DESC]", mTempItemName); + return TRUE; + } + + void setSaveAsCommit( const boost::signals2::signal::slot_type& cb ) + { + mSaveAsSignal.connect(cb); + } + + virtual void onOpen(const LLSD& key) + { + LLLineEditor* edit = getChild("name ed"); + if (edit) + { + edit->setFocus(TRUE); + edit->selectAll(); + } + } + + void onSave() + { + mItemName = childGetValue("name ed").asString(); + LLStringUtil::trim(mItemName); + if( !mItemName.empty() ) + { + mSaveAsSignal(mItemName); + closeFloater(); // destroys this object + } + } + + void onCancel() + { + closeFloater(); // destroys this object + } +}; + LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mActivePanel(NULL), mParent(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); + + static bool registered_dialog = false; + if (!registered_dialog) + { + LLFloaterReg::add("outfit_save_as", "floater_outfit_save_as.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + registered_dialog = true; + } } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -84,6 +150,14 @@ BOOL LLPanelOutfitsInventory::postBuild() return TRUE; } +// virtual +void LLPanelOutfitsInventory::onOpen(const LLSD& key) +{ + // Make sure we know which tab is selected, update the filter, + // and update verbs. + onTabChange(); +} + void LLPanelOutfitsInventory::updateVerbs() { if (mParent) @@ -94,6 +168,7 @@ void LLPanelOutfitsInventory::updateVerbs() if (mListCommands) { mListCommands->childSetVisible("look_edit_btn",sShowDebugEditor); + updateListCommands(); } } @@ -168,15 +243,36 @@ void LLPanelOutfitsInventory::onEdit() { } -void LLPanelOutfitsInventory::onNew() +void LLPanelOutfitsInventory::onSave() +{ + std::string outfit_name; + + if (!LLAppearanceManager::getInstance()->getBaseOutfitName(outfit_name)) + { + outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); + } + + LLOutfitSaveAsDialog* save_as_dialog = LLFloaterReg::showTypedInstance("outfit_save_as", LLSD(outfit_name), TRUE); + if (save_as_dialog) + { + save_as_dialog->setSaveAsCommit(boost::bind(&LLPanelOutfitsInventory::onSaveCommit, this, _1 )); + } +} + +void LLPanelOutfitsInventory::onSaveCommit(const std::string& outfit_name) { - const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); + LLSD key; + LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); + + if (mAppearanceTabs) + { + mAppearanceTabs->selectTabByName("outfitslist_tab"); + } } void LLPanelOutfitsInventory::onSelectionChange(const std::deque &items, BOOL user_action) { - updateListCommands(); updateVerbs(); if (getRootFolder()->needsAutoRename() && items.size()) { @@ -264,9 +360,12 @@ void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); bool wear_enabled = isActionEnabled("wear"); + bool make_outfit_enabled = isActionEnabled("make_outfit"); mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); + mListCommands->childSetVisible("wear_btn", wear_enabled); + mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled); } void LLPanelOutfitsInventory::onGearButtonClick() @@ -276,7 +375,7 @@ void LLPanelOutfitsInventory::onGearButtonClick() void LLPanelOutfitsInventory::onAddButtonClick() { - onNew(); + onSave(); } void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) @@ -303,6 +402,8 @@ void LLPanelOutfitsInventory::onClipboardAction(const LLSD& userdata) { std::string command_name = userdata.asString(); getActivePanel()->getRootFolder()->doToSelected(getActivePanel()->getModel(),command_name); + updateListCommands(); + updateVerbs(); } void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) @@ -313,7 +414,7 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "new") { - onNew(); + onSave(); } if (command_name == "edit") { @@ -323,6 +424,7 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) { onWearButtonClick(); } + // Note: This option has been removed from the gear menu. if (command_name == "add") { onAdd(); @@ -343,20 +445,22 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) { onClipboardAction("delete"); } + updateListCommands(); + updateVerbs(); } BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) { const std::string command_name = userdata.asString(); - if (command_name == "delete") + if (command_name == "delete" || command_name == "remove") { BOOL can_delete = FALSE; LLFolderView *folder = getActivePanel()->getRootFolder(); if (folder) { - can_delete = TRUE; std::set selection_set; folder->getSelectionList(selection_set); + can_delete = (selection_set.size() > 0); for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); ++iter) @@ -375,9 +479,9 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) LLFolderView *folder = getActivePanel()->getRootFolder(); if (folder) { - can_delete = TRUE; std::set selection_set; folder->getSelectionList(selection_set); + can_delete = (selection_set.size() > 0); for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); ++iter) @@ -391,10 +495,27 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "rename" || + command_name == "delete_outfit") + { + return (getCorrectListenerForAction() != NULL) && hasItemsSelected(); + } + + if (command_name == "wear") + { + const BOOL is_my_outfits = (mActivePanel->getName() == "outfitslist_tab"); + if (!is_my_outfits) + { + return FALSE; + } + } + if (command_name == "make_outfit") + { + return TRUE; + } + if (command_name == "edit" || - command_name == "wear" || - command_name == "add" || - command_name == "remove" + command_name == "add" ) { return (getCorrectListenerForAction() != NULL); @@ -402,6 +523,19 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) return TRUE; } +bool LLPanelOutfitsInventory::hasItemsSelected() +{ + bool has_items_selected = false; + LLFolderView *folder = getActivePanel()->getRootFolder(); + if (folder) + { + std::set selection_set; + folder->getSelectionList(selection_set); + has_items_selected = (selection_set.size() > 0); + } + return has_items_selected; +} + bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept) { *accept = ACCEPT_NO; @@ -425,17 +559,15 @@ bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropTy void LLPanelOutfitsInventory::initTabPanels() { mTabPanels.resize(2); + + LLInventoryPanel *cof_panel = getChild("cof_tab"); + cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mTabPanels[0] = cof_panel; - LLInventoryPanel *myoutfits_panel = getChild("outfitslist_accordionpanel"); + LLInventoryPanel *myoutfits_panel = getChild("outfitslist_tab"); myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mTabPanels[0] = myoutfits_panel; - mActivePanel = myoutfits_panel; - - - LLInventoryPanel *cof_panel = getChild("cof_accordionpanel"); - cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mTabPanels[1] = cof_panel; + mTabPanels[1] = myoutfits_panel; for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); iter != mTabPanels.end(); @@ -447,6 +579,7 @@ void LLPanelOutfitsInventory::initTabPanels() mAppearanceTabs = getChild("appearance_tabs"); mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this)); + mActivePanel = (LLInventoryPanel*)mAppearanceTabs->getCurrentPanel(); } void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque &items, BOOL user_action) @@ -479,9 +612,7 @@ void LLPanelOutfitsInventory::onTabChange() return; } mActivePanel->setFilterSubString(mFilterSubString); - - bool is_my_outfits = (mActivePanel->getName() == "outfitslist_accordionpanel"); - mListCommands->childSetEnabled("make_outfit_btn", is_my_outfits); + updateVerbs(); } LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel() diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 1e084750a0..76110e2a3f 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -53,12 +53,15 @@ public: virtual ~LLPanelOutfitsInventory(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); void onSearchEdit(const std::string& string); void onAdd(); void onRemove(); void onEdit(); - void onNew(); + void onSave(); + + void onSaveCommit(const std::string& item_name); void onSelectionChange(const std::deque &items, BOOL user_action); void onSelectorButtonClicked(); @@ -114,6 +117,7 @@ protected: BOOL isActionEnabled(const LLSD& command_name); void onCustomAction(const LLSD& command_name); bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); + bool hasItemsSelected(); private: LLPanel* mListCommands; LLMenuGL* mMenuGearDefault; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e14a5778ad..c14b282488 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -35,6 +35,7 @@ // libs #include "llfloaterreg.h" #include "llmenugl.h" +#include "llnotificationsutil.h" #include "llfiltereditor.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" @@ -531,10 +532,10 @@ BOOL LLPanelPeople::postBuild() friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); friends_panel->childSetAction("del_btn", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this)); - mOnlineFriendList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mOnlineFriendList)); - mAllFriendList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mAllFriendList)); - mNearbyList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mNearbyList)); - mRecentList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mRecentList)); + mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); + mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); + mNearbyList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); + mRecentList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mOnlineFriendList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mOnlineFriendList)); mAllFriendList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mAllFriendList)); @@ -750,7 +751,6 @@ void LLPanelPeople::updateButtons() LLPanel* groups_panel = mTabContainer->getCurrentPanel(); groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected - groups_panel->childSetEnabled("plus_btn", item_selected); groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull()); } else @@ -1005,12 +1005,15 @@ void LLPanelPeople::onTabSelected(const LLSD& param) mFilterEditor->setLabel(getString("people_filter_label")); } -void LLPanelPeople::onAvatarListDoubleClicked(LLAvatarList* list) +void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl) { - LLUUID clicked_id = list->getSelectedUUID(); - - if (clicked_id.isNull()) + LLAvatarListItem* item = dynamic_cast(ctrl); + if(!item) + { return; + } + + LLUUID clicked_id = item->getAvatarId(); #if 0 // SJB: Useful for testing, but not currently functional or to spec LLAvatarActions::showProfile(clicked_id); @@ -1138,6 +1141,12 @@ void LLPanelPeople::onAvatarPicked( void LLPanelPeople::onGroupPlusButtonClicked() { + if (!gAgent.canJoinGroups()) + { + LLNotificationsUtil::add("JoinedTooManyGroups"); + return; + } + LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get(); if (!plus_menu) return; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index da2c0e368c..7580fdbeef 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -109,7 +109,7 @@ private: void onNearbyViewSortButtonClicked(); void onFriendsViewSortButtonClicked(); void onGroupsViewSortButtonClicked(); - void onAvatarListDoubleClicked(LLAvatarList* list); + void onAvatarListDoubleClicked(LLUICtrl* ctrl); void onAvatarListCommitted(LLAvatarList* list); void onGroupPlusButtonClicked(); void onGroupMinusButtonClicked(); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 7a4dd3569d..5ac0587550 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -35,24 +35,30 @@ // profile. #include "llviewerprecompiledheaders.h" -#include "llpanel.h" + +#include "llpanelpick.h" + #include "message.h" -#include "llagent.h" -#include "llagentpicksinfo.h" + +#include "llparcel.h" + #include "llbutton.h" +#include "llfloaterreg.h" #include "lliconctrl.h" #include "lllineeditor.h" -#include "llparcel.h" -#include "llviewerparcelmgr.h" +#include "llpanel.h" +#include "llscrollcontainer.h" #include "lltexteditor.h" + +#include "llagent.h" +#include "llagentpicksinfo.h" +#include "llavatarpropertiesprocessor.h" +#include "llfloaterworldmap.h" #include "lltexturectrl.h" #include "lluiconstants.h" +#include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llworldmap.h" -#include "llfloaterworldmap.h" -#include "llfloaterreg.h" -#include "llavatarpropertiesprocessor.h" -#include "llpanelpick.h" #define XML_PANEL_EDIT_PICK "panel_edit_pick.xml" @@ -93,6 +99,10 @@ LLPanelPickInfo::LLPanelPickInfo() , mPickId(LLUUID::null) , mParcelId(LLUUID::null) , mRequestedId(LLUUID::null) + , mScrollingPanelMinHeight(0) + , mScrollingPanelWidth(0) + , mScrollingPanel(NULL) + , mScrollContainer(NULL) { } @@ -146,9 +156,35 @@ BOOL LLPanelPickInfo::postBuild() childSetAction("show_on_map_btn", boost::bind(&LLPanelPickInfo::onClickMap, this)); childSetAction("back_btn", boost::bind(&LLPanelPickInfo::onClickBack, this)); + mScrollingPanel = getChild("scroll_content_panel"); + mScrollContainer = getChild("profile_scroll"); + + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + return TRUE; } +void LLPanelPickInfo::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + LLPanel::reshape(width, height, called_from_parent); + + if (!mScrollContainer || !mScrollingPanel) + return; + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + S32 scroll_height = mScrollContainer->getRect().getHeight(); + if (mScrollingPanelMinHeight >= scroll_height) + { + mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); + } + else + { + mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); + } +} + void LLPanelPickInfo::processProperties(void* data, EAvatarProcessorType type) { if(APT_PICK_INFO != type) @@ -284,7 +320,6 @@ void LLPanelPickInfo::setPickName(const std::string& name) void LLPanelPickInfo::setPickDesc(const std::string& desc) { childSetValue(XML_DESC, desc); - updateContentPanelRect(); } void LLPanelPickInfo::setPickLocation(const std::string& location) @@ -292,31 +327,6 @@ void LLPanelPickInfo::setPickLocation(const std::string& location) childSetValue(XML_LOCATION, location); } -void LLPanelPickInfo::updateContentPanelRect() -{ - LLTextBox* desc = getChild(XML_DESC); - - S32 text_height = desc->getTextPixelHeight(); - LLRect text_rect = desc->getRect(); - - // let text-box height fit text height - text_rect.set(text_rect.mLeft, text_rect.mTop, text_rect.mRight, text_rect.mTop - text_height); - desc->setRect(text_rect); - desc->reshape(text_rect.getWidth(), text_rect.getHeight()); - // force reflow - desc->setText(desc->getText()); - - // bottom of description text-box will be bottom of content panel - desc->localRectToOtherView(desc->getLocalRect(), &text_rect, getChild("profile_scroll")); - - LLPanel* content_panel = getChild("scroll_content_panel"); - LLRect content_rect = content_panel->getRect(); - content_rect.set(content_rect.mLeft, content_rect.mTop, content_rect.mRight, text_rect.mBottom); - // Somehow setRect moves all elements down. - // Single reshape() updates rect and does not move anything. - content_panel->reshape(content_rect.getWidth(), content_rect.getHeight()); -} - void LLPanelPickInfo::onClickMap() { LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); @@ -438,7 +448,7 @@ BOOL LLPanelPickEdit::postBuild() { LLPanelPickInfo::postBuild(); - mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1)); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPickEdit::onSnapshotChanged, this)); LLLineEditor* line_edit = getChild("pick_name"); line_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1), NULL); @@ -527,16 +537,14 @@ void LLPanelPickEdit::sendUpdate() } } +void LLPanelPickEdit::onSnapshotChanged() +{ + enableSaveButton(true); +} + void LLPanelPickEdit::onPickChanged(LLUICtrl* ctrl) { - if(isDirty()) - { - enableSaveButton(true); - } - else - { - enableSaveButton(false); - } + enableSaveButton(isDirty()); } void LLPanelPickEdit::resetData() @@ -603,10 +611,6 @@ void LLPanelPickEdit::initTexturePickerMouseEvents() mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseEnter, this, _1)); mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseLeave, this, _1)); - // *WORKAROUND: Needed for EXT-1625: enabling save button each time when picker is opened, even if - // texture wasn't changed (see Steve's comment). - mSnapshotCtrl->setMouseDownCallback(boost::bind(&LLPanelPickEdit::enableSaveButton, this, true)); - text_icon->setVisible(FALSE); } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 12b5a116b4..4f27760a8d 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -43,6 +43,7 @@ class LLIconCtrl; class LLTextureCtrl; +class LLScrollContainer; class LLMessageSystem; class LLAvatarPropertiesObserver; @@ -69,6 +70,8 @@ public: /*virtual*/ BOOL postBuild(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /** @@ -139,15 +142,6 @@ protected: virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } virtual LLVector3d& getPosGlobal() { return mPosGlobal; } - /** - * Reshapes content panel to fit all elements. - * - * Assume that description text-box is the last element of panel. - * Reshape text-box to fit text height and then reshape content panel to fit - * text-box bottom. EXT-1326 - */ - void updateContentPanelRect(); - /** * Callback for "Map" button, opens Map */ @@ -162,7 +156,11 @@ protected: protected: - LLTextureCtrl* mSnapshotCtrl; + S32 mScrollingPanelMinHeight; + S32 mScrollingPanelWidth; + LLScrollContainer* mScrollContainer; + LLPanel* mScrollingPanel; + LLTextureCtrl* mSnapshotCtrl; LLUUID mAvatarId; LLVector3d mPosGlobal; @@ -223,6 +221,11 @@ protected: */ void sendUpdate(); + /** + * Called when snapshot image changes. + */ + void onSnapshotChanged(); + /** * Callback for Pick snapshot, name and description changed event. */ diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 751705dd57..ada65c98a4 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -411,6 +411,7 @@ BOOL LLPanelPicks::postBuild() LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2)); + mEnableCallbackRegistrar.add("Picks.Plus.Enable", boost::bind(&LLPanelPicks::isActionEnabled, this, _2)); mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); return TRUE; @@ -430,6 +431,18 @@ void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param) } } +bool LLPanelPicks::isActionEnabled(const LLSD& userdata) const +{ + std::string command_name = userdata.asString(); + + if (command_name == "new_pick" && LLAgentPicksInfo::getInstance()->isPickLimitReached()) + { + return false; + } + + return true; +} + void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) { if(!mPicksAccTab->getDisplayChildren()) @@ -652,7 +665,6 @@ void LLPanelPicks::updateButtons() if (getAvatarId() == gAgentID) { - childSetEnabled(XML_BTN_NEW, !LLAgentPicksInfo::getInstance()->isPickLimitReached()); childSetEnabled(XML_BTN_DELETE, has_selected); } diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 1b2e35ca46..3f757e482e 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -97,6 +97,7 @@ private: void onClickMap(); void onPlusMenuItemClicked(const LLSD& param); + bool isActionEnabled(const LLSD& userdata) const; void onListCommit(const LLFlatListView* f_list); void onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 685104a8b1..b037674c37 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -449,6 +449,22 @@ void LLPanelPlaces::setItem(LLInventoryItem* item) } } +S32 LLPanelPlaces::notifyParent(const LLSD& info) +{ + if(info.has("update_verbs")) + { + if(mPosGlobal.isExactlyZero()) + { + mPosGlobal.setVec(info["global_x"], info["global_y"], info["global_z"]); + } + + updateVerbs(); + + return 1; + } + return LLPanel::notifyParent(info); +} + void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) { if (!mLandmarkInfo) @@ -460,6 +476,8 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) mLandmarkInfo->displayParcelInfo(region_id, mPosGlobal); mSaveBtn->setEnabled(TRUE); + + updateVerbs(); } void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_filter) @@ -824,6 +842,19 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) mPlaceProfile->setVisible(FALSE); } + else + { + LLLandmarksPanel* landmarks_panel = + dynamic_cast(mTabContainer->getPanelByName("Landmarks")); + if (landmarks_panel && mItem.notNull()) + { + // If a landmark info is being closed we open the landmarks tab + // and set this landmark selected. + mTabContainer->selectTabPanel(landmarks_panel); + + landmarks_panel->setItemSelected(mItem->getUUID(), TRUE); + } + } } } diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 5ee8704992..27b5911ebb 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -71,6 +71,12 @@ public: void setItem(LLInventoryItem* item); + LLInventoryItem* getItem() { return mItem; } + + std::string getPlaceInfoType() { return mPlaceInfoType; } + + /*virtual*/ S32 notifyParent(const LLSD& info); + private: void onLandmarkLoaded(LLLandmark* landmark); void onFilterEdit(const std::string& search_string, bool force_filter); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 5cc9c1951b..2dc3a62637 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -127,7 +127,11 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mScrollState = SCROLL_NONE; mPanelHandle.bind(this); + + mInactiveTimeout = gSavedSettings.getF32("MediaControlTimeout"); + mControlFadeTime = gSavedSettings.getF32("MediaControlFadeTime"); } + LLPanelPrimMediaControls::~LLPanelPrimMediaControls() { } @@ -156,8 +160,6 @@ BOOL LLPanelPrimMediaControls::postBuild() mSkipBackCtrl = getChild("skip_back"); mVolumeCtrl = getChild("media_volume"); mMuteBtn = getChild("media_mute_button"); - mVolumeUpCtrl = getChild("volume_up"); - mVolumeDownCtrl = getChild("volume_down"); mVolumeSliderCtrl = getChild("volume_slider"); mWhitelistIcon = getChild("media_whitelist_flag"); mSecureLockIcon = getChild("media_secure_lock_flag"); @@ -172,6 +174,7 @@ BOOL LLPanelPrimMediaControls::postBuild() LLStringUtil::convertToF32(getString("zoom_near_padding"), mZoomNearPadding); LLStringUtil::convertToF32(getString("zoom_medium_padding"), mZoomMediumPadding); LLStringUtil::convertToF32(getString("zoom_far_padding"), mZoomFarPadding); + LLStringUtil::convertToS32(getString("top_world_view_avoid_zone"), mTopWorldViewAvoidZone); // These are currently removed...but getChild creates a "dummy" widget. // This class handles them missing. @@ -207,11 +210,9 @@ BOOL LLPanelPrimMediaControls::postBuild() } mMediaAddress->setFocusReceivedCallback(boost::bind(&LLPanelPrimMediaControls::onInputURL, _1, this )); - mInactiveTimeout = gSavedSettings.getF32("MediaControlTimeout"); - mControlFadeTime = gSavedSettings.getF32("MediaControlFadeTime"); - + mCurrentZoom = ZOOM_NONE; - // clicks on HUD buttons do not remove keyboard focus from media + // clicks on buttons do not remove keyboard focus from media setIsChrome(TRUE); return TRUE; } @@ -336,8 +337,6 @@ void LLPanelPrimMediaControls::updateShape() mMediaAddressCtrl->setVisible(has_focus && !mini_controls); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); mVolumeCtrl->setVisible(false); - mVolumeUpCtrl->setVisible(false); - mVolumeDownCtrl->setVisible(false); mWhitelistIcon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false); // Disable zoom if HUD @@ -370,11 +369,9 @@ void LLPanelPrimMediaControls::updateShape() mSkipBackCtrl->setEnabled(has_focus && !mini_controls); mVolumeCtrl->setVisible(has_focus); - mVolumeUpCtrl->setVisible(has_focus); - mVolumeDownCtrl->setVisible(has_focus); mVolumeCtrl->setEnabled(has_focus); - mVolumeSliderCtrl->setEnabled(has_focus && mVolumeSliderVisible > 0); - mVolumeSliderCtrl->setVisible(has_focus && mVolumeSliderVisible > 0); + mVolumeSliderCtrl->setEnabled(has_focus && shouldVolumeSliderBeVisible()); + mVolumeSliderCtrl->setVisible(has_focus && shouldVolumeSliderBeVisible()); mWhitelistIcon->setVisible(false); mSecureLockIcon->setVisible(false); @@ -414,21 +411,15 @@ void LLPanelPrimMediaControls::updateShape() // video vloume if(volume <= 0.0) { - mVolumeUpCtrl->setEnabled(TRUE); - mVolumeDownCtrl->setEnabled(FALSE); mMuteBtn->setToggleState(true); } else if (volume >= 1.0) { - mVolumeUpCtrl->setEnabled(FALSE); - mVolumeDownCtrl->setEnabled(TRUE); mMuteBtn->setToggleState(false); } else { mMuteBtn->setToggleState(false); - mVolumeUpCtrl->setEnabled(TRUE); - mVolumeDownCtrl->setEnabled(TRUE); } switch(result) @@ -473,12 +464,8 @@ void LLPanelPrimMediaControls::updateShape() mSkipBackCtrl->setEnabled(FALSE); mVolumeCtrl->setVisible(FALSE); - mVolumeUpCtrl->setVisible(FALSE); - mVolumeDownCtrl->setVisible(FALSE); mVolumeSliderCtrl->setVisible(FALSE); mVolumeCtrl->setEnabled(FALSE); - mVolumeUpCtrl->setEnabled(FALSE); - mVolumeDownCtrl->setEnabled(FALSE); mVolumeSliderCtrl->setEnabled(FALSE); if (mMediaPanelScroll) @@ -627,36 +614,45 @@ void LLPanelPrimMediaControls::updateShape() update_min_max(min, max, LLVector3(screen_vert.v)); } + // convert screenspace bbox to pixels (in screen coords) + LLRect window_rect = gViewerWindow->getWorldViewRectScaled(); LLCoordGL screen_min; - screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (min.mV[VY] + 1.f) * 0.5f); + screen_min.mX = llround((F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = llround((F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = llround((F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = llround((F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f); - // grow panel so that screenspace bounding box fits inside "media_region" element of HUD - LLRect media_controls_rect; - S32 volume_slider_height = mVolumeSliderCtrl->getRect().getHeight() - /*fudge*/ 2; - getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_controls_rect); - media_controls_rect.mLeft -= mMediaRegion->getRect().mLeft; - media_controls_rect.mBottom -= mMediaRegion->getRect().mBottom - volume_slider_height; - media_controls_rect.mTop += getRect().getHeight() - mMediaRegion->getRect().mTop; - media_controls_rect.mRight += getRect().getWidth() - mMediaRegion->getRect().mRight; + // grow panel so that screenspace bounding box fits inside "media_region" element of panel + LLRect media_panel_rect; + // Get the height of the controls (less the volume slider) + S32 controls_height = mMediaControlsStack->getRect().getHeight() - mVolumeSliderCtrl->getRect().getHeight(); + getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_panel_rect); + media_panel_rect.mTop += controls_height; - // keep all parts of HUD on-screen - LLRect window_rect = getParent()->getLocalRect(); - media_controls_rect.intersectWith(window_rect); + // keep all parts of panel on-screen + // Area of the top of the world view to avoid putting the controls + window_rect.mTop -= mTopWorldViewAvoidZone; + // Don't include "spacing" bookends on left & right of the media controls + window_rect.mLeft -= mLeftBookend->getRect().getWidth(); + window_rect.mRight += mRightBookend->getRect().getWidth(); + // Don't include the volume slider + window_rect.mBottom -= mVolumeSliderCtrl->getRect().getHeight(); + media_panel_rect.intersectWith(window_rect); // clamp to minimum size, keeping rect inside window - S32 centerX = media_controls_rect.getCenterX(); - S32 centerY = media_controls_rect.getCenterY(); + S32 centerX = media_panel_rect.getCenterX(); + S32 centerY = media_panel_rect.getCenterY(); + // Shrink screen rect by min width and height, to ensure containment window_rect.stretch(-mMinWidth/2, -mMinHeight/2); window_rect.clampPointToRect(centerX, centerY); - media_controls_rect.setCenterAndSize(centerX, centerY, - llmax(mMinWidth, media_controls_rect.getWidth()), llmax(mMinHeight, media_controls_rect.getHeight())); + media_panel_rect.setCenterAndSize(centerX, centerY, + llmax(mMinWidth, media_panel_rect.getWidth()), + llmax(mMinHeight, media_panel_rect.getHeight())); - setShape(media_controls_rect, true); + // Finally set the size of the panel + setShape(media_panel_rect, true); // Test mouse position to see if the cursor is stationary LLCoordWindow cursor_pos_window; @@ -699,13 +695,13 @@ void LLPanelPrimMediaControls::updateShape() /*virtual*/ void LLPanelPrimMediaControls::draw() { - F32 alpha = 1.f; + F32 alpha = getDrawContext().mAlpha; if(mFadeTimer.getStarted()) { F32 time = mFadeTimer.getElapsedTimeF32(); - alpha = llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f); + alpha *= llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f); - if(mFadeTimer.getElapsedTimeF32() >= mControlFadeTime) + if(time >= mControlFadeTime) { if(mClearFaceOnFade) { @@ -726,27 +722,30 @@ void LLPanelPrimMediaControls::draw() // Build rect for icon area in coord system of this panel // Assumes layout_stack is a direct child of this panel mMediaControlsStack->updateLayout(); - LLRect icon_area = mMediaControlsStack->getRect(); - + + // adjust for layout stack spacing + S32 space = mMediaControlsStack->getPanelSpacing() + 1; + LLRect controls_bg_area = mMediaControlsStack->getRect(); + + controls_bg_area.mTop += space; + // adjust to ignore space from volume slider - icon_area.mTop -= mVolumeSliderCtrl->getRect().getHeight(); + controls_bg_area.mBottom += mVolumeSliderCtrl->getRect().getHeight(); // adjust to ignore space from left bookend padding - icon_area.mLeft += mLeftBookend->getRect().getWidth(); + controls_bg_area.mLeft += mLeftBookend->getRect().getWidth() - space; // ignore space from right bookend padding - icon_area.mRight -= mRightBookend->getRect().getWidth(); + controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space; // draw control background UI image - mBackgroundImage->draw( icon_area, UI_VERTEX_COLOR % alpha); + mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); // draw volume slider background UI image if (mVolumeSliderCtrl->getVisible()) { - LLRect volume_slider_rect = mVolumeSliderCtrl->getRect(); - // For some reason the rect is not in the right place (??) - // This translates the bg to under the slider - volume_slider_rect.translate(mVolumeSliderCtrl->getParent()->getRect().mLeft, icon_area.getHeight()); + LLRect volume_slider_rect; + screenRectToLocal(mVolumeSliderCtrl->calcScreenRect(), &volume_slider_rect); mVolumeSliderBackgroundImage->draw(volume_slider_rect, UI_VERTEX_COLOR % alpha); } @@ -1259,6 +1258,11 @@ void LLPanelPrimMediaControls::onToggleMute() { media_impl->setVolume(0.0); } + else if (mVolumeSliderCtrl->getValueF32() == 0.0) + { + media_impl->setVolume(1.0); + mVolumeSliderCtrl->setValue(1.0); + } else { media_impl->setVolume(mVolumeSliderCtrl->getValueF32()); @@ -1271,8 +1275,12 @@ void LLPanelPrimMediaControls::showVolumeSlider() mVolumeSliderVisible++; } - void LLPanelPrimMediaControls::hideVolumeSlider() { mVolumeSliderVisible--; } + +bool LLPanelPrimMediaControls::shouldVolumeSliderBeVisible() +{ + return mVolumeSliderVisible > 0; +} diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index d899ee4473..743cec70a1 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -111,6 +111,7 @@ private: void onToggleMute(); void showVolumeSlider(); void hideVolumeSlider(); + bool shouldVolumeSliderBeVisible(); static void onScrollUp(void* user_data); static void onScrollUpHeld(void* user_data); @@ -155,8 +156,6 @@ private: LLUICtrl *mMediaPlaySliderCtrl; LLUICtrl *mVolumeCtrl; LLButton *mMuteBtn; - LLUICtrl *mVolumeUpCtrl; - LLUICtrl *mVolumeDownCtrl; LLSliderCtrl *mVolumeSliderCtrl; LLIconCtrl *mWhitelistIcon; LLIconCtrl *mSecureLockIcon; @@ -171,6 +170,7 @@ private: F32 mZoomNearPadding; F32 mZoomMediumPadding; F32 mZoomFarPadding; + S32 mTopWorldViewAvoidZone; LLUICtrl *mMediaPanelScroll; LLButton *mScrollUpCtrl; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 245f694ac6..1b8fb49641 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -550,7 +550,7 @@ void LLTeleportHistoryPanel::updateVerbs() LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); - mTeleportBtn->setEnabled(NULL != itemp && itemp->getIndex() < (S32)mTeleportHistory->getItems().size() - 1); + mTeleportBtn->setEnabled(NULL != itemp); mShowOnMapBtn->setEnabled(NULL != itemp); } @@ -723,7 +723,10 @@ void LLTeleportHistoryPanel::onTeleportHistoryChange(S32 removed_index) if (-1 == removed_index) showTeleportHistory(); // recreate all items else + { replaceItem(removed_index); // replace removed item by most recent + updateVerbs(); + } } void LLTeleportHistoryPanel::replaceItem(S32 removed_index) @@ -1033,7 +1036,7 @@ void LLTeleportHistoryPanel::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool bool LLTeleportHistoryPanel::isAccordionCollapsedByUser(LLUICtrl* acc_tab) { LLSD param = acc_tab->getValue(); - if(!param.has("acc_collapsed")) + if(!param.has(COLLAPSED_BY_USER)) { return false; } @@ -1045,4 +1048,11 @@ void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param bool expanded = param.asBoolean(); // Save accordion tab state to restore it in refresh() setAccordionCollapsedByUser(ctrl, !expanded); + + // Reset selection upon accordion being collapsed + // to disable "Teleport" and "Map" buttons for hidden item. + if (!expanded && mLastSelectedFlatlList) + { + mLastSelectedFlatlList->resetSelection(); + } } diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 5a70842a73..fbe68b4d92 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -54,7 +54,7 @@ #include "llcolorswatch.h" #include "lltexturectrl.h" #include "llcombobox.h" -#include "llfirstuse.h" +//#include "llfirstuse.h" #include "llfocusmgr.h" #include "llmanipscale.h" #include "llpreviewscript.h" @@ -470,7 +470,7 @@ void LLPanelVolume::sendIsFlexible() if (is_flexible) { - LLFirstUse::useFlexible(); + //LLFirstUse::useFlexible(); if (objectp->getClickAction() == CLICK_ACTION_SIT) { diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index e2da4c4475..b049f914ad 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -70,7 +70,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); - mAvatarListDoubleClickConnection = mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); + mAvatarListDoubleClickConnection = mAvatarList->setItemDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, _1)); mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); // Set onAvatarListDoubleClicked as default on_return action. mAvatarListReturnConnection = mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); @@ -132,10 +132,15 @@ void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible) mAvatarList->setSpeakingIndicatorsVisible(visible); }; -void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) +void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl) { - // NOTE(EM): Should we check if there is multiple selection and start conference if it is so? - LLUUID clicked_id = list->getSelectedUUID(); + LLAvatarListItem* item = dynamic_cast(ctrl); + if(!item) + { + return; + } + + LLUUID clicked_id = item->getAvatarId(); if (clicked_id.isNull() || clicked_id == gAgent.getID()) return; @@ -166,7 +171,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { name.erase(found, moderator_indicator_len); item->setName(name); - item->reshapeAvatarName(); } } } @@ -188,7 +192,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) name += " "; name += moderator_indicator; item->setName(name); - item->reshapeAvatarName(); } } } @@ -279,6 +282,9 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer e mModeratorList.erase(id); } } + + // apply changes immediately + onAvatarListRefreshed(mAvatarList, LLSD()); } } return true; @@ -576,7 +582,7 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata) { std::string item = userdata.asString(); - if (item == "can_mute_text" || "can_block" == item) + if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item) { return mUUIDs.front() != gAgentID; } @@ -592,8 +598,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& if (speakerp.notNull()) { // not in voice participants can not be moderated - return speakerp->mStatus == LLSpeaker::STATUS_VOICE_ACTIVE - || speakerp->mStatus == LLSpeaker::STATUS_MUTED; + return speakerp->isInVoiceChannel(); } } return false; diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 70badbc40d..e1b1b5af00 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -232,7 +232,7 @@ class LLParticipantList }; private: - void onAvatarListDoubleClicked(LLAvatarList* list); + void onAvatarListDoubleClicked(LLUICtrl* ctrl); void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); /** diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 2a40cbaba0..84bdaafacf 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -364,6 +364,12 @@ BOOL LLPreviewGesture::postBuild() LLTextBox* text; LLCheckBoxCtrl* check; + edit = getChild("name"); + edit->setKeystrokeCallback(onKeystrokeCommit, this); + + edit = getChild("desc"); + edit->setKeystrokeCallback(onKeystrokeCommit, this); + edit = getChild("trigger_editor"); edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitCallback(onCommitSetDirty, this); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 95756ac5f3..cc70360528 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -55,7 +55,6 @@ #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "lldir.h" -//#include "llfloaterchat.h" #include "llviewerstats.h" #include "llviewercontrol.h" // gSavedSettings #include "llappviewer.h" // app_abort_quit() diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 646c9fb6a4..fccf71f3cb 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -79,7 +79,6 @@ #include "llslider.h" #include "lldir.h" #include "llcombobox.h" -//#include "llfloaterchat.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerwindow.h" -- cgit v1.2.3 From ddc403aec0cf1c78f7206e4706e810b8659627a2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 14:40:15 +0100 Subject: ssreflections: reflect sunlight direction for reflection. dunno how I feel about this yet. --- .../newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 155f03fdcf..51d737f10b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -310,8 +310,11 @@ void main() // darken reflections from points which face away from the reflected ray - our guess was a back-face //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point - float reflit = max(dot(refn, lightnorm.xyz), 0.0); + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; vec3 ssshiny = (refprod * spec.a); -- cgit v1.2.3 From 1841fa97279aa08cbdfbce200586bad2fae328e4 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 14:50:24 +0100 Subject: ssreflections: use the minimum of the lighting dp and the appropriateness. not the product. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 51d737f10b..8b2b983ba4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -317,6 +317,8 @@ void main() float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together -- cgit v1.2.3 From ca1313e329dc01193fa771a0718a3c058b19819c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 15:20:35 +0100 Subject: ssreflections: water reflections strongly imply that the non-perspective reflection from eye is the right one. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 8b2b983ba4..25733e80d1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -282,7 +282,8 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); + //vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnorm, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; -- cgit v1.2.3 From cb689a7bdf674cf76b96efaa651a58dcf1f84d30 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 15:46:47 +0100 Subject: ssreflections: perspective reflection for sunlight, planar reflection for ssreflection --- .../newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 25733e80d1..d00d3ed412 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -282,13 +282,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); - //vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; -- cgit v1.2.3 From f9256879c77eca885b478267d9ba3baf3354bfa1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 15:59:11 +0100 Subject: clean-up transplant --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index d00d3ed412..503c7d0b83 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -317,7 +317,6 @@ void main() vec3 reflight = reflect(lightnorm.xyz, norm.xyz); float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); -- cgit v1.2.3 From e9d8427d0542ebd147ad9680deba61e283f032ac Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 16:03:20 +0100 Subject: apply ssreflection changes to class2 and class3 too. --- .../shaders/class2/deferred/softenLightF.glsl | 13 +++++++++---- .../shaders/class3/deferred/softenLightF.glsl | 15 ++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 922a07c306..d6fbae7b22 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -281,12 +281,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; @@ -311,9 +312,13 @@ void main() //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ddd69befc3..ecfd9bef52 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -284,12 +284,13 @@ void main() { // the old infinite-sky shiny reflection // - vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnorm, vary_light.xyz); + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; // screen-space cheap fakey reflection map // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); depth -= 0.5; // unbias depth // first figure out where we'll make our 2D guess from vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; @@ -313,10 +314,14 @@ void main() // darken reflections from points which face away from the reflected ray - our guess was a back-face //refapprop *= step(dot(refnorm, refn), 0.0); refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point - float reflit = min(max(dot(refn, lightnorm.xyz), 0.0), refshad); + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); // apply sun color to guess-point, dampen according to inappropriateness of guess - vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop; + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 ssshiny = (refprod * spec.a); // add the two types of shiny together -- cgit v1.2.3 From 45a99b8d0d061e5c703141e51f19579b0de00f02 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 2 Apr 2010 16:09:31 +0100 Subject: ssreflection: restore the shadow factor I accidentally removed with the last update. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index d6fbae7b22..00a6a9dcb5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -315,7 +315,7 @@ void main() // reflect light direction to increase the illusion that // these are reflections. vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = max(dot(refn, reflight.xyz), 0.0); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ecfd9bef52..aaa74eb7df 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -318,7 +318,7 @@ void main() // reflect light direction to increase the illusion that // these are reflections. vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = max(dot(refn, reflight.xyz), 0.0); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); // apply sun color to guess-point, dampen according to inappropriateness of guess float refmod = min(refapprop, reflit); vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; -- cgit v1.2.3 From 368d930b3fd80a180b3403337fdc2a7dba860a3f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 22:24:57 +0100 Subject: extra diffuse sample in ssreflection to decrease aliasing. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 503c7d0b83..3f4425a0b2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -298,13 +298,18 @@ void main() // of the diffuse map. LOD would be better in that regard. // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination // get attributes from the 2D guess point float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); -- cgit v1.2.3 From 09f2898df7956d3c6ad0a04af53e0e71b63b4bde Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 7 Apr 2010 09:45:20 +0100 Subject: tidy up ssreflections comments and structure a bit. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 3f4425a0b2..158eef9319 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -298,18 +298,20 @@ void main() // of the diffuse map. LOD would be better in that regard. // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. - // --------------------- - // ^ ^ ^ ^ ^ - // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point - float refdepth = texture2DRect(depthMap, ref2d).a; - vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); -- cgit v1.2.3 From 429beb3049dd0bac811de2faf4501f2fab597d2f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 7 Apr 2010 10:31:56 +0100 Subject: apply latest ssreflections tweaks to class2 and class3. --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 13 ++++++++++--- .../app_settings/shaders/class3/deferred/softenLightF.glsl | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 00a6a9dcb5..dbccb7fb8b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -298,12 +298,19 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; float refshad = texture2DRect(lightMap, ref2d).r; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index aaa74eb7df..ef81ed1308 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -301,12 +301,19 @@ void main() // The goal of the blur is to soften reflections in surfaces // with low shinyness, and also to disguise our lameness. float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); + vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5); + ref2d += checkoffset; ref2d += tc.xy; // use as offset from destination - // get attributes from the 2D guess point + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + // --------------------- + // ^ ^ ^ ^ ^ + // a . b o c . d check=0:avg(a,b) check=1:avg(c,d) + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb + + texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb; float refshad = texture2DRect(lightMap, ref2d).r; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); // figure out how appropriate our guess actually was -- cgit v1.2.3 From 6a3c28395343e8ac767c9d66198762fc6e9197c5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 7 Apr 2010 16:06:13 +0100 Subject: merge fix. --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 21052775bd..efb99061ab 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3420,7 +3420,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) glLoadMatrixd(gGLModelView); doOcclusion(camera); gGLLastMatrix = NULL; - glLoadMatrix(gGLModelView); + glLoadMatrixd(gGLModelView); } } -- cgit v1.2.3 From dc8f5a7b03a7ab19d134b4da9060028fd7db1cce Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 12:50:28 +0000 Subject: Backed out changeset f196197a816a --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llviewercontrol.cpp | 1 + indra/newview/llviewerwindow.cpp | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c570578e63..ef1a7b670f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7430,7 +7430,7 @@ Type Boolean Value - 0 + 1 RenderUIBuffer diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 0a1108c3c3..d14b8595eb 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -512,6 +512,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 96d9f2713e..35632a745e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1377,7 +1377,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - gSavedSettings.getU32("RenderFSAASamples")); + 0); //gSavedSettings.getU32("RenderFSAASamples")); if (!LLAppViewer::instance()->restoreErrorTrap()) { @@ -4594,8 +4594,9 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, return TRUE; } - U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); - U32 old_fsaa = mWindow->getFSAASamples(); + //U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); + //U32 old_fsaa = mWindow->getFSAASamples(); + // going from windowed to windowed if (!old_fullscreen && !fullscreen) { @@ -4605,7 +4606,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, mWindow->setSize(size); } - if (fsaa == old_fsaa) + //if (fsaa == old_fsaa) { return TRUE; } @@ -4634,13 +4635,13 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, gSavedSettings.setS32("WindowY", old_pos.mY); } - mWindow->setFSAASamples(fsaa); + //mWindow->setFSAASamples(fsaa); result_first_try = mWindow->switchContext(fullscreen, size, disable_vsync); if (!result_first_try) { // try to switch back - mWindow->setFSAASamples(old_fsaa); + //mWindow->setFSAASamples(old_fsaa); result_second_try = mWindow->switchContext(old_fullscreen, old_size, disable_vsync); if (!result_second_try) -- cgit v1.2.3 From f841d1499a6d3589c86ad4dcba6b138949f5dabc Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 20 Feb 2010 17:50:18 +0000 Subject: raise RenderDeferredSSAOMaxScale from 60 to 200. This is fine. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8b66cce8a3..6bfa42785f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6094,7 +6094,7 @@ Type U32 Value - 60 + 200 RenderSSAOFactor -- cgit v1.2.3 From 0f61c00218a07a7d487e33256382c4a10561e0c1 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 22 Feb 2010 16:50:46 +0000 Subject: Enumerate available voice fonts. --- indra/newview/llvoiceclient.cpp | 124 ++++++++++++++++++++++++++++++++++++++++ indra/newview/llvoiceclient.h | 38 ++++++++++-- 2 files changed, 158 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 59606f17b2..92dfa6d30e 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -240,6 +240,12 @@ protected: std::string audioMediaString; std::string displayNameString; std::string deviceString; + std::string idString; + std::string descriptionString; + std::string expirationDateString; + bool hasExpired; + std::string fontTypeString; + std::string fontStatusString; int participantType; bool isLocallyMuted; bool isModeratorMuted; @@ -625,6 +631,34 @@ void LLVivoxProtocolParser::EndTag(const char *tag) autoAcceptMask = string; else if (!stricmp("AutoAddAsBuddy", tag)) autoAddAsBuddy = string; + else if (!stricmp("SessionFont", tag)) + { + gVoiceClient->addSessionFont(idString, nameString, descriptionString, expirationDateString, hasExpired, fontTypeString, fontStatusString); + } + else if (!stricmp("ID", tag)) + { + idString = string; + } + else if (!stricmp("Description", tag)) + { + descriptionString = string; + } + else if (!stricmp("ExpirationDate", tag)) + { + expirationDateString = string; + } + else if (!stricmp("Expired", tag)) + { + hasExpired = !stricmp(string.c_str(), "1"); + } + else if (!stricmp("Type", tag)) + { + fontTypeString = string; + } + else if (!stricmp("Status", tag)) + { + fontStatusString = string; + } else if (!stricmp("MessageHeader", tag)) messageHeader = string; else if (!stricmp("MessageBody", tag)) @@ -895,6 +929,10 @@ void LLVivoxProtocolParser::processResponse(std::string tag) { gVoiceClient->accountListAutoAcceptRulesResponse(statusCode, statusString); } + else if (!stricmp(actionCstr, "Account.GetSessionFonts.1")) + { + gVoiceClient->accountGetSessionFontsResponse(statusCode, statusString); + } else if (!stricmp(actionCstr, "Session.Set3DPosition.1")) { // We don't need to process these, but they're so spammy we don't want to log them. @@ -1243,6 +1281,9 @@ LLVoiceClient::LLVoiceClient() : mBuddyListMapPopulated(false), mBlockRulesListReceived(false), mAutoAcceptRulesListReceived(false), + + mSessionFontsReceived(false), + mCaptureDeviceDirty(false), mRenderDeviceDirty(false), mSpatialCoordsDirty(false), @@ -2156,6 +2197,9 @@ void LLVoiceClient::stateMachine() notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN); + // request the set of available voice fonts + accountGetSessionFontsSendMessage(); + // request the current set of block rules (we'll need them when updating the friends list) accountListBlockRulesSendMessage(); @@ -2641,6 +2685,24 @@ void LLVoiceClient::accountListAutoAcceptRulesSendMessage() } } +void LLVoiceClient::accountGetSessionFontsSendMessage() +{ + if(!mAccountHandle.empty()) + { + std::ostringstream stream; + + LL_DEBUGS("Voice") << "requesting session font list" << LL_ENDL; + + stream + << "" + << "" << mAccountHandle << "" + << "" + << "\n\n\n"; + + writeString(stream.str()); + } +} + void LLVoiceClient::sessionGroupCreateSendMessage() { if(!mAccountHandle.empty()) @@ -2691,6 +2753,7 @@ void LLVoiceClient::sessionCreateSendMessage(sessionState *session, bool startAu stream << "" << (startAudio?"true":"false") << "" << "" << (startText?"true":"false") << "" +// << "0" << "" << mChannelName << "" << "\n\n\n"; writeString(stream.str()); @@ -2766,6 +2829,21 @@ void LLVoiceClient::sessionTextConnectSendMessage(sessionState *session) writeString(stream.str()); } +void LLVoiceClient::sessionSetVoiceFontSendMessage(sessionState *session, const std::string &fontId) +{ + LL_DEBUGS("Voice") << "selecting voice font: " << fontId << " in session handle: " << session->mHandle << LL_ENDL; + + std::ostringstream stream; + + stream + << "" + << "" << session->mHandle << "" + << "" << fontId << "" + << "\n\n\n"; + + writeString(stream.str()); +} + void LLVoiceClient::sessionTerminate() { mSessionTerminateRequested = true; @@ -6958,6 +7036,46 @@ void LLVoiceClient::addAutoAcceptRule(const std::string &autoAcceptMask, const s } } +LLVoiceClient::voiceFontEntry::voiceFontEntry(const std::string &id) : + mID(id), + mHasExpired(false) +{ +} + +LLVoiceClient::voiceFontEntry *LLVoiceClient::addSessionFont(const std::string &id, + const std::string &name, + const std::string &description, + const std::string &expirationDate, + const bool hasExpired, + const std::string &fontType, + const std::string &fontStatus) +{ + voiceFontEntry *font = NULL; + + voiceFontMap::iterator iter = mSessionFontMap.find(&id); + if(iter != mSessionFontMap.end()) + { + // Found session font already in the map. + LL_DEBUGS("Voice") << "existing session font " << id << " : " << name << LL_ENDL; + font = iter->second; + } + + if(font == NULL) + { + LL_DEBUGS("Voice") << "adding session font " << id << " : " << name << (hasExpired?" (Expired)":"") << LL_ENDL; + font = new voiceFontEntry(id); + font->mName = name; + font->mDescription = description; + font->mExpirationDate = expirationDate; + font->mHasExpired = hasExpired; + font->mFontType = fontType; + font->mFontStatus = fontStatus; + + mSessionFontMap.insert(voiceFontMap::value_type(&(font->mID), font)); + } + return font; +} + void LLVoiceClient::accountListBlockRulesResponse(int statusCode, const std::string &statusString) { // Block list entries were updated via addBlockRule() during parsing. Just flag that we're done. @@ -6970,6 +7088,12 @@ void LLVoiceClient::accountListAutoAcceptRulesResponse(int statusCode, const std mAutoAcceptRulesListReceived = true; } +void LLVoiceClient::accountGetSessionFontsResponse(int statusCode, const std::string &statusString) +{ + // Session font list entries were updated via addSessionFont() during parsing. Just flag that we're done. + mSessionFontsReceived = true; +} + void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) { mParticipantObservers.insert(observer); diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index a96cf18e27..05624bcefd 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -424,8 +424,32 @@ static void updatePosition(void); void deleteAllAutoAcceptRules(void); void addAutoAcceptRule(const std::string &autoAcceptMask, const std::string &autoAddAsBuddy); void accountListBlockRulesResponse(int statusCode, const std::string &statusString); - void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString); - + void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString); + + struct voiceFontEntry + { + voiceFontEntry(const std::string &id); + // *TODO: Decide which of these we don't need to store + std::string mID; + std::string mName; + std::string mDescription; + std::string mExpirationDate; + bool mHasExpired; + std::string mFontType; + std::string mFontStatus; + }; + + typedef std::map voiceFontMap; + + voiceFontEntry *addSessionFont(const std::string &id, + const std::string &name, + const std::string &description, + const std::string &expirationDate, + const bool hasExpired, + const std::string &fontType, + const std::string &fontStatus); + void accountGetSessionFontsResponse(int statusCode, const std::string &statusString); + ///////////////////////////// // session control messages void connectorCreate(); @@ -447,12 +471,15 @@ static void updatePosition(void); void accountListBlockRulesSendMessage(); void accountListAutoAcceptRulesSendMessage(); - + + void accountGetSessionFontsSendMessage(); + void sessionGroupCreateSendMessage(); void sessionCreateSendMessage(sessionState *session, bool startAudio = true, bool startText = false); void sessionGroupAddSessionSendMessage(sessionState *session, bool startAudio = true, bool startText = false); void sessionMediaConnectSendMessage(sessionState *session); // just joins the audio session void sessionTextConnectSendMessage(sessionState *session); // just joins the text session + void sessionSetVoiceFontSendMessage(sessionState *session, const std::string &fontId); void sessionTerminateSendMessage(sessionState *session); void sessionGroupTerminateSendMessage(sessionState *session); void sessionMediaDisconnectSendMessage(sessionState *session); @@ -653,7 +680,10 @@ static void updatePosition(void); bool mBlockRulesListReceived; bool mAutoAcceptRulesListReceived; buddyListMap mBuddyListMap; - + + bool mSessionFontsReceived; + voiceFontMap mSessionFontMap; + deviceList mCaptureDevices; deviceList mRenderDevices; -- cgit v1.2.3 From 5518e15f89359ba1627633f59f7299b69fc2bd69 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 22 Feb 2010 16:52:23 +0000 Subject: Added stateFontListReceived to the voice client state machine. This makes sure we have the voice font list before attempting to start a session. --- indra/newview/llvoiceclient.cpp | 11 +++++++++++ indra/newview/llvoiceclient.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 92dfa6d30e..de4e53f52c 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1622,6 +1622,7 @@ std::string LLVoiceClient::state2string(LLVoiceClient::state inState) CASE(stateNeedsLogin); CASE(stateLoggingIn); CASE(stateLoggedIn); + CASE(stateFontListReceived); CASE(stateCreatingSessionGroup); CASE(stateNoChannel); CASE(stateJoiningSession); @@ -2231,6 +2232,11 @@ void LLVoiceClient::stateMachine() writeString(stream.str()); } } + + // accountGetSessionFontsResponse() will transition from here to stateFontListReceived. + + //MARK: stateFontListReceived + case stateFontListReceived: // font list received #if USE_SESSION_GROUPS // create the main session group @@ -7092,6 +7098,11 @@ void LLVoiceClient::accountGetSessionFontsResponse(int statusCode, const std::st { // Session font list entries were updated via addSessionFont() during parsing. Just flag that we're done. mSessionFontsReceived = true; + + if(getState() == stateLoggedIn) + { + setState(stateFontListReceived); + } } void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 05624bcefd..2d8fff5508 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -429,7 +429,6 @@ static void updatePosition(void); struct voiceFontEntry { voiceFontEntry(const std::string &id); - // *TODO: Decide which of these we don't need to store std::string mID; std::string mName; std::string mDescription; @@ -584,6 +583,7 @@ static void updatePosition(void); stateNeedsLogin, // send login request stateLoggingIn, // waiting for account handle stateLoggedIn, // account handle received + stateFontListReceived, // List of available voice fonts received stateCreatingSessionGroup, // Creating the main session group stateNoChannel, // stateJoiningSession, // waiting for session handle -- cgit v1.2.3 From 65bd49f15fff33c574b599aac76335dcf74b1c74 Mon Sep 17 00:00:00 2001 From: Palmer Truelson Date: Thu, 25 Feb 2010 16:02:23 -0800 Subject: Turn of FBOs on x1600 on mac --- indra/newview/featuretable_mac.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 12d47a904c..db0252d2e7 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -366,6 +366,7 @@ list ATI_Radeon_X1500 Disregard128DefaultDrawDistance 1 0 list ATI_Radeon_X1600 Disregard128DefaultDrawDistance 1 0 +RenderUseFBO 0 0 list ATI_Radeon_X1700 Disregard128DefaultDrawDistance 1 0 list ATI_Mobility_Radeon_X1xxx -- cgit v1.2.3 From eb5b0f2542c16aaac2283d4050a4cc2a3c6691f8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 4 Mar 2010 15:30:15 -0600 Subject: Optimiziation pass. Added RenderUseStreamVBO to enable/disable usage of VBO's for streaming buffers. Faster traversal of LLCullResult members. Removal of llpushcallstacks from inner loops. Sprinkling in fast timers. --- indra/newview/app_settings/settings.xml | 11 +++ indra/newview/lldrawable.cpp | 7 ++ indra/newview/lldrawpool.cpp | 2 +- indra/newview/lldrawpoolalpha.cpp | 132 ++++++++++++++++---------------- indra/newview/lldrawpoolbump.cpp | 4 +- indra/newview/llface.cpp | 4 +- indra/newview/llspatialpartition.cpp | 36 +++++++-- indra/newview/llspatialpartition.h | 7 ++ indra/newview/llviewercontrol.cpp | 1 + indra/newview/llvovolume.cpp | 6 +- indra/newview/pipeline.cpp | 21 ++++- 11 files changed, 146 insertions(+), 85 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6bfa42785f..1dc90280a2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7542,6 +7542,17 @@ Value 1 + RenderUseStreamVBO + + Comment + Use VBO's for stream buffers + Persist + 1 + Type + Boolean + Value + 1 + RenderVolumeLODFactor Comment diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 38eda5bd2e..013577261c 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -673,8 +673,11 @@ BOOL LLDrawable::updateMoveDamped() return done_moving; } +static LLFastTimer::DeclareTimer FTM_UPDATE_DISTANCE("Update Distance"); + void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { + LLFastTimer t(FTM_UPDATE_DISTANCE); if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { llerrs << "WTF?" << llendl; @@ -1307,8 +1310,12 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* } } +static LLFastTimer::DeclareTimer FTM_BRIDGE_DISTANCE_UPDATE("Bridge Distance"); + void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { + LLFastTimer t(FTM_BRIDGE_DISTANCE_UPDATE); + if (mDrawable == NULL) { markDead(); diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index ef946ac49e..ae30af3647 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -442,7 +442,6 @@ void LLRenderPass::renderTexture(U32 type, U32 mask) void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture) { - llpushcallstacks ; for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i) { LLDrawInfo* pparams = *i; @@ -475,6 +474,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) { if (params.mTexture.notNull()) { + params.mTexture->addTextureStats(params.mVSize); gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; if (params.mTextureMatrix) { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 875c9ac6a9..75973cfa54 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -294,96 +294,98 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) LLRenderPass::applyModelMatrix(params); - if (params.mFullbright) { - // Turn off lighting if it hasn't already been so. - if (light_enabled || !initialized_lighting) + if (params.mFullbright) + { + // Turn off lighting if it hasn't already been so. + if (light_enabled || !initialized_lighting) + { + initialized_lighting = TRUE; + if (use_shaders) + { + target_shader = fullbright_shader; + } + else + { + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + } + light_enabled = FALSE; + } + } + // Turn on lighting if it isn't already. + else if (!light_enabled || !initialized_lighting) { initialized_lighting = TRUE; if (use_shaders) { - target_shader = fullbright_shader; + target_shader = simple_shader; } else { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + gPipeline.enableLightsDynamic(); } - light_enabled = FALSE; + light_enabled = TRUE; } - } - // Turn on lighting if it isn't already. - else if (!light_enabled || !initialized_lighting) - { - initialized_lighting = TRUE; - if (use_shaders) - { - target_shader = simple_shader; - } - else - { - gPipeline.enableLightsDynamic(); - } - light_enabled = TRUE; - } - // If we need shaders, and we're not ALREADY using the proper shader, then bind it - // (this way we won't rebind shaders unnecessarily). - if(use_shaders && (current_shader != target_shader)) - { - llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } - current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else + // If we need shaders, and we're not ALREADY using the proper shader, then bind it + // (this way we won't rebind shaders unnecessarily). + if(use_shaders && (current_shader != target_shader)) { - current_shader->bind(); + llassert(target_shader != NULL); + if (deferred_render && current_shader != NULL) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + current_shader = target_shader; + if (deferred_render) + { + gPipeline.bindDeferredShader(*current_shader); + diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + } + else + { + current_shader->bind(); + } } - } - else if (!use_shaders && current_shader != NULL) - { - if (deferred_render) + else if (!use_shaders && current_shader != NULL) { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; + if (deferred_render) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + LLGLSLShader::bindNoShader(); + current_shader = NULL; } - LLGLSLShader::bindNoShader(); - current_shader = NULL; - } - - if (params.mGroup) - { - params.mGroup->rebuildMesh(); - } - - if (params.mTexture.notNull()) - { - gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); - if(params.mTexture.notNull()) + if (params.mGroup) { - params.mTexture->addTextureStats(params.mVSize); + params.mGroup->rebuildMesh(); } - if (params.mTextureMatrix) + + + if (params.mTexture.notNull()) { - gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); - gPipeline.mTextureMatrixOps++; + gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); + if(params.mTexture.notNull()) + { + params.mTexture->addTextureStats(params.mVSize); + } + if (params.mTextureMatrix) + { + gGL.getTexUnit(0)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; + } } } params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - + if (params.mTextureMatrix && params.mTexture.notNull()) { gGL.getTexUnit(0)->activate(); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index a4a8dc80b5..8f3e775976 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -837,7 +837,6 @@ void LLBumpImageList::addTextureStats(U8 bump, const LLUUID& base_image_id, F32 void LLBumpImageList::updateImages() { - llpushcallstacks ; for (bump_image_map_t::iterator iter = mBrightnessEntries.begin(); iter != mBrightnessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -864,7 +863,7 @@ void LLBumpImageList::updateImages() } } } - llpushcallstacks ; + for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -891,7 +890,6 @@ void LLBumpImageList::updateImages() } } } - llpushcallstacks ; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 9de69a8173..8d86070bdf 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -862,12 +862,14 @@ void LLFace::updateRebuildFlags() } } +static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); + BOOL LLFace::getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, const U16 &index_offset) { - llpushcallstacks ; + LLFastTimer t(FTM_FACE_GET_GEOM); const LLVolumeFace &vf = volume.getVolumeFace(f); S32 num_vertices = (S32)vf.mVertices.size(); S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d6e9256fee..cf1e3bf186 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1513,6 +1513,7 @@ void LLSpatialGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) { + LLFastTimer t(FTM_OCCLUSION_READBACK); LLSpatialGroup* parent = getParent(); if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED)) { //if the parent has been marked as occluded, the child is implicitly occluded @@ -1520,7 +1521,6 @@ void LLSpatialGroup::checkOcclusion() } else if (isOcclusionState(QUERY_PENDING)) { //otherwise, if a query is pending, read it back - LLFastTimer t(FTM_OCCLUSION_READBACK); GLuint res = 1; if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { @@ -3423,11 +3423,23 @@ LLCullResult::LLCullResult() void LLCullResult::clear() { mVisibleGroupsSize = 0; + mVisibleGroupsEnd = mVisibleGroups.begin(); + mAlphaGroupsSize = 0; + mAlphaGroupsEnd = mAlphaGroups.begin(); + mOcclusionGroupsSize = 0; + mOcclusionGroupsEnd = mOcclusionGroups.begin(); + mDrawableGroupsSize = 0; + mDrawableGroupsEnd = mDrawableGroups.begin(); + mVisibleListSize = 0; + mVisibleListEnd = mVisibleList.begin(); + mVisibleBridgeSize = 0; + mVisibleBridgeEnd = mVisibleBridge.begin(); + for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) { @@ -3436,6 +3448,7 @@ void LLCullResult::clear() mRenderMap[i][j] = 0; } mRenderMapSize[i] = 0; + mRenderMapEnd[i] = mRenderMap[i].begin(); } } @@ -3446,7 +3459,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups() LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups() { - return mVisibleGroups.begin() + mVisibleGroupsSize; + return mVisibleGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() @@ -3456,7 +3469,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups() { - return mAlphaGroups.begin() + mAlphaGroupsSize; + return mAlphaGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() @@ -3466,7 +3479,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups() { - return mOcclusionGroups.begin() + mOcclusionGroupsSize; + return mOcclusionGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() @@ -3476,7 +3489,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups() { - return mDrawableGroups.begin() + mDrawableGroupsSize; + return mDrawableGroupsEnd; } LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() @@ -3486,7 +3499,7 @@ LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList() { - return mVisibleList.begin() + mVisibleListSize; + return mVisibleListEnd; } LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() @@ -3496,7 +3509,7 @@ LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge() { - return mVisibleBridge.begin() + mVisibleBridgeSize; + return mVisibleBridgeEnd; } LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) @@ -3506,7 +3519,7 @@ LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type) { - return mRenderMap[type].begin() + mRenderMapSize[type]; + return mRenderMapEnd[type]; } void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) @@ -3520,6 +3533,7 @@ void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) mVisibleGroups.push_back(group); } ++mVisibleGroupsSize; + mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize; } void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) @@ -3533,6 +3547,7 @@ void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) mAlphaGroups.push_back(group); } ++mAlphaGroupsSize; + mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize; } void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) @@ -3546,6 +3561,7 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) mOcclusionGroups.push_back(group); } ++mOcclusionGroupsSize; + mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize; } void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) @@ -3559,6 +3575,7 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) mDrawableGroups.push_back(group); } ++mDrawableGroupsSize; + mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize; } void LLCullResult::pushDrawable(LLDrawable* drawable) @@ -3572,6 +3589,7 @@ void LLCullResult::pushDrawable(LLDrawable* drawable) mVisibleList.push_back(drawable); } ++mVisibleListSize; + mVisibleListEnd = mVisibleList.begin()+mVisibleListSize; } void LLCullResult::pushBridge(LLSpatialBridge* bridge) @@ -3585,6 +3603,7 @@ void LLCullResult::pushBridge(LLSpatialBridge* bridge) mVisibleBridge.push_back(bridge); } ++mVisibleBridgeSize; + mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize; } void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) @@ -3598,6 +3617,7 @@ void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) mRenderMap[type].push_back(draw_info); } ++mRenderMapSize[type]; + mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type]; } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 7896488379..de3745a1a3 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -534,12 +534,19 @@ private: U32 mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES]; sg_list_t mVisibleGroups; + sg_list_t::iterator mVisibleGroupsEnd; sg_list_t mAlphaGroups; + sg_list_t::iterator mAlphaGroupsEnd; sg_list_t mOcclusionGroups; + sg_list_t::iterator mOcclusionGroupsEnd; sg_list_t mDrawableGroups; + sg_list_t::iterator mDrawableGroupsEnd; drawable_list_t mVisibleList; + drawable_list_t::iterator mVisibleListEnd; bridge_list_t mVisibleBridge; + bridge_list_t::iterator mVisibleBridgeEnd; drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; + drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES]; }; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 6f037177fa..51a1ae901e 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -576,6 +576,7 @@ void settings_setup_listeners() gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); + gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8a77461369..073d7c2b91 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3304,7 +3304,6 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { - llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3533,9 +3532,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); + void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { - llpushcallstacks ; llassert(group); if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { @@ -3546,6 +3546,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { + LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3627,7 +3628,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { - llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3d700abd01..1ae8bc5481 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -361,6 +361,7 @@ void LLPipeline::init() sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); + LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); @@ -1725,8 +1726,12 @@ void LLPipeline::markOccluder(LLSpatialGroup* group) } } +static LLFastTimer::DeclareTimer FTM_DO_OCCLUSION("Do Occlusion"); + void LLPipeline::doOcclusion(LLCamera& camera) { + LLFastTimer t(FTM_DO_OCCLUSION); + LLVertexBuffer::unbind(); if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) @@ -1799,7 +1804,6 @@ void LLPipeline::rebuildPriorityGroups() void LLPipeline::rebuildGroups() { - llpushcallstacks ; // Iterate through some drawables on the non-priority build queue S32 size = (S32) mGroupQ2.size(); S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size); @@ -1944,9 +1948,13 @@ void LLPipeline::updateGeom(F32 max_dtime) updateMovedList(mMovedBridge); } +static LLFastTimer::DeclareTimer FTM_MARK_VISIBLE("Mark Visible"); + void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); + LLFastTimer t(FTM_MARK_VISIBLE); + if(!drawablep || drawablep->isDead()) { return; @@ -4630,8 +4638,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) mLightMask = 0; } +static LLFastTimer::DeclareTimer FTM_ENABLE_LIGHTS("Enable Lights"); + void LLPipeline::enableLights(U32 mask) { + LLFastTimer ftm(FTM_ENABLE_LIGHTS); + assertInitialized(); if (mLightingDetail == 0) @@ -4737,16 +4749,16 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) enableLights(mask); glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); - if (mLightingDetail >= 2) + /*if (mLightingDetail >= 2) { glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default - } + }*/ } void LLPipeline::disableLights() { enableLights(0); // no lighting (full bright) - glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default + //glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default } //============================================================================ @@ -5349,6 +5361,7 @@ void LLPipeline::resetVertexBuffers() { sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); + LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) -- cgit v1.2.3 From c52ed438fb84c59435867c8752e04095a2a598ef Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 5 Mar 2010 10:49:05 -0600 Subject: Remove some fast timers that were being futzy. --- indra/newview/lldrawable.cpp | 7 ------- indra/newview/pipeline.cpp | 13 ++----------- 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 013577261c..38eda5bd2e 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -673,11 +673,8 @@ BOOL LLDrawable::updateMoveDamped() return done_moving; } -static LLFastTimer::DeclareTimer FTM_UPDATE_DISTANCE("Update Distance"); - void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { - LLFastTimer t(FTM_UPDATE_DISTANCE); if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { llerrs << "WTF?" << llendl; @@ -1310,12 +1307,8 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* } } -static LLFastTimer::DeclareTimer FTM_BRIDGE_DISTANCE_UPDATE("Bridge Distance"); - void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { - LLFastTimer t(FTM_BRIDGE_DISTANCE_UPDATE); - if (mDrawable == NULL) { markDead(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1ae8bc5481..2f4314f7e5 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -510,6 +510,7 @@ void LLPipeline::destroyGL() } static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); + void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -1726,12 +1727,8 @@ void LLPipeline::markOccluder(LLSpatialGroup* group) } } -static LLFastTimer::DeclareTimer FTM_DO_OCCLUSION("Do Occlusion"); - void LLPipeline::doOcclusion(LLCamera& camera) { - LLFastTimer t(FTM_DO_OCCLUSION); - LLVertexBuffer::unbind(); if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) @@ -1948,12 +1945,9 @@ void LLPipeline::updateGeom(F32 max_dtime) updateMovedList(mMovedBridge); } -static LLFastTimer::DeclareTimer FTM_MARK_VISIBLE("Mark Visible"); - void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); - LLFastTimer t(FTM_MARK_VISIBLE); if(!drawablep || drawablep->isDead()) { @@ -4638,12 +4632,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) mLightMask = 0; } -static LLFastTimer::DeclareTimer FTM_ENABLE_LIGHTS("Enable Lights"); - void LLPipeline::enableLights(U32 mask) { - LLFastTimer ftm(FTM_ENABLE_LIGHTS); - assertInitialized(); if (mLightingDetail == 0) @@ -5497,6 +5487,7 @@ void LLPipeline::bindScreenToTexture() } static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom"); + void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); -- cgit v1.2.3 From 69befdfb34db1a18170de5e75f3076e4cbe5dc53 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 5 Mar 2010 10:49:52 -0600 Subject: Fix for sun specular highlights showing up in shadow when diffuse ambiance greater than 0. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 531f7376a3..249ac7ef9b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -275,7 +275,7 @@ void main() { vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + col.rgb += vary_SunlitColor*scol_ambocc.r*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); -- cgit v1.2.3 From c986e5c86343da17cf9565ee14ff1cf7d83770b4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 5 Mar 2010 10:50:29 -0600 Subject: Fix for avatar eyes not showing up when deferred rendering enabled. --- indra/newview/lldrawpoolavatar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 546b60f286..012e41383f 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -157,6 +157,8 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = TRUE; + if (LLPipeline::sImpostorRender) { beginDeferredSkinned(); @@ -181,6 +183,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = FALSE; + if (LLPipeline::sImpostorRender) { endDeferredSkinned(); @@ -564,7 +568,6 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginDeferredSkinned() { - sSkipTransparent = TRUE; sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarProgram; @@ -579,7 +582,6 @@ void LLDrawPoolAvatar::beginDeferredSkinned() void LLDrawPoolAvatar::endDeferredSkinned() { - sSkipTransparent = FALSE; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); -- cgit v1.2.3 From c66e2b16fe0463f5b0df265e9d8c3471a3b590b1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 5 Mar 2010 14:33:14 -0600 Subject: COMMENTS! --- indra/newview/llspatialpartition.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index de3745a1a3..929f2adc1a 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -346,11 +346,11 @@ public: F32 mBuilt; OctreeNode* mOctreeNode; LLSpatialPartition* mSpatialPartition; - LLVector3 mBounds[2]; - LLVector3 mExtents[2]; + LLVector3 mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) + LLVector3 mExtents[2]; // extents (min, max) of this node and all its children - LLVector3 mObjectExtents[2]; - LLVector3 mObjectBounds[2]; + LLVector3 mObjectExtents[2]; // extents (min, max) of objects in this node + LLVector3 mObjectBounds[2]; // bounding box (center, size) of objects in this node LLPointer mVertexBuffer; F32* mOcclusionVerts; -- cgit v1.2.3 From 3af97238f315b421bea057c02353b858d7e02f12 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sun, 7 Mar 2010 09:40:11 +0000 Subject: Remove the class2/class3 water shaders, which aren't materially different from class1 except for some minor const tweaks (I've migrated class3's tweaks into class1 on the assumption that this was what davep sees all the time) --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index d21575119d..5cb8bbba0f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -131,11 +131,11 @@ void main() //color.rgb = scaleSoftClip(color.rgb); //color.a = spec * sunAngle2; - //wavef.z = -0.25f; + //wavef.z *= 0.1f; wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.75); - gl_FragData[1] = vec4(1,1,1, 0.8); + gl_FragData[0] = vec4(color.rgb, 0.5); + gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); } -- cgit v1.2.3 From 7b1eac159730ae3d43b4336a41372ac342f18995 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sun, 7 Mar 2010 09:41:47 +0000 Subject: Remove an extraneous normalize() from the water fragment shader - the last thing we did to this vector was normalize it anyway. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 5cb8bbba0f..411c4bc1c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -132,7 +132,7 @@ void main() //color.a = spec * sunAngle2; //wavef.z *= 0.1f; - wavef = normalize(wavef); + //wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; gl_FragData[0] = vec4(color.rgb, 0.5); -- cgit v1.2.3 From f612453d84737fd5940647c8d5d1bba21f4b9658 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sun, 7 Mar 2010 10:09:06 +0000 Subject: trivial comment typo fix. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 411c4bc1c3..1fc5811382 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -115,7 +115,7 @@ void main() vec4 fb = texture2D(screenTex, distort2); //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug + // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); float shadow = 1.0; -- cgit v1.2.3 From 44289977dc36f0a83dd5734d506240b278774efc Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sun, 7 Mar 2010 10:15:07 +0000 Subject: Some extra comments to help me get things straight. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 1fc5811382..55c893d73b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -135,7 +135,7 @@ void main() //wavef = normalize(wavef); wavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.5); - gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); - gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); + gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse + gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec + gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); // normal } -- cgit v1.2.3 From 18432d1bc5bdab244b6054af73c5e4cf3d855164 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sun, 7 Mar 2010 11:34:31 +0000 Subject: Add a touch of fakey ripple to shadows on the surface of water, as if the water has depth. Using 4th component of the normal map to encode a position displacement (along the normal) in the class2 shadow lookup. --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 4 ++-- indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 55c893d73b..ceb7e0fb56 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -133,9 +133,9 @@ void main() //wavef.z *= 0.1f; //wavef = normalize(wavef); - wavef = (norm_mat*vec4(wavef, 1.0)).xyz; + vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); // normal + gl_FragData[2] = vec4(screenspacewavef*0.5+0.5, screenspacewavef.z*0.5); // normal, displace } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 74a948f584..50502dbdad 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -159,7 +159,9 @@ void main() vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + vec4 nmap4 = texture2DRect(normalMap, pos_screen); + float displace = nmap4.w; + vec3 norm = nmap4.xyz*2.0-1.0; /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { @@ -168,9 +170,9 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec4 spos = vec4(pos.xyz + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + vec4 spos = vec4(pos.xyz + displace*norm + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { -- cgit v1.2.3 From 6286dad2e98e6737afaad405a5e9d4a009d6218b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 8 Mar 2010 12:28:33 +0000 Subject: fixes VWR-4214 Glow effect passes through alpha textures where alpha is actually "solid" and its many many dupes. In summary this does the following: * When laying down alpha, uses the new separated color-and-alpha blend func support to suppress existing glow in proportion to the opacity of the incoming fragments * Moves glowing-alpha support from the glow pool to the alpha pool, ensures that the glow pass for a vertex buffer happens after the alpha pass for the vertex buffer so that it doesn't suppress its *own* glow. Tested with all shader modes, FBO on/off, and deferred rendering. Tested with every permutation of alpha/non-alpha/glow/non-glow/fullbright/waterglow/particle interaction I could contrive so far. :) --- indra/newview/lldrawpoolalpha.cpp | 37 ++++++++++++++++++++++++++++++++++++- indra/newview/llvovolume.cpp | 16 +++++----------- 2 files changed, 41 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 75973cfa54..9a778a063d 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -204,7 +204,12 @@ void LLDrawPoolAlpha::render(S32 pass) } LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); + + gGL.setColorMask(true, true); + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, + LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); renderAlpha(getVertexDataMask()); + gGL.setColorMask(true, false); if (deferred_render && current_shader != NULL) { @@ -283,9 +288,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; + llassert(group); + llassert(group->mSpatialPartition); + if (group->mSpatialPartition->mRenderByGroup && - !group->isDead()) + !group->isDead()) { + bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. + // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_CLOUD && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) @@ -385,6 +399,27 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. + if (draw_glow_for_this_partition && + params.mGlowColor.mV[3] > 0) + { + // install glow-accumulating blend mode + gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color + LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) + + // glow doesn't use vertex colors from the mesh data + params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR); + glColor4ubv(params.mGlowColor.mV); + + // do the actual drawing, again + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // restore our alpha blend mode + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, + LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + } if (params.mTextureMatrix && params.mTexture.notNull()) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 073d7c2b91..c92af140da 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3199,11 +3199,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; - BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3232,12 +3231,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLViewerTexture* tex = facep->getTexture(); - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW) - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (facep->mVertexBuffer.isNull()) { @@ -3878,7 +3872,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } -- cgit v1.2.3 From e2fb574d786bbea03883a6f4c1146a82798c013d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 8 Mar 2010 14:51:27 +0000 Subject: VWR-4214 followup Make the fix work for alpha masks ('fast alpha') too - ironically this hasn't ever worked either AFAICT. --- indra/newview/lldrawpoolalpha.cpp | 26 +++++++++++++++++++------- indra/newview/lldrawpoolalpha.h | 7 +++++++ 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 9a778a063d..7fd7cd3910 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -60,7 +60,9 @@ static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL) + simple_shader(NULL), fullbright_shader(NULL), + mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), + mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { } @@ -178,9 +180,16 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLSPipelineAlpha gls_pipeline_alpha; + gGL.setColorMask(true, true); + if (LLPipeline::sFastAlpha && !deferred_render) { - LLGLDisable blend_disable(GL_BLEND); + mColorSFactor = LLRender::BF_ONE; // } + mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow + mAlphaSFactor = LLRender::BF_ZERO; + mAlphaDFactor = LLRender::BF_ZERO; // block (zero-out) glow where the alpha test succeeds + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); if (mVertexShaderLevel > 0) { @@ -205,10 +214,14 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); - gGL.setColorMask(true, true); - gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, - LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + mColorSFactor = LLRender::BF_SOURCE_ALPHA; // } regular alpha blend + mColorDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + mAlphaSFactor = LLRender::BF_ZERO; // } glow suppression + mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + renderAlpha(getVertexDataMask()); + gGL.setColorMask(true, false); if (deferred_render && current_shader != NULL) @@ -417,8 +430,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // restore our alpha blend mode - gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA, - LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); } if (params.mTextureMatrix && params.mTexture.notNull()) diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 3aa752f72c..61f73d0b31 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -34,6 +34,7 @@ #define LL_LLDRAWPOOLALPHA_H #include "lldrawpool.h" +#include "llrender.h" #include "llframetimer.h" class LLFace; @@ -83,6 +84,12 @@ private: LLGLSLShader* target_shader; LLGLSLShader* simple_shader; LLGLSLShader* fullbright_shader; + + // our 'normal' alpha blend function for this pass + LLRender::eBlendFactor mColorSFactor; + LLRender::eBlendFactor mColorDFactor; + LLRender::eBlendFactor mAlphaSFactor; + LLRender::eBlendFactor mAlphaDFactor; }; class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha -- cgit v1.2.3 From 4f4fc07eb12066dcb65a3c2274160ffa0bfd52ef Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:28:23 +0000 Subject: Disable alpha-masking for glowing surfaces. It seems beyond my ability to get right. Refactor some replicated and/or strangely-expressed logic. --- indra/newview/llspatialpartition.h | 5 +++-- indra/newview/llvovolume.cpp | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 929f2adc1a..2c09a25e04 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -613,14 +613,15 @@ public: //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { -public: + public: virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); - + private: + bool canRenderAsMask(LLFace* facep); // logic helper }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c92af140da..ea493d4798 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3201,7 +3201,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { @@ -3296,6 +3296,16 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) +{ + const LLTextureEntry* te = facep->getTextureEntry(); + return (LLPipeline::sFastAlpha && + (te->getColor().mV[3] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + facep->getTexture()->getIsAlphaMask()); +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3421,10 +3431,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3768,15 +3775,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { if (te->getFullbright()) { -- cgit v1.2.3 From b64b0c1b777419d210d16a378b6957de65dc3932 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:45:53 +0000 Subject: We can enable alpha masking for fullbright faces as long as we're not in deferred mode. Deferred masked fullbrights are still broken (we fall back to blending instead of masking as a workaround), but they always have been. :/ --- indra/newview/llvovolume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ea493d4798..49c0c4d4e0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3299,11 +3299,15 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) { const LLTextureEntry* te = facep->getTextureEntry(); - return (LLPipeline::sFastAlpha && - (te->getColor().mV[3] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + return ( + LLPipeline::sFastAlpha && // do we want masks at all? + + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - facep->getTexture()->getIsAlphaMask()); + + facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) + ); } void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) -- cgit v1.2.3 From 5287c1781962a895955694b0b1660624b8aadc1d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Mar 2010 21:17:01 -0500 Subject: Fix for impostors being fullbright when deferred rendering enabled. --- indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 8c140a7b4f..508bbf415e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -11,7 +11,8 @@ uniform sampler2D specularMap; void main() { - gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); } -- cgit v1.2.3 From 3de4396aa4e96ae5ad1b9384b57d19caf8e674ac Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Mar 2010 22:22:02 -0500 Subject: CTS-110 Remove soft alpha in deferred pipeline (breaks some content). Will revisit soft alpha in materials project. --- .../newview/app_settings/shaders/class1/deferred/alphaF.glsl | 11 ----------- .../app_settings/shaders/class1/deferred/fullbrightF.glsl | 11 ----------- .../newview/app_settings/shaders/class2/deferred/alphaF.glsl | 11 ----------- indra/newview/pipeline.cpp | 1 - 4 files changed, 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 4fb109d687..fea2e16090 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -24,8 +24,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -57,15 +55,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index e518bddb98..0db9586a88 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,8 +23,6 @@ varying vec4 vary_position; varying vec3 vary_normal; varying vec3 vary_fragcoord; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -56,15 +54,6 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index ad16de6d81..665fe16b43 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -29,8 +29,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform float shadow_bias; uniform mat4 inv_proj; @@ -115,15 +113,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2f4314f7e5..674f2fe58c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6173,7 +6173,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f("alpha_soften", gSavedSettings.getF32("RenderDeferredAlphaSoften")); shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")); shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")); shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); -- cgit v1.2.3 From 9710f634b5d6b1692b0784aef88b9bce420e5ea2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 18 Mar 2010 15:43:37 -0500 Subject: XML changes for new graphics preferences --- indra/newview/app_settings/settings.xml | 26 +- .../default/xui/en/panel_preferences_graphics1.xml | 285 ++++++++++----------- 2 files changed, 163 insertions(+), 148 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1dc90280a2..c8a6db89ed 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6679,6 +6679,18 @@ 1 + RenderDeferredSSAO + + Comment + Execute screen space ambient occlusion shader in deferred renderer. + Persist + 1 + Type + Boolean + Value + 1 + + RenderDeferredBlurLight Comment @@ -7311,7 +7323,19 @@ Value 2 - RenderReflectionRes + RenderShadowDetail + + Comment + Detail of shadows. + Persist + 1 + Type + S32 + Value + 2 + + + RenderReflectionRes Comment Reflection map resolution. diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 44c44f5f59..8d43adb545 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -155,12 +155,12 @@ visiblity_control="ShowAdvancedGraphicsSettings" border="false" follows="top|left" - height="260" + height="283" label="CustomGraphics" layout="topleft" left="5" name="CustomGraphics Panel" - top="124" + top="101" width="485"> - - - - - Reflection detail: - - - - - - - - - Avatar rendering: - - - - - - + + width="256"/> + + Water Reflections: + + + + + + + + + + + Shadows: + + + + + + + Low @@ -599,46 +585,51 @@ width="128"> Low - - Lighting detail: - - - - - + + Avatar rendering: + + + + + + Terrain detail: @@ -676,7 +667,7 @@ name="2" top_delta="16" width="315" /> - + --> + + + + -- cgit v1.2.3 From 04ef90ceb0829e660d9c89a13ef526b3d30c732c Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 18 May 2010 15:55:22 +0100 Subject: EXT-7390 WIP Created SLapp secondlife:///app/voice/effects/refresh to update the voice effect list with new effects. --- indra/newview/llvoiceclient.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 52a7de61a0..d44b47707e 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -35,6 +35,7 @@ #include "llviewerwindow.h" #include "llvoicevivox.h" #include "llviewernetwork.h" +#include "llcommandhandler.h" #include "llhttpnode.h" #include "llnotificationsutil.h" #include "llsdserialize.h" @@ -46,6 +47,39 @@ const F32 LLVoiceClient::VOLUME_MIN = 0.f; const F32 LLVoiceClient::VOLUME_DEFAULT = 0.5f; const F32 LLVoiceClient::VOLUME_MAX = 1.0f; + +// Support for secondlife:///app/voice SLapps +class LLVoiceHandler : public LLCommandHandler +{ +public: + // requests will be throttled from a non-trusted browser + LLVoiceHandler() : LLCommandHandler("voice", UNTRUSTED_THROTTLE) {} + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + if (params[0].asString() == "effects") + { + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); + // If the voice client doesn't support voice effects, we can't handle effects SLapps + if (!effect_interface) + { + return false; + } + + // Support secondlife:///app/voice/effects/refresh to update the voice effect list with new effects + if (params[1].asString() == "refresh") + { + effect_interface->refreshVoiceEffectLists(false); + return true; + } + } + return false; + } +}; +LLVoiceHandler gVoiceHandler; + + + std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserver::EStatusType inStatus) { std::string result = "UNKNOWN"; @@ -77,7 +111,6 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv - /////////////////////////////////////////////////////////////////////////////////////////////// LLVoiceClient::LLVoiceClient() : -- cgit v1.2.3 From e319e13a9759e758791d0aecab7f7b72d58a9a7b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 18 May 2010 21:06:45 -0400 Subject: EXT-6953 WIP - cache dumping option to help with updating static vfs cache with new contents --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llappviewer.cpp | 46 +++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d65a1ca583..75232da541 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10362,6 +10362,17 @@ Value 0 + DumpVFSCaches + + Comment + Dump VFS caches on startup. + Persist + 1 + Type + Boolean + Value + 0 + UseStartScreen Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 82b6f1286f..d7632e69e8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2979,6 +2979,42 @@ S32 LLAppViewer::getCacheVersion() return cache_version ; } +void dumpVFSCaches() +{ + llinfos << "======= Dumping Static VFS ========" << llendl; + gStaticVFS->listFiles(); +#if LL_WINDOWS + WCHAR w_str[MAX_PATH]; + GetCurrentDirectory(MAX_PATH, w_str); + S32 res = LLFile::mkdir("StaticVFSDump"); + if (res == -1) + { + if (errno != EEXIST) + { + llwarns << "Couldn't create StaticVFSDump" << llendl; + } + } + SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str()); + gStaticVFS->dumpFiles(); + SetCurrentDirectory(w_str); +#endif + + llinfos << "========= Dumping regular VFS ====" << llendl; + gVFS->listFiles(); +#if LL_WINDOWS + res = LLFile::mkdir("VFSDump"); + if (res == -1) + { + if (errno != EEXIST) + { + llwarns << "Couldn't create VFSDump" << llendl; + } + } + SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str()); + gVFS->dumpFiles(); + SetCurrentDirectory(w_str); +#endif +} bool LLAppViewer::initCache() { mPurgeCache = false; @@ -3196,11 +3232,11 @@ bool LLAppViewer::initCache() { LLVFile::initClass(); - //llinfos << "======= Static VFS listing ========" << llendl; - //gStaticVFS->listFiles(); - - //llinfos << "========= regular VFS listing =====" << llendl; - //gVFS->listFiles(); + if (gSavedSettings.getBOOL("DumpVFSCaches")) + { + dumpVFSCaches(); + + } return true; } -- cgit v1.2.3 From be0662234565f772fc4c89e47400dc9df8277800 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 19 May 2010 16:25:52 +0100 Subject: EXT-7337 WIP Voice font previewing Added LLVoiceEffectInterface::getVoiceEffectProperties Added LLVivoxVoiceClient::getVoiceFontTemplateIndex --- indra/newview/llvoicevivox.cpp | 50 +++++++++++++++++++++++++++++++++++++++++- indra/newview/llvoicevivox.h | 2 ++ 2 files changed, 51 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ee67879d3d..2df9152a17 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6378,6 +6378,36 @@ const LLUUID LLVivoxVoiceClient::getVoiceEffect() return mAudioSession ? mAudioSession->mVoiceFontID : LLUUID::null; } +LLSD LLVivoxVoiceClient::getVoiceEffectProperties(const LLUUID& id) +{ + LLSD sd; + + voice_font_map_t::iterator iter = mVoiceFontMap.find(id); + if (iter != mVoiceFontMap.end()) + { + sd["template_only"] = false; + } + else + { + // Voice effect is not in the voice font map, see if there is a template + iter = mVoiceFontTemplateMap.find(id); + if (iter == mVoiceFontTemplateMap.end()) + { + LL_WARNS("Voice") << "Voice effect " << id << "not found." << LL_ENDL; + return sd; + } + sd["template_only"] = true; + } + + voiceFontEntry *font = iter->second; + sd["name"] = font->mName; + sd["expired"] = font->mHasExpired; + sd["expiry_date"] = font->mExpirationDate; + sd["is_new"] = font->mIsNew; + + return sd; +} + LLVivoxVoiceClient::voiceFontEntry::voiceFontEntry(LLUUID& id) : mID(id), mFontIndex(0), @@ -6536,6 +6566,24 @@ S32 LLVivoxVoiceClient::getVoiceFontIndex(const LLUUID& id) const return result; } +S32 LLVivoxVoiceClient::getVoiceFontTemplateIndex(const LLUUID& id) const +{ + S32 result = 0; + if (!id.isNull()) + { + voice_font_map_t::const_iterator it = mVoiceFontTemplateMap.find(id); + if (it != mVoiceFontTemplateMap.end()) + { + result = it->second->mFontIndex; + } + else + { + LL_DEBUGS("Voice") << "Selected voice font template " << id << " is not available." << LL_ENDL; + } + } + return result; +} + void LLVivoxVoiceClient::accountGetSessionFontsSendMessage() { if(!mAccountHandle.empty()) @@ -6753,7 +6801,7 @@ void LLVivoxVoiceClient::captureBufferPlayStartSendMessage(const LLUUID& voice_f LL_DEBUGS("Voice") << "Starting audio buffer playback." << LL_ENDL; - S32 font_index = getVoiceFontIndex(voice_font_id); + S32 font_index = getVoiceFontTemplateIndex(voice_font_id); LL_DEBUGS("Voice") << "With voice font: " << voice_font_id << " (" << font_index << ")" << LL_ENDL; stream diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 6c302962a3..1047d2e5ed 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -240,6 +240,7 @@ public: //@{ virtual bool setVoiceEffect(const LLUUID& id); virtual const LLUUID getVoiceEffect(); + virtual LLSD getVoiceEffectProperties(const LLUUID& id); virtual void refreshVoiceEffectLists(bool clear_lists); virtual const voice_effect_list_t& getVoiceEffectList() const; @@ -859,6 +860,7 @@ private: void deleteVoiceFontTemplates(); S32 getVoiceFontIndex(const LLUUID& id) const; + S32 getVoiceFontTemplateIndex(const LLUUID& id) const; void accountGetSessionFontsSendMessage(); void accountGetTemplateFontsSendMessage(); -- cgit v1.2.3 From 95ed59a9dec737ffe8d566595e1a74f662fe1e43 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 19 May 2010 16:28:03 +0100 Subject: EXT-7337 WIP Added template voice fonts to the voice font list for previewing --- indra/newview/llfloatervoiceeffect.cpp | 91 ++++++++++++++++++---- indra/newview/llvoiceclient.h | 1 + .../skins/default/xui/en/floater_voice_effect.xml | 89 ++++++++++++++++----- 3 files changed, 150 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 5a579f5aeb..de12e8d12a 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -99,29 +99,94 @@ void LLFloaterVoiceEffect::update() return; } + LL_DEBUGS("Voice")<< "Rebuilding voice effect list."<< LL_ENDL; + + // Preserve selected items and scroll position + S32 scroll_pos = mVoiceEffectList->getScrollPos(); + uuid_vec_t selected_items; + std::vector items = mVoiceEffectList->getAllSelected(); + for(std::vector::const_iterator it = items.begin(); it != items.end(); it++) + { + selected_items.push_back((*it)->getUUID()); + } + mVoiceEffectList->deleteAllItems(); - LLSD element; - element["id"] = LLUUID::null; - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = getString("no_voice_effect"); - mVoiceEffectList->addElement(element, ADD_BOTTOM); - - const voice_effect_list_t& effect_list = effect_interface->getVoiceEffectList(); - if (!effect_list.empty()) + { - for (voice_effect_list_t::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + // Add the "No Voice Effect" entry + LLSD element; + + element["id"] = LLUUID::null; + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = getString("no_voice_effect"); + element["columns"][0]["font"]["name"] = "SANSSERIF"; + element["columns"][0]["font"]["style"] = "BOLD"; + + LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); + // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( + if(sl_item) { + ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(LLFontGL::BOLD); + } + } + + const voice_effect_list_t& template_list = effect_interface->getVoiceEffectTemplateList(); + if (!template_list.empty()) + { + for (voice_effect_list_t::const_iterator it = template_list.begin(); it != template_list.end(); ++it) + { + const LLUUID& effect_id = it->second; + std::string effect_name = it->first; + + LLSD effect_properties = effect_interface->getVoiceEffectProperties(effect_id); + bool is_template_only = effect_properties["template_only"].asBoolean(); + bool is_new = effect_properties["is_new"].asBoolean(); + std::string expiry_date = effect_properties["expiry_date"].asString(); + + std::string font_style = "NORMAL"; + if (!is_template_only) + { + font_style = "BOLD"; + } LLSD element; - element["id"] = it->second; - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = it->first; - mVoiceEffectList->addElement(element, ADD_BOTTOM); + element["id"] = effect_id; + + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = effect_name; + element["columns"][0]["font"]["name"] = "SANSSERIF"; + element["columns"][0]["font"]["style"] = font_style; + element["columns"][1]["column"] = "new"; + element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; + element["columns"][1]["font"]["name"] = "SANSSERIF"; + element["columns"][1]["font"]["style"] = font_style; + + element["columns"][2]["column"] = "expires"; + element["columns"][2]["value"] = !is_template_only ? expiry_date : ""; + element["columns"][2]["font"]["name"] = "SANSSERIF"; + element["columns"][2]["font"]["style"] = font_style; + + LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); + // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( + if(sl_item) + { + LLFontGL::StyleFlags style = is_template_only ? LLFontGL::NORMAL : LLFontGL::BOLD; + ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + } } } + // Re-select items that were selected before, and restore the scroll position + for(uuid_vec_t::iterator it = selected_items.begin(); it != selected_items.end(); it++) + { + mVoiceEffectList->selectByID(*it); + } + mVoiceEffectList->setScrollPos(scroll_pos); + mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); mVoiceEffectList->setEnabled(true); + // Update button states + // *TODO: Should separate this from rebuilding the effects list, to avoid rebuilding it unnecessarily bool recording = effect_interface->isPreviewRecording(); getChild("record_btn")->setVisible(!recording); getChild("record_stop_btn")->setVisible(recording); diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 8d898378d6..5caf26c492 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -289,6 +289,7 @@ public: //@{ virtual bool setVoiceEffect(const LLUUID& id) = 0; virtual const LLUUID getVoiceEffect() = 0; + virtual LLSD getVoiceEffectProperties(const LLUUID& id) = 0; virtual void refreshVoiceEffectLists(bool clear_lists) = 0; virtual const voice_effect_list_t &getVoiceEffectList() const = 0; diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 5627eb3aff..8f2f13dffe 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -16,6 +16,9 @@ No Voice Effect + + New! + - + - - + + + + - + --> @@ -92,19 +145,19 @@ left_delta="0" name="record_stop_btn" top_delta="0" - width="83"> + width="135"> @@ -116,7 +169,7 @@ left_delta="0" name="play_stop_btn" top_delta="0" - width="83"> + width="135"> -- cgit v1.2.3 From 2930b805d3a5aa88efdbe9eadfec210c461edfa9 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 19 May 2010 17:35:53 +0100 Subject: EXT-7337 WIP Fix formatting in floater_voice_effect.xml (no functional change) --- .../skins/default/xui/en/floater_voice_effect.xml | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 8f2f13dffe..8452fb55b7 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -41,31 +41,31 @@ name="expires" width="100" /> - + -- cgit v1.2.3 From 49d8b3f5195e854f8b87fd08098b54eeda51b0ae Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 02:31:46 +0100 Subject: EXT-7337 WIP Voice morph previewing - Remove redundant play button now single-click preview is possible. --- indra/newview/skins/default/xui/en/floater_voice_effect.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 9a6c21c7f2..d0c503f7b8 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -155,6 +155,7 @@ + -- cgit v1.2.3 From 6e98ca08300fad1fa8a4a5ab3996e1a6f8318564 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 04:35:31 +0100 Subject: EXT-7337 WIP Voice morph previewing. Remove the activate button in the preview floater for now, it doesn't work in capture mode. Remove the remains of the play button. --- indra/newview/llfloatervoiceeffect.cpp | 45 +++++++-------- indra/newview/llfloatervoiceeffect.h | 2 +- .../skins/default/xui/en/floater_voice_effect.xml | 65 +++------------------- 3 files changed, 30 insertions(+), 82 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 0fa6135da2..1afea66d91 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -45,7 +45,7 @@ LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); mCommitCallbackRegistrar.add("VoiceEffect.Stop", boost::bind(&LLFloaterVoiceEffect::onClickStop, this)); mCommitCallbackRegistrar.add("VoiceEffect.Add", boost::bind(&LLFloaterVoiceEffect::onClickAdd, this)); - mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); +// mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } // virtual @@ -70,7 +70,7 @@ BOOL LLFloaterVoiceEffect::postBuild() if (mVoiceEffectList) { mVoiceEffectList->setCommitCallback(boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); - mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); +// mVoiceEffectList->setDoubleClickCallback(boost::bind(&LLFloaterVoiceEffect::onClickActivate, this)); } LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); @@ -133,7 +133,7 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = getString("no_voice_effect"); element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = "BOLD"; + element["columns"][0]["font"]["style"] = "ITALIC"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( @@ -152,9 +152,16 @@ void LLFloaterVoiceEffect::refreshEffectList() std::string effect_name = it->first; LLSD effect_properties = effect_interface->getVoiceEffectProperties(effect_id); + + // Tag the active effect. + if (effect_id == LLVoiceClient::instance().getVoiceEffectDefault()) + { + effect_name += " " + getString("active_voice_effect"); + } + + std::string expiry_date = effect_properties["expiry_date"].asString(); bool is_template_only = effect_properties["template_only"].asBoolean(); bool is_new = effect_properties["is_new"].asBoolean(); - std::string expiry_date = effect_properties["expiry_date"].asString(); std::string font_style = "NORMAL"; if (!is_template_only) @@ -168,6 +175,7 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["value"] = effect_name; element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = font_style; + element["columns"][1]["column"] = "new"; element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; element["columns"][1]["font"]["name"] = "SANSSERIF"; @@ -194,8 +202,6 @@ void LLFloaterVoiceEffect::refreshEffectList() mVoiceEffectList->selectByID(*it); } mVoiceEffectList->setScrollPos(scroll_pos); - - mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); mVoiceEffectList->setEnabled(true); } @@ -213,16 +219,6 @@ void LLFloaterVoiceEffect::updateControls() getChild("record_btn")->setVisible(!recording); getChild("record_stop_btn")->setVisible(recording); - - getChild("play_btn")->setVisible(!playing); - getChild("play_stop_btn")->setVisible(playing); - - getChild("play_btn")->setEnabled(effect_interface->isPreviewReady()); - - if (!mVoiceEffectList) - { - mVoiceEffectList->setValue(effect_interface->getVoiceEffect()); - } } // virtual @@ -281,11 +277,12 @@ void LLFloaterVoiceEffect::onClickAdd() LLWeb::loadURL(getString("get_voice_effects_url")); } -void LLFloaterVoiceEffect::onClickActivate() -{ - LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); - if (effect_interface && mVoiceEffectList) - { - effect_interface->setVoiceEffect(mVoiceEffectList->getCurrentID()); - } -} +//void LLFloaterVoiceEffect::onClickActivate() +//{ +// LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); +// if (effect_interface && mVoiceEffectList) +// { +// effect_interface->setVoiceEffect(mVoiceEffectList->getCurrentID()); +// } +//} + diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index 060ffc99e9..ed38cd6925 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -63,7 +63,7 @@ private: void onClickPlay(); void onClickStop(); void onClickAdd(); - void onClickActivate(); +// void onClickActivate(); LLUUID mSelectedID; LLScrollListCtrl* mVoiceEffectList; diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index d0c503f7b8..728beece6b 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -14,11 +14,14 @@ min_width="240" width="313"> - No Voice Effect + (No Voice Effect) http://secondlife.com/landing/v0icem0rphingt3st + + (Active) + New! @@ -38,8 +41,8 @@ - + @@ -86,6 +89,7 @@ + - - -- cgit v1.2.3 From 234b3edc26db7cf87a11fc16d9720bf4a9c20177 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sun, 23 May 2010 14:11:48 +0100 Subject: EXT-7337 WIP Added explanatory note to the voice morph preview floater --- indra/newview/llfloatervoiceeffect.cpp | 2 ++ .../skins/default/xui/en/floater_voice_effect.xml | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 1afea66d91..49dd6fa4d9 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -65,6 +65,8 @@ LLFloaterVoiceEffect::~LLFloaterVoiceEffect() BOOL LLFloaterVoiceEffect::postBuild() { setDefaultBtn("record_btn"); + getChild("record_btn")->setFocus(true); + mVoiceEffectList = getChild("voice_effect_list"); if (mVoiceEffectList) diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 728beece6b..acd70bce8e 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -2,7 +2,7 @@ --> + + Record a sample of your voice, and then select an effect to preview. Close this window to return to in-world voice. + - - + right="-10" + top="25"> Record a sample of your voice, and then select an effect to preview. Close this window to return to in-world voice. + + + + + + + [[URL] Get Voice Morphing] + -- cgit v1.2.3 From 1ad46b5cd0fcac0d3224d37d555092258593eabd Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 24 May 2010 13:59:10 -0700 Subject: DEV-50173 - investigate certificate code performance DEV-50166 - LLBasicCertificateChain::validate calls in log Added caching of certificates that have been validated. The sha1 hash for the certificate is stored and is associated with the from and to times. When the certificate is validated, the code determines whether the certificate has successfully been validated before by looking for it in the cache, and then checks the date of the cert. If that is successful, the validation calls with success. Otherwise, it proceeds to do a full validation of the certificate. --- indra/newview/llsecapi.cpp | 2 +- indra/newview/llsecapi.h | 31 ++++--- indra/newview/llsechandler_basic.cpp | 114 +++++++++++++++++------- indra/newview/llsechandler_basic.h | 23 +++-- indra/newview/llstartup.cpp | 3 +- indra/newview/llxmlrpctransaction.cpp | 3 +- indra/newview/tests/llsechandler_basic_test.cpp | 34 +++---- 7 files changed, 134 insertions(+), 76 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 1caeec5b04..9e636f38c0 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -124,7 +124,7 @@ int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param) // we rely on libcurl to validate the hostname, as libcurl does more extensive validation // leaving our hostname validation call mechanism for future additions with respect to // OS native (Mac keyring, windows CAPI) validation. - chain->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), store, validation_params); + store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params); } catch (LLCertValidationTrustException& cert_exception) { diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 59a1e1eff0..5a1a3879d4 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -154,7 +154,7 @@ public: // return an LLSD object containing information about the certificate // such as its name, signature, expiry time, serial number - virtual LLSD getLLSD() const=0; + virtual void getLLSD(LLSD& llsd)=0; // return an openSSL X509 struct for the certificate virtual X509* getOpenSSLX509() const=0; @@ -231,6 +231,18 @@ public: virtual LLPointer erase(iterator cert)=0; }; +// class LLCertificateChain +// Class representing a chain of certificates in order, with the +// first element being the child cert. +class LLCertificateChain : virtual public LLCertificateVector +{ + +public: + LLCertificateChain() {} + + virtual ~LLCertificateChain() {} + +}; // class LLCertificateStore // represents a store of certificates, typically a store of root CA @@ -250,30 +262,17 @@ public: // return the store id virtual std::string storeId() const=0; -}; - -// class LLCertificateChain -// Class representing a chain of certificates in order, with the -// first element being the child cert. -class LLCertificateChain : virtual public LLCertificateVector -{ - -public: - LLCertificateChain() {} - virtual ~LLCertificateChain() {} - // validate a certificate chain given the params. // Will throw exceptions on error virtual void validate(int validation_policy, - LLPointer ca_store, + LLPointer cert_chain, const LLSD& validation_params) =0; + }; - - inline bool operator==(const LLCertificateVector::iterator& _lhs, const LLCertificateVector::iterator& _rhs) { diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index edf5ce9b60..84ab9b9175 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -85,7 +85,6 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert) { throw LLInvalidCertificate(this); } - _initLLSD(); } @@ -96,7 +95,6 @@ LLBasicCertificate::LLBasicCertificate(X509* pCert) throw LLInvalidCertificate(this); } mCert = X509_dup(pCert); - _initLLSD(); } LLBasicCertificate::~LLBasicCertificate() @@ -150,9 +148,13 @@ std::vector LLBasicCertificate::getBinary() const } -LLSD LLBasicCertificate::getLLSD() const +void LLBasicCertificate::getLLSD(LLSD &llsd) { - return mLLSDInfo; + if (mLLSDInfo.isUndefined()) + { + _initLLSD(); + } + llsd = mLLSDInfo; } // Initialize the LLSD info for the certificate @@ -516,8 +518,9 @@ LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& pa cert++) { - found= TRUE; - LLSD cert_info = (*cert)->getLLSD(); + found= TRUE; + LLSD cert_info; + (*cert)->getLLSD(cert_info); for (LLSD::map_const_iterator param = params.beginMap(); param != params.endMap(); param++) @@ -543,7 +546,8 @@ LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& pa void LLBasicCertificateVector::insert(iterator _iter, LLPointer cert) { - LLSD cert_info = cert->getLLSD(); + LLSD cert_info; + cert->getLLSD(cert_info); if (cert_info.isMap() && cert_info.has(CERT_SHA1_DIGEST)) { LLSD existing_cert_info = LLSD::emptyMap(); @@ -691,7 +695,8 @@ LLBasicCertificateChain::LLBasicCertificateChain(const X509_STORE_CTX* store) while(untrusted_certs.size() > 0) { LLSD find_data = LLSD::emptyMap(); - LLSD cert_data = current->getLLSD(); + LLSD cert_data; + current->getLLSD(cert_data); // we simply build the chain via subject/issuer name as the // client should not have passed in multiple CA's with the same // subject name. If they did, it'll come out in the wash during @@ -850,12 +855,13 @@ bool _LLSDArrayIncludesValue(const LLSD& llsd_set, LLSD llsd_value) } void _validateCert(int validation_policy, - const LLPointer cert, + LLPointer cert, const LLSD& validation_params, int depth) { - LLSD current_cert_info = cert->getLLSD(); + LLSD current_cert_info; + cert->getLLSD(current_cert_info); // check basic properties exist in the cert if(!current_cert_info.has(CERT_SUBJECT_NAME) || !current_cert_info.has(CERT_SUBJECT_NAME_STRING)) { @@ -943,8 +949,9 @@ bool _verify_signature(LLPointer parent, LLPointer child) { bool verify_result = FALSE; - LLSD cert1 = parent->getLLSD(); - LLSD cert2 = child->getLLSD(); + LLSD cert1, cert2; + parent->getLLSD(cert1); + child->getLLSD(cert2); X509 *signing_cert = parent->getOpenSSLX509(); X509 *child_cert = child->getOpenSSLX509(); if((signing_cert != NULL) && (child_cert != NULL)) @@ -979,6 +986,7 @@ bool _verify_signature(LLPointer parent, return verify_result; } + // validate the certificate chain against a store. // There are many aspects of cert validatioin policy involved in // trust validation. The policies in this validation algorithm include @@ -993,8 +1001,8 @@ bool _verify_signature(LLPointer parent, // and verify the last cert is in the certificate store, or points // to a cert in the store. It validates whether any cert in the chain // is trusted in the store, even if it's not the last one. -void LLBasicCertificateChain::validate(int validation_policy, - LLPointer ca_store, +void LLBasicCertificateStore::validate(int validation_policy, + LLPointer cert_chain, const LLSD& validation_params) { @@ -1002,8 +1010,8 @@ void LLBasicCertificateChain::validate(int validation_policy, { throw LLCertException(NULL, "No certs in chain"); } - iterator current_cert = begin(); - LLSD current_cert_info = (*current_cert)->getLLSD(); + iterator current_cert = cert_chain->begin(); + LLSD current_cert_info; LLSD validation_date; if (validation_params.has(CERT_VALIDATION_DATE)) { @@ -1012,6 +1020,7 @@ void LLBasicCertificateChain::validate(int validation_policy, if (validation_policy & VALIDATION_POLICY_HOSTNAME) { + (*current_cert)->getLLSD(current_cert_info); if(!validation_params.has(CERT_HOSTNAME)) { throw LLCertException((*current_cert), "No hostname passed in for validation"); @@ -1021,7 +1030,7 @@ void LLBasicCertificateChain::validate(int validation_policy, throw LLInvalidCertificate((*current_cert)); } - LL_INFOS("SECAPI") << "Validating the hostname " << validation_params[CERT_HOSTNAME].asString() << + LL_DEBUGS("SECAPI") << "Validating the hostname " << validation_params[CERT_HOSTNAME].asString() << "against the cert CN " << current_cert_info[CERT_SUBJECT_NAME][CERT_NAME_CN].asString() << LL_ENDL; if(!_cert_hostname_wildcard_match(validation_params[CERT_HOSTNAME].asString(), current_cert_info[CERT_SUBJECT_NAME][CERT_NAME_CN].asString())) @@ -1030,16 +1039,50 @@ void LLBasicCertificateChain::validate(int validation_policy, (*current_cert)); } } - + // check the cache of already validated certs + X509* cert_x509 = (*current_cert)->getOpenSSLX509(); + if(!cert_x509) + { + throw LLInvalidCertificate((*current_cert)); + } + std::string sha1_hash((const char *)cert_x509->sha1_hash, SHA_DIGEST_LENGTH); + t_cert_cache::iterator cache_entry = mTrustedCertCache.find(sha1_hash); + if(cache_entry != mTrustedCertCache.end()) + { + LL_DEBUGS("SECAPI") << "Found cert in cache" << LL_ENDL; + // this cert is in the cache, so validate the time. + if (validation_policy & VALIDATION_POLICY_TIME) + { + LLDate validation_date(time(NULL)); + if(validation_params.has(CERT_VALIDATION_DATE)) + { + validation_date = validation_params[CERT_VALIDATION_DATE]; + } + + if((validation_date < cache_entry->second.first) || + (validation_date > cache_entry->second.second)) + { + throw LLCertValidationExpirationException((*current_cert), validation_date); + } + } + // successfully found in cache + return; + } + if(current_cert_info.isUndefined()) + { + (*current_cert)->getLLSD(current_cert_info); + } + LLDate from_time = current_cert_info[CERT_VALID_FROM].asDate(); + LLDate to_time = current_cert_info[CERT_VALID_TO].asDate(); int depth = 0; LLPointer previous_cert; // loop through the cert chain, validating the current cert against the next one. - while(current_cert != end()) + while(current_cert != cert_chain->end()) { int local_validation_policy = validation_policy; - if(current_cert == begin()) + if(current_cert == cert_chain->begin()) { // for the child cert, we don't validate CA stuff local_validation_policy &= ~(VALIDATION_POLICY_CA_KU | @@ -1061,23 +1104,23 @@ void LLBasicCertificateChain::validate(int validation_policy, depth); // look for a CA in the CA store that may belong to this chain. - LLSD cert_llsd = (*current_cert)->getLLSD(); LLSD cert_search_params = LLSD::emptyMap(); // is the cert itself in the store? - cert_search_params[CERT_SHA1_DIGEST] = cert_llsd[CERT_SHA1_DIGEST]; - LLCertificateStore::iterator found_store_cert = ca_store->find(cert_search_params); - if(found_store_cert != ca_store->end()) + cert_search_params[CERT_SHA1_DIGEST] = current_cert_info[CERT_SHA1_DIGEST]; + LLCertificateStore::iterator found_store_cert = find(cert_search_params); + if(found_store_cert != end()) { + mTrustedCertCache[sha1_hash] = std::pair(from_time, to_time); return; } // is the parent in the cert store? cert_search_params = LLSD::emptyMap(); - cert_search_params[CERT_SUBJECT_NAME_STRING] = cert_llsd[CERT_ISSUER_NAME_STRING]; - if (cert_llsd.has(CERT_AUTHORITY_KEY_IDENTIFIER)) + cert_search_params[CERT_SUBJECT_NAME_STRING] = current_cert_info[CERT_ISSUER_NAME_STRING]; + if (current_cert_info.has(CERT_AUTHORITY_KEY_IDENTIFIER)) { - LLSD cert_aki = cert_llsd[CERT_AUTHORITY_KEY_IDENTIFIER]; + LLSD cert_aki = current_cert_info[CERT_AUTHORITY_KEY_IDENTIFIER]; if(cert_aki.has(CERT_AUTHORITY_KEY_IDENTIFIER_ID)) { cert_search_params[CERT_SUBJECT_KEY_IDENTFIER] = cert_aki[CERT_AUTHORITY_KEY_IDENTIFIER_ID]; @@ -1087,11 +1130,10 @@ void LLBasicCertificateChain::validate(int validation_policy, cert_search_params[CERT_SERIAL_NUMBER] = cert_aki[CERT_AUTHORITY_KEY_IDENTIFIER_SERIAL]; } } - found_store_cert = ca_store->find(cert_search_params); + found_store_cert = find(cert_search_params); - if(found_store_cert != ca_store->end()) + if(found_store_cert != end()) { - LLSD foo = (*found_store_cert)->getLLSD(); // validate the store cert against the depth _validateCert(validation_policy & VALIDATION_POLICY_CA_BASIC_CONSTRAINTS, (*found_store_cert), @@ -1105,11 +1147,16 @@ void LLBasicCertificateChain::validate(int validation_policy, throw LLCertValidationInvalidSignatureException(*current_cert); } // successfully validated. + mTrustedCertCache[sha1_hash] = std::pair(from_time, to_time); return; } previous_cert = (*current_cert); current_cert++; - depth++; + depth++; + if(current_cert != current_cert != cert_chain->end()) + { + (*current_cert)->getLLSD(current_cert_info); + } } if (validation_policy & VALIDATION_POLICY_TRUSTED) { @@ -1118,6 +1165,7 @@ void LLBasicCertificateChain::validate(int validation_policy, throw LLCertValidationTrustException((*this)[size()-1]); } + mTrustedCertCache[sha1_hash] = std::pair(from_time, to_time); } @@ -1155,7 +1203,7 @@ void LLSecAPIBasicHandler::init() "CA.pem"); - LL_INFOS("SECAPI") << "Loading certificate store from " << store_file << LL_ENDL; + LL_DEBUGS("SECAPI") << "Loading certificate store from " << store_file << LL_ENDL; mStore = new LLBasicCertificateStore(store_file); // grab the application CA.pem file that contains the well-known certs shipped @@ -1465,7 +1513,7 @@ void LLSecAPIBasicHandler::saveCredential(LLPointer cred, bool sav { credential["authenticator"] = cred->getAuthenticator(); } - LL_INFOS("SECAPI") << "Saving Credential " << cred->getGrid() << ":" << cred->userID() << " " << save_authenticator << LL_ENDL; + LL_DEBUGS("SECAPI") << "Saving Credential " << cred->getGrid() << ":" << cred->userID() << " " << save_authenticator << LL_ENDL; setProtectedData("credential", cred->getGrid(), credential); //*TODO: If we're saving Agni credentials, should we write the // credentials to the legacy password.dat/etc? diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 4bbb73f062..3ddd36a81a 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -59,12 +59,13 @@ public: virtual std::string getPem() const; virtual std::vector getBinary() const; - virtual LLSD getLLSD() const; + virtual void getLLSD(LLSD &llsd); virtual X509* getOpenSSLX509() const; // set llsd elements for testing void setLLSD(const std::string name, const LLSD& value) { mLLSDInfo[name] = value; } + protected: // certificates are stored as X509 objects, as validation and @@ -173,8 +174,21 @@ public: // return the store id virtual std::string storeId() const; + // validate a certificate chain against a certificate store, using the + // given validation policy. + virtual void validate(int validation_policy, + LLPointer ca_chain, + const LLSD& validation_params); + protected: - std::vector >mCerts; + std::vector > mCerts; + + // cache of cert sha1 hashes to from/to date pairs, to improve + // performance of cert trust. Note, these are not the CA certs, + // but the certs that have been validated against this store. + typedef std::map > t_cert_cache; + t_cert_cache mTrustedCertCache; + std::string mFilename; }; @@ -189,11 +203,6 @@ public: virtual ~LLBasicCertificateChain() {} - // validate a certificate chain against a certificate store, using the - // given validation policy. - virtual void validate(int validation_policy, - LLPointer ca_store, - const LLSD& validation_params); }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0a464b3b6c..7022d83868 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2702,7 +2702,8 @@ LLSD transform_cert_args(LLPointer cert) { LLSD args = LLSD::emptyMap(); std::string value; - LLSD cert_info = cert->getLLSD(); + LLSD cert_info; + cert->getLLSD(cert_info); // convert all of the elements in the cert into // args for the xml dialog, so we have flexability to // display various parts of the cert by only modifying diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index da61840761..bc1a48e26a 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -247,7 +247,8 @@ int LLXMLRPCTransaction::Impl::_sslCertVerifyCallback(X509_STORE_CTX *ctx, void validation_params[CERT_HOSTNAME] = uri.hostName(); try { - chain->validate(VALIDATION_POLICY_SSL, store, validation_params); + // don't validate hostname. Let libcurl do it instead. That way, it'll handle redirects + store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params); } catch (LLCertValidationTrustException& cert_exception) { diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index fd680b24f0..d1330e2270 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -950,15 +950,15 @@ namespace tut test_chain->add(new LLBasicCertificate(mX509IntermediateCert)); - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); // add the root certificate to the chain and revalidate test_chain->add(new LLBasicCertificate(mX509RootCert)); - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); // add the child cert at the head of the chain, and revalidate (3 deep chain) test_chain->insert(test_chain->begin(), new LLBasicCertificate(mX509ChildCert)); - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); // basic failure cases test_chain = new LLBasicCertificateChain(NULL); @@ -967,14 +967,14 @@ namespace tut ensure_throws("no CA, with only a child cert", LLCertValidationTrustException, (*test_chain)[0], - test_chain->validate, + test_store->validate, VALIDATION_POLICY_TRUSTED, - test_store, + test_chain, validation_params); // validate without the trust flag. - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); // clear out the store test_store = new LLBasicCertificateStore("mycertstore.pem"); @@ -983,9 +983,9 @@ namespace tut ensure_throws("no CA, with child and intermediate certs", LLCertValidationTrustException, (*test_chain)[1], - test_chain->validate, + test_store->validate, VALIDATION_POLICY_TRUSTED, - test_store, + test_chain, validation_params); // validate without the trust flag test_chain->validate(0, test_store, validation_params); @@ -994,7 +994,7 @@ namespace tut LLSD child_info = (*test_chain)[0]->getLLSD(); validation_params = LLSD::emptyMap(); validation_params[CERT_VALIDATION_DATE] = LLDate(child_info[CERT_VALID_FROM].asDate().secondsSinceEpoch() + 1.0); - test_chain->validate(VALIDATION_POLICY_TIME, test_store, validation_params); + test_store->validate(VALIDATION_POLICY_TIME, test_chain, validation_params); validation_params = LLSD::emptyMap(); validation_params[CERT_VALIDATION_DATE] = child_info[CERT_VALID_FROM].asDate(); @@ -1005,9 +1005,9 @@ namespace tut ensure_throws("Child cert not yet valid" , LLCertValidationExpirationException, (*test_chain)[0], - test_chain->validate, + test_store->validate, VALIDATION_POLICY_TIME, - test_store, + test_chain, validation_params); validation_params = LLSD::emptyMap(); validation_params[CERT_VALIDATION_DATE] = LLDate(child_info[CERT_VALID_TO].asDate().secondsSinceEpoch() + 1.0); @@ -1016,9 +1016,9 @@ namespace tut ensure_throws("Child cert expired", LLCertValidationExpirationException, (*test_chain)[0], - test_chain->validate, + test_store->validate, VALIDATION_POLICY_TIME, - test_store, + test_chain, validation_params); // test SSL KU @@ -1026,7 +1026,7 @@ namespace tut test_chain = new LLBasicCertificateChain(NULL); test_chain->add(new LLBasicCertificate(mX509ChildCert)); test_chain->add(new LLBasicCertificate(mX509IntermediateCert)); - test_chain->validate(VALIDATION_POLICY_SSL_KU, test_store, validation_params); + test_store->validate(VALIDATION_POLICY_SSL_KU, test_chain, validation_params); test_chain = new LLBasicCertificateChain(NULL); test_chain->add(new LLBasicCertificate(mX509TestCert)); @@ -1034,9 +1034,9 @@ namespace tut ensure_throws("Cert doesn't have ku", LLCertKeyUsageValidationException, (*test_chain)[0], - test_chain->validate, + test_store->validate, VALIDATION_POLICY_SSL_KU, - test_store, + test_chain, validation_params); // test sha1RSA validation @@ -1044,7 +1044,7 @@ namespace tut test_chain->add(new LLBasicCertificate(mSha1RSATestCert)); test_chain->add(new LLBasicCertificate(mSha1RSATestCA)); - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); } }; -- cgit v1.2.3 From 1077ab49c171c0f310f9b76b360ea2ad162a31ff Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 24 May 2010 15:19:33 -0700 Subject: Just enough hackery to get minidumps into Wind'ohs crash reports. Code clean up needed. --- indra/newview/llappviewerwin32.cpp | 5 +++-- indra/newview/llwindebug.cpp | 28 +++++++++++----------------- 2 files changed, 14 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 60a6d2f072..4bee8d9ac5 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -529,8 +529,9 @@ bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) } bool LLAppViewerWin32::restoreErrorTrap() -{ - return LLWinDebug::checkExceptionHandler(); +{ + return true; + //return LLWinDebug::checkExceptionHandler(); } void LLAppViewerWin32::handleSyncCrashTrace() diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 59bc9dc62b..9f8585f163 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -718,7 +718,8 @@ BOOL PreventSetUnhandledExceptionFilter() // static void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) { - + return; +#if 0 static bool s_first_run = true; // Load the dbghelp dll now, instead of waiting for the crash. // Less potential for stack mangling @@ -762,34 +763,27 @@ void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) Module32First_ = (MODULE32_FIRST)GetProcAddress(hKernel32, "Module32FirstW"); Module32Next_ = (MODULE32_NEST)GetProcAddress(hKernel32, "Module32NextW"); - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(filter_func); - - // *REMOVE:Mani - //PreventSetUnhandledExceptionFilter(); + PVOID added_filter = + AddVectoredExceptionHandler(0, filter_func); - if(prev_filter != gFilterFunc) + if(added_filter == 0) { LL_WARNS("AppInit") - << "Replacing unknown exception (" << (void *)prev_filter << ") with (" << (void *)filter_func << ") !" << LL_ENDL; + << "Failed to add exception handler (" << added_filter << ") !" << LL_ENDL; } gFilterFunc = filter_func; +#endif } bool LLWinDebug::checkExceptionHandler() { bool ok = true; - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(gFilterFunc); - if (prev_filter != gFilterFunc) - { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with " << prev_filter << "!" << LL_ENDL; - ok = false; - } + RemoveVectoredExceptionHandler(gFilterFunc); + PVOID filter = AddVectoredExceptionHandler(0, gFilterFunc); - if (prev_filter == NULL) + if (filter == NULL) { ok = FALSE; if (gFilterFunc == NULL) @@ -798,7 +792,7 @@ bool LLWinDebug::checkExceptionHandler() } else { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with NULL!" << LL_ENDL; + LL_WARNS("AppInit") << "Failed to add exception handler (" << (void *)gFilterFunc << ")!" << LL_ENDL; } } -- cgit v1.2.3 From a7d1c68c787fcccf888632b9787c4cc9b30393f7 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 24 May 2010 15:31:10 -0700 Subject: Fixup some certificate related unit tests --- indra/newview/llsechandler_basic.cpp | 2 +- indra/newview/tests/llsechandler_basic_test.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 84ab9b9175..a81cde3126 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -1153,7 +1153,7 @@ void LLBasicCertificateStore::validate(int validation_policy, previous_cert = (*current_cert); current_cert++; depth++; - if(current_cert != current_cert != cert_chain->end()) + if(current_cert != cert_chain->end()) { (*current_cert)->getLLSD(current_cert_info); } diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index d1330e2270..dfbd596d39 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -328,7 +328,8 @@ namespace tut ensure_equals("Der Format is correct", memcmp(buffer, mDerFormat.c_str(), mDerFormat.length()), 0); - LLSD llsd_cert = test_cert->getLLSD(); + LLSD llsd_cert; + test_cert->getLLSD(llsd_cert); std::ostringstream llsd_value; llsd_value << LLSDOStreamer(llsd_cert) << std::endl; std::string llsd_cert_str = llsd_value.str(); @@ -988,10 +989,11 @@ namespace tut test_chain, validation_params); // validate without the trust flag - test_chain->validate(0, test_store, validation_params); + test_store->validate(0, test_chain, validation_params); // Test time validity - LLSD child_info = (*test_chain)[0]->getLLSD(); + LLSD child_info; + ((*test_chain)[0])->getLLSD(child_info); validation_params = LLSD::emptyMap(); validation_params[CERT_VALIDATION_DATE] = LLDate(child_info[CERT_VALID_FROM].asDate().secondsSinceEpoch() + 1.0); test_store->validate(VALIDATION_POLICY_TIME, test_chain, validation_params); -- cgit v1.2.3 From f24c312f8369fbc6ec4eb0607e7e8ea636aacb82 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 24 May 2010 15:59:26 -0700 Subject: so long llwindebug, we hardly knew ye. --- indra/newview/CMakeLists.txt | 3 - indra/newview/llappviewer.cpp | 5 - indra/newview/llappviewerwin32.cpp | 55 --- indra/newview/llstartup.cpp | 1 - indra/newview/llviewermessage.cpp | 4 - indra/newview/llwindebug.cpp | 906 ------------------------------------- indra/newview/llwindebug.h | 75 --- 7 files changed, 1049 deletions(-) delete mode 100644 indra/newview/llwindebug.cpp delete mode 100644 indra/newview/llwindebug.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f2bed843c9..4571aa1074 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1055,7 +1055,6 @@ set(viewer_HEADER_FILES llwearabletype.h llweb.h llwind.h - llwindebug.h llwlanimator.h llwldaycycle.h llwlparammanager.h @@ -1130,12 +1129,10 @@ endif (LINUX) if (WINDOWS) list(APPEND viewer_SOURCE_FILES llappviewerwin32.cpp - llwindebug.cpp ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h - llwindebug.h ) # precompiled header configuration diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 56486c788b..e9ec0b8b77 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -104,7 +104,6 @@ #include #if LL_WINDOWS - #include "llwindebug.h" # include // For _SH_DENYWR in initMarkerFile #else # include // For initMarkerFile support @@ -3288,10 +3287,6 @@ void LLAppViewer::badNetworkHandler() mPurgeOnExit = TRUE; -#if LL_WINDOWS - // Generates the minidump. - LLWinDebug::generateCrashStacks(NULL); -#endif LLAppViewer::handleSyncViewerCrash(); LLAppViewer::handleViewerCrash(); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 4bee8d9ac5..88d8dba8af 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -57,8 +57,6 @@ #include "llweb.h" #include "llsecondlifeurls.h" -#include "llwindebug.h" - #include "llviewernetwork.h" #include "llmd5.h" #include "llfindlocale.h" @@ -81,51 +79,6 @@ extern "C" { const std::string LLAppViewerWin32::sWindowClass = "Second Life"; -LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) -{ - // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. - //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); - // *TODO: Translate the signals/exceptions into cross-platform stuff - // Windows implementation - _tprintf( _T("Entering Windows Exception Handler...\n") ); - llinfos << "Entering Windows Exception Handler..." << llendl; - - // Make sure the user sees something to indicate that the app crashed. - LONG retval; - - if (LLApp::isError()) - { - _tprintf( _T("Got another fatal signal while in the error handler, die now!\n") ); - llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; - - retval = EXCEPTION_EXECUTE_HANDLER; - return retval; - } - - // Generate a minidump if we can. - // Before we wake the error thread... - // Which will start the crash reporting. - LLWinDebug::generateCrashStacks(exception_infop); - - // Flag status to error, so thread_error starts its work - LLApp::setError(); - - // Block in the exception handler until the app has stopped - // This is pretty sketchy, but appears to work just fine - while (!LLApp::isStopped()) - { - ms_sleep(10); - } - - // - // At this point, we always want to exit the app. There's no graceful - // recovery for an unhandled exception. - // - // Just kill the process. - retval = EXCEPTION_EXECUTE_HANDLER; - return retval; -} - // Create app mutex creates a unique global windows object. // If the object can be created it returns true, otherwise // it returns false. The false result can be used to determine @@ -191,8 +144,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); - - LLWinDebug::initExceptionHandler(viewer_windows_exception_handler); viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); @@ -405,12 +356,6 @@ bool LLAppViewerWin32::cleanup() bool LLAppViewerWin32::initLogging() { - // Remove the crash stack log from previous executions. - // Since we've started logging a new instance of the app, we can assume - // *NOTE: This should happen before the we send a 'previous instance froze' - // crash report, but it must happen after we initialize the DirUtil. - LLWinDebug::clearCrashStacks(); - return LLAppViewer::initLogging(); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a84bb98a90..e43b3b84c8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -199,7 +199,6 @@ #include "llstartuplistener.h" #if LL_WINDOWS -#include "llwindebug.h" #include "lldxhardware.h" #endif diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fb87e2d3b9..c677406223 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -110,10 +110,6 @@ #include // #include -#if LL_WINDOWS // For Windows specific error handler -#include "llwindebug.h" // For the invalid message handler -#endif - #include "llnotificationmanager.h" // #if LL_MSVC diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp deleted file mode 100644 index 9f8585f163..0000000000 --- a/indra/newview/llwindebug.cpp +++ /dev/null @@ -1,906 +0,0 @@ -/** - * @file llwindebug.cpp - * @brief Windows debugging functions - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include -#include -#include "llwindebug.h" -#include "llviewercontrol.h" -#include "lldir.h" -#include "llsd.h" -#include "llsdserialize.h" - -#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union -#pragma warning(disable: 4100) //unreferenced formal parameter - - -/* -LLSD Block for Windows Dump Information - - - Platform - - Process - - Module - - DateModified - - ExceptionCode - - ExceptionRead/WriteAddress - - Instruction - - Registers - - - EIP - ... - - - Call Stack - - - - ModuleName - - ModuleBaseAddress - - ModuleOffsetAddress - - Parameters - - - - - - - - - -*/ - - -extern void (*gCrashCallback)(void); - -// based on dbghelp.h -typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, - CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, - CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, - CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam - ); - -MINIDUMPWRITEDUMP f_mdwp = NULL; - -#undef UNICODE - -static LPTOP_LEVEL_EXCEPTION_FILTER gFilterFunc = NULL; - -HMODULE hDbgHelp; - -// Tool Help functions. -typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID); -typedef BOOL (WINAPI * MODULE32_FIRST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); -typedef BOOL (WINAPI * MODULE32_NEST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); - -CREATE_TOOL_HELP32_SNAPSHOT CreateToolhelp32Snapshot_; -MODULE32_FIRST Module32First_; -MODULE32_NEST Module32Next_; - -#define DUMP_SIZE_MAX 8000 //max size of our dump -#define CALL_TRACE_MAX ((DUMP_SIZE_MAX - 2000) / (MAX_PATH + 40)) //max number of traced calls -#define NL L"\r\n" //new line - - -typedef struct STACK -{ - STACK * Ebp; - PBYTE Ret_Addr; - DWORD Param[0]; -} STACK, * PSTACK; - -BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr); -void WINAPI Get_Call_Stack(const EXCEPTION_RECORD* exception_record, - const CONTEXT* context_record, - LLSD& info); - -void printError( CHAR* msg ) -{ - DWORD eNum; - TCHAR sysMsg[256]; - TCHAR* p; - - eNum = GetLastError( ); - FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, eNum, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - sysMsg, 256, NULL ); - - // Trim the end of the line and terminate it with a null - p = sysMsg; - while( ( *p > 31 ) || ( *p == 9 ) ) - ++p; - do { *p-- = 0; } while( ( p >= sysMsg ) && - ( ( *p == '.' ) || ( *p < 33 ) ) ); - - // Display the message - printf( "\n WARNING: %s failed with error %d (%s)", msg, eNum, sysMsg ); -} - -BOOL GetProcessThreadIDs(DWORD process_id, std::vector& thread_ids) -{ - HANDLE hThreadSnap = INVALID_HANDLE_VALUE; - THREADENTRY32 te32; - - // Take a snapshot of all running threads - hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); - if( hThreadSnap == INVALID_HANDLE_VALUE ) - return( FALSE ); - - // Fill in the size of the structure before using it. - te32.dwSize = sizeof(THREADENTRY32 ); - - // Retrieve information about the first thread, - // and exit if unsuccessful - if( !Thread32First( hThreadSnap, &te32 ) ) - { - printError( "Thread32First" ); // Show cause of failure - CloseHandle( hThreadSnap ); // Must clean up the snapshot object! - return( FALSE ); - } - - // Now walk the thread list of the system, - // and display information about each thread - // associated with the specified process - do - { - if( te32.th32OwnerProcessID == process_id ) - { - thread_ids.push_back(te32.th32ThreadID); - } - } while( Thread32Next(hThreadSnap, &te32 ) ); - -// Don't forget to clean up the snapshot object. - CloseHandle( hThreadSnap ); - return( TRUE ); -} - -BOOL GetThreadCallStack(DWORD thread_id, LLSD& info) -{ - if(GetCurrentThreadId() == thread_id) - { - // Early exit for the current thread. - // Suspending the current thread would be a bad idea. - // Plus you can't retrieve a valid current thread context. - return false; - } - - HANDLE thread_handle = INVALID_HANDLE_VALUE; - thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id); - if(INVALID_HANDLE_VALUE == thread_handle) - { - return FALSE; - } - - BOOL result = false; - if(-1 != SuspendThread(thread_handle)) - { - CONTEXT context_struct; - context_struct.ContextFlags = CONTEXT_FULL; - if(GetThreadContext(thread_handle, &context_struct)) - { - Get_Call_Stack(NULL, &context_struct, info); - result = true; - } - ResumeThread(thread_handle); - } - else - { - // Couldn't suspend thread. - } - - CloseHandle(thread_handle); - return result; -} - - -//Windows Call Stack Construction idea from -//http://www.codeproject.com/tools/minidump.asp - -//**************************************************************************************** -BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr) -//**************************************************************************************** -// Find module by Ret_Addr (address in the module). -// Return Module_Name (full path) and Module_Addr (start address). -// Return TRUE if found. -{ - MODULEENTRY32 M = {sizeof(M)}; - HANDLE hSnapshot; - - bool found = false; - - if (CreateToolhelp32Snapshot_) - { - hSnapshot = CreateToolhelp32Snapshot_(TH32CS_SNAPMODULE, 0); - - if ((hSnapshot != INVALID_HANDLE_VALUE) && - Module32First_(hSnapshot, &M)) - { - do - { - if (DWORD(Ret_Addr - M.modBaseAddr) < M.modBaseSize) - { - lstrcpyn(Module_Name, M.szExePath, MAX_PATH); - Module_Addr = M.modBaseAddr; - found = true; - break; - } - } while (Module32Next_(hSnapshot, &M)); - } - - CloseHandle(hSnapshot); - } - - return found; -} //Get_Module_By_Ret_Addr - -bool has_valid_call_before(PDWORD cur_stack_loc) -{ - PBYTE p_first_byte = (PBYTE)(*cur_stack_loc - 1); - PBYTE p_second_byte = (PBYTE)(*cur_stack_loc -2); - PBYTE p_fifth_byte = (PBYTE)(*cur_stack_loc - 5); - PBYTE p_sixth_byte = (PBYTE)(*cur_stack_loc - 6); - - // make sure we can read it - if(IsBadReadPtr(p_sixth_byte, 6 * sizeof(BYTE))) - { - return false; - } - - // check for 9a + 4 bytes - if(*p_fifth_byte == 0x9A) - { - return true; - } - - // Check for E8 + 4 bytes and last byte is 00 or FF - if(*p_fifth_byte == 0xE8 && (*p_first_byte == 0x00 || *p_first_byte == 0xFF)) - { - return true; - } - - // the other is six bytes - if(*p_sixth_byte == 0xFF || *p_second_byte == 0xFF) - { - return true; - } - - return false; -} - -PBYTE get_valid_frame(PBYTE esp) -{ - PDWORD cur_stack_loc = NULL; - const int max_search = 400; - WCHAR module_name[MAX_PATH]; - PBYTE module_addr = 0; - - // round to highest multiple of four - esp = (esp + (4 - ((int)esp % 4)) % 4); - - // scroll through stack a few hundred places. - for (cur_stack_loc = (PDWORD) esp; cur_stack_loc < (PDWORD)esp + max_search; cur_stack_loc += 1) - { - // if you can read the pointer, - if (IsBadReadPtr(cur_stack_loc, sizeof(PDWORD))) - { - continue; - } - - // check if it's in a module - if (!Get_Module_By_Ret_Addr((PBYTE)*cur_stack_loc, module_name, module_addr)) - { - continue; - } - - // check if the code before the instruction ptr is a call - if(!has_valid_call_before(cur_stack_loc)) - { - continue; - } - - // if these all pass, return that ebp, otherwise continue till we're dead - return (PBYTE)(cur_stack_loc - 1); - } - - return NULL; -} - -bool shouldUseStackWalker(PSTACK Ebp, int max_depth) -{ - WCHAR Module_Name[MAX_PATH]; - PBYTE Module_Addr = 0; - int depth = 0; - - while (depth < max_depth) - { - if (IsBadReadPtr(Ebp, sizeof(PSTACK)) || - IsBadReadPtr(Ebp->Ebp, sizeof(PSTACK)) || - Ebp->Ebp < Ebp || - Ebp->Ebp - Ebp > 0xFFFFFF || - IsBadCodePtr(FARPROC(Ebp->Ebp->Ret_Addr)) || - !Get_Module_By_Ret_Addr(Ebp->Ebp->Ret_Addr, Module_Name, Module_Addr)) - { - return true; - } - depth++; - Ebp = Ebp->Ebp; - } - - return false; -} - -//****************************************************************** -void WINAPI Get_Call_Stack(const EXCEPTION_RECORD* exception_record, - const CONTEXT* context_record, - LLSD& info) -//****************************************************************** -// Fill Str with call stack info. -// pException can be either GetExceptionInformation() or NULL. -// If pException = NULL - get current call stack. -{ - LPWSTR Module_Name = new WCHAR[MAX_PATH]; - PBYTE Module_Addr = 0; - LLSD params; - PBYTE Esp = NULL; - LLSD tmp_info; - - bool fake_frame = false; - bool ebp_used = false; - const int HEURISTIC_MAX_WALK = 20; - int heuristic_walk_i = 0; - int Ret_Addr_I = 0; - - STACK Stack = {0, 0}; - PSTACK Ebp; - - if (exception_record && context_record) //fake frame for exception address - { - Stack.Ebp = (PSTACK)(context_record->Ebp); - Stack.Ret_Addr = (PBYTE)exception_record->ExceptionAddress; - Ebp = &Stack; - Esp = (PBYTE) context_record->Esp; - fake_frame = true; - } - else if(context_record) - { - Ebp = (PSTACK)(context_record->Ebp); - Esp = (PBYTE)(context_record->Esp); - } - else - { - Ebp = (PSTACK)&exception_record - 1; //frame addr of Get_Call_Stack() - Esp = (PBYTE)&exception_record; - - // Skip frame of Get_Call_Stack(). - if (!IsBadReadPtr(Ebp, sizeof(PSTACK))) - Ebp = Ebp->Ebp; //caller ebp - } - - // Trace CALL_TRACE_MAX calls maximum - not to exceed DUMP_SIZE_MAX. - // Break trace on wrong stack frame. - for (Ret_Addr_I = 0; - heuristic_walk_i < HEURISTIC_MAX_WALK && - Ret_Addr_I < CALL_TRACE_MAX && !IsBadReadPtr(Ebp, sizeof(PSTACK)) && !IsBadCodePtr(FARPROC(Ebp->Ret_Addr)); - Ret_Addr_I++) - { - // If module with Ebp->Ret_Addr found. - if (Get_Module_By_Ret_Addr(Ebp->Ret_Addr, Module_Name, Module_Addr)) - { - // Save module's address and full path. - tmp_info["CallStack"][Ret_Addr_I]["ModuleName"] = ll_convert_wide_to_string(Module_Name); - tmp_info["CallStack"][Ret_Addr_I]["ModuleAddress"] = (int)Module_Addr; - tmp_info["CallStack"][Ret_Addr_I]["CallOffset"] = (int)(Ebp->Ret_Addr - Module_Addr); - - // Save 5 params of the call. We don't know the real number of params. - if (fake_frame && !Ret_Addr_I) //fake frame for exception address - params[0] = "Exception Offset"; - else if (!IsBadReadPtr(Ebp, sizeof(PSTACK) + 5 * sizeof(DWORD))) - { - for(int j = 0; j < 5; ++j) - { - params[j] = (int)Ebp->Param[j]; - } - } - tmp_info["CallStack"][Ret_Addr_I]["Parameters"] = params; - } - - tmp_info["CallStack"][Ret_Addr_I]["ReturnAddress"] = (int)Ebp->Ret_Addr; - - // get ready for next frame - // Set ESP to just after return address. Not the real esp, but just enough after the return address - if(!fake_frame) { - Esp = (PBYTE)Ebp + 8; - } - else - { - fake_frame = false; - } - - // is next ebp valid? - // only run if we've never found a good ebp - // and make sure the one after is valid as well - if( !ebp_used && - shouldUseStackWalker(Ebp, 2)) - { - heuristic_walk_i++; - PBYTE new_ebp = get_valid_frame(Esp); - if (new_ebp != NULL) - { - Ebp = (PSTACK)new_ebp; - } - } - else - { - ebp_used = true; - Ebp = Ebp->Ebp; - } - } -/* TODO remove or turn this code back on to edit the stack after i see a few raw ones. -Palmer - // Now go back through and edit out heuristic stacks that could very well be bogus. - // Leave the top and the last 3 stack chosen by the heuristic, however. - if(heuristic_walk_i > 2) - { - info["CallStack"][0] = tmp_info["CallStack"][0]; - std::string ttest = info["CallStack"][0]["ModuleName"]; - for(int cur_frame = 1; - (cur_frame + heuristic_walk_i - 2 < Ret_Addr_I); - ++cur_frame) - { - // edit out the middle heuristic found frames - info["CallStack"][cur_frame] = tmp_info["CallStack"][cur_frame + heuristic_walk_i - 2]; - } - } - else - { - info = tmp_info; - } -*/ - info = tmp_info; - info["HeuristicWalkI"] = heuristic_walk_i; - info["EbpUsed"] = ebp_used; - -} //Get_Call_Stack - -//*********************************** -void WINAPI Get_Version_Str(LLSD& info) -//*********************************** -// Fill Str with Windows version. -{ - OSVERSIONINFOEX V = {sizeof(OSVERSIONINFOEX)}; //EX for NT 5.0 and later - - if (!GetVersionEx((POSVERSIONINFO)&V)) - { - ZeroMemory(&V, sizeof(V)); - V.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx((POSVERSIONINFO)&V); - } - - if (V.dwPlatformId != VER_PLATFORM_WIN32_NT) - V.dwBuildNumber = LOWORD(V.dwBuildNumber); //for 9x HIWORD(dwBuildNumber) = 0x04xx - - info["Platform"] = llformat("Windows: %d.%d.%d, SP %d.%d, Product Type %d", //SP - service pack, Product Type - VER_NT_WORKSTATION,... - V.dwMajorVersion, V.dwMinorVersion, V.dwBuildNumber, V.wServicePackMajor, V.wServicePackMinor, V.wProductType); -} //Get_Version_Str - -//************************************************************* -LLSD WINAPI Get_Exception_Info(PEXCEPTION_POINTERS pException) -//************************************************************* -// Allocate Str[DUMP_SIZE_MAX] and return Str with dump, if !pException - just return call stack in Str. -{ - LLSD info; - LPWSTR Str; - int Str_Len; -// int i; - LPWSTR Module_Name = new WCHAR[MAX_PATH]; - PBYTE Module_Addr; - HANDLE hFile; - FILETIME Last_Write_Time; - FILETIME Local_File_Time; - SYSTEMTIME T; - - Str = new WCHAR[DUMP_SIZE_MAX]; - Str_Len = 0; - if (!Str) - return NULL; - - Get_Version_Str(info); - - GetModuleFileName(NULL, Str, MAX_PATH); - info["Process"] = ll_convert_wide_to_string(Str); - info["ThreadID"] = (S32)GetCurrentThreadId(); - - // If exception occurred. - if (pException) - { - EXCEPTION_RECORD & E = *pException->ExceptionRecord; - CONTEXT & C = *pException->ContextRecord; - - // If module with E.ExceptionAddress found - save its path and date. - if (Get_Module_By_Ret_Addr((PBYTE)E.ExceptionAddress, Module_Name, Module_Addr)) - { - info["Module"] = ll_convert_wide_to_string(Module_Name); - - if ((hFile = CreateFile(Module_Name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) - { - if (GetFileTime(hFile, NULL, NULL, &Last_Write_Time)) - { - FileTimeToLocalFileTime(&Last_Write_Time, &Local_File_Time); - FileTimeToSystemTime(&Local_File_Time, &T); - - info["DateModified"] = llformat("%02d/%02d/%d", T.wMonth, T.wDay, T.wYear); - } - CloseHandle(hFile); - } - } - else - { - info["ExceptionAddr"] = (int)E.ExceptionAddress; - } - - info["ExceptionCode"] = (int)E.ExceptionCode; - - /* - //TODO: Fix this - if (E.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) - { - // Access violation type - Write/Read. - LLSD exception_info; - exception_info["Type"] = E.ExceptionInformation[0] ? "Write" : "Read"; - exception_info["Address"] = llformat("%08x", E.ExceptionInformation[1]); - info["Exception Information"] = exception_info; - } - */ - - - // Save instruction that caused exception. - /* - std::string str; - for (i = 0; i < 16; i++) - str += llformat(" %02X", PBYTE(E.ExceptionAddress)[i]); - info["Instruction"] = str; - */ - LLSD registers; - registers["EAX"] = (int)C.Eax; - registers["EBX"] = (int)C.Ebx; - registers["ECX"] = (int)C.Ecx; - registers["EDX"] = (int)C.Edx; - registers["ESI"] = (int)C.Esi; - registers["EDI"] = (int)C.Edi; - registers["ESP"] = (int)C.Esp; - registers["EBP"] = (int)C.Ebp; - registers["EIP"] = (int)C.Eip; - registers["EFlags"] = (int)C.EFlags; - info["Registers"] = registers; - } //if (pException) - - // Save call stack info. - Get_Call_Stack(pException->ExceptionRecord, pException->ContextRecord, info); - - return info; -} //Get_Exception_Info - -#define UNICODE - - -class LLMemoryReserve { -public: - LLMemoryReserve(); - ~LLMemoryReserve(); - void reserve(); - void release(); -protected: - unsigned char *mReserve; - static const size_t MEMORY_RESERVATION_SIZE; -}; - -LLMemoryReserve::LLMemoryReserve() : - mReserve(NULL) -{ -}; - -LLMemoryReserve::~LLMemoryReserve() -{ - release(); -} - -// I dunno - this just seemed like a pretty good value. -const size_t LLMemoryReserve::MEMORY_RESERVATION_SIZE = 5 * 1024 * 1024; - -void LLMemoryReserve::reserve() -{ - if(NULL == mReserve) - mReserve = new unsigned char[MEMORY_RESERVATION_SIZE]; -}; - -void LLMemoryReserve::release() -{ - delete [] mReserve; - mReserve = NULL; -}; - -static LLMemoryReserve gEmergencyMemoryReserve; - -#ifndef _M_IX86 - #error "The following code only works for x86!" -#endif -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter( - LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) -{ - if(lpTopLevelExceptionFilter == gFilterFunc) - return gFilterFunc; - - llinfos << "Someone tried to set the exception filter. Listing call stack modules" << llendl; - LLSD cs_info; - Get_Call_Stack(NULL, NULL, cs_info); - - if(cs_info.has("CallStack") && cs_info["CallStack"].isArray()) - { - LLSD cs = cs_info["CallStack"]; - for(LLSD::array_iterator i = cs.beginArray(); - i != cs.endArray(); - ++i) - { - llinfos << "Module: " << (*i)["ModuleName"] << llendl; - } - } - - return gFilterFunc; -} - -BOOL PreventSetUnhandledExceptionFilter() -{ - HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll")); - if (hKernel32 == NULL) - return FALSE; - - void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter"); - if(pOrgEntry == NULL) - return FALSE; - - unsigned char newJump[ 100 ]; - DWORD dwOrgEntryAddr = (DWORD)pOrgEntry; - dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far - void *pNewFunc = &MyDummySetUnhandledExceptionFilter; - DWORD dwNewEntryAddr = (DWORD) pNewFunc; - DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr; - - newJump[ 0 ] = 0xE9; // JMP absolute - memcpy(&newJump[ 1 ], &dwRelativeAddr, sizeof(pNewFunc)); - SIZE_T bytesWritten; - BOOL bRet = WriteProcessMemory(GetCurrentProcess(), - pOrgEntry, newJump, sizeof(pNewFunc) + 1, &bytesWritten); - return bRet; -} - -// static -void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) -{ - return; -#if 0 - static bool s_first_run = true; - // Load the dbghelp dll now, instead of waiting for the crash. - // Less potential for stack mangling - - if (s_first_run) - { - // First, try loading from the directory that the app resides in. - std::string local_dll_name = gDirUtilp->findFile("dbghelp.dll", gDirUtilp->getWorkingDir(), gDirUtilp->getExecutableDir()); - - HMODULE hDll = NULL; - hDll = LoadLibraryA(local_dll_name.c_str()); - if (!hDll) - { - hDll = LoadLibrary(L"dbghelp.dll"); - } - - if (!hDll) - { - LL_WARNS("AppInit") << "Couldn't find dbghelp.dll!" << LL_ENDL; - } - else - { - f_mdwp = (MINIDUMPWRITEDUMP) GetProcAddress(hDll, "MiniDumpWriteDump"); - - if (!f_mdwp) - { - FreeLibrary(hDll); - hDll = NULL; - } - } - - gEmergencyMemoryReserve.reserve(); - - s_first_run = false; - } - - // Try to get Tool Help library functions. - HMODULE hKernel32; - hKernel32 = GetModuleHandle(_T("KERNEL32")); - CreateToolhelp32Snapshot_ = (CREATE_TOOL_HELP32_SNAPSHOT)GetProcAddress(hKernel32, "CreateToolhelp32Snapshot"); - Module32First_ = (MODULE32_FIRST)GetProcAddress(hKernel32, "Module32FirstW"); - Module32Next_ = (MODULE32_NEST)GetProcAddress(hKernel32, "Module32NextW"); - - PVOID added_filter = - AddVectoredExceptionHandler(0, filter_func); - - if(added_filter == 0) - { - LL_WARNS("AppInit") - << "Failed to add exception handler (" << added_filter << ") !" << LL_ENDL; - } - - gFilterFunc = filter_func; -#endif -} - -bool LLWinDebug::checkExceptionHandler() -{ - bool ok = true; - - RemoveVectoredExceptionHandler(gFilterFunc); - PVOID filter = AddVectoredExceptionHandler(0, gFilterFunc); - - if (filter == NULL) - { - ok = FALSE; - if (gFilterFunc == NULL) - { - LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; - } - else - { - LL_WARNS("AppInit") << "Failed to add exception handler (" << (void *)gFilterFunc << ")!" << LL_ENDL; - } - } - - return ok; -} - -void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename) -{ - if(f_mdwp == NULL || gDirUtilp == NULL) - { - return; - //write_debug("No way to generate a minidump, no MiniDumpWriteDump function!\n"); - } - else - { - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - - HANDLE hFile = CreateFileA(dump_path.c_str(), - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) - { - // Write the dump, ignoring the return value - f_mdwp(GetCurrentProcess(), - GetCurrentProcessId(), - hFile, - type, - ExInfop, - NULL, - NULL); - - CloseHandle(hFile); - } - - } -} - -// static -void LLWinDebug::generateCrashStacks(struct _EXCEPTION_POINTERS *exception_infop) -{ - // *NOTE:Mani - This method is no longer the exception handler. - // Its called from viewer_windows_exception_handler() and other places. - - // - // Let go of a bunch of reserved memory to give library calls etc - // a chance to execute normally in the case that we ran out of - // memory. - // - LLSD info; - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLifeException"); - std::string log_path = dump_path + ".log"; - - if (exception_infop) - { - // Since there is exception info... Release the hounds. - gEmergencyMemoryReserve.release(); - - if(gSavedSettings.getControl("SaveMinidump").notNull() && gSavedSettings.getBOOL("SaveMinidump")) - { - _MINIDUMP_EXCEPTION_INFORMATION ExInfo; - - ExInfo.ThreadId = ::GetCurrentThreadId(); - ExInfo.ExceptionPointers = exception_infop; - ExInfo.ClientPointers = NULL; - - writeDumpToFile(MiniDumpNormal, &ExInfo, "SecondLife.dmp"); - writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLifePlus.dmp"); - } - - info = Get_Exception_Info(exception_infop); - } - - LLSD threads; - std::vector thread_ids; - GetProcessThreadIDs(GetCurrentProcessId(), thread_ids); - - for(std::vector::iterator th_itr = thread_ids.begin(); - th_itr != thread_ids.end(); - ++th_itr) - { - LLSD thread_info; - if(*th_itr != GetCurrentThreadId()) - { - GetThreadCallStack(*th_itr, thread_info); - } - - if(thread_info) - { - threads[llformat("ID %d", *th_itr)] = thread_info; - } - } - - info["Threads"] = threads; - - llofstream out_file(log_path); - LLSDSerialize::toPrettyXML(info, out_file); - out_file.close(); -} - -void LLWinDebug::clearCrashStacks() -{ - LLSD info; - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLifeException.log"); - LLFile::remove(dump_path); -} diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h deleted file mode 100644 index f4a6a2d54d..0000000000 --- a/indra/newview/llwindebug.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file llwindebug.h - * @brief LLWinDebug class header file - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLWINDEBUG_H -#define LL_LLWINDEBUG_H - -#include "stdtypes.h" -#include - -class LLWinDebug -{ -public: - - /** - * @brief initialize the llwindebug exception filter callback - * - * Hand a windows unhandled exception filter to LLWinDebug - * This method should only be called to change the - * exception filter used by llwindebug. - * - * Setting filter_func to NULL will clear any custom filters. - **/ - static void initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func); - - /** - * @brief check the status of the exception filter. - * - * Resets unhandled exception filter to the filter specified - * w/ initExceptionFilter). - * Returns false if the exception filter was modified. - * - * *NOTE:Mani In the past mozlib has been accused of - * overriding the exception filter. If the mozlib filter - * is required, perhaps we can chain calls from our - * filter to mozlib's. - **/ - static bool checkExceptionHandler(); - - static void generateCrashStacks(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); - static void clearCrashStacks(); // Delete the crash stack file(s). - - static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename); -private: -}; - -#endif // LL_LLWINDEBUG_H -- cgit v1.2.3 From 32ad37b3f7ca48564bd15de2664f323ad4a2d367 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 24 May 2010 16:21:29 -0700 Subject: Few more touchups for the cert performance code --- indra/newview/llsechandler_basic.cpp | 5 ++--- indra/newview/tests/llsechandler_basic_test.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index a81cde3126..5f24d4398a 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -1006,7 +1006,7 @@ void LLBasicCertificateStore::validate(int validation_policy, const LLSD& validation_params) { - if(size() < 1) + if(cert_chain->size() < 1) { throw LLCertException(NULL, "No certs in chain"); } @@ -1160,9 +1160,8 @@ void LLBasicCertificateStore::validate(int validation_policy, } if (validation_policy & VALIDATION_POLICY_TRUSTED) { - LLPointer untrusted_ca_cert = (*this)[size()-1]; // we reached the end without finding a trusted cert. - throw LLCertValidationTrustException((*this)[size()-1]); + throw LLCertValidationTrustException((*cert_chain)[cert_chain->size()-1]); } mTrustedCertCache[sha1_hash] = std::pair(from_time, to_time); diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index dfbd596d39..df0673a159 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -963,8 +963,15 @@ namespace tut // basic failure cases test_chain = new LLBasicCertificateChain(NULL); - //validate with only the child cert + //validate with only the child cert in chain, but child cert was previously + // trusted test_chain->add(new LLBasicCertificate(mX509ChildCert)); + + // validate without the trust flag. + test_store->validate(VALIDATION_POLICY_TRUSTED, test_chain, validation_params); + + // Validate with child cert but no parent, and no parent in CA store + test_store = new LLBasicCertificateStore("mycertstore.pem"); ensure_throws("no CA, with only a child cert", LLCertValidationTrustException, (*test_chain)[0], @@ -1033,6 +1040,7 @@ namespace tut test_chain = new LLBasicCertificateChain(NULL); test_chain->add(new LLBasicCertificate(mX509TestCert)); + test_store = new LLBasicCertificateStore("mycertstore.pem"); ensure_throws("Cert doesn't have ku", LLCertKeyUsageValidationException, (*test_chain)[0], -- cgit v1.2.3 From 563ae1c7e029ceef2aed0b85623c2f0a95d38b46 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 25 May 2010 02:47:28 +0100 Subject: EXT-7337 WIP Replace the new column with a (New!) tag after the voice effect name --- indra/newview/llfloatervoiceeffect.cpp | 24 ++++++++++++---------- .../skins/default/xui/en/floater_voice_effect.xml | 12 ++++------- 2 files changed, 17 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 9529f947c1..46356cf161 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -145,6 +145,7 @@ void LLFloaterVoiceEffect::refreshEffectList() } } + // Add each Voice Effect template, if there are any (template list includes all usable effects) const voice_effect_list_t& template_list = effect_interface->getVoiceEffectTemplateList(); if (!template_list.empty()) { @@ -161,15 +162,21 @@ void LLFloaterVoiceEffect::refreshEffectList() effect_name += " " + getString("active_voice_effect"); } + // Tag available effects that are new this session + if (effect_properties["is_new"].asBoolean()) + { + effect_name += " " + getString("new_voice_effect"); + } + LLDate expiry_date = effect_properties["expiry_date"].asDate(); bool is_template_only = effect_properties["template_only"].asBoolean(); - bool is_new = effect_properties["is_new"].asBoolean(); std::string font_style = "NORMAL"; if (!is_template_only) { font_style = "BOLD"; } + LLSD element; element["id"] = effect_id; @@ -178,21 +185,16 @@ void LLFloaterVoiceEffect::refreshEffectList() element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = font_style; - element["columns"][1]["column"] = "new"; - element["columns"][1]["value"] = is_new ? getString("new_voice_effect") : ""; - element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = font_style; - - element["columns"][2]["column"] = "expires"; + element["columns"][1]["column"] = "expires"; if (!is_template_only) { - element["columns"][2]["value"] = expiry_date; + element["columns"][1]["value"] = expiry_date; } else { - element["columns"][2]["value"] = ""; + element["columns"][1]["value"] = ""; } - element["columns"][2]["font"]["name"] = "SANSSERIF"; - element["columns"][2]["font"]["style"] = font_style; + element["columns"][1]["font"]["name"] = "SANSSERIF"; + element["columns"][1]["font"]["style"] = font_style; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 73e4a694eb..f79d4fd35c 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -20,7 +20,7 @@ (Active) - New! + (New!) - + dynamic_width="true" + label="Voice Effect" + name="name"/> Date: Tue, 25 May 2010 03:36:36 +0100 Subject: EXT-7337 WIP Further tweaking of Voice Effect preview layout --- indra/newview/llfloatervoiceeffect.cpp | 5 ++- .../skins/default/xui/en/floater_voice_effect.xml | 51 +++++++++++----------- 2 files changed, 29 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 46356cf161..b47d562995 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -189,19 +189,20 @@ void LLFloaterVoiceEffect::refreshEffectList() if (!is_template_only) { element["columns"][1]["value"] = expiry_date; + element["columns"][1]["type"] = "date"; } else { element["columns"][1]["value"] = ""; } element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = font_style; + element["columns"][1]["font"]["style"] = "NORMAL"; LLScrollListItem* sl_item = mVoiceEffectList->addElement(element, ADD_BOTTOM); // *HACK: Copied from llfloatergesture.cpp : ["font"]["style"] does not affect font style :( if(sl_item) { LLFontGL::StyleFlags style = is_template_only ? LLFontGL::NORMAL : LLFontGL::BOLD; - ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + dynamic_cast(sl_item->getColumn(0))->setFontStyle(style); } } } diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index f79d4fd35c..4f4b20066d 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -11,8 +11,8 @@ label="Places" layout="topleft" min_height="350" - min_width="240" - width="300"> + min_width="300" + width="455"> (No Voice Effect) @@ -33,18 +33,19 @@ name="status_text" right="-10" top="25"> - Record a sample of your voice, and then select an effect to preview. Close this window to return to in-world voice. +Record a sample of your voice, and then select an effect to preview. +Close this window to return to in-world voice. @@ -56,41 +57,41 @@ left_delta="0" name="record_stop_btn" top_delta="0" - width="135"> + width="150"> + + [[URL] Get Voice Morphing] + + name="name" relative_width="0.41"/> + relative_width="0.59" /> - - [[URL] Get Voice Morphing] - -- cgit v1.2.3 From 76fc600e948f8c8ae9723f8ec5559408de5dc87f Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 25 May 2010 13:51:28 +0100 Subject: EXT-7138 WIP Made selecting voice effects while the Voice Control Panel is docked work properly. --- indra/newview/llpanelvoiceeffect.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index f4f0ea3ee7..518afc5eb3 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -39,6 +39,7 @@ #include "llfloaterreg.h" #include "llpanel.h" #include "lltrans.h" +#include "lltransientfloatermgr.h" #include "llvoiceclient.h" static LLRegisterPanelClassWrapper t_panel_voice_effect("panel_voice_effect"); @@ -51,6 +52,9 @@ LLPanelVoiceEffect::LLPanelVoiceEffect() LLPanelVoiceEffect::~LLPanelVoiceEffect() { + LLView* combo_list_view = mVoiceEffectCombo->getChildView("ComboBox"); + LLTransientFloaterMgr::getInstance()->removeControlView(combo_list_view); + if(LLVoiceClient::instanceExists()) { LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); @@ -66,6 +70,11 @@ BOOL LLPanelVoiceEffect::postBuild() { mVoiceEffectCombo = getChild("voice_effect"); + // Need to tell LLTransientFloaterMgr about the combo list, otherwise it can't + // be clicked while in a docked floater as it extends outside the floater area. + LLView* combo_list_view = mVoiceEffectCombo->getChildView("ComboBox"); + LLTransientFloaterMgr::getInstance()->addControlView(combo_list_view); + LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface(); if (effect_interface) { -- cgit v1.2.3 From 5a52c5eb8a5cc4e1215911bac9121891dd802d45 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 25 May 2010 13:32:12 -0700 Subject: Mac crash behavior matches windows and linux: report on crash (not after restart). This is OK because we use Breakpad generated minidumps instead of OS generated ones. --- indra/newview/llappviewer.cpp | 26 ++++---------------------- indra/newview/llappviewermacosx.cpp | 32 -------------------------------- 2 files changed, 4 insertions(+), 54 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e9ec0b8b77..418b587321 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -102,6 +102,8 @@ // Third party library includes #include +#include + #if LL_WINDOWS # include // For _SH_DENYWR in initMarkerFile @@ -2281,17 +2283,7 @@ void LLAppViewer::checkForCrash(void) { #if LL_SEND_CRASH_REPORTS - //*NOTE:Mani The current state of the crash handler has the MacOSX - // sending all crash reports as freezes, in order to let - // the MacOSX CrashRepoter generate stacks before spawning the - // SL crash logger. - // The Linux and Windows clients generate their own stacks and - // spawn the SL crash logger immediately. This may change in the future. -#if LL_DARWIN - if(gLastExecEvent != LAST_EXEC_NORMAL) -#else if (gLastExecEvent == LAST_EXEC_FROZE) -#endif { llinfos << "Last execution froze, requesting to send crash report." << llendl; // @@ -2552,9 +2544,6 @@ void LLAppViewer::handleViewerCrash() return; } pApp->mReportedCrash = TRUE; - - // Make sure the watchdog gets turned off... -// pApp->destroyMainloopTimeout(); // SJB: Bah. This causes the crash handler to hang, not sure why. //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version //to check against no matter what @@ -2665,10 +2654,6 @@ void LLAppViewer::handleViewerCrash() LLError::logToFile(""); -// On Mac, we send the report on the next run, since we need macs crash report -// for a stack trace, so we have to let it the app fail. -#if !LL_DARWIN - // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked if(gDebugInfo["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH) { @@ -2681,8 +2666,6 @@ void LLAppViewer::handleViewerCrash() // Call to pure virtual, handled by platform specific llappviewer instance. pApp->handleCrashReporting(); - -#endif //!LL_DARWIN return; } @@ -3287,9 +3270,6 @@ void LLAppViewer::badNetworkHandler() mPurgeOnExit = TRUE; - LLAppViewer::handleSyncViewerCrash(); - LLAppViewer::handleViewerCrash(); - std::ostringstream message; message << "The viewer has detected mangled network data indicative\n" @@ -3302,6 +3282,8 @@ void LLAppViewer::badNetworkHandler() "If the problem continues, see the Tech Support FAQ at: \n" "www.secondlife.com/support"; forceDisconnect(message.str()); + + LLApp::instance()->getExceptionHandler()->WriteMinidump(); } // This routine may get called more than once during the shutdown process. diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 0b5f18c330..2f12ad7e38 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -384,38 +384,6 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) } } - - if(!reportFreeze) - { - _exit(1); - } - - // TODO from palmer: Find a better way to handle managing old crash logs - // when this is a separate imbedable module. Ideally just sort crash stack - // logs based on date, and grab the latest one as opposed to deleting them - // for thoughts on what the module would look like. - // See: https://wiki.lindenlab.com/wiki/Viewer_Crash_Reporter_Round_4 - - // Remove the crash stack log from previous executions. - // Since we've started logging a new instance of the app, we can assume - // The old crash stack is invalid for the next crash report. - char path[MAX_PATH]; - FSRef folder; - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - std::string pathname = std::string(path) + std::string("/CrashReporter/"); - std::string mask = "Second Life*"; - std::string file_name; - while(gDirUtilp->getNextFileInDir(pathname, mask, file_name, false)) - { - LLFile::remove(pathname + file_name); - } - } - } - } std::string LLAppViewerMacOSX::generateSerialNumber() -- cgit v1.2.3 From 6a39149fec72e3a105d7a47b8a9f5aa2a0bfba87 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 25 May 2010 15:08:36 -0700 Subject: Added configuration setting to send crash reports to configured url rather than through the grid. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 7 +++++++ 2 files changed, 18 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f71662a7c8..6dcbb4e57a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1,6 +1,17 @@ + CrashHostUrl + + Comment + A URL pointing to a crash report handler; overrides cluster negotiation to locate crash handler. + Persist + 1 + Type + String + Value + + AFKTimeout Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 418b587321..7cdd8ca309 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2545,6 +2545,13 @@ void LLAppViewer::handleViewerCrash() } pApp->mReportedCrash = TRUE; + // Insert crash host url (url to post crash log to) if configured. + std::string crashHostUrl = gSavedSettings.get("CrashHostUrl"); + if(crashHostUrl != "") + { + gDebugInfo["CrashHostUrl"] = crashHostUrl; + } + //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version //to check against no matter what gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); -- cgit v1.2.3 From 9b57c13efcc2c4f1de6cfd07322beffc89f5c3a0 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 25 May 2010 19:02:39 -0400 Subject: EXT-7209 EXT-7366 WIP better handling of wearable editor camera views Added code to get camera change to trigger on first opening a wearable editor. Also fixed a minor label issue that was causing skirt editor to fail. Code reviewed by Seraph --- indra/newview/llpaneleditwearable.cpp | 111 ++++++++++++--------- indra/newview/llpaneleditwearable.h | 7 +- .../skins/default/xui/en/panel_edit_wearable.xml | 2 +- 3 files changed, 71 insertions(+), 49 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 8e9b164c09..359b523dd6 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -215,7 +215,9 @@ LLEditWearableDictionary::~LLEditWearableDictionary() LLEditWearableDictionary::Wearables::Wearables() { - addEntry(LLWearableType::WT_SHAPE, new WearableEntry(LLWearableType::WT_SHAPE,"edit_shape_title","shape_desc_text",0,0,9, SUBPART_SHAPE_HEAD, SUBPART_SHAPE_EYES, SUBPART_SHAPE_EARS, SUBPART_SHAPE_NOSE, SUBPART_SHAPE_MOUTH, SUBPART_SHAPE_CHIN, SUBPART_SHAPE_TORSO, SUBPART_SHAPE_LEGS, SUBPART_SHAPE_WHOLE)); + // note the subpart that is listed first is treated as "default", regardless of what order is in enum. + // Please match the order presented in XUI. -Nyx + addEntry(LLWearableType::WT_SHAPE, new WearableEntry(LLWearableType::WT_SHAPE,"edit_shape_title","shape_desc_text",0,0,9, SUBPART_SHAPE_WHOLE, SUBPART_SHAPE_HEAD, SUBPART_SHAPE_EYES, SUBPART_SHAPE_EARS, SUBPART_SHAPE_NOSE, SUBPART_SHAPE_MOUTH, SUBPART_SHAPE_CHIN, SUBPART_SHAPE_TORSO, SUBPART_SHAPE_LEGS )); addEntry(LLWearableType::WT_SKIN, new WearableEntry(LLWearableType::WT_SKIN,"edit_skin_title","skin_desc_text",0,3,4, TEX_HEAD_BODYPAINT, TEX_UPPER_BODYPAINT, TEX_LOWER_BODYPAINT, SUBPART_SKIN_COLOR, SUBPART_SKIN_FACEDETAIL, SUBPART_SKIN_MAKEUP, SUBPART_SKIN_BODYDETAIL)); addEntry(LLWearableType::WT_HAIR, new WearableEntry(LLWearableType::WT_HAIR,"edit_hair_title","hair_desc_text",0,1,4, TEX_HAIR, SUBPART_HAIR_COLOR, SUBPART_HAIR_STYLE, SUBPART_HAIR_EYEBROWS, SUBPART_HAIR_FACIAL)); addEntry(LLWearableType::WT_EYES, new WearableEntry(LLWearableType::WT_EYES,"edit_eyes_title","eyes_desc_text",0,1,1, TEX_EYES_IRIS, SUBPART_EYES)); @@ -893,8 +895,68 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) // Update picker controls state for_each_picker_ctrl_entry (targetPanel, type, boost::bind(set_enabled_color_swatch_ctrl, show, _1, _2)); for_each_picker_ctrl_entry (targetPanel, type, boost::bind(set_enabled_texture_ctrl, show, _1, _2)); + + showDefaultSubpart(); +} + +void LLPanelEditWearable::showDefaultSubpart() +{ + changeCamera(0); +} + +void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index) +{ + bool expanded = param.asBoolean(); + + if (!mWearablePtr || !gAgentCamera.cameraCustomizeAvatar()) + { + // we don't have a valid wearable we're editing, or we've left the wearable editor + return; + } + + if (expanded) + { + changeCamera(index); + } + } +void LLPanelEditWearable::changeCamera(U8 subpart) +{ + const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType()); + if (!wearable_entry) + { + llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl; + return; + } + + if (subpart >= wearable_entry->mSubparts.size()) + { + llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << llendl; + return; + } + + ESubpart subpart_e = wearable_entry->mSubparts[subpart]; + const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e); + + if (!subpart_entry) + { + llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl; + return; + } + + // Update the camera + gMorphView->setCameraDistToDefault(); + gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) ); + gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset ); + gMorphView->setCameraOffset( subpart_entry->mCameraOffset ); + if (gSavedSettings.getBOOL("AppearanceCameraMovement")) + { + gMorphView->updateCamera(); + } +} + + void LLPanelEditWearable::initializePanel() { if (!mWearablePtr) @@ -969,6 +1031,7 @@ void LLPanelEditWearable::initializePanel() for_each_picker_ctrl_entry (getPanel(type), type, boost::bind(init_color_swatch_ctrl, this, _1, _2)); for_each_picker_ctrl_entry (getPanel(type), type, boost::bind(init_texture_ctrl, this, _1, _2)); + showDefaultSubpart(); updateVerbs(); } @@ -994,52 +1057,6 @@ void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type) } } -void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index) -{ - bool expanded = param.asBoolean(); - - if (!mWearablePtr || !gAgentCamera.cameraCustomizeAvatar()) - { - // we don't have a valid wearable we're editing, or we've left the wearable editor - return; - } - - if (expanded) - { - const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType()); - if (!wearable_entry) - { - llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl; - return; - } - - if (index >= wearable_entry->mSubparts.size()) - { - llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << index << llendl; - return; - } - - ESubpart subpart_e = wearable_entry->mSubparts[index]; - const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e); - - if (!subpart_entry) - { - llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl; - return; - } - - // Update the camera - gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) ); - gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset ); - gMorphView->setCameraOffset( subpart_entry->mCameraOffset ); - gMorphView->setCameraDistToDefault(); - if (gSavedSettings.getBOOL("AppearanceCameraMovement")) - { - gMorphView->updateCamera(); - } - } -} - void LLPanelEditWearable::updateScrollingPanelUI() { // do nothing if we don't have a valid wearable we're editing diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 6f9ac82407..5de2bcb170 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -63,10 +63,12 @@ public: void saveChanges(); void revertChanges(); + void showDefaultSubpart(); + void onTabExpandedCollapsed(const LLSD& param, U8 index); + static void onRevertButtonClicked(void* userdata); void onCommitSexChange(); - void onTabExpandedCollapsed(const LLSD& param, U8 index); private: typedef std::map value_map_t; @@ -86,6 +88,9 @@ private: void toggleTypeSpecificControls(LLWearableType::EType type); void updateTypeSpecificControls(LLWearableType::EType type); + // changes camera angle to default for selected subpart + void changeCamera(U8 subpart); + // the pointer to the wearable we're editing. NULL means we're not editing a wearable. LLWearable *mWearablePtr; LLViewerInventoryItem* mWearableItem; diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 71f740590b..0455086ef3 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -107,7 +107,7 @@ left="0" Jacket: + name="skirt_desc_text"> Skirt: Date: Tue, 25 May 2010 19:30:08 -0400 Subject: EXT-7392 WIP correct implementation of isTextureVisible() This is needed so that we don't duplicate this functionality for EXT-7392. Its late, so will be reviewed tomorrow (but before code is pushed!) --- indra/newview/llvoavatar.cpp | 23 +++++++++++++++++++++++ indra/newview/llvoavatar.h | 14 +++----------- indra/newview/llvoavatarself.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llvoavatarself.h | 3 +++ 4 files changed, 55 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4371396629..76aa2ae0f1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7887,3 +7887,26 @@ BOOL LLVOAvatar::isTextureDefined(LLVOAvatarDefines::ETextureIndex te, U32 index getImage(te, index)->getID() != IMG_DEFAULT); } +//virtual +BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +{ + if (isIndexLocalTexture(type)) + { + return isTextureDefined(type, index); + } + else + { + // baked textures can use TE images directly + return ((isTextureDefined(type) || isSelf()) + && (getTEImage(type)->getID() != IMG_INVISIBLE + || LLDrawPoolAlpha::sShowDebugAlpha)); + } +} + +//virtual +BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const +{ + // non-self avatars don't have wearables + return FALSE; +} + diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 86a7cdae02..df47e9ba1d 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -462,7 +462,9 @@ public: //-------------------------------------------------------------------- public: virtual BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; - BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex index) const; + virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const; + protected: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); @@ -1039,14 +1041,4 @@ protected: // Shared with LLVOAvatarSelf }; // LLVOAvatar -//------------------------------------------------------------------------ -// Inlines -//------------------------------------------------------------------------ -inline BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex te) const -{ - return ((isTextureDefined(te) || isSelf()) - && (getTEImage(te)->getID() != IMG_INVISIBLE - || LLDrawPoolAlpha::sShowDebugAlpha)); -} - #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index cf3fb01b5a..ebca12dee8 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1332,6 +1332,32 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 return isDefined; } +//virtual +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +{ + if (isIndexBakedTexture(type)) + { + return LLVOAvatar::isTextureVisible(type,0); + } + + LLUUID tex_id = getLocalTextureID(type,index); + return (tex_id != IMG_INVISIBLE) + || (LLDrawPoolAlpha::sShowDebugAlpha); +} + +//virtual +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const +{ + if (isIndexBakedTexture(type)) + { + return isTextureVisible(type); + } + + U32 index = gAgentWearables.getWearableIndex(wearable); + return isTextureVisible(type,index); +} + + //----------------------------------------------------------------------------- // requestLayerSetUploads() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 8e6d9698f2..189c1ac808 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -179,6 +179,9 @@ public: BOOL isLocalTextureDataFinal(const LLTexLayerSet* layerset) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index /*virtual*/ BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index) const; + /*virtual*/ BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + /*virtual*/ BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const; + //-------------------------------------------------------------------- // Local Textures -- cgit v1.2.3 From b524aacb599b8c907e02eeb56b7441f42e9ddad2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 25 May 2010 20:17:23 -0400 Subject: EXT-7213 WIP kill old appearance editor and all traces of code First pass - eliminated all references to gFloaterCustomize except those that call saveIfDirty. Haven't compiled, haven't reviewed. Will clean up in further patches and get reviewed before pushing. --- indra/newview/llagentcamera.cpp | 20 -------------------- indra/newview/llinventorybridge.cpp | 11 +++-------- indra/newview/llpaneleditwearable.cpp | 4 ++++ indra/newview/llpaneleditwearable.h | 2 ++ indra/newview/llsidepanelappearance.cpp | 16 ++++++++++++++++ indra/newview/llsidepanelappearance.h | 2 ++ indra/newview/llviewerinventory.cpp | 5 +++-- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llwearable.cpp | 16 ++++++++++------ 9 files changed, 41 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 9638d0e94f..d9eceec30d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1538,26 +1538,6 @@ F32 LLAgentCamera::calcCustomizeAvatarUIOffset(const LLVector3d& camera_pos_glob { F32 ui_offset = 0.f; - if (gFloaterCustomize) - { - const LLRect& rect = gFloaterCustomize->getRect(); - - // Move the camera so that the avatar isn't covered up by this floater. - F32 fraction_of_fov = 0.5f - (0.5f * (1.f - llmin(1.f, ((F32)rect.getWidth() / (F32)gViewerWindow->getWindowWidthScaled())))); - F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); // radians - F32 offset = tan(apparent_angle); - - if( rect.mLeft < (gViewerWindow->getWindowWidthScaled() - rect.mRight) ) - { - // Move the avatar to the right (camera to the left) - ui_offset = offset; - } - else - { - // Move the avatar to the left (camera to the right) - ui_offset = -offset; - } - } F32 range = (F32)dist_vec(camera_pos_global, getFocusGlobal()); mUIOffset = lerp(mUIOffset, ui_offset, LLCriticalDamp::getInterpolant(0.05f)); return mUIOffset * range; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0f532236e4..7625a7ab83 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -62,6 +62,7 @@ #include "llpreviewgesture.h" #include "llpreviewtexture.h" #include "llselectmgr.h" +#include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltrans.h" #include "llviewerassettype.h" @@ -4884,15 +4885,9 @@ void LLWearableBridge::editOnAvatar() const LLWearable* wearable = gAgentWearables.getWearableFromItemID(linked_id); if( wearable ) { - // Set the tab to the right wearable. - if (gFloaterCustomize) - gFloaterCustomize->setCurrentWearableType( wearable->getType() ); + LLPanel * panel = LLSideTray::getInstance()->getPanel("sidepanel_appearance"); - if( CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() ) - { - // Start Avatar Customization - gAgentCamera.changeCameraToCustomizeAvatar(); - } + LLSidePanelAppearance::editWearable(wearable, panel); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 359b523dd6..2ba39fca9c 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -956,6 +956,10 @@ void LLPanelEditWearable::changeCamera(U8 subpart) } } +void LLPanelEditWearable::updateScrollingPanelList() +{ + updateScrollingPanelUI(); +} void LLPanelEditWearable::initializePanel() { diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 5de2bcb170..0af3758a4e 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -66,6 +66,8 @@ public: void showDefaultSubpart(); void onTabExpandedCollapsed(const LLSD& param, U8 index); + void updateScrollingPanelList(); + static void onRevertButtonClicked(void* userdata); void onCommitSexChange(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 010d593b27..6f934a0b66 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -465,3 +465,19 @@ void LLSidepanelAppearance::setWearablesLoading(bool val) childSetVisible("wearables_loading_indicator", val); childSetVisible("edit_outfit_btn", !val); } + +void LLSidepanelAppearance::showDefaultSubpart() +{ + if (mEditWearable->getVisible()) + { + mEditWearable->showDefaultSubpart(); + } +} + +void LLSidepanelAppearance::updateScrollingPanelList() +{ + if (mEditWearable->getVisible()) + { + mEditWearable->updateScrollingPanelList(); + } +} diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 12303b6e96..5bde962c8d 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -67,6 +67,8 @@ public: void showOutfitEditPanel(); void showWearableEditPanel(LLWearable *wearable = NULL); void setWearablesLoading(bool val); + void showDefaultSubpart(); + void updateScrollingPanelList(); private: void onFilterEdit(const std::string& search_string); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f0532d5a31..838f57073e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -883,9 +883,10 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() ) { // If we're in appearance editing mode, the current tab may need to be refreshed - if (gFloaterCustomize) + LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if (panel) { - gFloaterCustomize->switchToDefaultSubpart(); + panel->showDefaultSubpart(); } } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e0463e3c4a..f72f122f8a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4545,7 +4545,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) gResizeScreenTexture = TRUE; - if (gFloaterCustomize && gFloaterCustomize->getVisible()) + if (gAgentCamera.cameraCustomizeAvatar()) { LLVisualParamHint::requestHintUpdates(); } diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 10b9a18fa8..358defbb31 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -705,9 +705,9 @@ void LLWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake } } - if( gFloaterCustomize ) + if( gAgentCamera.cameraCustomizeAvatar() ) { - gFloaterCustomize->setWearable(type, NULL, PERM_ALL, TRUE); + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } gAgentAvatarp->updateVisualParams(); @@ -976,9 +976,11 @@ void LLWearable::revertValues() syncImages(mSavedTEMap, mTEMap); - if( gFloaterCustomize ) + + LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if( panel ) { - gFloaterCustomize->updateScrollingPanelList(TRUE); + panel->updateScrollingPanelList(); } } @@ -1015,9 +1017,11 @@ void LLWearable::saveValues() // Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed) syncImages(mTEMap, mSavedTEMap); - if( gFloaterCustomize ) + + LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if( panel ) { - gFloaterCustomize->updateScrollingPanelList(TRUE); + panel->updateScrollingPanelList(); } } -- cgit v1.2.3 From 80b9e6b3fb5086a8d4506a95787a9e84d0e46fb8 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 26 May 2010 12:55:30 +0100 Subject: EXT-7138 WIP Improved debug logging around voice font expiry --- indra/newview/llvoicevivox.cpp | 54 ++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 17f4b661be..9ce6ae521e 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6551,35 +6551,36 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, voice_font_map_t::iterator iter = font_map.find(font_id); bool new_font = (iter == font_map.end()); - // If it is a new (unexpired) font create a new entry, otherwise update the existing one. if (new_font) { - if (!has_expired) - { - font = new voiceFontEntry(font_id); - } - else + if (has_expired) { - LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id - << " (" << font_index << ") : " << name << " has expired." << LL_ENDL; + // If it's new and already marked expired, ignore it. + return; } + // If it is a new (unexpired) font create a new entry. + font = new voiceFontEntry(font_id); } else { + // Not a new font, update the existing entry font = iter->second; } if (font) { - // Remove fonts that have expired since we last saw them. + // Remove existing fonts that have expired since we last saw them. if (has_expired) { - LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id - << " (" << font_index << ") : " << name << " has expired, removing." - << LL_ENDL; + LL_DEBUGS("Voice") << "Expired " << (template_font ? "Template: " : ":") + << font->mExpirationDate.asString() << font_id + << " (" << font_index << ") " << name << LL_ENDL; - deleteVoiceFont(font_id); + if (!template_font) + { + deleteVoiceFont(font_id); + } return; } @@ -6591,10 +6592,22 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font->mFontType = font_type; font->mFontStatus = font_status; + LL_DEBUGS("Voice") << (template_font ? "Template: " : "") + << font->mExpirationDate.asString() << font->mID + << " (" << font->mFontIndex << ") " << name << LL_ENDL; + // Set the expiry timer to trigger a notification when the voice font can no longer be used. font->mExpiryTimer.start(); font->mExpiryTimer.setExpiryAt(expiration_date.secondsSinceEpoch()); + if (font->mExpiryTimer.hasExpired()) + { + // Should never happen, but check anyway. + LL_DEBUGS("Voice") << "Voice font " << font->mID + << " expired " << font->mExpirationDate.asString() + << " but is not marked expired!" << LL_ENDL; + } + // Set the warning timer to some interval before actual expiry. S32 warning_time = gSavedSettings.getS32("VoiceEffectExpiryWarningTime"); if (warning_time != 0) @@ -6624,9 +6637,6 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, // Debugging stuff - LL_DEBUGS("Voice") << (template_font?"Template: ":"") << font_id - << " (" << font_index << ") : " << name << LL_ENDL; - if (font_type < VOICE_FONT_TYPE_NONE || font_type >= VOICE_FONT_TYPE_UNKNOWN) { LL_DEBUGS("Voice") << "Unknown voice font type: " << font_type << LL_ENDL; @@ -6717,6 +6727,7 @@ void LLVivoxVoiceClient::deleteVoiceFont(const LLUUID& id) { if (list_iter->second == id) { + LL_DEBUGS("Voice") << "Removing " << id << " from the voice font list." << LL_ENDL; mVoiceFontList.erase(list_iter++); } else @@ -6884,6 +6895,8 @@ void LLVivoxVoiceClient::removeObserver(LLVoiceEffectObserver* observer) void LLVivoxVoiceClient::notifyVoiceFontObservers(bool lists_changed) { + LL_DEBUGS("Voice") << "Notifying voice effect observers. Lists changed: " << lists_changed << LL_ENDL; + for (voice_font_observer_set_t::iterator it = mVoiceFontObservers.begin(); it != mVoiceFontObservers.end(); ) @@ -7504,8 +7517,9 @@ LLDate LLVivoxProtocolParser::vivoxTimeStampToLLDate(const std::string& vivox_ts { LLDate ts; - // First check to see if it actually already is a parseable ISO8601 date, - // in case the format miraculously changes in future ;) + // First check to see if it actually already is an ISO 8601 date that + // LLDate::fromString() can parse. + // In case the format miraculously changes in future ;) if (ts.fromString(vivox_ts)) { return ts; @@ -7527,8 +7541,8 @@ LLDate LLVivoxProtocolParser::vivoxTimeStampToLLDate(const std::string& vivox_ts ts.fromString(time_stamp); if(!ts.fromString(time_stamp)) { - LL_WARNS_ONCE("Voice") << "Failed to parse Vivox timestamp: " << vivox_ts - << " to ISO 8601 date: " << time_stamp << LL_ENDL; + LL_WARNS_ONCE("VivoxProtocolParser") << "Failed to parse Vivox timestamp: " + << vivox_ts << " to ISO 8601 date: " << time_stamp << LL_ENDL; return LLDate(); } -- cgit v1.2.3 From 3c7df727eeb10a1e6adf27b7aa352afddfcd5d6d Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Wed, 26 May 2010 14:42:18 +0100 Subject: EXT-7138 WIP Simplify and improve detection and notification of changes to the Voice font list --- indra/newview/llvoicevivox.cpp | 98 +++++++++++++++++++++--------------------- indra/newview/llvoicevivox.h | 3 +- 2 files changed, 52 insertions(+), 49 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9ce6ae521e..c8e4630e24 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -348,6 +348,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mVoiceFontsReceived(false), mVoiceFontsNew(false), + mVoiceFontListDirty(false), mCaptureBufferMode(false), mCaptureBufferRecording(false), @@ -1173,7 +1174,7 @@ void LLVivoxVoiceClient::stateMachine() mCaptureTimer.setTimerExpirySec(CAPTURE_BUFFER_MAX_TIME); // Update UI, should really use a separate callback. - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); setState(stateCaptureBufferRecording); break; @@ -1188,7 +1189,7 @@ void LLVivoxVoiceClient::stateMachine() mCaptureBufferRecording = false; // Update UI, should really use a separate callback. - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); setState(stateCaptureBufferPaused); } @@ -1202,7 +1203,7 @@ void LLVivoxVoiceClient::stateMachine() mPreviewVoiceFontLast = mPreviewVoiceFont; // Update UI, should really use a separate callback. - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); setState(stateCaptureBufferPlaying); break; @@ -1221,7 +1222,7 @@ void LLVivoxVoiceClient::stateMachine() mCaptureBufferPlaying = false; // Update UI, should really use a separate callback. - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); setState(stateCaptureBufferPaused); } @@ -1769,7 +1770,7 @@ void LLVivoxVoiceClient::stateMachine() { mAudioSessionChanged = false; notifyParticipantObservers(); - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); } else if (mAudioSession && mAudioSession->mParticipantsChanged) { @@ -6442,7 +6443,7 @@ bool LLVivoxVoiceClient::setVoiceEffect(const LLUUID& id) gSavedPerAccountSettings.setString("VoiceEffectDefault", id.asString()); sessionSetVoiceFontSendMessage(mAudioSession); - notifyVoiceFontObservers(false); + notifyVoiceFontObservers(); return true; } @@ -6551,15 +6552,26 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, voice_font_map_t::iterator iter = font_map.find(font_id); bool new_font = (iter == font_map.end()); - if (new_font) + if (has_expired) { - if (has_expired) + // Remove existing session fonts that have expired since we last saw them. + if (!new_font) { - // If it's new and already marked expired, ignore it. - return; + LL_DEBUGS("Voice") << "Expired " << (template_font ? "Template " : "") + << expiration_date.asString() << " " << font_id + << " (" << font_index << ") " << name << LL_ENDL; + + if (!template_font) + { + deleteVoiceFont(font_id); + } } + return; + } - // If it is a new (unexpired) font create a new entry. + if (new_font) + { + // If it is a new font create a new entry. font = new voiceFontEntry(font_id); } else @@ -6570,20 +6582,6 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, if (font) { - // Remove existing fonts that have expired since we last saw them. - if (has_expired) - { - LL_DEBUGS("Voice") << "Expired " << (template_font ? "Template: " : ":") - << font->mExpirationDate.asString() << font_id - << " (" << font_index << ") " << name << LL_ENDL; - - if (!template_font) - { - deleteVoiceFont(font_id); - } - return; - } - font->mFontIndex = font_index; // Use the description for the human readable name if available, as the // "name" may be a UUID. @@ -6592,8 +6590,8 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font->mFontType = font_type; font->mFontStatus = font_status; - LL_DEBUGS("Voice") << (template_font ? "Template: " : "") - << font->mExpirationDate.asString() << font->mID + LL_DEBUGS("Voice") << (template_font ? "Template " : "") + << font->mExpirationDate.asString() << " " << font->mID << " (" << font->mFontIndex << ") " << name << LL_ENDL; // Set the expiry timer to trigger a notification when the voice font can no longer be used. @@ -6622,7 +6620,7 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font->mExpiryWarningTimer.stop(); } - // Only flag it as a new font if we have already seen the font list. + // Only flag new session fonts. if (!template_font && mVoiceFontsReceived && new_font) { font->mIsNew = true; @@ -6635,6 +6633,8 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font_list.insert(voice_effect_list_t::value_type(font->mName, font->mID)); } + mVoiceFontListDirty = true; + // Debugging stuff if (font_type < VOICE_FONT_TYPE_NONE || font_type >= VOICE_FONT_TYPE_UNKNOWN) @@ -6706,7 +6706,7 @@ void LLVivoxVoiceClient::expireVoiceFonts() } // Refresh voice font lists in the UI. - notifyVoiceFontObservers(true); + notifyVoiceFontObservers(); } // Give a warning notification if any voice fonts are due to expire. @@ -6729,6 +6729,7 @@ void LLVivoxVoiceClient::deleteVoiceFont(const LLUUID& id) { LL_DEBUGS("Voice") << "Removing " << id << " from the voice font list." << LL_ENDL; mVoiceFontList.erase(list_iter++); + mVoiceFontListDirty = true; } else { @@ -6866,22 +6867,15 @@ void LLVivoxVoiceClient::accountGetSessionFontsResponse(int statusCode, const st { setState(stateVoiceFontsReceived); } - mVoiceFontsReceived = true; - - // If new Voice Fonts have been found notify the user. - if (mVoiceFontsNew) - { - LLNotificationsUtil::add("VoiceEffectsNew"); - mVoiceFontsNew = false; - } - notifyVoiceFontObservers(true); + notifyVoiceFontObservers(); + mVoiceFontsReceived = true; } void LLVivoxVoiceClient::accountGetTemplateFontsResponse(int statusCode, const std::string &statusString) { // Voice font list entries were updated via addVoiceFont() during parsing. - notifyVoiceFontObservers(true); + notifyVoiceFontObservers(); } void LLVivoxVoiceClient::addObserver(LLVoiceEffectObserver* observer) { @@ -6893,19 +6887,30 @@ void LLVivoxVoiceClient::removeObserver(LLVoiceEffectObserver* observer) mVoiceFontObservers.erase(observer); } -void LLVivoxVoiceClient::notifyVoiceFontObservers(bool lists_changed) +void LLVivoxVoiceClient::notifyVoiceFontObservers() { - LL_DEBUGS("Voice") << "Notifying voice effect observers. Lists changed: " << lists_changed << LL_ENDL; + LL_DEBUGS("Voice") << "Notifying voice effect observers. Lists changed: " << mVoiceFontListDirty << LL_ENDL; for (voice_font_observer_set_t::iterator it = mVoiceFontObservers.begin(); it != mVoiceFontObservers.end(); ) { LLVoiceEffectObserver* observer = *it; - observer->onVoiceEffectChanged(lists_changed); + observer->onVoiceEffectChanged(mVoiceFontListDirty); // In case onVoiceEffectChanged() deleted an entry. it = mVoiceFontObservers.upper_bound(observer); } + mVoiceFontListDirty = false; + + // If new Voice Fonts have been added notify the user. + if (mVoiceFontsNew) + { + if(mVoiceFontsReceived) + { + LLNotificationsUtil::add("VoiceEffectsNew"); + } + mVoiceFontsNew = false; + } } void LLVivoxVoiceClient::enablePreviewBuffer(bool enable) @@ -7528,14 +7533,11 @@ LLDate LLVivoxProtocolParser::vivoxTimeStampToLLDate(const std::string& vivox_ts std::string time_stamp = vivox_ts; // Vivox's format is missing a T from being standard ISO 8601, - // so add it. It is the only space in their result. + // so add it instead of the only space after the date. LLStringUtil::replaceChar(time_stamp, ' ', 'T'); - // Also need to remove the hours away from GMT to be compatible - // with LLDate, as well as the fractions of seconds. - time_stamp = time_stamp.substr(0, time_stamp.length() - 5); - - // It also needs a 'Z' at the end + // LLDate can't handle offsets from UTC, so remove it, and add a Z + time_stamp = time_stamp.substr(0, time_stamp.length() - 3); time_stamp += "Z"; ts.fromString(time_stamp); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index debc03377f..5424e352f8 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -869,7 +869,7 @@ private: void accountGetTemplateFontsSendMessage(); void sessionSetVoiceFontSendMessage(sessionState *session); - void notifyVoiceFontObservers(bool lists_changed = false); + void notifyVoiceFontObservers(); typedef enum e_voice_font_type { @@ -906,6 +906,7 @@ private: bool mVoiceFontsReceived; bool mVoiceFontsNew; + bool mVoiceFontListDirty; voice_effect_list_t mVoiceFontList; voice_effect_list_t mVoiceFontTemplateList; -- cgit v1.2.3 From a63b6dd93c1ef78e647dbd221a5a3b14ff363102 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 26 May 2010 14:43:27 +0100 Subject: Hooked up Google Breakpad for the Linux client too. Using Alain's Darwin reporter callback was all that was needed. Also replaced the call that exposed the breakpad exception class with a call to just write out the minidump, as that was the only reason for exposing it. Now clients don't need to know about Google Breakpad. --- indra/newview/llappviewer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7cdd8ca309..0484659793 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -102,7 +102,6 @@ // Third party library includes #include -#include #if LL_WINDOWS @@ -2582,7 +2581,10 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin(); gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); - if(pApp->minidump_path[0] != 0) gDebugInfo["MinidumpPath"] = pApp->minidump_path; + if(pApp->minidump_path[0] != 0) + { + gDebugInfo["MinidumpPath"] = pApp->minidump_path; + } if(gLogoutInProgress) { @@ -3290,7 +3292,7 @@ void LLAppViewer::badNetworkHandler() "www.secondlife.com/support"; forceDisconnect(message.str()); - LLApp::instance()->getExceptionHandler()->WriteMinidump(); + LLApp::instance()->writeMiniDump(); } // This routine may get called more than once during the shutdown process. -- cgit v1.2.3 From 94bddd2b4450674b9f121a10b97f0846b6a97d87 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 26 May 2010 16:46:55 +0100 Subject: EXT-7479 FIXED only bumpmaps of type Brightness or Darkness load on 2.0.2 (205107) --- indra/newview/lldrawpoolbump.cpp | 2 +- indra/newview/llviewercontrol.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index eefb93dc0c..4963b95046 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -82,7 +82,7 @@ static S32 bump_channel = -1; // static void LLStandardBumpmap::init() { - // do nothing + LLStandardBumpmap::restoreGL(); } // static diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index c940437929..2144ab1489 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -118,10 +118,9 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue) static bool handleSetShaderChanged(const LLSD& newvalue) { - // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear the bump cache - gBumpImageList.clear(); - LLStandardBumpmap::clear(); - LLStandardBumpmap::addstandard(); + // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache + gBumpImageList.destroyGL(); + gBumpImageList.restoreGL(); LLViewerShaderMgr::instance()->setShaders(); return true; -- cgit v1.2.3 From 1084bfef0057de5cd3201426aaad68329a62a0da Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 26 May 2010 13:27:19 -0400 Subject: EXT-7213 WIP kill old appearance editor and all traces of code part 2 - correcting a few points that would have broken the build. Final version will be reviewed before pushing. --- indra/newview/llagentwearables.cpp | 17 +++++++++++++++++ indra/newview/llagentwearables.h | 1 + indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/llviewerinventory.cpp | 3 ++- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoavatarself.cpp | 4 ++-- indra/newview/llwearable.cpp | 13 ++++++++----- 7 files changed, 33 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 68c4fa1ea0..0f9ab6cfa1 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -617,6 +617,23 @@ const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) return NULL; } +LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) +{ + const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) + { + LLWearable * curr_wearable = getWearable((LLWearableType::EType)i, j); + if (curr_wearable && (curr_wearable->getItemID() == base_item_id)) + { + return curr_wearable; + } + } + } + return NULL; +} + LLWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_id) { for (S32 i=0; i < LLWearableType::WT_COUNT; i++) diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 1f19d1045b..c53b1333fc 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -91,6 +91,7 @@ public: const LLUUID getWearableItemID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLUUID getWearableAssetID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLWearable* getWearableFromItemID(const LLUUID& item_id) const; + LLWearable* getWearableFromItemID(const LLUUID& item_id); LLWearable* getWearableFromAssetID(const LLUUID& asset_id); LLInventoryItem* getWearableInventoryItem(LLWearableType::EType type, U32 index /*= 0*/); static BOOL selfHasWearable(LLWearableType::EType type); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 39fcf867b1..3ff88ec951 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4879,12 +4879,12 @@ void LLWearableBridge::onEditOnAvatar(void* user_data) void LLWearableBridge::editOnAvatar() { - const LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID); + LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID); if( wearable ) { LLPanel * panel = LLSideTray::getInstance()->getPanel("sidepanel_appearance"); - LLSidePanelAppearance::editWearable(wearable, panel); + LLSidepanelAppearance::editWearable(wearable, panel); } } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 838f57073e..4dbede79da 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -64,6 +64,7 @@ #include "llfloatercustomize.h" #include "llcommandhandler.h" #include "llviewermessage.h" +#include "llsidepanelappearance.h" ///---------------------------------------------------------------------------- /// Helper class to store special inventory item names @@ -883,7 +884,7 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() ) { // If we're in appearance editing mode, the current tab may need to be refreshed - LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); if (panel) { panel->showDefaultSubpart(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 76aa2ae0f1..a1637c4724 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7888,7 +7888,7 @@ BOOL LLVOAvatar::isTextureDefined(LLVOAvatarDefines::ETextureIndex te, U32 index } //virtual -BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index ) const { if (isIndexLocalTexture(type)) { diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ebca12dee8..1ad4175a42 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1333,11 +1333,11 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index) const { if (isIndexBakedTexture(type)) { - return LLVOAvatar::isTextureVisible(type,0); + return LLVOAvatar::isTextureVisible(type, (U32)0); } LLUUID tex_id = getLocalTextureID(type,index); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 358defbb31..94d70992f6 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -33,23 +33,26 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" +#include "llagentcamera.h" #include "llagentwearables.h" +#include "lldictionary.h" #include "llfloatercustomize.h" #include "lllocaltextureobject.h" #include "llnotificationsutil.h" #include "llviewertexturelist.h" #include "llinventorymodel.h" #include "llinventoryobserver.h" +#include "llsidepanelappearance.h" +#include "llsidetray.h" +#include "lltexlayer.h" +#include "lltexglobalcolor.h" +#include "lltrans.h" #include "llviewerregion.h" +#include "llvisualparam.h" #include "llvoavatar.h" #include "llvoavatarself.h" #include "llvoavatardefines.h" #include "llwearable.h" -#include "lldictionary.h" -#include "lltrans.h" -#include "lltexlayer.h" -#include "llvisualparam.h" -#include "lltexglobalcolor.h" using namespace LLVOAvatarDefines; -- cgit v1.2.3 From 4dec1430202d1c5578c4e0a6d4107c88f1050ab3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 26 May 2010 16:07:16 -0400 Subject: VPLAT-268: Add libexception_handler.dylib to viewer_manifest.py. Without this, the viewer fails to start because it can't find the new libexception_handler.dylib. --- indra/newview/viewer_manifest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 96541088b5..cf66fbc383 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -636,7 +636,9 @@ class DarwinManifest(ViewerManifest): if dylibs["llcommon"]: for libfile in ("libapr-1.0.3.7.dylib", "libaprutil-1.0.3.8.dylib", - "libexpat.0.5.0.dylib"): + "libexpat.0.5.0.dylib", + "libexception_handler.dylib", + ): self.path(os.path.join(libdir, libfile), libfile) #libfmodwrapper.dylib -- cgit v1.2.3 From ec7dbc704040dfcdcd101f090dbb2f780ca0ee8a Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 26 May 2010 18:22:04 -0400 Subject: EXT-7213 WIP kill old appearance editor and traces of code Removed last remaining references to gFloaterCustomize. Next step: kill the files themselves. Will be reviewed when complete, before pushing --- indra/newview/llagentwearables.cpp | 10 ++++------ indra/newview/llappearancemgr.cpp | 14 ++++++-------- indra/newview/llinventorybridge.cpp | 12 +++++------- indra/newview/llviewermenu.cpp | 16 +++++++--------- indra/newview/llwearable.cpp | 8 -------- 5 files changed, 22 insertions(+), 38 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0f9ab6cfa1..1deba2e2e6 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1676,14 +1676,12 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty void LLAgentWearables::userRemoveAllClothes() { // We have to do this up front to avoid having to deal with the case of multiple wearables being dirty. - if (gFloaterCustomize) + if (gAgentCamera.cameraCustomizeAvatar()) { - gFloaterCustomize->askToSaveIfDirty(userRemoveAllClothesStep2); - } - else - { - userRemoveAllClothesStep2(TRUE); + // switching to outfit editor should automagically save any currently edited wearable + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } + userRemoveAllClothesStep2(TRUE); } // static diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e017fffa54..5a4c30a307 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -34,6 +34,7 @@ #include "llaccordionctrltab.h" #include "llagent.h" +#include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" #include "llcommandhandler.h" @@ -1362,16 +1363,13 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego llinfos << "wearInventoryCategoryOnAvatar( " << category->getName() << " )" << llendl; - if( gFloaterCustomize ) + if (gAgentCamera.cameraCustomizeAvatar()) { - gFloaterCustomize->askToSaveIfDirty(boost::bind(&LLAppearanceMgr::changeOutfit, - &LLAppearanceMgr::instance(), - _1, category->getUUID(), append)); - } - else - { - LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append); + // switching to outfit editor should automagically save any currently edited wearable + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } + + LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append); } void LLAppearanceMgr::wearOutfitByName(const std::string& name) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3ff88ec951..f3dfde03c3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4447,15 +4447,13 @@ void remove_inventory_category_from_avatar( LLInventoryCategory* category ) << " )" << llendl; - if( gFloaterCustomize ) + if (gAgentCamera.cameraCustomizeAvatar()) { - gFloaterCustomize->askToSaveIfDirty( - boost::bind(remove_inventory_category_from_avatar_step2, _1, category->getUUID())); - } - else - { - remove_inventory_category_from_avatar_step2(TRUE, category->getUUID() ); + // switching to outfit editor should automagically save any currently edited wearable + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } + + remove_inventory_category_from_avatar_step2(TRUE, category->getUUID() ); } struct OnRemoveStruct diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d0ac103f56..b1b6db3305 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3736,17 +3736,15 @@ void reset_view_final( BOOL proceed ); void handle_reset_view() { - if( (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode()) && gFloaterCustomize ) + if (gAgentCamera.cameraCustomizeAvatar()) { - // Show dialog box if needed. - gFloaterCustomize->askToSaveIfDirty( reset_view_final ); - } - else - { - gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW); - reset_view_final( TRUE ); - LLFloaterCamera::resetCameraMode(); + // switching to outfit editor should automagically save any currently edited wearable + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "my_outfits")); } + + gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW); + reset_view_final( TRUE ); + LLFloaterCamera::resetCameraMode(); } class LLViewResetView : public view_listener_t diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 94d70992f6..0fcb257e74 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -579,14 +579,6 @@ BOOL LLWearable::isDirty() const } } - //if( gFloaterCustomize ) - //{ - // if( mDescription != gFloaterCustomize->getWearableDescription( mType ) ) - // { - // return TRUE; - // } - //} - return FALSE; } -- cgit v1.2.3 From cca5aa48ae07a2d0e4f4a26e647b360c098cd831 Mon Sep 17 00:00:00 2001 From: karina Date: Wed, 26 May 2010 23:46:42 -0700 Subject: Add new mechanism for getting a unique machine id. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 2 + indra/newview/llmachineid.cpp | 267 +++++++++++++++++++++ indra/newview/llmachineid.h | 56 +++++ indra/newview/llsechandler_basic.cpp | 19 +- indra/newview/llxmlrpctransaction.cpp | 6 +- .../newview/skins/default/xui/en/notifications.xml | 31 +++ indra/newview/tests/llsechandler_basic_test.cpp | 15 +- 8 files changed, 380 insertions(+), 18 deletions(-) create mode 100644 indra/newview/llmachineid.cpp create mode 100644 indra/newview/llmachineid.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d77d53f6af..ec0116bd87 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -272,6 +272,7 @@ set(viewer_SOURCE_FILES lllogchat.cpp llloginhandler.cpp lllogininstance.cpp + llmachineid.cpp llmanip.cpp llmaniprotate.cpp llmanipscale.cpp @@ -787,6 +788,7 @@ set(viewer_HEADER_FILES lllogchat.h llloginhandler.h lllogininstance.h + llmachineid.h llmanip.h llmaniprotate.h llmanipscale.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f7f7cb599e..5756eade87 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -195,6 +195,7 @@ // Include for security api initialization #include "llsecapi.h" +#include "llmachineid.h" // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either @@ -619,6 +620,7 @@ bool LLAppViewer::init() // *NOTE:Mani - LLCurl::initClass is not thread safe. // Called before threads are created. LLCurl::initClass(); + LLMachineID::init(); initThreads(); writeSystemInfo(); diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp new file mode 100644 index 0000000000..b691baaf08 --- /dev/null +++ b/indra/newview/llmachineid.cpp @@ -0,0 +1,267 @@ +/** + * @file llmachineid.cpp + * @brief retrieves unique machine ids + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lluuid.h" +#include "llmachineid.h" +#define _WIN32_DCOM +#include +using namespace std; +#include +#include + +unsigned char static_unique_id[] = {0,0,0,0,0,0}; +bool static has_static_unique_id = false; + +// get an unique machine id. +// NOT THREAD SAFE - do before setting up threads. +// MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot, Go figure?? + +S32 LLMachineID::init() +{ + memset(static_unique_id,0,sizeof(static_unique_id)); + size_t len = sizeof(static_unique_id); + S32 ret_code = 0; +#if LL_WINDOWS +# pragma comment(lib, "wbemuuid.lib") + + // algorithm to detect BIOS serial number found at: + // http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx + // we can't use the MAC address since on Windows 7, the first returned MAC address changes with every reboot. + + + HRESULT hres; + + // Step 1: -------------------------------------------------- + // Initialize COM. ------------------------------------------ + + hres = CoInitializeEx(0, COINIT_MULTITHREADED); + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << hres << LL_ENDL; + return 1; // Program has failed. + } + + // Step 2: -------------------------------------------------- + // Set general COM security levels -------------------------- + // Note: If you are using Windows 2000, you need to specify - + // the default authentication credentials for a user by using + // a SOLE_AUTHENTICATION_LIST structure in the pAuthList ---- + // parameter of CoInitializeSecurity ------------------------ + + hres = CoInitializeSecurity( + NULL, + -1, // COM authentication + NULL, // Authentication services + NULL, // Reserved + RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication + RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation + NULL, // Authentication info + EOAC_NONE, // Additional capabilities + NULL // Reserved + ); + + + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL; + CoUninitialize(); + return 1; // Program has failed. + } + + // Step 3: --------------------------------------------------- + // Obtain the initial locator to WMI ------------------------- + + IWbemLocator *pLoc = NULL; + + hres = CoCreateInstance( + CLSID_WbemLocator, + 0, + CLSCTX_INPROC_SERVER, + IID_IWbemLocator, (LPVOID *) &pLoc); + + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; + CoUninitialize(); + return 1; // Program has failed. + } + + // Step 4: ----------------------------------------------------- + // Connect to WMI through the IWbemLocator::ConnectServer method + + IWbemServices *pSvc = NULL; + + // Connect to the root\cimv2 namespace with + // the current user and obtain pointer pSvc + // to make IWbemServices calls. + hres = pLoc->ConnectServer( + _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace + NULL, // User name. NULL = current user + NULL, // User password. NULL = current + 0, // Locale. NULL indicates current + NULL, // Security flags. + 0, // Authority (e.g. Kerberos) + 0, // Context object + &pSvc // pointer to IWbemServices proxy + ); + + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL; + pLoc->Release(); + CoUninitialize(); + return 1; // Program has failed. + } + + LL_DEBUGS("AppInit") << "Connected to ROOT\\CIMV2 WMI namespace" << LL_ENDL; + + + // Step 5: -------------------------------------------------- + // Set security levels on the proxy ------------------------- + + hres = CoSetProxyBlanket( + pSvc, // Indicates the proxy to set + RPC_C_AUTHN_WINNT, // RPC_C_AUTHN_xxx + RPC_C_AUTHZ_NONE, // RPC_C_AUTHZ_xxx + NULL, // Server principal name + RPC_C_AUTHN_LEVEL_CALL, // RPC_C_AUTHN_LEVEL_xxx + RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx + NULL, // client identity + EOAC_NONE // proxy capabilities + ); + + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL; + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return 1; // Program has failed. + } + + // Step 6: -------------------------------------------------- + // Use the IWbemServices pointer to make requests of WMI ---- + + // For example, get the name of the operating system + IEnumWbemClassObject* pEnumerator = NULL; + hres = pSvc->ExecQuery( + bstr_t("WQL"), + bstr_t("SELECT * FROM Win32_OperatingSystem"), + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + NULL, + &pEnumerator); + + if (FAILED(hres)) + { + LL_DEBUGS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return 1; // Program has failed. + } + + // Step 7: ------------------------------------------------- + // Get the data from the query in step 6 ------------------- + + IWbemClassObject *pclsObj = NULL; + ULONG uReturn = 0; + + while (pEnumerator) + { + HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, + &pclsObj, &uReturn); + + if(0 == uReturn) + { + break; + } + + VARIANT vtProp; + + // Get the value of the Name property + hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); + LL_DEBUGS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; + // use characters in the returned Serial Number to create a byte array of size len + BSTR serialNumber ( vtProp.bstrVal); + unsigned int j = 0; + while( vtProp.bstrVal[j] != 0) + { + for (unsigned int i = 0; i < len; i++) + { + if (vtProp.bstrVal[j] == 0) + break; + + static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]); + j++; + } + } + VariantClear(&vtProp); + + pclsObj->Release(); + pclsObj = NULL; + break; + } + + // Cleanup + // ======== + + if (pSvc) + pSvc->Release(); + if (pLoc) + pLoc->Release(); + if (pEnumerator) + pEnumerator->Release(); + CoUninitialize(); + ret_code=0; +#else + ret_code = LLUUID::getNodeID(&static_unique_id); +#endif + has_static_unique_id = true; + return ret_code; +} + + +S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) +{ + if (has_static_unique_id) + { + memcpy ( unique_id, &static_unique_id, len); + LL_DEBUGS("AppInit") << "UniqueID: " << unique_id[0] << unique_id[1]<< unique_id[2] << unique_id[3] << unique_id[4] << unique_id [5] << LL_ENDL; + return 1; + } + return 0; +} + + + + diff --git a/indra/newview/llmachineid.h b/indra/newview/llmachineid.h new file mode 100644 index 0000000000..8160309b47 --- /dev/null +++ b/indra/newview/llmachineid.h @@ -0,0 +1,56 @@ +/** + * @file llmachineid.h + * @brief retrieves unique machine ids + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLMACHINEID_H +#define LL_LLMACHINEID_H + + +class LLMachineID +{ +public: + LLMachineID(); + virtual ~LLMachineID(); + static S32 getUniqueID(unsigned char *unique_id, size_t len); + static S32 init(); + +protected: + +private: + + +}; + + + + + +#endif // LL_LLMACHINEID_H diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index edf5ce9b60..c006f4dd0d 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -52,6 +52,7 @@ LLS * By copying, modifying or distributing this software, you acknowledge #include #include #include +#include "llmachineid.h" @@ -1195,9 +1196,9 @@ void LLSecAPIBasicHandler::_readProtectedData() U8 buffer[BUFFER_READ_SIZE]; U8 decrypted_buffer[BUFFER_READ_SIZE]; int decrypted_length; - unsigned char MACAddress[MAC_ADDRESS_BYTES]; - LLUUID::getNodeID(MACAddress); - LLXORCipher cipher(MACAddress, MAC_ADDRESS_BYTES); + unsigned char unique_id[MAC_ADDRESS_BYTES]; + LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); + LLXORCipher cipher(unique_id, sizeof(unique_id)); // read in the salt and key protected_data_stream.read((char *)salt, STORE_SALT_SIZE); @@ -1281,9 +1282,9 @@ void LLSecAPIBasicHandler::_writeProtectedData() EVP_CIPHER_CTX ctx; EVP_CIPHER_CTX_init(&ctx); EVP_EncryptInit(&ctx, EVP_rc4(), salt, NULL); - unsigned char MACAddress[MAC_ADDRESS_BYTES]; - LLUUID::getNodeID(MACAddress); - LLXORCipher cipher(MACAddress, MAC_ADDRESS_BYTES); + unsigned char unique_id[MAC_ADDRESS_BYTES]; + LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); + LLXORCipher cipher(unique_id, sizeof(unique_id)); cipher.encrypt(salt, STORE_SALT_SIZE); protected_data_stream.write((const char *)salt, STORE_SALT_SIZE); @@ -1501,9 +1502,9 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword() } // Decipher with MAC address - unsigned char MACAddress[MAC_ADDRESS_BYTES]; - LLUUID::getNodeID(MACAddress); - LLXORCipher cipher(MACAddress, 6); + unsigned char unique_id[MAC_ADDRESS_BYTES]; + LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); + LLXORCipher cipher(unique_id, sizeof(unique_id)); cipher.decrypt(&buffer[0], buffer.size()); return std::string((const char*)&buffer[0], buffer.size()); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index da61840761..58ba9e1378 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -514,7 +514,9 @@ void LLXMLRPCTransaction::Impl::setStatus(EStatus status, "Despite our best efforts, something unexpected has gone wrong. \n" " \n" "Please check secondlife.com/status \n" - "to see if there is a known problem with the service."; + "to see if there is a known problem with the service.\n" + "If you continue to experience problems," + "Please check your network and firewall setup.\n"; mStatusURI = "http://secondlife.com/status/"; } @@ -550,7 +552,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) "Often this means that your computer\'s clock is set incorrectly.\n" "Please go to Control Panels and make sure the time and date\n" "are set correctly.\n" - "\n" + "Also check that your network and firewall are setup correctly.\n" "If you continue to receive this error, please go\n" "to the Support section of the SecondLife.com web site\n" "and report the problem."; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 999f804e71..b9aec7dd63 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6182,6 +6182,37 @@ Avatar '[NAME]' entered appearance mode. Avatar '[NAME]' left appearance mode. + + We're having trouble connecting using [PROTOCOL] [HOSTID]. + Please check your network and firewall setup. +
+
- - - - - - - - - - - - - - - - - - - - + + + + Rotate Camera Around Focus + + + Zoom Camera Towards Focus + + + Move Camera Up and Down, Left and Right + + + Camera modes + + + Orbit Zoom Pan + + + Preset Views + + + View Object + + + + + + + + + Front View + + + + + + + + Side View + + + + + + + + Rear View + + + + + + + + Object View + + + + + + + + Mouselook View + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From a0351c6ea4446bfa8fc85450c2603251cd703c2c Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 27 May 2010 18:41:28 +0300 Subject: EXT-7200 FIXED Integrated art missing from appearance. Replaced "Shop" button text with icon, changed sizes of buttons according to comments in ticket, also changed heights of hovered and selected icons for items- made them equal to heights of panels they are used on. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/410/ --HG-- branch : product-engine --- .../newview/skins/default/textures/icons/Shop.png | Bin 0 -> 647 bytes indra/newview/skins/default/textures/textures.xml | 1 + .../default/xui/en/panel_body_parts_list_item.xml | 32 +++++++++++------ .../xui/en/panel_bodyparts_list_button_bar.xml | 4 +-- .../xui/en/panel_clothing_list_button_bar.xml | 4 +-- .../default/xui/en/panel_clothing_list_item.xml | 39 ++++++++++++++------- .../xui/en/panel_dummy_clothing_list_item.xml | 10 +++--- .../skins/default/xui/en/sidepanel_appearance.xml | 2 +- 8 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Shop.png (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/icons/Shop.png b/indra/newview/skins/default/textures/icons/Shop.png new file mode 100644 index 0000000000..d7e0001dc6 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Shop.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 57f23c7e76..29c72a414b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -453,6 +453,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml index e3f6045e27..2edd643cc5 100644 --- a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml @@ -1,7 +1,7 @@ - + height="23" + width="23" + tab_stop="false"> + + - - - - - - - - - - - - - + + + + Rotate Camera Around Focus + + + Zoom Camera Towards Focus + + + Move Camera Up and Down, Left and Right + + + Camera modes + + + Orbit Zoom Pan + + + Preset Views + + + View Object + + + + + + + + + Front View + + + + + + + + Side View + + + + + + + + Rear View + + + + + + + + Object View + + + + + + + + Mouselook View + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/panel_camera_item.xml b/indra/newview/skins/default/xui/en/widgets/panel_camera_item.xml index a77b81f76f..98707b8495 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel_camera_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel_camera_item.xml @@ -1,70 +1,70 @@ - - - - - - - - Text - - \ No newline at end of file + + + + + + + + Text + + -- cgit v1.2.3 From e25d0d34ba1b88008ef3bfbf40fb43f498bc1bea Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:01:26 +0100 Subject: CID-481 Checker: FORWARD_NULL Function: LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory *, LLInventoryObject *) File: /indra/newview/llpanelobjectinventory.cpp --- indra/newview/llpanelobjectinventory.cpp | 54 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 0d3beaa9a5..c557e9b85d 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1249,29 +1249,30 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* { LLTaskInvFVBridge* new_bridge = NULL; const LLInventoryItem* item = dynamic_cast(object); + const U32 itemflags = ( NULL == item ? 0 : item->getFlags() ); LLAssetType::EType type = object->getType(); switch(type) { case LLAssetType::AT_TEXTURE: new_bridge = new LLTaskTextureBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_SOUND: new_bridge = new LLTaskSoundBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_LANDMARK: new_bridge = new LLTaskLandmarkBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_CALLINGCARD: new_bridge = new LLTaskCallingCardBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_SCRIPT: // OLD SCRIPTS DEPRECATED - JC @@ -1281,45 +1282,42 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* // object->getName()); break; case LLAssetType::AT_OBJECT: - { - U32 flags = ( NULL == item ? 0 : item->getFlags() ); - new_bridge = new LLTaskObjectBridge(panel, - object->getUUID(), - object->getName(), - flags); - } + new_bridge = new LLTaskObjectBridge(panel, + object->getUUID(), + object->getName(), + itemflags); break; case LLAssetType::AT_NOTECARD: new_bridge = new LLTaskNotecardBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_ANIMATION: new_bridge = new LLTaskAnimationBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_GESTURE: new_bridge = new LLTaskGestureBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: new_bridge = new LLTaskWearableBridge(panel, - object->getUUID(), - object->getName(), - item->getFlags()); + object->getUUID(), + object->getName(), + itemflags); break; case LLAssetType::AT_CATEGORY: new_bridge = new LLTaskCategoryBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; case LLAssetType::AT_LSL_TEXT: new_bridge = new LLTaskLSLBridge(panel, - object->getUUID(), - object->getName()); + object->getUUID(), + object->getName()); break; default: llinfos << "Unhandled inventory type (llassetstorage.h): " -- cgit v1.2.3 From c68e4c559718740bc19eb3c9c71a11d450bae3b5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:04:49 +0100 Subject: CID-478 Checker: NULL_RETURNS Function: LLCOFWearables::buildBodypartListItem(LLViewerInventoryItem *) File: /indra/newview/llcofwearables.cpp --- indra/newview/llcofwearables.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index dfc203111a..661449c60c 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -340,14 +340,15 @@ LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventory LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventoryItem* item) { llassert(item); - + if (!item) return NULL; LLPanelBodyPartsListItem* item_panel = LLPanelBodyPartsListItem::create(item); if (!item_panel) return NULL; //updating verbs //we don't need to use permissions of a link but of an actual/linked item if (item->getLinkedItem()) item = item->getLinkedItem(); - + llassert(item); + if (!item) return NULL; bool allow_modify = item->getPermissions().allowModifyBy(gAgentID); item_panel->setShowLockButton(!allow_modify); item_panel->setShowEditButton(allow_modify); -- cgit v1.2.3 From 89990d746e7cef9e96c6aa350d25309f7c0c29de Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:06:03 +0100 Subject: CID-477 Checker: NULL_RETURNS Function: LLCOFWearables::buildClothingListItem(LLViewerInventoryItem *, bool, bool) File: /indra/newview/llcofwearables.cpp --- indra/newview/llcofwearables.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 661449c60c..0864d63919 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -308,13 +308,15 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last) { llassert(item); - + if (!item) return NULL; LLPanelClothingListItem* item_panel = LLPanelClothingListItem::create(item); if (!item_panel) return NULL; //updating verbs //we don't need to use permissions of a link but of an actual/linked item if (item->getLinkedItem()) item = item->getLinkedItem(); + llassert(item); + if (!item) return NULL; bool allow_modify = item->getPermissions().allowModifyBy(gAgentID); -- cgit v1.2.3 From b3f758785dd0ee165276c0ac97e1823e44536cc8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:07:45 +0100 Subject: CID-479 Checker: UNINIT_CTOR Function: LLVivoxVoiceClient::sessionState::sessionState() File: /indra/newview/llvoicevivox.cpp --- indra/newview/llvoicevivox.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 1597691347..f90d46bc9c 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5538,6 +5538,7 @@ LLVivoxVoiceClient::sessionState::sessionState() : mVoiceEnabled(false), mReconnect(false), mVolumeDirty(false), + mMuteDirty(false), mParticipantsChanged(false) { } -- cgit v1.2.3 From 14e03b56fc363d83004d0c0ae5d79a9bedf68eae Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:09:48 +0100 Subject: CID-480 Checker: UNINIT_CTOR Function: LLVivoxVoiceClient::participantState::participantState(const std::basic_string, std::allocator>&) File: /indra/newview/llvoicevivox.cpp --- indra/newview/llvoicevivox.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f90d46bc9c..c6c155f0f0 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4088,7 +4088,9 @@ LLVivoxVoiceClient::participantState::participantState(const std::string &uri) : mLastSpokeTimestamp(0.f), mPower(0.f), mVolume(LLVoiceClient::VOLUME_DEFAULT), + mUserVolume(0), mOnMuteList(false), + mVolumeSet(false), mVolumeDirty(false), mAvatarIDValid(false), mIsSelf(false) -- cgit v1.2.3 From 878e1d06d5e9ac3bb6c002d3fd7342f5beda2017 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:20:06 +0100 Subject: CID-476 Checker: NULL_RETURNS Function: LLPanelEditWearable::updateScrollingPanelUI() File: /indra/newview/llpaneleditwearable.cpp --- indra/newview/llpaneleditwearable.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 9eccceca66..36f2d05fab 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1095,6 +1095,8 @@ void LLPanelEditWearable::updateScrollingPanelUI() if(panel && (mWearablePtr->getItemID().notNull())) { const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type); + llassert(wearable_entry); + if (!wearable_entry) return; U8 num_subparts = wearable_entry->mSubparts.size(); LLScrollingPanelParam::sUpdateDelayFrames = 0; -- cgit v1.2.3 From 4f0d41090469c5b43f50308433e3cadbac9f368a Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Fri, 28 May 2010 12:28:40 +0100 Subject: EXT-7496 FIXED Turn OFF extra Voice debug logging when merging Voice Morphing --- indra/newview/app_settings/logcontrol.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index f907f184f7..937c4e4c6a 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -41,7 +41,8 @@ tags - Voice + +
-- cgit v1.2.3 From 3927d183278e4cc11396a2c78b9393bcf6b0e802 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:31:43 +0100 Subject: CID-466 Checker: NULL_RETURNS Function: LLInventoryItemsList::refresh() File: /indra/newview/llinventoryitemslist.cpp --- indra/newview/llinventoryitemslist.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 1c3eb547bb..750cdfb678 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -388,7 +388,7 @@ void LLInventoryItemsList::refresh() computeDifference(getIDs(), added_items, removed_items); bool add_limit_exceeded = false; - unsigned nadded = 0; + unsigned int nadded = 0; uuid_vec_t::const_iterator it = added_items.begin(); for( ; added_items.end() != it; ++it) @@ -400,8 +400,12 @@ void LLInventoryItemsList::refresh() } LLViewerInventoryItem* item = gInventory.getItem(*it); // Do not rearrange items on each adding, let's do that on filter call - addNewItem(item, false); - ++nadded; + llassert(item); + if (item) + { + addNewItem(item, false); + ++nadded; + } } it = removed_items.begin(); -- cgit v1.2.3 From 6f8e96159a59b3e519cf7a5abba3ae34abcab725 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:41:54 +0100 Subject: CID-448 Checker: UNINIT_CTOR Function: LLVoiceClient::LLVoiceClient() File: /indra/newview/llvoiceclient.cpp --- indra/newview/llvoiceclient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 91353281a8..42e44634b6 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -81,8 +81,10 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv /////////////////////////////////////////////////////////////////////////////////////////////// LLVoiceClient::LLVoiceClient() + : + mVoiceModule(NULL), + m_servicePump(NULL) { - mVoiceModule = NULL; } //--------------------------------------------------- -- cgit v1.2.3 From 58fb834a6ea3698ec6d89cb07e543d088dc69c00 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:46:31 +0100 Subject: CID-443 Checker: FORWARD_NULL Function: LLBasicCertificateVector::BasicIteratorImpl::equals(const LLPointer &) const File: /indra/newview/llsechandler_basic.h --- indra/newview/llsechandler_basic.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 4bbb73f062..407e74ad00 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -116,6 +116,8 @@ public: virtual bool equals(const LLPointer& _iter) const { const BasicIteratorImpl *rhs_iter = dynamic_cast(_iter.get()); + llassert(rhs_iter); + if (!rhs_iter) return 0; return (mIter == rhs_iter->mIter); } virtual LLPointer get() -- cgit v1.2.3 From 7e0b36d6102f5e285296cd8e0dc6961b5c73c7cb Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 28 May 2010 12:47:45 +0100 Subject: CID-442 Checker: FORWARD_NULL Function: LLBasicCertificateVector::insert(LLCertificateVector::iterator, LLPointer) File: /indra/newview/llsechandler_basic.cpp --- indra/newview/llsechandler_basic.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index edf5ce9b60..c4c13ccdca 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -541,7 +541,7 @@ LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& pa // Insert a certificate into the store. If the certificate already // exists in the store, nothing is done. void LLBasicCertificateVector::insert(iterator _iter, - LLPointer cert) + LLPointer cert) { LLSD cert_info = cert->getLLSD(); if (cert_info.isMap() && cert_info.has(CERT_SHA1_DIGEST)) @@ -551,7 +551,11 @@ void LLBasicCertificateVector::insert(iterator _iter, if(find(existing_cert_info) == end()) { BasicIteratorImpl *basic_iter = dynamic_cast(_iter.mImpl.get()); - mCerts.insert(basic_iter->mIter, cert); + llassert(basic_iter); + if (basic_iter) + { + mCerts.insert(basic_iter->mIter, cert); + } } } } -- cgit v1.2.3 From 4fb77380279bdf853b7f213ba8997511720468dd Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 28 May 2010 15:10:52 +0100 Subject: Write breakpad minidump files to the SL log directory. Also, clean out old minidump files when we start up. --- indra/newview/llappviewer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 00a2678a9a..3528deb9e0 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -602,6 +602,14 @@ bool LLAppViewer::init() if (!initConfiguration()) return false; + // write Google Breakpad minidump files to our log directory + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + logdir += gDirUtilp->getDirDelimiter(); + setMiniDumpDir(logdir); + + // remove any old minidump files from the log directory + gDirUtilp->deleteFilesInDir(logdir, "*-*-*-*-*.dmp"); + // Although initLogging() is the right place to mess with // setFatalFunction(), we can't query gSavedSettings until after // initConfiguration(). @@ -2574,9 +2582,10 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin(); gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); - if(pApp->minidump_path[0] != 0) + char *minidump_file = pApp->getMiniDumpFilename(); + if(minidump_file && minidump_file[0] != 0) { - gDebugInfo["MinidumpPath"] = pApp->minidump_path; + gDebugInfo["MinidumpPath"] = minidump_file; } if(gLogoutInProgress) -- cgit v1.2.3 From e07deaa3dac6b9bc651034543c174e974b4b9ad2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 28 May 2010 11:38:37 -0400 Subject: AVP-44 WIP architectural cleanup for multi-wearables Implemented some resident-suggested tweaks to better support multiwearables code reviewed by Seraph --- indra/newview/llagentwearables.cpp | 14 +++++++------- indra/newview/llagentwearables.h | 5 +++-- indra/newview/llappearancemgr.cpp | 5 +++-- indra/newview/llwearabletype.cpp | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index cc9e68d593..e5796f8e63 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -718,16 +718,16 @@ U32 LLAgentWearables::pushWearable(const LLWearableType::EType type, LLWearable { // no null wearables please! llwarns << "Null wearable sent for type " << type << llendl; - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } - if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) + if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) { mWearableDatas[type].push_back(wearable); wearableUpdated(wearable); checkWearableAgainstInventory(wearable); return mWearableDatas[type].size()-1; } - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } void LLAgentWearables::wearableUpdated(LLWearable *wearable) @@ -764,7 +764,7 @@ void LLAgentWearables::popWearable(LLWearable *wearable) U32 index = getWearableIndex(wearable); LLWearableType::EType type = wearable->getType(); - if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type)) + if (index < MAX_CLOTHING_PER_TYPE && index < getWearableCount(type)) { popWearable(type, index); } @@ -785,7 +785,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) { if (wearable == NULL) { - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const LLWearableType::EType type = wearable->getType(); @@ -793,7 +793,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) if (wearable_iter == mWearableDatas.end()) { llwarns << "tried to get wearable index with an invalid type!" << llendl; - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const wearableentry_vec_t& wearable_vec = wearable_iter->second; for(U32 index = 0; index < wearable_vec.size(); index++) @@ -804,7 +804,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) } } - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const LLWearable* LLAgentWearables::getWearable(const LLWearableType::EType type, U32 index) const diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index c53b1333fc..5d5c5ae371 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -102,6 +102,9 @@ public: U32 getWearableCount(const LLWearableType::EType type) const; U32 getWearableCount(const U32 tex_index) const; + static const U32 MAX_CLOTHING_PER_TYPE = 5; + + //-------------------------------------------------------------------- // Setters //-------------------------------------------------------------------- @@ -274,8 +277,6 @@ private: LLPointer mCB; }; - static const U32 MAX_WEARABLES_PER_TYPE = 1; - }; // LLAgentWearables extern LLAgentWearables gAgentWearables; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8cc4436188..c417f8bdf5 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -970,7 +970,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING, false); // Reduce wearables to max of one per type. removeDuplicateItems(wear_items); - filterWearableItems(wear_items, 5); + filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); // - Attachments: include COF contents only if appending. LLInventoryModel::item_array_t obj_items; @@ -1525,11 +1525,12 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update else { LLPointer cb = do_update ? new ModifiedCOFCallback : 0; + const std::string description = vitem->getIsLinkType() ? vitem->getDescription() : ""; link_inventory_item( gAgent.getID(), vitem->getLinkedUUID(), getCOF(), vitem->getName(), - vitem->getDescription(), + description, LLAssetType::AT_LINK, cb); } diff --git a/indra/newview/llwearabletype.cpp b/indra/newview/llwearabletype.cpp index c692df06ad..2a14ace38c 100644 --- a/indra/newview/llwearabletype.cpp +++ b/indra/newview/llwearabletype.cpp @@ -85,7 +85,7 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_TATTOO)); addEntry(LLWearableType::WT_INVALID, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE)); addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE)); - addEntry(LLWearableType::WT_COUNT, NULL); + addEntry(LLWearableType::WT_COUNT, new WearableEntry("count", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE)); } // static -- cgit v1.2.3 From d42fd6cf7fa3ac4d7e2ef35cef50eb7740b4ec6d Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 28 May 2010 20:10:10 +0300 Subject: EXT-7472 FIXED Open add to outfit panel by (+) button click on unwearable items and by selecting 'Replace' menu item click body part context menu Main changes: - Added callback for a '(+) button' to the LLCOFCallbacks and bind it with LLPanelOutfitEdit::onAddWearableClicked - Created the callback(LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked) for 'Replace' menu item of context menu Related changes: - Changed LLFilteredWearableListManager so that it can use different functors (subclasses of LLInventoryCollectFunctor) as a criterion for LLInventoryItemsList filtering. Before it used only LLFindNonLinksByMask filter. Moved LLFindNonLinksByMask from to the llfilteredwearablelist.cpp to the llinventoryfunctions.h - Created getter 'LLPanelDummyClothingListItem::getWearableType()' for LLPanelDummyClothingListItem - Made 'add wearables panel' a member of LLPanelOutfitEdit so that not to use findChild each time panel is needed Reviewed by Igor Borovkov at http://jira.secondlife.com/browse/EXT-7472 --HG-- branch : product-engine --- indra/newview/llcofwearables.cpp | 16 +++++++++-- indra/newview/llcofwearables.h | 3 ++ indra/newview/llfilteredwearablelist.cpp | 46 +++++++++--------------------- indra/newview/llfilteredwearablelist.h | 9 +++--- indra/newview/llinventoryfunctions.cpp | 5 ++++ indra/newview/llinventoryfunctions.h | 35 ++++++++++++++++++++++- indra/newview/llpaneloutfitedit.cpp | 49 +++++++++++++++++++++++++++++--- indra/newview/llpaneloutfitedit.h | 9 ++++++ indra/newview/llwearableitemslist.cpp | 5 ++++ indra/newview/llwearableitemslist.h | 1 + 10 files changed, 134 insertions(+), 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index dfc203111a..6e7a7fe937 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -43,6 +43,8 @@ #include "llmenugl.h" #include "llviewermenu.h" #include "llwearableitemslist.h" +#include "llpaneloutfitedit.h" +#include "llsidetray.h" static LLRegisterPanelClassWrapper t_cof_accodion_list_adaptor("accordion_list_adaptor"); @@ -135,8 +137,10 @@ protected: LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; LLUUID selected_id = mUUIDs.back(); - registrar.add("BodyPart.Replace", boost::bind(&LLAppearanceMgr::wearItemOnAvatar, - LLAppearanceMgr::getInstance(), selected_id, true, true)); + // *HACK* need to pass pointer to LLPanelOutfitEdit instead of LLSideTray::getInstance()->getPanel(). + // LLSideTray::getInstance()->getPanel() is rather slow variant + LLPanelOutfitEdit* panel_oe = dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfit_edit")); + registrar.add("BodyPart.Replace", boost::bind(&LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked, panel_oe, selected_id)); registrar.add("BodyPart.Edit", boost::bind(LLAgentWearables::editWearable, selected_id)); enable_registrar.add("BodyPart.OnEnable", boost::bind(&CofBodyPartContextMenu::onEnable, this, _2)); @@ -416,6 +420,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by LLWearableType::EType w_type = static_cast(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; + item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable); mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); } } @@ -435,6 +440,13 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) return selected_ids.size() != 0; } +LLPanel* LLCOFWearables::getSelectedItem() +{ + if (!mLastSelectedList) return NULL; + + return mLastSelectedList->getSelectedItem(); +} + void LLCOFWearables::clear() { mAttachments->clear(); diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 590aa709dd..8f8bda2be8 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -107,6 +107,7 @@ public: typedef boost::function cof_callback_t; + cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; cof_callback_t mMoveWearableFurther; cof_callback_t mEditWearable; @@ -123,6 +124,8 @@ public: LLUUID getSelectedUUID(); bool getSelectedUUIDs(uuid_vec_t& selected_ids); + LLPanel* getSelectedItem(); + void refresh(); void clear(); diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index fd99f673e0..28e159421c 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -37,32 +37,10 @@ #include "llinventoryitemslist.h" #include "llinventorymodel.h" -class LLFindNonLinksByMask : public LLInventoryCollectFunctor -{ -public: - LLFindNonLinksByMask(U64 mask) - : mFilterMask(mask) - {} - - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { - if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) - { - return true; - } - - return false; - } -private: - U64 mFilterMask; -}; - -////////////////////////////////////////////////////////////////////////// - -LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask) +LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) : mWearableList(list) -, mFilterMask(filter_mask) +, mCollector(collector) { llassert(mWearableList); gInventory.addObserver(this); @@ -84,9 +62,9 @@ void LLFilteredWearableListManager::changed(U32 mask) populateList(); } -void LLFilteredWearableListManager::setFilterMask(U64 mask) +void LLFilteredWearableListManager::setFilterCollector(LLInventoryCollectFunctor* collector) { - mFilterMask = mask; + mCollector = collector; populateList(); } @@ -94,14 +72,16 @@ void LLFilteredWearableListManager::populateList() { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - LLFindNonLinksByMask collector(mFilterMask); - gInventory.collectDescendentsIf( - gInventory.getRootFolderID(), - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - collector); + if(mCollector) + { + gInventory.collectDescendentsIf( + gInventory.getRootFolderID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + *mCollector); + } // Probably will also need to get items from Library (waiting for reply in EXT-6724). diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h index 0780c02442..b7825c07af 100644 --- a/indra/newview/llfilteredwearablelist.h +++ b/indra/newview/llfilteredwearablelist.h @@ -32,6 +32,7 @@ #ifndef LL_LLFILTEREDWEARABLELIST_H #define LL_LLFILTEREDWEARABLELIST_H +#include "llinventoryfunctions.h" #include "llinventoryobserver.h" class LLInventoryItemsList; @@ -42,7 +43,7 @@ class LLFilteredWearableListManager : public LLInventoryObserver LOG_CLASS(LLFilteredWearableListManager); public: - LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask); + LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector); ~LLFilteredWearableListManager(); /** LLInventoryObserver implementation @@ -51,9 +52,9 @@ public: /*virtual*/ void changed(U32 mask); /** - * Sets new filter and applies it immediately + * Sets new collector and applies it immediately */ - void setFilterMask(U64 mask); + void setFilterCollector(LLInventoryCollectFunctor* collector); /** * Populates wearable list with filtered data. @@ -62,7 +63,7 @@ public: private: LLInventoryItemsList* mWearableList; - U64 mFilterMask; + LLInventoryCollectFunctor* mCollector; }; #endif //LL_LLFILTEREDWEARABLELIST_H diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index c38d45f0f5..6301ff0d6d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -372,6 +372,11 @@ bool LLFindWearablesOfType::operator()(LLInventoryCategory* cat, LLInventoryItem return true; } +void LLFindWearablesOfType::setType(LLWearableType::EType type) +{ + mWearableType = type; +} + ///---------------------------------------------------------------------------- /// LLAssetIDMatches ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 8b96ba29d9..bb365573d7 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -251,6 +251,37 @@ public: }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFindNonLinksByMask +// +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFindNonLinksByMask : public LLInventoryCollectFunctor +{ +public: + LLFindNonLinksByMask(U64 mask) + : mFilterMask(mask) + {} + + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) + { + return true; + } + + return false; + } + + void setFilterMask(U64 mask) + { + mFilterMask = mask; + } + +private: + U64 mFilterMask; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFindWearables // @@ -272,8 +303,10 @@ public: LLFindWearablesOfType(LLWearableType::EType type) : mWearableType(type) {} virtual ~LLFindWearablesOfType() {} virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + void setType(LLWearableType::EType type); - const LLWearableType::EType mWearableType; +private: + LLWearableType::EType mWearableType; }; /** Inventory Collector Functions diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ae4b288588..8d7a2b33be 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -67,6 +67,7 @@ #include "llsidepanelappearance.h" #include "lltoggleablemenu.h" #include "llwearablelist.h" +#include "llwearableitemslist.h" static LLRegisterPanelClassWrapper t_outfit_edit("panel_outfit_edit"); @@ -214,7 +215,10 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mCOFObserver(NULL), mGearMenu(NULL), mCOFDragAndDropObserver(NULL), - mInitialized(false) + mInitialized(false), + mAddWearablesPanel(NULL), + mWearableListMaskCollector(NULL), + mWearableListTypeCollector(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -236,6 +240,9 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit() delete mCOFObserver; delete mCOFDragAndDropObserver; + + delete mWearableListMaskCollector; + delete mWearableListTypeCollector; } BOOL LLPanelOutfitEdit::postBuild() @@ -261,6 +268,7 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFWearables = getChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onOutfitItemSelectionChange, this)); + mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this); mCOFWearables->getCOFCallbacks().mEditWearable = boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this); mCOFWearables->getCOFCallbacks().mDeleteWearable = boost::bind(&LLPanelOutfitEdit::onRemoveFromOutfitClicked, this); mCOFWearables->getCOFCallbacks().mMoveWearableCloser = boost::bind(&LLPanelOutfitEdit::moveWearable, this, true); @@ -268,6 +276,7 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFWearables->childSetAction("add_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this)); + mAddWearablesPanel = getChild("add_wearables_panel"); mInventoryItemsPanel = getChild("inventory_items"); mInventoryItemsPanel->setFilterTypes(ALL_ITEMS_MASK); @@ -306,9 +315,12 @@ BOOL LLPanelOutfitEdit::postBuild() save_registar.add("Outfit.SaveAsNew.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true)); mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_save_outfit.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK); + mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE); + mWearableItemsPanel = getChild("filtered_wearables_panel"); mWearableItemsList = getChild("filtered_wearables_list"); - mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, ALL_ITEMS_MASK); + mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, mWearableListMaskCollector); return TRUE; } @@ -334,7 +346,8 @@ void LLPanelOutfitEdit::moveWearable(bool closer_to_body) void LLPanelOutfitEdit::toggleAddWearablesPanel() { - childSetVisible("add_wearables_panel", !childIsVisible("add_wearables_panel")); + BOOL current_visibility = mAddWearablesPanel->getVisible(); + mAddWearablesPanel->setVisible(!current_visibility); } void LLPanelOutfitEdit::showWearablesFilter() @@ -407,7 +420,9 @@ void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl) { U32 curr_filter_type = type_filter->getCurrentIndex(); mInventoryItemsPanel->setFilterTypes(mLookItemTypes[curr_filter_type].inventoryMask); - mWearableListManager->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); + + mWearableListMaskCollector->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); + mWearableListManager->setFilterCollector(mWearableListMaskCollector); } mSavedFolderState->setApply(TRUE); @@ -487,6 +502,25 @@ void LLPanelOutfitEdit::onAddToOutfitClicked(void) LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id); } +void LLPanelOutfitEdit::onAddWearableClicked(void) +{ + LLPanelDummyClothingListItem* item = dynamic_cast(mCOFWearables->getSelectedItem()); + + if(item) + { + showFilteredWearableItemsList(item->getWearableType()); + } +} + +void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id) +{ + LLViewerInventoryItem* item = gInventory.getLinkedItem(selected_item_id); + + if (item && item->getType() == LLAssetType::AT_BODYPART) + { + showFilteredWearableItemsList(item->getWearableType()); + } +} void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) { @@ -722,4 +756,11 @@ void LLPanelOutfitEdit::onGearMenuItemClick(const LLSD& data) } } +void LLPanelOutfitEdit::showFilteredWearableItemsList(LLWearableType::EType type) +{ + mWearableListTypeCollector->setType(type); + mWearableListManager->setFilterCollector(mWearableListTypeCollector); + mAddWearablesPanel->setVisible(TRUE); +} + // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 1bf69c5606..dbfeb2c375 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -59,6 +59,8 @@ class LLToggleableMenu; class LLFilterEditor; class LLFilteredWearableListManager; class LLMenuGL; +class LLFindNonLinksByMask; +class LLFindWearablesOfType; class LLPanelOutfitEdit : public LLPanel { @@ -103,6 +105,8 @@ public: void onOutfitItemSelectionChange(void); void onRemoveFromOutfitClicked(void); void onEditWearableClicked(void); + void onAddWearableClicked(void); + void onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id); void displayCurrentOutfit(); void updateCurrentOutfitName(); @@ -129,6 +133,7 @@ private: void onGearButtonClick(LLUICtrl* clicked_button); void onGearMenuItemClick(const LLSD& data); + void showFilteredWearableItemsList(LLWearableType::EType type); LLTextBox* mCurrentOutfitName; @@ -141,6 +146,10 @@ private: LLButton* mFolderViewBtn; LLButton* mListViewBtn; LLToggleableMenu* mSaveMenu; + LLPanel* mAddWearablesPanel; + + LLFindNonLinksByMask* mWearableListMaskCollector; + LLFindWearablesOfType* mWearableListTypeCollector; LLFilteredWearableListManager* mWearableListManager; LLInventoryItemsList* mWearableItemsList; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index fb7577c008..161cd40cfc 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -251,6 +251,11 @@ BOOL LLPanelDummyClothingListItem::postBuild() return TRUE; } +LLWearableType::EType LLPanelDummyClothingListItem::getWearableType() const +{ + return mWearableType; +} + LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type) : LLPanelWearableListItem(NULL) , mWearableType(w_type) diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 7ad1b5a3ad..de024ed220 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -162,6 +162,7 @@ public: /*virtual*/ void updateItem(); /*virtual*/ BOOL postBuild(); + LLWearableType::EType getWearableType() const; protected: LLPanelDummyClothingListItem(LLWearableType::EType w_type); -- cgit v1.2.3 From 05626c3371395d76b1f2e6b7fcbe64ef12f7d974 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 28 May 2010 20:13:18 +0300 Subject: EXT-7013 FIX time formatting function didn't work for some parameters for Japanise (like weekdays). reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/457/ --HG-- branch : product-engine --- indra/newview/llappviewer.cpp | 11 ++++++++++- indra/newview/skins/default/xui/en/strings.xml | 15 +++++++++++++++ indra/newview/skins/default/xui/ja/strings.xml | 20 +++++++++++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f7f7cb599e..7b17933b5c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -890,7 +890,16 @@ bool LLAppViewer::init() } LLViewerMedia::initClass(); - + + LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames")); + LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames")); + LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames")); + LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames")); + LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat")); + + LLStringOps::sAM = LLTrans::getString("dateTimeAM"); + LLStringOps::sPM = LLTrans::getString("dateTimePM"); + return true; } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e57b30185d..9247e3f74c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3183,4 +3183,19 @@ Abuse Report Please check secondlife.com/status to see if there is a known problem with the service. + + + + + + + + diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 57120ff7ec..a06dcc54e4 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -1,4 +1,4 @@ - + + + Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday + + + Son:Mon:Tue:Wed:Thu:Fri:Sat + + + January:February:March:April:May:June:July:August:September:October:November:December + + + Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec + + + [MDAY] D + + AM + PM -- cgit v1.2.3 From fd98253aecb4a26a9a41cf5b2af0802a1b9e19d5 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Fri, 28 May 2010 18:46:22 +0100 Subject: Fix borked merge, DOH! --- indra/newview/llvoiceclient.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 76cf7ad3dd..e8635d7f1a 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -117,7 +117,6 @@ LLVoiceClient::LLVoiceClient() : mVoiceModule(NULL), m_servicePump(NULL), - mVoiceModule(NULL), mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled")), mVoiceEffectDefault(LLCachedControl(gSavedPerAccountSettings, "VoiceEffectDefault")) { -- cgit v1.2.3 From 0b96ae29cf0b2baf4732e09a28a5f76d3df05727 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 28 May 2010 14:02:44 -0400 Subject: Fixed linux compile error due to missing forward declare in lltextureview.h. --- indra/newview/lltextureview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h index 6072cd3f11..dfd9c42c2c 100644 --- a/indra/newview/lltextureview.h +++ b/indra/newview/lltextureview.h @@ -38,6 +38,7 @@ class LLViewerFetchedTexture; class LLTextureBar; class LLGLTexMemBar; +class LLAvatarTexBar; class LLTextureView : public LLContainerView { -- cgit v1.2.3 From 3f5abfb2bf58032242d6c24328463558a1828b20 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Fri, 28 May 2010 11:47:38 -0700 Subject: ND-46735 WIP FR JA linguistic --- .../newview/skins/default/xui/fr/floater_preview_gesture.xml | 12 ++++++------ indra/newview/skins/default/xui/fr/floater_tools.xml | 2 +- indra/newview/skins/default/xui/fr/notifications.xml | 2 +- indra/newview/skins/default/xui/fr/panel_edit_pick.xml | 4 ++-- .../skins/default/xui/fr/panel_group_control_panel.xml | 2 +- indra/newview/skins/default/xui/fr/panel_group_notices.xml | 6 +++--- indra/newview/skins/default/xui/fr/panel_notes.xml | 2 +- indra/newview/skins/default/xui/fr/panel_people.xml | 2 +- .../skins/default/xui/fr/panel_preferences_advanced.xml | 2 +- indra/newview/skins/default/xui/fr/panel_profile.xml | 2 +- indra/newview/skins/default/xui/fr/strings.xml | 2 +- .../newview/skins/default/xui/ja/floater_avatar_textures.xml | 2 +- indra/newview/skins/default/xui/ja/floater_god_tools.xml | 2 +- indra/newview/skins/default/xui/ja/floater_moveview.xml | 12 ++++++------ indra/newview/skins/default/xui/ja/menu_avatar_self.xml | 4 ++-- .../skins/default/xui/ja/panel_bodyparts_list_button_bar.xml | 4 ++-- .../skins/default/xui/ja/panel_clothing_list_button_bar.xml | 2 +- indra/newview/skins/default/xui/ja/panel_edit_shape.xml | 2 +- indra/newview/skins/default/xui/ja/panel_region_general.xml | 2 +- indra/newview/skins/default/xui/ja/panel_region_texture.xml | 4 ++-- 20 files changed, 36 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml index 7133f8754c..1d164ac661 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml @@ -31,10 +31,10 @@ Description : - Déclencheur : + Déclench. : - Remplacer par : + Rempl. par : @@ -50,20 +50,20 @@ Étapes : - - - - - Date: Tue, 1 Jun 2010 14:13:56 +0300 Subject: =?UTF-8?q?EXT-6710=20FIXED=20Added=20inventory=20items=20sharing?= =?UTF-8?q?=20confirmation=20and=20modified=20alert=20about=20non-copy=20o?= =?UTF-8?q?bjects=20sharing.=20Current=20behavior:=20*=20user=20will=20be?= =?UTF-8?q?=20prompted=20about=20sharing=20items=20regardless=20is=20it=20?= =?UTF-8?q?one=20or=20more=20items;=20*=20user=20will=20be=20prompted=20ab?= =?UTF-8?q?out=20trying=20to=20share=20one=20ore=20more=20non-copy=20items?= =?UTF-8?q?;=20*=20in=20case=20user=20tries=20to=20share=20non-copy=20item?= =?UTF-8?q?s=20among=20with=20copy=20items=20=E2=80=94=20copy=20=20tems=20?= =?UTF-8?q?will=20be=20shared=20and=20user=20will=20be=20prompted=20about?= =?UTF-8?q?=20sharing=20non-copy=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/475/ --HG-- branch : product-engine --- indra/newview/llavataractions.cpp | 159 ++++++++++++++++++--- indra/newview/llfloateravatarpicker.cpp | 2 +- indra/newview/llgiveinventory.cpp | 46 +++--- indra/newview/llgiveinventory.h | 7 +- indra/newview/lltooldraganddrop.cpp | 50 ++++++- indra/newview/lltooldraganddrop.h | 3 +- .../newview/skins/default/xui/en/notifications.xml | 26 +++- indra/newview/skins/default/xui/en/strings.xml | 1 + 8 files changed, 250 insertions(+), 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 875ed72a12..01d6c3a8d5 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -475,32 +475,83 @@ namespace action_give_inventory return acceptable; } - /** - * Performs "give inventory" operations for provided avatars. - * - * Sends one requests to give all selected inventory items for each passed avatar. - * Avatars are represent by two vectors: names and UUIDs which must be sychronized with each other. - * - * @param avatar_names - avatar names request to be sent. - * @param avatar_uuids - avatar names request to be sent. - */ - static void give_inventory(const std::vector& avatar_names, const uuid_vec_t& avatar_uuids) + static void build_residents_string(const std::vector& avatar_names, std::string& residents_string) { - llassert(avatar_names.size() == avatar_uuids.size()); + llassert(avatar_names.size() > 0); + + const std::string& separator = LLTrans::getString("words_separator"); + for (std::vector::const_iterator it = avatar_names.begin(); ; ) + { + residents_string.append(*it); + if (++it == avatar_names.end()) + { + break; + } + residents_string.append(separator); + } + } + + static void build_items_string(const uuid_set_t& inventory_selected_uuids , std::string& items_string) + { + llassert(inventory_selected_uuids.size() > 0); + + const std::string& separator = LLTrans::getString("words_separator"); + for (uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); ; ) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (NULL != inv_cat) + { + items_string = inv_cat->getName(); + break; + } + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + if (NULL != inv_item) + { + items_string.append(inv_item->getName()); + } + if(++it == inventory_selected_uuids.end()) + { + break; + } + items_string.append(separator); + } + } + + struct LLShareInfo : public LLSingleton + { + std::vector mAvatarNames; + uuid_vec_t mAvatarUuids; + }; + + static void give_inventory_cb(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // if Cancel pressed + if (option == 1) + { + return; + } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (NULL == active_panel) return; + if (NULL == active_panel) + { + return; + } const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); - if (inventory_selected_uuids.empty()) return; + if (inventory_selected_uuids.empty()) + { + return; + } - S32 count = llmin(avatar_names.size(), avatar_uuids.size()); + S32 count = LLShareInfo::instance().mAvatarNames.size(); + bool shared = false; // iterate through avatars for(S32 i = 0; i < count; ++i) { - const std::string& avatar_name = avatar_names[i]; - const LLUUID& avatar_uuid = avatar_uuids[i]; + const std::string& avatar_name = LLShareInfo::instance().mAvatarNames[i]; + const LLUUID& avatar_uuid = LLShareInfo::instance().mAvatarUuids[i]; // Start up IM before give the item const LLUUID session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, avatar_uuid); @@ -508,6 +559,9 @@ namespace action_give_inventory uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + const std::string& separator = LLTrans::getString("words_separator"); + std::string noncopy_item_names; + LLSD noncopy_items = LLSD::emptyArray(); // iterate through selected inventory objects for (; it != it_end; ++it) { @@ -515,12 +569,82 @@ namespace action_give_inventory if (inv_cat) { LLGiveInventory::doGiveInventoryCategory(avatar_uuid, inv_cat, session_id); + shared = true; break; } LLViewerInventoryItem* inv_item = gInventory.getItem(*it); - LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id); + if (!inv_item->getPermissions().allowCopyBy(gAgentID)) + { + if (!noncopy_item_names.empty()) + { + noncopy_item_names.append(separator); + } + noncopy_item_names.append(inv_item->getName()); + noncopy_items.append(*it); + } + else + { + LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id); + shared = true; + } + } + if (noncopy_items.beginArray() != noncopy_items.endArray()) + { + LLSD substitutions; + substitutions["ITEMS"] = noncopy_item_names; + LLSD payload; + payload["agent_id"] = avatar_uuid; + payload["items"] = noncopy_items; + LLNotificationsUtil::add("CannotCopyWarning", substitutions, payload, + &LLGiveInventory::handleCopyProtectedItem); + break; } } + if (shared) + { + LLFloaterReg::hideInstance("avatar_picker"); + LLNotificationsUtil::add("ItemsShared"); + } + } + + /** + * Performs "give inventory" operations for provided avatars. + * + * Sends one requests to give all selected inventory items for each passed avatar. + * Avatars are represent by two vectors: names and UUIDs which must be sychronized with each other. + * + * @param avatar_names - avatar names request to be sent. + * @param avatar_uuids - avatar names request to be sent. + */ + static void give_inventory(const std::vector& avatar_names, const uuid_vec_t& avatar_uuids) + { + llassert(avatar_names.size() == avatar_uuids.size()); + + + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (NULL == active_panel) + { + return; + } + + const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + if (inventory_selected_uuids.empty()) + { + return; + } + + std::string residents; + build_residents_string(avatar_names, residents); + + std::string items; + build_items_string(inventory_selected_uuids, items); + + LLSD substitutions; + substitutions["RESIDENTS"] = residents; + substitutions["ITEMS"] = items; + LLShareInfo::instance().mAvatarNames = avatar_names; + LLShareInfo::instance().mAvatarUuids = avatar_uuids; + LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, LLSD(), &give_inventory_cb); } } @@ -532,7 +656,6 @@ void LLAvatarActions::shareWithAvatars() LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE); picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable)); - LLNotificationsUtil::add("ShareNotification"); } // static diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index b40c19c2c6..96364f9418 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -437,7 +437,7 @@ BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask, session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, dest_agent_id); } return LLToolDragAndDrop::handleGiveDragAndDrop(dest_agent_id, session_id, drop, - cargo_type, cargo_data, accept); + cargo_type, cargo_data, accept, getName()); } } } diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index d83d895dd0..4a13e1e504 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -192,15 +192,16 @@ bool LLGiveInventory::isInventoryGroupGiveAcceptable(const LLInventoryItem* item } // static -void LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent, +bool LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent, const LLInventoryItem* item, const LLUUID& im_session_id/* = LLUUID::null*/) { + bool res = true; llinfos << "LLGiveInventory::giveInventory()" << llendl; if (!isInventoryGiveAcceptable(item)) { - return; + return false; } if (item->getPermissions().allowCopyBy(gAgentID)) { @@ -210,12 +211,19 @@ void LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent, else { // ask if the agent is sure. + LLSD substitutions; + substitutions["ITEMS"] = item->getName(); LLSD payload; payload["agent_id"] = to_agent; - payload["item_id"] = item->getUUID(); - LLNotificationsUtil::add("CannotCopyWarning", LLSD(), payload, + LLSD items = LLSD::emptyArray(); + items.append(item->getUUID()); + payload["items"] = items; + LLNotificationsUtil::add("CannotCopyWarning", substitutions, payload, &LLGiveInventory::handleCopyProtectedItem); + res = false; } + + return res; } void LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, @@ -318,25 +326,29 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + LLSD itmes = notification["payload"]["items"]; LLInventoryItem* item = NULL; switch(option) { case 0: // "Yes" - item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - if (item) - { - LLGiveInventory::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(), - item); - // delete it for now - it will be deleted on the server - // quickly enough. - gInventory.deleteObject(notification["payload"]["item_id"].asUUID()); - gInventory.notifyObservers(); - } - else + for (LLSD::array_iterator it = itmes.beginArray(); it != itmes.endArray(); it++) { - LLNotificationsUtil::add("CannotGiveItem"); + item = gInventory.getItem((*it).asUUID()); + if (item) + { + LLGiveInventory::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(), + item); + // delete it for now - it will be deleted on the server + // quickly enough. + gInventory.deleteObject(item->getUUID()); + gInventory.notifyObservers(); + } + else + { + LLNotificationsUtil::add("CannotGiveItem"); + } + break; } - break; default: // no, cancel, whatever, who cares, not yes. LLNotificationsUtil::add("TransactionCancelled"); diff --git a/indra/newview/llgiveinventory.h b/indra/newview/llgiveinventory.h index e589a0cc69..86f0f2fe86 100644 --- a/indra/newview/llgiveinventory.h +++ b/indra/newview/llgiveinventory.h @@ -61,7 +61,7 @@ public: /** * Gives passed inventory item to specified avatar in specified session. */ - static void doGiveInventoryItem(const LLUUID& to_agent, + static bool doGiveInventoryItem(const LLUUID& to_agent, const LLInventoryItem* item, const LLUUID& im_session_id = LLUUID::null); @@ -72,6 +72,9 @@ public: const LLInventoryCategory* item, const LLUUID &session_id = LLUUID::null); + // give inventory item functionality + static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response); + private: // this class is not intended to be instantiated. LLGiveInventory(); @@ -82,8 +85,6 @@ private: static void logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id = LLUUID::null); - // give inventory item functionality - static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response); static void commitGiveInventoryItem(const LLUUID& to_agent, const LLInventoryItem* item, const LLUUID &im_session_id = LLUUID::null); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 8a8bdd2dba..bc77ac5fd1 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -48,7 +48,7 @@ #include "llgiveinventory.h" #include "llhudmanager.h" #include "llhudeffecttrail.h" -//#include "llimview.h" +#include "llimview.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" @@ -1422,12 +1422,42 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL } +static void give_inventory_cb(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // if Cancel pressed + if (option == 1) + { + return; + } + + LLSD payload = notification["payload"]; + const LLUUID& session_id = payload["session_id"]; + const LLUUID& agent_id = payload["agent_id"]; + LLViewerInventoryItem * inv_item = gInventory.getItem(payload["item_id"]); + if (NULL == inv_item) + { + llassert(NULL != inv_item); + return; + } + + if (LLGiveInventory::doGiveInventoryItem(agent_id, inv_item, session_id)) + { + if ("avatarpicker" == payload["d&d_dest"].asString()) + { + LLFloaterReg::hideInstance("avatar_picker"); + } + LLNotificationsUtil::add("ItemsShared"); + } +} + // function used as drag-and-drop handler for simple agent give inventory requests //static bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_id, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - EAcceptance* accept) + EAcceptance* accept, + const LLSD& dest) { // check the type switch(cargo_type) @@ -1452,7 +1482,21 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ *accept = ACCEPT_YES_COPY_SINGLE; if (drop) { - LLGiveInventory::doGiveInventoryItem(dest_agent, inv_item, session_id); + LLIMModel::LLIMSession * session = LLIMModel::instance().findIMSession(session_id); + if (NULL == session) + { + llassert(NULL != session); + return false; + } + LLSD substitutions; + substitutions["RESIDENTS"] = session->mName; + substitutions["ITEMS"] = inv_item->getName(); + LLSD payload; + payload["agent_id"] = dest_agent; + payload["item_id"] = inv_item->getUUID(); + payload["session_id"] = session_id; + payload["d&d_dest"] = dest.asString(); + LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, payload, &give_inventory_cb); } } else diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 18334b5ee1..36e69c1db3 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -246,7 +246,8 @@ public: static bool handleGiveDragAndDrop(LLUUID agent, LLUUID session, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - EAcceptance* accept); + EAcceptance* accept, + const LLSD& dest = LLSD()); // Classes used for determining 3d drag and drop types. private: diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 079d029eab..5185b78f96 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1090,7 +1090,9 @@ The region [REGION] does not allow terraforming. icon="alertmodal.tga" name="CannotCopyWarning" type="alertmodal"> -You do not have permission to copy this item and will lose it from your inventory if you give it away. Do you really want to offer this item? +You do not have permission to copy the following items: +[ITEMS] +and will lose it from your inventory if you give it away. Do you really want to offer these items? Drag items from inventory onto a person in the resident picker + + +Are you sure you want to share the following items: + +[ITEMS] + +With the following Residents: + +[RESIDENTS] + + + +Items are successfully shared. + , Despite our best efforts, something unexpected has gone wrong. -- cgit v1.2.3 From fdb5debe4f6ddf16c5f1008d0b89a1dd0e9a65fb Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 1 Jun 2010 14:55:40 +0300 Subject: EXT-7255 COMMENTS Updated comments about implementation details. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index abd96c89e7..93b5bb54e6 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -150,8 +150,8 @@ - + Date: Tue, 1 Jun 2010 15:22:05 +0300 Subject: EXT-6710 ADDITIONAL FIX win build fixed --HG-- branch : product-engine --- indra/newview/llgiveinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 4a13e1e504..aebf1b4c26 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -347,8 +347,8 @@ bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LL { LLNotificationsUtil::add("CannotGiveItem"); } - break; } + break; default: // no, cancel, whatever, who cares, not yes. LLNotificationsUtil::add("TransactionCancelled"); -- cgit v1.2.3 From 1e090dafa6271ec2acb92441bcbbbbe058124be0 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 1 Jun 2010 16:42:31 +0300 Subject: EXT-7087 ADDITIONAL FIX Style changes regarding image_flash attribute Removed default "FlashIconAbsent" value of image_flash button attribute. Changed check for presence of thic icon in code accordingly. --HG-- branch : product-engine --- .../newview/skins/default/xui/en/widgets/button.xml | 2 +- .../skins/default/xui/en/widgets/tab_container.xml | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 6dcc27b469..2d0a1728d5 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -2,12 +2,12 @@ - - + + Date: Wed, 16 Jun 2010 16:54:14 -0700 Subject: web browser test should always use internal browser --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2c7ae539ce..cc33dfcfef 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7209,7 +7209,7 @@ void handle_web_browser_test(const LLSD& param) { url = "about:blank"; } - LLWeb::loadURL(url); + LLWeb::loadURLInternal(url); } void handle_buy_currency_test(void*) -- cgit v1.2.3 From 4aef5f54de70a8d729c93f7eb11995a7d23feed0 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 16 Jun 2010 17:32:51 -0700 Subject: EXT-7734 FIX In-world object properteis often don't show correct information reviewed by Leyla --- indra/newview/llinventoryfunctions.cpp | 5 ++ indra/newview/llinventoryfunctions.h | 1 + indra/newview/llpanelobjectinventory.cpp | 12 +-- indra/newview/llselectmgr.h | 15 ++-- indra/newview/llsidepaneltaskinfo.cpp | 27 ++++++- indra/newview/llsidepaneltaskinfo.h | 4 +- .../skins/default/xui/en/sidepanel_item_info.xml | 89 +++++++++++----------- 7 files changed, 86 insertions(+), 67 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 68fc86467c..3913e1805f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -327,6 +327,11 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) return FALSE; } +void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id) +{ + LLSideTray::getInstance()->showPanel("sidepanel_inventory", LLSD().with("id", item_uuid).with("object", object_id)); +} + void show_item_profile(const LLUUID& item_uuid) { LLUUID linked_uuid = gInventory.getLinkedItemID(item_uuid); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 93c56e1b8a..aa4ac98241 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -53,6 +53,7 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id); BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id); void show_item_profile(const LLUUID& item_uuid); +void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id); void show_item_original(const LLUUID& item_uuid); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index da809b7baa..f683cbc8d0 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -176,17 +176,7 @@ LLInventoryItem* LLTaskInvFVBridge::findItem() const void LLTaskInvFVBridge::showProperties() { - show_item_profile(mUUID); - - // Disable old properties floater; this is replaced by the sidepanel. - /* - LLFloaterProperties* floater = LLFloaterReg::showTypedInstance("properties", mUUID); - if (floater) - { - floater->setObjectID(mPanel->getTaskUUID()); - } - */ - + show_task_item_profile(mUUID, mPanel->getTaskUUID()); } struct LLBuyInvItemData diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index d315f40ff3..668c04cf15 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -257,7 +257,6 @@ public: LLObjectSelection(); void updateEffects(); - void cleanupNodes(); BOOL isEmpty() const; @@ -281,11 +280,6 @@ public: template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res); template bool isMultipleTEValue(LLSelectedTEGetFunctor* func, const T& ignore_value); - void addNode(LLSelectNode *nodep); - void addNodeAtEnd(LLSelectNode *nodep); - void moveNodeToFront(LLSelectNode *nodep); - void removeNode(LLSelectNode *nodep); - void deleteAllNodes(); // Delete all nodes S32 getNumNodes(); LLSelectNode* findNode(LLViewerObject* objectp); @@ -312,6 +306,15 @@ public: ESelectType getSelectType() const { return mSelectType; } +private: + void addNode(LLSelectNode *nodep); + void addNodeAtEnd(LLSelectNode *nodep); + void moveNodeToFront(LLSelectNode *nodep); + void removeNode(LLSelectNode *nodep); + void deleteAllNodes(); + void cleanupNodes(); + + private: list_t mList; const LLObjectSelection &operator=(const LLObjectSelection &); diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index e76397671b..3ab71eac64 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -80,6 +80,7 @@ static LLRegisterPanelClassWrapper t_task_info("sidepanel_t LLSidepanelTaskInfo::LLSidepanelTaskInfo() { setMouseOpaque(FALSE); + LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLSidepanelTaskInfo::refreshAll, this)); } @@ -271,7 +272,6 @@ void LLSidepanelTaskInfo::refresh() // BUG: fails if a root and non-root are both single-selected. const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) || LLSelectMgr::getInstance()->selectGetModify(); - const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = @@ -365,14 +365,14 @@ void LLSidepanelTaskInfo::refresh() if (is_one_object) { - if (keyboard_focus_view != LineEditorObjectName) + if (!LineEditorObjectName->hasFocus()) { childSetText("Object Name",nodep->mName); } if (LineEditorObjectDesc) { - if (keyboard_focus_view != LineEditorObjectDesc) + if (!LineEditorObjectDesc->hasFocus()) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -1178,9 +1178,30 @@ void LLSidepanelTaskInfo::save() onCommitIncludeInSearch(getChild("search_check"), this); } +// removes keyboard focus so that all fields can be updated +// and then restored focus +void LLSidepanelTaskInfo::refreshAll() +{ + // update UI as soon as we have an object + // but remove keyboard focus first so fields are free to update + LLFocusableElement* focus = NULL; + if (hasFocus()) + { + focus = gFocusMgr.getKeyboardFocus(); + setFocus(FALSE); + } + refresh(); + if (focus) + { + focus->setFocus(TRUE); + } +} + + void LLSidepanelTaskInfo::setObjectSelection(LLObjectSelectionHandle selection) { mObjectSelection = selection; + refreshAll(); } LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel() diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 15274c90db..010173e84e 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -67,6 +67,8 @@ protected: /*virtual*/ void save(); /*virtual*/ void updateVerbs(); + void refreshAll(); // ignore current keyboard focus and update all fields + // statics static void onClickClaim(void*); static void onClickRelease(void*); @@ -120,7 +122,7 @@ protected: LLViewerObject* getObject(); private: LLViewerObject* mObject; - LLObjectSelectionHandle mObjectSelection; + LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; }; diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index e2bd6f375e..b3bc618eec 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -159,51 +159,49 @@ name="LabelCreatorName" top_delta="6" width="140"> - Nicole Linden - - @@ -61,22 +73,22 @@ To reconnect to Nearby Voice simply close this window. left_delta="0" name="record_stop_btn" top_delta="0" - width="150"> + width="100"> - [[URL] Get Voice Morphing] + right="-10"> + [[URL] Subscribe Now] + top="95"> + label="Voice Name" + name="name" + relative_width="0.60" /> + relative_width="0.30" /> + diff --git a/indra/newview/skins/default/xui/en/panel_voice_effect.xml b/indra/newview/skins/default/xui/en/panel_voice_effect.xml index c575ca468c..93e79b7328 100644 --- a/indra/newview/skins/default/xui/en/panel_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/panel_voice_effect.xml @@ -6,7 +6,7 @@ name="panel_voice_effect" width="200"> - No Voice Morph + Voice Morphing Off Preview Voice Morphing ▶ @@ -19,11 +19,11 @@ follows="left|top|right" height="23" name="voice_effect" - tool_tip="Select a Voice Morphing effect to change your voice." + tool_tip="Select a Voice Morph to change your voice" top_pad="0" width="200"> -- cgit v1.2.3 From cc0d5eae4d59adf41d59248e1b481a66db791b07 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 18 Jun 2010 16:17:34 +0100 Subject: Fix llpreviewgesture.h build borkage. --- indra/newview/llpreviewgesture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index 1814f0d403..b141b14445 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -35,8 +35,8 @@ #include "llassettype.h" #include "llpreview.h" +#include "llmultigesture.h" -class LLMultiGesture; class LLLineEditor; class LLTextBox; class LLCheckBoxCtrl; -- cgit v1.2.3 From c7f0cabc0eb530efdbbc0bf74bf33979be23e6fa Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Fri, 18 Jun 2010 20:30:52 +0300 Subject: EXT-7821 FIXED Editor type was changed to the type as in "Name:" editor in "My Inventory"->"Object Profile". Fix details: Using line_editor instead of text_editor. Enabled ascii filter for entering, because (for example) Russian charters corrupts outfit items and makes Edit Outfit very buggy. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/608/ --HG-- branch : product-engine --- indra/newview/llpaneleditwearable.cpp | 16 ++++++++-------- indra/newview/llpaneleditwearable.h | 4 ++-- .../skins/default/xui/en/panel_edit_wearable.xml | 20 +++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 1aedfec86f..4402b2130f 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -652,7 +652,7 @@ BOOL LLPanelEditWearable::postBuild() // handled at appearance panel level? //mBtnBack->setClickedCallback(boost::bind(&LLPanelEditWearable::onBackButtonClicked, this)); - mTextEditor = getChild("description"); + mNameEditor = getChild("description"); mPanelTitle = getChild("edit_wearable_title"); mDescTitle = getChild("description_text"); @@ -758,7 +758,7 @@ BOOL LLPanelEditWearable::isDirty() const if (mWearablePtr) { if (mWearablePtr->isDirty() || - mWearablePtr->getName().compare(mTextEditor->getText()) != 0) + mWearablePtr->getName().compare(mNameEditor->getText()) != 0) { isDirty = TRUE; } @@ -796,7 +796,7 @@ void LLPanelEditWearable::onRevertButtonClicked(void* userdata) void LLPanelEditWearable::onSaveAsButtonClicked() { LLSD args; - args["DESC"] = mTextEditor->getText(); + args["DESC"] = mNameEditor->getText(); LLNotificationsUtil::add("SaveWearableAs", args, LLSD(), boost::bind(&LLPanelEditWearable::saveAsCallback, this, _1, _2)); } @@ -810,7 +810,7 @@ void LLPanelEditWearable::saveAsCallback(const LLSD& notification, const LLSD& r LLStringUtil::trim(wearable_name); if( !wearable_name.empty() ) { - mTextEditor->setText(wearable_name); + mNameEditor->setText(wearable_name); saveChanges(); } } @@ -956,10 +956,10 @@ void LLPanelEditWearable::saveChanges() U32 index = gAgentWearables.getWearableIndex(mWearablePtr); - if (mWearablePtr->getName().compare(mTextEditor->getText()) != 0) + if (mWearablePtr->getName().compare(mNameEditor->getText()) != 0) { // the name of the wearable has changed, re-save wearable with new name - gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, mTextEditor->getText(), FALSE); + gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, mNameEditor->getText(), FALSE); } else { @@ -976,7 +976,7 @@ void LLPanelEditWearable::revertChanges() } mWearablePtr->revertValues(); - mTextEditor->setText(mWearablePtr->getName()); + mNameEditor->setText(mWearablePtr->getName()); } void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) @@ -1018,7 +1018,7 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) mDescTitle->setText(description_title); // set name - mTextEditor->setText(wearable->getName()); + mNameEditor->setText(wearable->getName()); updatePanelPickerControls(type); updateTypeSpecificControls(type); diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index c63671fcc9..61441435cd 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -41,7 +41,6 @@ class LLCheckBoxCtrl; class LLWearable; -class LLTextEditor; class LLTextBox; class LLViewerInventoryItem; class LLViewerVisualParam; @@ -49,6 +48,7 @@ class LLVisualParamHint; class LLViewerJointMesh; class LLAccordionCtrlTab; class LLJoint; +class LLLineEditor; class LLPanelEditWearable : public LLPanel { @@ -140,7 +140,7 @@ private: // This text editor reference will change each time we edit a new wearable - // it will be grabbed from the currently visible panel - LLTextEditor *mTextEditor; + LLLineEditor *mNameEditor; // The following panels will be shown/hidden based on what wearable we're editing // body parts diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 950c4a5fdb..3106ed34ff 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -225,15 +225,17 @@ left="0" tool_tip="Female" top="7" width="16" /> - + Date: Fri, 18 Jun 2010 12:33:17 -0500 Subject: EXT-7910 allow GPU and feature table to load from a custom location --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llfeaturemanager.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2244f05104..1d635ef18a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2840,6 +2840,17 @@ Boolean Value 0 +
+ FeatureManagerHTTPTable + + Comment + Base directory for HTTP feature/gpu table fetches + Persist + 1 + Type + String + Value + http://viewer-settings.secondlife.com FPSLogFrequency diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 4fdb010162..f32fcd6b7f 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -496,11 +496,11 @@ private: void fetch_table(std::string table) { - const std::string base = "http://viewer-settings.s3.amazonaws.com/"; + const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); const std::string filename = llformat(table.c_str(), LLVersionInfo::getVersion().c_str()); - const std::string url = base + filename; + const std::string url = base + "/" + filename; const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); -- cgit v1.2.3 From d8ec78e325ee3add1a5968ea0a3051de16958404 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 18 Jun 2010 10:51:45 -0700 Subject: EXT-7152 TOS breaks Critical Message in 2.0.0 and 2.0.1 removed cancel button --- indra/newview/skins/default/xui/en/floater_critical.xml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_critical.xml b/indra/newview/skins/default/xui/en/floater_critical.xml index 7b5451553f..05c958e051 100644 --- a/indra/newview/skins/default/xui/en/floater_critical.xml +++ b/indra/newview/skins/default/xui/en/floater_critical.xml @@ -6,6 +6,7 @@ height="500" layout="topleft" name="modal container" + open_centered="true" width="600"> diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml index d3fb77f135..d8f4297e0c 100644 --- a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml @@ -10,7 +10,6 @@ name="topinfo_bar" width="1024"> - - Date: Tue, 27 Jul 2010 10:51:35 +0100 Subject: Fix implicit downcast in world map change. --- indra/newview/llfloaterworldmap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 031294ad56..88f8545877 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1191,9 +1191,9 @@ void LLFloaterWorldMap::onCoordinatesCommit() return; } - F32 x_coord = (F32)childGetValue("teleport_coordinate_x").asReal(); - F32 y_coord = (F32)childGetValue("teleport_coordinate_y").asReal(); - F32 z_coord = (F32)childGetValue("teleport_coordinate_z").asReal(); + S32 x_coord = (S32)childGetValue("teleport_coordinate_x").asReal(); + S32 y_coord = (S32)childGetValue("teleport_coordinate_y").asReal(); + S32 z_coord = (S32)childGetValue("teleport_coordinate_z").asReal(); const std::string region_name = childGetValue("location").asString(); -- cgit v1.2.3 From 092d49cb3a0ca090ffd792661c9cf335fec4c5c6 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 27 Jul 2010 15:59:11 +0300 Subject: EXT-7015 FIXED Avoided wearing item moved to trash. Details: Disabled wear button and hidden related context menu entries if base object of inventory link is in trash. reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/806/ --HG-- branch : product-engine --- indra/newview/lloutfitslist.cpp | 32 +++++++++++++++++++++++++++++++- indra/newview/lloutfitslist.h | 5 +++++ indra/newview/llwearableitemslist.cpp | 15 ++++++++++++--- 3 files changed, 48 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 63ffb80ff2..ccde5be900 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -665,7 +665,14 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) } if (command_name == "wear") { - return !gAgentWearables.isCOFChangeInProgress(); + if (gAgentWearables.isCOFChangeInProgress()) + { + return false; + } + uuid_vec_t ids; + getSelectedItemsUUIDs(ids); + + return !ids.empty() && !isSelectedInTrash(); } if (command_name == "take_off") { @@ -711,6 +718,29 @@ void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const } } +bool LLOutfitsList::isSelectedInTrash() +{ + bool res = false; + const LLUUID trash_id = gInventory.findCategoryUUIDForType( + LLFolderType::FT_TRASH); + + uuid_vec_t selected_uuids; + getSelectedItemsUUIDs(selected_uuids); + + for (uuid_vec_t::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); it++) + { + const LLInventoryItem* item = gInventory.getItem(*it); + if (item != NULL && gInventory.isObjectDescendentOf( + item->getLinkedUUID(), trash_id)) + { + res = true; + break; + } + } + + return res; +} + boost::signals2::connection LLOutfitsList::setSelectionChangeCallback(selection_change_callback_t cb) { return mSelectionChangeSignal.connect(cb); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index d7cf8a8c08..dbb35c4d5f 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -105,6 +105,11 @@ public: void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; + /** + * Returns true in case any of selected item is in trash. + */ + bool isSelectedInTrash(); + boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index b614860b74..1ce89b13ac 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -767,6 +767,9 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones + bool item_in_trash = false; + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { LLUUID id = *it; @@ -802,16 +805,22 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu { ++n_already_worn; } + + // if any in trash + if (!item_in_trash) + { + item_in_trash = gInventory.isObjectDescendentOf(item->getLinkedUUID(), trash_id); + } } // for bool standalone = mParent ? mParent->isStandalone() : false; // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && !item_in_trash); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); - setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0); + setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && !item_in_trash); setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); - setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0); + setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && !item_in_trash); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); -- cgit v1.2.3 From 431a6771ccf22501d47d0f09168926239aa21854 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 27 Jul 2010 18:00:37 +0300 Subject: Performed necessary refactoring after merge rev. 14093:babb41195f70 --HG-- branch : product-engine --- indra/newview/llinventoryfunctions.cpp | 10 ++++++++++ indra/newview/lloutfitslist.cpp | 23 ----------------------- indra/newview/lloutfitslist.h | 5 ----- indra/newview/llwearableitemslist.cpp | 13 ++++++------- 4 files changed, 16 insertions(+), 35 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f20acbd016..2517db2678 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -251,6 +251,16 @@ BOOL get_can_item_be_worn(const LLUUID& id) if (!item) return FALSE; + const LLUUID trash_id = gInventory.findCategoryUUIDForType( + LLFolderType::FT_TRASH); + + // item can't be worn if base obj in trash, see EXT-7015 + if (gInventory.isObjectDescendentOf(item->getLinkedUUID(), + trash_id)) + { + return false; + } + switch(item->getType()) { case LLAssetType::AT_OBJECT: diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 1ed7ca22f5..c3eee1d1ad 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -723,29 +723,6 @@ void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const } } -bool LLOutfitsList::isSelectedInTrash() -{ - bool res = false; - const LLUUID trash_id = gInventory.findCategoryUUIDForType( - LLFolderType::FT_TRASH); - - uuid_vec_t selected_uuids; - getSelectedItemsUUIDs(selected_uuids); - - for (uuid_vec_t::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); it++) - { - const LLInventoryItem* item = gInventory.getItem(*it); - if (item != NULL && gInventory.isObjectDescendentOf( - item->getLinkedUUID(), trash_id)) - { - res = true; - break; - } - } - - return res; -} - boost::signals2::connection LLOutfitsList::setSelectionChangeCallback(selection_change_callback_t cb) { return mSelectionChangeSignal.connect(cb); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index af094c28d4..206854b232 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -105,11 +105,6 @@ public: void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; - /** - * Returns true in case any of selected item is in trash. - */ - bool isSelectedInTrash(); - boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 98ebd68564..8035cd2d93 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -769,8 +769,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones - bool item_in_trash = false; - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool can_be_worn = false; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { @@ -809,20 +808,20 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu } // if any in trash - if (!item_in_trash) + if (!can_be_worn) { - item_in_trash = gInventory.isObjectDescendentOf(item->getLinkedUUID(), trash_id); + can_be_worn = get_can_item_be_worn(item->getLinkedUUID()); } } // for bool standalone = mParent ? mParent->isStandalone() : false; // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); - setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && can_be_worn); setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); - setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); -- cgit v1.2.3 From 4c693bfe89e930ce958a65b4521f36d5079dd907 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 27 Jul 2010 18:30:35 +0300 Subject: EXT-2707 FIXED Fixed incorrectness of coalesced objects icons in inventory. Bug was caused by multiobject's icon name index substitution with ordinary object's one. It happened because index was set depending on asset type in switch that followed "if" which set index for multiobject regardless of its result. - Added returning index icon name inside of "if" block to avoid change of the index by switch for multiobject. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/804/ --HG-- branch : product-engine --- indra/newview/llpanelgroupgeneral.cpp | 20 ++++++++------------ indra/newview/llpanelgroupgeneral.h | 1 - 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 8e1b7ba4d9..2302772803 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -184,8 +184,7 @@ BOOL LLPanelGroupGeneral::postBuild() mComboActiveTitle = getChild("active_title", recurse); if (mComboActiveTitle) { - mComboActiveTitle->setCommitCallback(onCommitTitle, this); - mComboActiveTitle->resetDirty(); + mComboActiveTitle->setCommitCallback(onCommitAny, this); } mIncompleteMemberDataStr = getString("incomplete_member_data_str"); @@ -277,16 +276,6 @@ void LLPanelGroupGeneral::onCommitEnrollment(LLUICtrl* ctrl, void* data) } } -// static -void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data) -{ - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; - if (self->mGroupID.isNull() || !self->mAllowEdit) return; - LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID()); - self->update(GC_TITLES); - self->mComboActiveTitle->resetDirty(); -} - // static void LLPanelGroupGeneral::onClickInfo(void *userdata) { @@ -356,6 +345,13 @@ void LLPanelGroupGeneral::draw() bool LLPanelGroupGeneral::apply(std::string& mesg) { + if (!mGroupID.isNull() && mAllowEdit && mComboActiveTitle && mComboActiveTitle->isDirty()) + { + LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID()); + update(GC_TITLES); + mComboActiveTitle->resetDirty(); + } + BOOL has_power_in_group = gAgent.hasPowerInGroup(mGroupID,GP_GROUP_CHANGE_IDENTITY); if (has_power_in_group || mGroupID.isNull()) diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 6f4fa994da..358d353074 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -77,7 +77,6 @@ private: static void onFocusEdit(LLFocusableElement* ctrl, void* data); static void onCommitAny(LLUICtrl* ctrl, void* data); static void onCommitUserOnly(LLUICtrl* ctrl, void* data); - static void onCommitTitle(LLUICtrl* ctrl, void* data); static void onCommitEnrollment(LLUICtrl* ctrl, void* data); static void onClickInfo(void* userdata); static void onReceiveNotices(LLUICtrl* ctrl, void* data); -- cgit v1.2.3 From a3690e080ec2bc349a1247a3680b3e49f4099089 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 27 Jul 2010 18:44:57 +0300 Subject: EXT-8350 FIXED ([HARD CODED] ALL LANGS Untranslated folder names under French Group Profile (roles and powers)) Added translation of folders to the strings.xml Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/810/ --HG-- branch : product-engine --- indra/newview/llpanelgrouproles.cpp | 3 ++- indra/newview/skins/default/xui/en/strings.xml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 445cfe64f7..7a28d10baf 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -51,6 +51,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "lltexteditor.h" +#include "lltrans.h" #include "llviewertexturelist.h" #include "llviewerwindow.h" #include "llfocusmgr.h" @@ -587,7 +588,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, row["columns"][1]["column"] = "action"; row["columns"][1]["type"] = "text"; - row["columns"][1]["value"] = action_set->mActionSetData->mName; + row["columns"][1]["value"] = LLTrans::getString(action_set->mActionSetData->mName); row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL"; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index a0c67e3612..048de70045 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3239,4 +3239,20 @@ Abuse Report US$ [AMOUNT] + + + Membership + Roles + Group Identity + Parcel Management + Parcel Identity + Parcel Settings + Parcel Powers + Parcel Access + Parcel Content + Object Management + Accounting + Notices + Chat + -- cgit v1.2.3 From 7bec8b2a9ee1182f9eec14305b7099bee44b7a10 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 27 Jul 2010 18:45:32 +0300 Subject: EXT-8366 FIXED ([HARD CODED] ALL LANGS Whole Item Profile window is untranslated in the French viewer) - Added 'name' attribute for untranslated panel in EN and all other locales Reviewed by Mike Antipov and Vadim Savchuk at https://codereview.productengine.com/secondlife/r/808/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/da/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/de/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/en/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/es/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/fr/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/it/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/ja/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/pl/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/pt/sidepanel_item_info.xml | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/da/sidepanel_item_info.xml b/indra/newview/skins/default/xui/da/sidepanel_item_info.xml index 070b4218a8..b1ec2c44df 100644 --- a/indra/newview/skins/default/xui/da/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/da/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Navn: diff --git a/indra/newview/skins/default/xui/de/sidepanel_item_info.xml b/indra/newview/skins/default/xui/de/sidepanel_item_info.xml index 63e7bce8ae..b9ca969ac5 100644 --- a/indra/newview/skins/default/xui/de/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/de/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Name: diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index 50df227fbf..49b252174c 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -80,10 +80,11 @@ - + Nombre: diff --git a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml index 0a5680fe06..0350ea5116 100644 --- a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Nom : diff --git a/indra/newview/skins/default/xui/it/sidepanel_item_info.xml b/indra/newview/skins/default/xui/it/sidepanel_item_info.xml index d0ec943e67..627aeb5cb5 100644 --- a/indra/newview/skins/default/xui/it/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/it/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Nome: diff --git a/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml b/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml index fdabe88362..414eba0509 100644 --- a/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + åå‰ï¼š diff --git a/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml b/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml index 2f43e0c215..0c6169c9c0 100644 --- a/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Nazwa: diff --git a/indra/newview/skins/default/xui/pt/sidepanel_item_info.xml b/indra/newview/skins/default/xui/pt/sidepanel_item_info.xml index 8e880588e9..d2050f4660 100644 --- a/indra/newview/skins/default/xui/pt/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/pt/sidepanel_item_info.xml @@ -23,7 +23,8 @@ - + Nome: -- cgit v1.2.3 From 75980159451eb4f80c1ac03ec4b9d8d488279840 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 27 Jul 2010 22:34:34 +0300 Subject: EXT-8491 FIXED Crash in LLAppearanceMgr::addCOFItemLink(). Reason: When you click on a clothing link in COF, LLAppearanceMgr::wearItemOnAvatar() removes all COF links of the clicked wearable type -- thus invalidating all previously obtained LLViewerInventoryItems for those links -- and then passes such an invalid item (item_to_wear) to addCOFItemLink() which of course crashes. Fix: 1. Handle this case in wearItemOnAvatar(): don't try wearing COF items. 2. Disable the Wear button in the inventory SP when a COF item is selected. 3. Fixed get_can_item_be_worn() to return FALSE for items which are in COF or have links in COF. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/811/ --HG-- branch : product-engine --- indra/newview/llappearancemgr.cpp | 4 ++++ indra/newview/llinventoryfunctions.cpp | 12 ++++++++++++ indra/newview/lloutfitslist.cpp | 5 ----- indra/newview/llpaneloutfitedit.cpp | 4 +--- indra/newview/llsidepanelinventory.cpp | 7 ++++++- 5 files changed, 23 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b64007aa75..78edcb3e25 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -983,6 +983,10 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up LLNotificationsUtil::add("CannotWearTrash"); return false; } + else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), LLAppearanceMgr::instance().getCOF())) // EXT-84911 + { + return false; + } switch (item_to_wear->getType()) { diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f20acbd016..3d350606c6 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -250,6 +250,18 @@ BOOL get_can_item_be_worn(const LLUUID& id) const LLViewerInventoryItem* item = gInventory.getItem(id); if (!item) return FALSE; + + if (LLAppearanceMgr::isLinkInCOF(item->getLinkedUUID())) + { + // an item having links in COF (i.e. a worn item) + return FALSE; + } + + if (gInventory.isObjectDescendentOf(id, LLAppearanceMgr::instance().getCOF())) + { + // a non-link object in COF (should not normally happen) + return FALSE; + } switch(item->getType()) { diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index c3eee1d1ad..8147a97317 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -1005,11 +1005,6 @@ bool LLOutfitsList::canWearSelected() { const LLUUID& id = *it; - if (LLAppearanceMgr::isLinkInCOF(id)) - { - return false; - } - // Check whether the item is worn. if (!get_can_item_be_worn(id)) { diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 58a5529505..2cd354277e 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -779,9 +779,7 @@ void LLPanelOutfitEdit::updatePlusButton() } // If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button. - uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1) - // since item can be not worn but in wearing process at that time - we need to check is link to item presents in COF - || boost::bind(&LLAppearanceMgr::isLinkInCOF, _1)); + uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(&get_can_item_be_worn, _1)); bool can_add = ( unwearable_item == selected_items.end() ); mPlusBtn->setEnabled(can_add); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index de59af49da..0951586dd5 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -33,10 +33,13 @@ #include "llsidepanelinventory.h" #include "llagent.h" +#include "llappearancemgr.h" #include "llavataractions.h" #include "llbutton.h" #include "llinventorybridge.h" +#include "llinventoryfunctions.h" #include "llinventorypanel.h" +#include "lloutfitobserver.h" #include "llpanelmaininventory.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" @@ -98,6 +101,8 @@ BOOL LLSidepanelInventory::postBuild() my_inventory_panel->addHideFolderType(LLFolderType::FT_LANDMARK); my_inventory_panel->addHideFolderType(LLFolderType::FT_FAVORITE); */ + + LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this)); } // UI elements from item panel @@ -283,7 +288,7 @@ void LLSidepanelInventory::updateVerbs() case LLInventoryType::IT_OBJECT: case LLInventoryType::IT_ATTACHMENT: mWearBtn->setVisible(TRUE); - mWearBtn->setEnabled(TRUE); + mWearBtn->setEnabled(get_can_item_be_worn(item->getLinkedUUID())); mShopBtn->setVisible(FALSE); break; case LLInventoryType::IT_SOUND: -- cgit v1.2.3 From 15247f086989a43881d79c1ee5416bb00721eb68 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Jul 2010 14:22:14 -0700 Subject: Backed out changeset: 58571b4e704b --- indra/newview/app_settings/settings.xml | 17 +- indra/newview/llagent.cpp | 3 + indra/newview/llagentwearablesfetch.cpp | 2 +- indra/newview/llappearancemgr.cpp | 24 +- indra/newview/llavatarlist.cpp | 2 +- indra/newview/llchiclet.cpp | 4 +- indra/newview/llcofwearables.cpp | 28 ++- indra/newview/llcofwearables.h | 4 + indra/newview/lldndbutton.cpp | 2 +- indra/newview/lldndbutton.h | 2 +- indra/newview/llexpandabletextbox.cpp | 8 +- indra/newview/llfolderview.h | 1 + indra/newview/llimview.cpp | 8 + indra/newview/llinspectobject.cpp | 3 +- indra/newview/llinventoryfunctions.cpp | 13 + indra/newview/llinventoryfunctions.h | 36 ++- indra/newview/llinventoryitemslist.cpp | 8 +- indra/newview/llinventorylistitem.cpp | 93 +++++-- indra/newview/llinventorylistitem.h | 31 ++- indra/newview/lllocationinputctrl.cpp | 2 +- indra/newview/llpanelgenerictip.cpp | 6 +- indra/newview/llpanelmaininventory.cpp | 11 +- indra/newview/llpanelonlinestatus.cpp | 5 +- indra/newview/llpaneloutfitedit.cpp | 127 ++++++++-- indra/newview/llpaneloutfitedit.h | 9 +- indra/newview/llparticipantlist.cpp | 2 +- indra/newview/llpreviewtexture.cpp | 6 +- indra/newview/llpreviewtexture.h | 8 +- indra/newview/llscriptfloater.cpp | 27 +- indra/newview/llscriptfloater.h | 5 + indra/newview/llsidetray.cpp | 14 +- indra/newview/llsidetray.h | 14 +- indra/newview/llsyswellwindow.cpp | 4 +- indra/newview/lltexturectrl.cpp | 4 + indra/newview/llurllineeditorctrl.cpp | 5 +- indra/newview/llviewerinventory.cpp | 15 ++ indra/newview/llviewerinventory.h | 9 +- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerobject.cpp | 7 + indra/newview/llviewerstats.cpp | 8 + indra/newview/llviewerstats.h | 55 +++++ indra/newview/llviewertexture.cpp | 71 ++++-- indra/newview/llviewertexture.h | 13 +- indra/newview/llvoavatar.cpp | 34 +-- indra/newview/llvoavatar.h | 3 +- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/llwearableitemslist.cpp | 186 ++++++++++---- indra/newview/llwearableitemslist.h | 58 +++-- indra/newview/llwindebug.cpp | 61 +++-- indra/newview/pipeline.cpp | 2 +- .../default/xui/da/floater_publish_classified.xml | 2 +- .../skins/default/xui/da/menu_cof_clothing.xml | 3 +- .../skins/default/xui/da/menu_inventory.xml | 3 +- .../default/xui/da/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/da/menu_outfit_gear.xml | 1 + .../default/xui/da/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/da/notifications.xml | 12 +- .../skins/default/xui/da/panel_outfit_edit.xml | 10 +- .../default/xui/da/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/da/panel_outfits_list.xml | 7 + .../skins/default/xui/da/panel_outfits_wearing.xml | 6 + .../skins/default/xui/da/sidepanel_item_info.xml | 10 +- .../skins/default/xui/da/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/da/strings.xml | 15 +- .../skins/default/xui/de/floater_buy_currency.xml | 2 +- .../default/xui/de/floater_publish_classified.xml | 2 +- .../skins/default/xui/de/floater_voice_effect.xml | 2 +- .../skins/default/xui/de/menu_inventory.xml | 3 +- .../default/xui/de/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/de/menu_outfit_gear.xml | 1 + .../default/xui/de/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/de/notifications.xml | 12 +- .../skins/default/xui/de/panel_navigation_bar.xml | 4 +- .../skins/default/xui/de/panel_outfit_edit.xml | 10 +- .../default/xui/de/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/de/panel_outfits_list.xml | 7 + .../skins/default/xui/de/panel_outfits_wearing.xml | 6 + .../skins/default/xui/de/sidepanel_appearance.xml | 2 +- .../skins/default/xui/de/sidepanel_item_info.xml | 18 +- .../skins/default/xui/de/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/de/strings.xml | 15 +- .../skins/default/xui/en/floater_camera.xml | 15 +- .../skins/default/xui/en/menu_inventory_add.xml | 9 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 16 +- .../newview/skins/default/xui/en/notifications.xml | 5 +- .../skins/default/xui/en/panel_nearby_media.xml | 2 + .../skins/default/xui/en/panel_outfits_list.xml | 4 +- indra/newview/skins/default/xui/en/strings.xml | 7 +- .../default/xui/en/widgets/bodyparts_list_item.xml | 73 ++++++ .../default/xui/en/widgets/clothing_list_item.xml | 93 +++++++ .../en/widgets/deletable_wearable_list_item.xml | 43 ++++ .../xui/en/widgets/dummy_clothing_list_item.xml | 52 ++++ .../default/xui/en/widgets/inventory_list_item.xml | 35 ++- .../default/xui/es/floater_publish_classified.xml | 2 +- .../skins/default/xui/es/menu_cof_clothing.xml | 3 +- .../skins/default/xui/es/menu_inventory.xml | 3 +- .../default/xui/es/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/es/menu_outfit_gear.xml | 1 + .../default/xui/es/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/es/notifications.xml | 12 +- .../skins/default/xui/es/panel_outfit_edit.xml | 10 +- .../default/xui/es/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/es/panel_outfits_list.xml | 7 + .../skins/default/xui/es/panel_outfits_wearing.xml | 6 + .../skins/default/xui/es/sidepanel_item_info.xml | 10 +- .../skins/default/xui/es/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/es/strings.xml | 15 +- .../skins/default/xui/fr/floater_bulk_perms.xml | 2 +- .../default/xui/fr/floater_publish_classified.xml | 2 +- .../skins/default/xui/fr/menu_cof_clothing.xml | 3 +- .../skins/default/xui/fr/menu_gesture_gear.xml | 2 +- .../skins/default/xui/fr/menu_inventory.xml | 3 +- .../default/xui/fr/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/fr/menu_outfit_gear.xml | 1 + .../default/xui/fr/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/fr/notifications.xml | 16 +- .../skins/default/xui/fr/panel_group_general.xml | 2 +- .../skins/default/xui/fr/panel_outfit_edit.xml | 10 +- .../default/xui/fr/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/fr/panel_outfits_list.xml | 7 + .../skins/default/xui/fr/panel_outfits_wearing.xml | 6 + .../default/xui/fr/panel_preferences_general.xml | 2 +- .../skins/default/xui/fr/sidepanel_item_info.xml | 18 +- indra/newview/skins/default/xui/fr/strings.xml | 15 +- .../skins/default/xui/it/floater_about_land.xml | 10 +- .../skins/default/xui/it/floater_buy_currency.xml | 6 +- .../default/xui/it/floater_publish_classified.xml | 2 +- .../skins/default/xui/it/menu_cof_clothing.xml | 3 +- .../skins/default/xui/it/menu_inventory.xml | 3 +- .../default/xui/it/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/it/menu_outfit_gear.xml | 1 + .../default/xui/it/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/it/notifications.xml | 12 +- .../skins/default/xui/it/panel_outfit_edit.xml | 10 +- .../default/xui/it/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/it/panel_outfits_list.xml | 7 + .../skins/default/xui/it/panel_outfits_wearing.xml | 6 + .../newview/skins/default/xui/it/panel_people.xml | 2 +- .../skins/default/xui/it/sidepanel_item_info.xml | 10 +- indra/newview/skins/default/xui/it/strings.xml | 15 +- .../default/xui/ja/floater_publish_classified.xml | 2 +- .../skins/default/xui/ja/menu_cof_clothing.xml | 3 +- .../skins/default/xui/ja/menu_inventory.xml | 3 +- .../default/xui/ja/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/ja/menu_outfit_gear.xml | 1 + .../default/xui/ja/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/ja/notifications.xml | 12 +- .../skins/default/xui/ja/panel_outfit_edit.xml | 10 +- .../default/xui/ja/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/ja/panel_outfits_list.xml | 7 + .../skins/default/xui/ja/panel_outfits_wearing.xml | 6 + .../skins/default/xui/ja/sidepanel_item_info.xml | 18 +- indra/newview/skins/default/xui/ja/strings.xml | 15 +- .../newview/skins/default/xui/pl/floater_about.xml | 15 +- .../skins/default/xui/pl/floater_about_land.xml | 3 + .../default/xui/pl/floater_animation_preview.xml | 48 ++-- .../default/xui/pl/floater_avatar_textures.xml | 72 +++--- .../default/xui/pl/floater_buy_currency_html.xml | 2 + .../skins/default/xui/pl/floater_camera.xml | 21 +- .../default/xui/pl/floater_day_cycle_options.xml | 43 ++-- .../skins/default/xui/pl/floater_god_tools.xml | 9 +- .../skins/default/xui/pl/floater_image_preview.xml | 20 +- .../skins/default/xui/pl/floater_incoming_call.xml | 8 +- indra/newview/skins/default/xui/pl/floater_map.xml | 5 +- .../skins/default/xui/pl/floater_moveview.xml | 36 ++- .../skins/default/xui/pl/floater_outgoing_call.xml | 2 +- .../default/xui/pl/floater_preview_gesture.xml | 8 +- .../default/xui/pl/floater_preview_notecard.xml | 4 +- .../default/xui/pl/floater_publish_classified.xml | 2 +- .../skins/default/xui/pl/floater_snapshot.xml | 44 ++-- .../newview/skins/default/xui/pl/floater_tools.xml | 15 +- indra/newview/skins/default/xui/pl/floater_tos.xml | 12 +- .../default/xui/pl/floater_voice_controls.xml | 8 +- .../skins/default/xui/pl/floater_voice_effect.xml | 30 +++ .../skins/default/xui/pl/inspect_object.xml | 11 +- .../skins/default/xui/pl/menu_attachment_other.xml | 2 +- .../skins/default/xui/pl/menu_attachment_self.xml | 7 +- .../skins/default/xui/pl/menu_avatar_other.xml | 2 +- .../skins/default/xui/pl/menu_avatar_self.xml | 5 +- .../skins/default/xui/pl/menu_bottomtray.xml | 5 + .../skins/default/xui/pl/menu_cof_attachment.xml | 4 + .../skins/default/xui/pl/menu_cof_body_part.xml | 5 + .../skins/default/xui/pl/menu_cof_clothing.xml | 6 + .../newview/skins/default/xui/pl/menu_cof_gear.xml | 5 + indra/newview/skins/default/xui/pl/menu_edit.xml | 12 + .../skins/default/xui/pl/menu_hide_navbar.xml | 1 + .../default/xui/pl/menu_inspect_avatar_gear.xml | 2 +- .../default/xui/pl/menu_inspect_self_gear.xml | 3 +- .../default/xui/pl/menu_inv_offer_chiclet.xml | 4 + .../skins/default/xui/pl/menu_inventory.xml | 6 +- .../default/xui/pl/menu_inventory_gear_default.xml | 3 +- indra/newview/skins/default/xui/pl/menu_login.xml | 16 +- .../skins/default/xui/pl/menu_outfit_gear.xml | 27 ++ .../skins/default/xui/pl/menu_outfit_tab.xml | 9 + .../skins/default/xui/pl/menu_participant_list.xml | 5 +- .../skins/default/xui/pl/menu_save_outfit.xml | 5 + .../skins/default/xui/pl/menu_script_chiclet.xml | 4 + .../skins/default/xui/pl/menu_topinfobar.xml | 7 + indra/newview/skins/default/xui/pl/menu_viewer.xml | 36 ++- .../default/xui/pl/menu_wearable_list_item.xml | 14 ++ .../skins/default/xui/pl/menu_wearing_gear.xml | 4 + .../skins/default/xui/pl/menu_wearing_tab.xml | 4 + .../newview/skins/default/xui/pl/notifications.xml | 225 +++++++++++++++-- .../skins/default/xui/pl/outfit_accordion_tab.xml | 4 + .../default/xui/pl/panel_body_parts_list_item.xml | 8 + .../xui/pl/panel_bodyparts_list_button_bar.xml | 5 + .../skins/default/xui/pl/panel_bottomtray.xml | 23 +- .../xui/pl/panel_clothing_list_button_bar.xml | 5 + .../default/xui/pl/panel_clothing_list_item.xml | 9 + .../skins/default/xui/pl/panel_cof_wearables.xml | 8 + .../xui/pl/panel_deletable_wearable_list_item.xml | 5 + .../xui/pl/panel_dummy_clothing_list_item.xml | 7 + .../skins/default/xui/pl/panel_edit_eyes.xml | 8 +- .../skins/default/xui/pl/panel_edit_gloves.xml | 8 +- .../skins/default/xui/pl/panel_edit_hair.xml | 14 +- .../skins/default/xui/pl/panel_edit_jacket.xml | 8 +- .../skins/default/xui/pl/panel_edit_pants.xml | 8 +- .../skins/default/xui/pl/panel_edit_shape.xml | 41 ++-- .../skins/default/xui/pl/panel_edit_shirt.xml | 8 +- .../skins/default/xui/pl/panel_edit_shoes.xml | 8 +- .../skins/default/xui/pl/panel_edit_skin.xml | 14 +- .../skins/default/xui/pl/panel_edit_skirt.xml | 8 +- .../skins/default/xui/pl/panel_edit_socks.xml | 8 +- .../skins/default/xui/pl/panel_edit_tattoo.xml | 1 + .../skins/default/xui/pl/panel_edit_underpants.xml | 8 +- .../skins/default/xui/pl/panel_edit_undershirt.xml | 8 +- .../skins/default/xui/pl/panel_edit_wearable.xml | 13 +- .../skins/default/xui/pl/panel_group_general.xml | 5 +- .../default/xui/pl/panel_group_land_money.xml | 3 + .../skins/default/xui/pl/panel_group_notices.xml | 1 + .../default/xui/pl/panel_im_control_panel.xml | 2 +- .../skins/default/xui/pl/panel_inventory_item.xml | 4 + indra/newview/skins/default/xui/pl/panel_login.xml | 9 +- .../skins/default/xui/pl/panel_main_inventory.xml | 66 +---- .../xui/pl/panel_media_settings_permissions.xml | 9 + .../skins/default/xui/pl/panel_nearby_media.xml | 26 +- .../skins/default/xui/pl/panel_outfit_edit.xml | 51 ++++ .../default/xui/pl/panel_outfits_inventory.xml | 15 +- .../skins/default/xui/pl/panel_outfits_list.xml | 7 + .../skins/default/xui/pl/panel_outfits_wearing.xml | 6 + .../newview/skins/default/xui/pl/panel_people.xml | 37 +-- .../newview/skins/default/xui/pl/panel_places.xml | 7 +- .../default/xui/pl/panel_preferences_advanced.xml | 5 + .../default/xui/pl/panel_preferences_chat.xml | 1 + .../default/xui/pl/panel_preferences_graphics1.xml | 4 +- .../skins/default/xui/pl/panel_status_bar.xml | 6 +- .../skins/default/xui/pl/panel_voice_effect.xml | 15 ++ .../skins/default/xui/pl/panel_world_map.xml | 6 + .../skins/default/xui/pl/sidepanel_appearance.xml | 10 +- .../skins/default/xui/pl/sidepanel_inventory.xml | 8 +- .../skins/default/xui/pl/sidepanel_item_info.xml | 14 +- .../skins/default/xui/pl/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/pl/strings.xml | 271 +++++++++++++++++++-- .../default/xui/pt/floater_preview_gesture.xml | 22 +- .../default/xui/pt/floater_publish_classified.xml | 2 +- .../newview/skins/default/xui/pt/floater_tools.xml | 44 ++-- .../skins/default/xui/pt/floater_voice_effect.xml | 2 +- .../skins/default/xui/pt/floater_world_map.xml | 8 +- .../skins/default/xui/pt/menu_cof_clothing.xml | 3 +- .../skins/default/xui/pt/menu_inventory.xml | 11 +- .../default/xui/pt/menu_inventory_gear_default.xml | 3 +- .../skins/default/xui/pt/menu_outfit_gear.xml | 1 + .../default/xui/pt/menu_wearable_list_item.xml | 3 +- .../newview/skins/default/xui/pt/notifications.xml | 12 +- .../skins/default/xui/pt/panel_landmark_info.xml | 16 +- .../skins/default/xui/pt/panel_outfit_edit.xml | 10 +- .../default/xui/pt/panel_outfits_inventory.xml | 10 +- .../skins/default/xui/pt/panel_outfits_list.xml | 7 + .../skins/default/xui/pt/panel_outfits_wearing.xml | 6 + .../skins/default/xui/pt/panel_place_profile.xml | 16 +- .../default/xui/pt/panel_preferences_privacy.xml | 4 +- .../newview/skins/default/xui/pt/role_actions.xml | 4 +- .../skins/default/xui/pt/sidepanel_item_info.xml | 10 +- .../skins/default/xui/pt/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/pt/strings.xml | 15 +- 275 files changed, 2862 insertions(+), 1017 deletions(-) create mode 100644 indra/newview/skins/default/xui/da/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/da/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/de/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/de/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml create mode 100644 indra/newview/skins/default/xui/es/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/es/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/fr/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/fr/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/it/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/it/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/ja/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/ja/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_buy_currency_html.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_voice_effect.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_cof_attachment.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_cof_body_part.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_cof_clothing.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_cof_gear.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_edit.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_inv_offer_chiclet.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_outfit_gear.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_outfit_tab.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_save_outfit.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_script_chiclet.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_topinfobar.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_wearable_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_wearing_gear.xml create mode 100644 indra/newview/skins/default/xui/pl/menu_wearing_tab.xml create mode 100644 indra/newview/skins/default/xui/pl/outfit_accordion_tab.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_body_parts_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_bodyparts_list_button_bar.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_clothing_list_button_bar.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_clothing_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_cof_wearables.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_deletable_wearable_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_dummy_clothing_list_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_inventory_item.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_outfit_edit.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_outfits_wearing.xml create mode 100644 indra/newview/skins/default/xui/pl/panel_voice_effect.xml create mode 100644 indra/newview/skins/default/xui/pt/panel_outfits_list.xml create mode 100644 indra/newview/skins/default/xui/pt/panel_outfits_wearing.xml (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d51498f6d1..af296f918e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4666,7 +4666,7 @@ Type String Value - https://www.xstreetsl.com/modules.php?name=Marketplace + http://marketplace.secondlife.com/ MarketplaceURL_objectFemale @@ -4721,7 +4721,7 @@ Type String Value - https://www.xstreetsl.com/modules.php?name=Marketplace + http://marketplace.secondlife.com MarketplaceURL_bodypartMale @@ -4732,7 +4732,7 @@ Type String Value - https://www.xstreetsl.com/modules.php?name=Marketplace + http://marketplace.secondlife.com/ MarketplaceURL_glovesMale @@ -11857,5 +11857,16 @@ Value 1 + TipToastMessageLineCount + + Comment + Max line count of text message on tip toast. + Persist + 1 + Type + S32 + Value + 10 +
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4e5fdb1219..72d51540ef 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3406,6 +3406,9 @@ void LLAgent::setTeleportState(ETeleportState state) } else if(mTeleportState == TELEPORT_ARRIVING) { + // First two position updates after a teleport tend to be weird + LLViewerStats::getInstance()->mAgentPositionSnaps.mCountOfNextUpdatesToIgnore = 2; + // Let the interested parties know we've teleported. LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal()); } diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 0a2f0e9399..d911d123f4 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -48,7 +48,7 @@ public: virtual ~LLOrderMyOutfitsOnDestroy() { - if (LLApp::isExiting()) + if (!LLApp::isRunning()) { llwarns << "called during shutdown, skipping" << llendl; return; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 43f6be42b6..a7d90ab8d3 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -995,7 +995,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up { removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1), false); } - addCOFItemLink(item_to_wear, do_update); + addCOFItemLink(item_to_wear, do_update, cb); } break; case LLAssetType::AT_BODYPART: @@ -2179,17 +2179,19 @@ void LLAppearanceMgr::updateIsDirty() } else { + LLIsOfAssetType collector = LLIsOfAssetType(LLAssetType::AT_LINK); + LLInventoryModel::cat_array_t cof_cats; LLInventoryModel::item_array_t cof_items; - gInventory.collectDescendents(cof, cof_cats, cof_items, - LLInventoryModel::EXCLUDE_TRASH); + gInventory.collectDescendentsIf(cof, cof_cats, cof_items, + LLInventoryModel::EXCLUDE_TRASH, collector); LLInventoryModel::cat_array_t outfit_cats; LLInventoryModel::item_array_t outfit_items; - gInventory.collectDescendents(base_outfit, outfit_cats, outfit_items, - LLInventoryModel::EXCLUDE_TRASH); + gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items, + LLInventoryModel::EXCLUDE_TRASH, collector); - if(outfit_items.count() != cof_items.count() -1) + if(outfit_items.count() != cof_items.count()) { // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. @@ -2197,16 +2199,6 @@ void LLAppearanceMgr::updateIsDirty() return; } - //getting rid of base outfit folder link to simplify comparison - for (LLInventoryModel::item_array_t::iterator it = cof_items.begin(); it != cof_items.end(); ++it) - { - if (*it == base_outfit_item) - { - cof_items.erase(it); - break; - } - } - //"dirty" - also means a difference in linked UUIDs and/or a difference in wearables order (links' descriptions) std::sort(cof_items.begin(), cof_items.end(), sort_by_linked_uuid); std::sort(outfit_items.begin(), outfit_items.end(), sort_by_linked_uuid); diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 3275d784a3..99156b9d9d 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -211,7 +211,7 @@ void LLAvatarList::setDirty(bool val /*= true*/, bool force_refresh /*= false*/) void LLAvatarList::addAvalineItem(const LLUUID& item_id, const LLUUID& session_id, const std::string& item_name) { LL_DEBUGS("Avaline") << "Adding avaline item into the list: " << item_name << "|" << item_id << ", session: " << session_id << LL_ENDL; - LLAvalineListItem* item = new LLAvalineListItem; + LLAvalineListItem* item = new LLAvalineListItem(/*hide_number=*/false); item->setAvatarId(item_id, session_id, true, false); item->setName(item_name); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 6897f4ee8e..2826899cb0 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1886,7 +1886,7 @@ void LLScriptChiclet::onMenuItemClicked(const LLSD& user_data) if("end" == action) { - LLScriptFloaterManager::instance().onRemoveNotification(getSessionId()); + LLScriptFloaterManager::instance().removeNotification(getSessionId()); } } @@ -1969,7 +1969,7 @@ void LLInvOfferChiclet::onMenuItemClicked(const LLSD& user_data) if("end" == action) { - LLScriptFloaterManager::instance().onRemoveNotification(getSessionId()); + LLScriptFloaterManager::instance().removeNotification(getSessionId()); } } diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 4c0f51056d..86d9121213 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -283,7 +283,8 @@ LLCOFWearables::LLCOFWearables() : LLPanel(), mClothingTab(NULL), mAttachmentsTab(NULL), mBodyPartsTab(NULL), - mLastSelectedTab(NULL) + mLastSelectedTab(NULL), + mCOFVersion(-1) { mClothingMenu = new CofClothingContextMenu(this); mAttachmentMenu = new CofAttachmentContextMenu(this); @@ -378,6 +379,23 @@ void LLCOFWearables::onAccordionTabStateChanged(LLUICtrl* ctrl, const LLSD& expa void LLCOFWearables::refresh() { + const LLUUID cof_id = LLAppearanceMgr::instance().getCOF(); + if (cof_id.isNull()) + { + llwarns << "COF ID cannot be NULL" << llendl; + return; + } + + LLViewerInventoryCategory* catp = gInventory.getCategory(cof_id); + if (!catp) + { + llwarns << "COF category cannot be NULL" << llendl; + return; + } + + if (mCOFVersion == catp->getVersion()) return; + mCOFVersion = catp->getVersion(); + typedef std::vector values_vector_t; typedef std::map selection_map_t; @@ -393,7 +411,7 @@ void LLCOFWearables::refresh() LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t cof_items; - gInventory.collectDescendents(LLAppearanceMgr::getInstance()->getCOF(), cats, cof_items, LLInventoryModel::EXCLUDE_TRASH); + gInventory.collectDescendents(cof_id, cats, cof_items, LLInventoryModel::EXCLUDE_TRASH); populateAttachmentsAndBodypartsLists(cof_items); @@ -501,7 +519,7 @@ LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventory item_panel->childSetAction("btn_edit", mCOFCallbacks.mEditWearable); //turning on gray separator line for the last item in the items group of the same wearable type - item_panel->childSetVisible("wearable_type_separator_icon", last); + item_panel->setSeparatorVisible(last); return item_panel; } @@ -637,10 +655,10 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() const LLAccordionCtrlTab* expanded_tab = accordion_ctrl->getExpandedTab(); return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); -} + } LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() -{ + { static LLAccordionCtrl* accordion_ctrl = getChild("cof_wearables_accordion"); const LLAccordionCtrlTab* selected_tab = accordion_ctrl->getSelectedTab(); diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 0518d59df3..d005b75eaa 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -81,6 +81,7 @@ public: LLPanel* getSelectedItem(); void getSelectedItems(std::vector& selected_items) const; + /* Repopulate the COF wearables list if the COF category has been changed since the last refresh */ void refresh(); void clear(); @@ -123,6 +124,9 @@ protected: LLListContextMenu* mClothingMenu; LLListContextMenu* mAttachmentMenu; LLListContextMenu* mBodyPartMenu; + + /* COF category version since last refresh */ + S32 mCOFVersion; }; diff --git a/indra/newview/lldndbutton.cpp b/indra/newview/lldndbutton.cpp index 22f2bb1d16..4f4c7dead7 100644 --- a/indra/newview/lldndbutton.cpp +++ b/indra/newview/lldndbutton.cpp @@ -42,7 +42,7 @@ LLDragAndDropButton::Params::Params() } -LLDragAndDropButton::LLDragAndDropButton(Params& params) +LLDragAndDropButton::LLDragAndDropButton(const Params& params) : LLButton(params) { diff --git a/indra/newview/lldndbutton.h b/indra/newview/lldndbutton.h index c888268187..433b3f7ff5 100644 --- a/indra/newview/lldndbutton.h +++ b/indra/newview/lldndbutton.h @@ -54,7 +54,7 @@ public: Params(); }; - LLDragAndDropButton(Params& params); + LLDragAndDropButton(const Params& params); typedef boost::functionmInitialTargetIDs.begin(); it!=session->mInitialTargetIDs.end();++it) { diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index a2b5ffbac4..cb7b338e95 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -161,8 +161,7 @@ BOOL LLInspectObject::postBuild(void) // Hide floater when name links clicked LLTextBox* textbox = getChild("object_creator"); - textbox->mURLClickSignal.connect( - boost::bind(&LLInspectObject::closeFloater, this, false) ); + textbox->setURLClickedCallback(boost::bind(&LLInspectObject::closeFloater, this, false) ); // Hook up functionality getChild("buy_btn")->setCommitCallback( diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 2d11337955..f20acbd016 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -507,6 +507,19 @@ bool LLIsNotType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) return TRUE; } +bool LLIsOfAssetType::operator()(LLInventoryCategory* cat, LLInventoryItem* item) +{ + if(mType == LLAssetType::AT_CATEGORY) + { + if(cat) return TRUE; + } + if(item) + { + if(item->getActualType() == mType) return TRUE; + } + return FALSE; +} + bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item) { if(mType == LLAssetType::AT_CATEGORY) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 1c3f82c531..4a7721098d 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -174,6 +174,25 @@ protected: LLAssetType::EType mType; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLIsOfAssetType +// +// Implementation of a LLInventoryCollectFunctor which returns TRUE if +// the item or category is of asset type passed in during construction. +// Link types are treated as links, not as the types they point to. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLIsOfAssetType : public LLInventoryCollectFunctor +{ +public: + LLIsOfAssetType(LLAssetType::EType type) : mType(type) {} + virtual ~LLIsOfAssetType() {} + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item); +protected: + LLAssetType::EType mType; +}; + class LLIsTypeWithPermissions : public LLInventoryCollectFunctor { public: @@ -271,9 +290,7 @@ public: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFindNonLinksByMask -// -// +// Class LLFindByMask //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLFindByMask : public LLInventoryCollectFunctor { @@ -382,6 +399,19 @@ public: } }; +/* Filters out items of a particular asset type */ +class LLIsTypeActual : public LLIsType +{ +public: + LLIsTypeActual(LLAssetType::EType type) : LLIsType(type) {} + virtual ~LLIsTypeActual() {} + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if (item && item->getIsLinkType()) return false; + return LLIsType::operator()(cat, item); + } +}; + // Collect non-removable folders and items. class LLFindNonRemovableObjects : public LLInventoryCollectFunctor { diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index fbb3774917..e01f05c0f2 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -107,9 +107,12 @@ void LLInventoryItemsList::idle(void* user_data) } } +LLFastTimer::DeclareTimer FTM_INVENTORY_ITEMS_REFRESH("Inventory List Refresh"); + void LLInventoryItemsList::refresh() { - static const unsigned ADD_LIMIT = 50; + LLFastTimer _(FTM_INVENTORY_ITEMS_REFRESH); + static const unsigned ADD_LIMIT = 20; uuid_vec_t added_items; uuid_vec_t removed_items; @@ -140,7 +143,8 @@ void LLInventoryItemsList::refresh() it = removed_items.begin(); for( ; removed_items.end() != it; ++it) { - removeItemByUUID(*it); + // don't filter items right away + removeItemByUUID(*it, false); } // Filter, rearrange and notify parent about shape changes diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index c487aa10a7..e4a7a158a3 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -51,7 +51,12 @@ static const S32 WIDGET_SPACING = 3; LLPanelInventoryListItemBase::Params::Params() : default_style("default_style"), - worn_style("worn_style") + worn_style("worn_style"), + hover_image("hover_image"), + selected_image("selected_image"), + separator_image("separator_image"), + item_icon("item_icon"), + item_name("item_name") {}; LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) @@ -59,8 +64,10 @@ LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInven LLPanelInventoryListItemBase* list_item = NULL; if (item) { - list_item = new LLPanelInventoryListItemBase(item); - list_item->init(); + const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); + list_item = new LLPanelInventoryListItemBase(item, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } @@ -76,6 +83,25 @@ void LLPanelInventoryListItemBase::draw() } setNeedsRefresh(false); } + + if (mHovered && mHoverImage) + { + mHoverImage->draw(getLocalRect()); + } + + if (mSelected && mSelectedImage) + { + mSelectedImage->draw(getLocalRect()); + } + + if (mSeparatorVisible && mSeparatorImage) + { + // stretch along bottom of listitem, using image height + LLRect separator_rect = getLocalRect(); + separator_rect.mTop = mSeparatorImage->getHeight(); + mSeparatorImage->draw(separator_rect); + } + LLPanel::draw(); } @@ -134,9 +160,6 @@ void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show) BOOL LLPanelInventoryListItemBase::postBuild() { - setIconCtrl(getChild("item_icon")); - setTitleCtrl(getChild("item_name")); - LLViewerInventoryItem* inv_item = getItem(); if (inv_item) { @@ -156,18 +179,18 @@ void LLPanelInventoryListItemBase::setValue(const LLSD& value) { if (!value.isMap()) return; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + mSelected = value["selected"]; } void LLPanelInventoryListItemBase::onMouseEnter(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", true); + mHovered = true; LLPanel::onMouseEnter(x, y, mask); } void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", false); + mHovered = false; LLPanel::onMouseLeave(x, y, mask); } @@ -244,21 +267,47 @@ S32 LLPanelInventoryListItemBase::notify(const LLSD& info) return rv; } -LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item) -: LLPanel() -, mInventoryItemUUID(item ? item->getUUID() : LLUUID::null) -, mIconCtrl(NULL) -, mTitleCtrl(NULL) -, mWidgetSpacing(WIDGET_SPACING) -, mLeftWidgetsWidth(0) -, mRightWidgetsWidth(0) -, mNeedsRefresh(false) +LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item, const LLPanelInventoryListItemBase::Params& params) +: LLPanel(params), + mInventoryItemUUID(item ? item->getUUID() : LLUUID::null), + mIconCtrl(NULL), + mTitleCtrl(NULL), + mWidgetSpacing(WIDGET_SPACING), + mLeftWidgetsWidth(0), + mRightWidgetsWidth(0), + mNeedsRefresh(false), + mHovered(false), + mSelected(false), + mSeparatorVisible(false), + mHoverImage(params.hover_image), + mSelectedImage(params.selected_image), + mSeparatorImage(params.separator_image) { -} + LLIconCtrl::Params icon_params(params.item_icon); + applyXUILayout(icon_params, this); -void LLPanelInventoryListItemBase::init() -{ - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory_item.xml"); + mIconCtrl = LLUICtrlFactory::create(icon_params); + if (mIconCtrl) + { + addChild(mIconCtrl); + } + else + { + mIconCtrl = dynamic_cast(LLUICtrlFactory::createDefaultWidget("item_icon")); + } + + LLTextBox::Params text_params(params.item_name); + applyXUILayout(text_params, this); + + mTitleCtrl = LLUICtrlFactory::create(text_params); + if (mTitleCtrl) + { + addChild(mTitleCtrl); + } + else + { + mTitleCtrl = dynamic_cast(LLUICtrlFactory::createDefaultWidget("item_title")); + } } class WidgetVisibilityChanger diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index f29d92d51c..575f6aec19 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -41,12 +41,12 @@ // llui #include "llpanel.h" #include "llstyle.h" +#include "lliconctrl.h" +#include "lltextbox.h" // newview #include "llwearabletype.h" -class LLIconCtrl; -class LLTextBox; class LLViewerInventoryItem; /** @@ -70,6 +70,11 @@ public: { Optional default_style, worn_style; + Optional hover_image, + selected_image, + separator_image; + Optional item_icon; + Optional item_name; Params(); }; @@ -149,30 +154,22 @@ public: /** Get the associated inventory item */ LLViewerInventoryItem* getItem() const; + void setSeparatorVisible(bool visible) { mSeparatorVisible = visible; } + virtual ~LLPanelInventoryListItemBase(){} protected: - LLPanelInventoryListItemBase(LLViewerInventoryItem* item); + LLPanelInventoryListItemBase(LLViewerInventoryItem* item, const Params& params); typedef std::vector widget_array_t; - /** - * Use it from a factory function to build panel, do not build panel in constructor - */ - virtual void init(); - /** * Called after inventory item was updated, update panel widgets to reflect inventory changes. */ virtual void updateItem(const std::string& name, EItemState item_state = IS_DEFAULT); - /** setter for mIconCtrl */ - void setIconCtrl(LLIconCtrl* icon) { mIconCtrl = icon; } - /** setter for MTitleCtrl */ - void setTitleCtrl(LLTextBox* tb) { mTitleCtrl = tb; } - void setLeftWidgetsWidth(S32 width) { mLeftWidgetsWidth = width; } void setRightWidgetsWidth(S32 width) { mRightWidgetsWidth = width; } @@ -221,6 +218,14 @@ private: LLTextBox* mTitleCtrl; LLUIImagePtr mIconImage; + LLUIImagePtr mHoverImage; + LLUIImagePtr mSelectedImage; + LLUIImagePtr mSeparatorImage; + + bool mHovered; + bool mSelected; + bool mSeparatorVisible; + std::string mHighlightedText; widget_array_t mLeftSideWidgets; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index b8590d838e..46ebb54786 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -1052,7 +1052,7 @@ void LLLocationInputCtrl::changeLocationPresentation() //needs unescaped one LLSLURL slurl; LLAgentUI::buildSLURL(slurl, false); - mTextEntry->setText(slurl.getSLURLString()); + mTextEntry->setText(LLURI::unescape(slurl.getSLURLString())); mTextEntry->selectAll(); mMaturityButton->setVisible(FALSE); diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index e0658554a4..8ba2e6d01c 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -35,6 +35,7 @@ #include "llpanelgenerictip.h" #include "llnotifications.h" +#include "llviewercontrol.h" // for gSavedSettings LLPanelGenericTip::LLPanelGenericTip( @@ -45,7 +46,8 @@ LLPanelGenericTip::LLPanelGenericTip( childSetValue("message", notification->getMessage()); - // set line max count to 3 in case of a very long name - snapToMessageHeight(getChild ("message"), 3); + + S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); + snapToMessageHeight(getChild ("message"), max_line_count); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 29ce3449d1..3e12f0ba9a 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -197,14 +197,15 @@ BOOL LLPanelMainInventory::postBuild() mFilterEditor->setCommitCallback(boost::bind(&LLPanelMainInventory::onFilterEdit, this, _2)); } + initListCommandsHandlers(); + // *TODO:Get the cost info from the server const std::string upload_cost("10"); - childSetLabelArg("Upload Image", "[COST]", upload_cost); - childSetLabelArg("Upload Sound", "[COST]", upload_cost); - childSetLabelArg("Upload Animation", "[COST]", upload_cost); - childSetLabelArg("Bulk Upload", "[COST]", upload_cost); + mMenuAdd->getChild("Upload Image")->setLabelArg("[COST]", upload_cost); + mMenuAdd->getChild("Upload Sound")->setLabelArg("[COST]", upload_cost); + mMenuAdd->getChild("Upload Animation")->setLabelArg("[COST]", upload_cost); + mMenuAdd->getChild("Bulk Upload")->setLabelArg("[COST]", upload_cost); - initListCommandsHandlers(); return TRUE; } diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp index 6ba015b11c..b21fd7d385 100644 --- a/indra/newview/llpanelonlinestatus.cpp +++ b/indra/newview/llpanelonlinestatus.cpp @@ -34,6 +34,7 @@ #include "llnotifications.h" #include "llpanelonlinestatus.h" +#include "llviewercontrol.h" // for gSavedSettings LLPanelOnlineStatus::LLPanelOnlineStatus( const LLNotificationPtr& notification) : @@ -54,7 +55,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus( notification, notification->getResponseTemplate())); } - // set line max count to 3 in case of a very long name - snapToMessageHeight(getChild ("message"), 3); + S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); + snapToMessageHeight(getChild ("message"), max_line_count); } diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index f8350a56ef..937b794686 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -71,6 +71,7 @@ #include "llsdutil.h" #include "llsidepanelappearance.h" #include "lltoggleablemenu.h" +#include "llvoavatarself.h" #include "llwearablelist.h" #include "llwearableitemslist.h" #include "llwearabletype.h" @@ -263,7 +264,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() observer.addBOFReplacedCallback(boost::bind(&LLPanelOutfitEdit::updateCurrentOutfitName, this)); observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this)); observer.addOutfitLockChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this)); - observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::update, this)); + observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::onCOFChanged, this)); gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitEdit::onOutfitChanging, this, true)); gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitEdit::onOutfitChanging, this, false)); @@ -297,9 +298,9 @@ BOOL LLPanelOutfitEdit::postBuild() mFolderViewItemTypes[FVIT_ATTACHMENT] = LLLookItemType(getString("Filter.Objects"), ATTACHMENT_MASK); //order is important, see EListViewItemType for order information - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindByMask(ALL_ITEMS_MASK))); - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsType(LLAssetType::AT_CLOTHING))); - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsType(LLAssetType::AT_BODYPART))); + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindNonLinksByMask(ALL_ITEMS_MASK))); + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsTypeActual(LLAssetType::AT_CLOTHING))); + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsTypeActual(LLAssetType::AT_BODYPART))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindByMask(ATTACHMENT_MASK)));; mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("shape"), new LLFindActualWearablesOfType(LLWearableType::WT_SHAPE))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("skin"), new LLFindActualWearablesOfType(LLWearableType::WT_SKIN))); @@ -331,7 +332,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); - setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this)); + setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2)); mCOFWearables = getChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); @@ -347,8 +348,8 @@ BOOL LLPanelOutfitEdit::postBuild() mInventoryItemsPanel = getChild("folder_view"); mInventoryItemsPanel->setFilterTypes(ALL_ITEMS_MASK); mInventoryItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryItemsPanel->setSelectCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); - mInventoryItemsPanel->getRootFolder()->setReshapeCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); + mInventoryItemsPanel->setSelectCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); + mInventoryItemsPanel->getRootFolder()->setReshapeCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); mCOFDragAndDropObserver = new LLCOFDragAndDropObserver(mInventoryItemsPanel->getModel()); @@ -388,7 +389,7 @@ BOOL LLPanelOutfitEdit::postBuild() mWearablesListViewPanel = getChild("filtered_wearables_panel"); mWearableItemsList = getChild("list_view"); mWearableItemsList->setCommitOnSelectionChange(true); - mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); + mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); mWearableItemsList->setDoubleClickCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); @@ -442,6 +443,9 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) mListViewFilterCmbBox->setVisible(false); showWearablesFilter(); + + // Reset mWearableItemsList position to top. See EXT-8180. + mWearableItemsList->goToTop(); } //switching button bars @@ -583,11 +587,16 @@ void LLPanelOutfitEdit::onPlusBtnClicked(void) } } -void LLPanelOutfitEdit::onVisibilityChange() +void LLPanelOutfitEdit::onVisibilityChange(const LLSD &in_visible_chain) { showAddWearablesPanel(false); mWearableItemsList->resetSelection(); mInventoryItemsPanel->clearSelection(); + + if (in_visible_chain.asBoolean()) + { + update(); + } } void LLPanelOutfitEdit::onAddWearableClicked(void) @@ -614,15 +623,52 @@ void LLPanelOutfitEdit::onShopButtonClicked() { static LLShopURLDispatcher url_resolver; + // will contain the resultant URL std::string url; + + if (isAgentAvatarValid()) + { + // try to get wearable type from 'Add More' panel first (EXT-7639) + LLWearableType::EType type = getAddMorePanelSelectionType(); + + if (type == LLWearableType::WT_NONE) + { + type = getCOFWearablesSelectionType(); + } + + ESex sex = gAgentAvatarp->getSex(); + + // WT_INVALID comes for attachments + if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) + { + url = url_resolver.resolveURL(type, sex); + } + + if (url.empty()) + { + url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); + } + } + else + { + llwarns << "Agent avatar is invalid" << llendl; + + // the second argument is not important in this case: generic market place will be opened + url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); + } + + LLWeb::loadURLExternal(url); +} + +LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const +{ std::vector selected_items; - mCOFWearables->getSelectedItems(selected_items); + LLWearableType::EType type = LLWearableType::WT_NONE; - ESex sex = gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE; + mCOFWearables->getSelectedItems(selected_items); if (selected_items.size() == 1) { - LLWearableType::EType type = LLWearableType::WT_NONE; LLPanel* item = selected_items.front(); // LLPanelDummyClothingListItem is lower then LLPanelInventoryListItemBase in hierarchy tree @@ -634,20 +680,45 @@ void LLPanelOutfitEdit::onShopButtonClicked() { type = real_item->getWearableType(); } + } - // WT_INVALID comes for attachments - if (type != LLWearableType::WT_INVALID) + return type; +} + +LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const +{ + LLWearableType::EType type = LLWearableType::WT_NONE; + + if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) + { + if (mInventoryItemsPanel != NULL && mInventoryItemsPanel->getVisible()) { - url = url_resolver.resolveURL(type, sex); + std::set selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); + + if (selected_uuids.size() == 1) + { + type = getWearableTypeByItemUUID(*(selected_uuids.begin())); + } } - } + else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) + { + std::vector selected_uuids; + mWearableItemsList->getSelectedUUIDs(selected_uuids); - if (url.empty()) - { - url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); + if (selected_uuids.size() == 1) + { + type = getWearableTypeByItemUUID(selected_uuids.front()); + } + } } - LLWeb::loadURLExternal(url); + return type; +} + +LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const +{ + LLViewerInventoryItem* item = gInventory.getLinkedItem(item_uuid); + return (item != NULL) ? item->getWearableType() : LLWearableType::WT_NONE; } void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) @@ -667,7 +738,7 @@ void LLPanelOutfitEdit::onEditWearableClicked(void) } } -void LLPanelOutfitEdit::onInventorySelectionChange() +void LLPanelOutfitEdit::updatePlusButton() { uuid_vec_t selected_items; getSelectedItemsUUID(selected_items); @@ -910,6 +981,9 @@ void LLPanelOutfitEdit::updateVerbs() mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); updateCurrentOutfitName(); + + //updating state of "Wear Item" button previously known as "Plus" button + updatePlusButton(); } bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel) @@ -945,9 +1019,6 @@ void LLPanelOutfitEdit::showFilteredWearablesListView(LLWearableType::EType type showAddWearablesPanel(true); showWearablesListView(); - // Reset mWearableItemsList position to top. See EXT-8180. - mWearableItemsList->goToTop(); - //e_list_view_item_type implicitly contains LLWearableType::EType starting from LVIT_SHAPE applyListViewFilter((EListViewItemType) (LVIT_SHAPE + type)); } @@ -1014,5 +1085,13 @@ void LLPanelOutfitEdit::getSelectedItemsUUID(uuid_vec_t& uuid_list) // return selected_id; } +void LLPanelOutfitEdit::onCOFChanged() +{ + //the panel is only updated when is visible to a user + if (!isInVisibleChain()) return; + + update(); +} + // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index fb9a35411c..770e2a229b 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -145,10 +145,10 @@ public: void onFolderViewFilterCommitted(LLUICtrl* ctrl); void onListViewFilterCommitted(LLUICtrl* ctrl); void onSearchEdit(const std::string& string); - void onInventorySelectionChange(); + void updatePlusButton(); void onPlusBtnClicked(void); - void onVisibilityChange(); + void onVisibilityChange(const LLSD &in_visible_chain); void applyFolderViewFilter(EFolderViewItemType type); void applyListViewFilter(EListViewItemType type); @@ -196,6 +196,11 @@ private: void onOutfitChanging(bool started); void getSelectedItemsUUID(uuid_vec_t& uuid_list); void getCurrentItemUUID(LLUUID& selected_id); + void onCOFChanged(); + + LLWearableType::EType getCOFWearablesSelectionType() const; + LLWearableType::EType getAddMorePanelSelectionType() const; + LLWearableType::EType getWearableTypeByItemUUID(const LLUUID& item_uuid) const; LLTextBox* mCurrentOutfitName; LLTextBox* mStatus; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 8fe78a0f81..f2e6969998 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -582,7 +582,7 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) else { std::string display_name = LLVoiceClient::getInstance()->getDisplayName(avatar_id); - mAvatarList->addAvalineItem(avatar_id, mSpeakerMgr->getSessionID(), display_name.empty() ? display_name : LLTrans::getString("AvatarNameWaiting")); + mAvatarList->addAvalineItem(avatar_id, mSpeakerMgr->getSessionID(), display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name); mAvalineUpdater->watchAvalineCaller(avatar_id); } adjustParticipant(avatar_id); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index bf18c9e5e7..c4cbbbb791 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -75,7 +75,8 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mLastWidth(0), mAspectRatio(0.f), mPreviewToSave(FALSE), - mImage(NULL) + mImage(NULL), + mImageOldBoostLevel(LLViewerTexture::BOOST_NONE) { updateImageID(); if (key.has("save_as")) @@ -93,7 +94,7 @@ LLPreviewTexture::~LLPreviewTexture() { getWindow()->decBusyCount(); } - + mImage->setBoostLevel(mImageOldBoostLevel); mImage = NULL; } @@ -543,6 +544,7 @@ void LLPreviewTexture::onAspectRatioCommit(LLUICtrl* ctrl, void* userdata) void LLPreviewTexture::loadAsset() { mImage = LLViewerTextureManager::getFetchedTexture(mImageID, MIPMAP_TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + mImageOldBoostLevel = mImage->getBoostLevel(); mImage->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); mImage->forceToSaveRawImage(0) ; mAssetStatus = PREVIEW_ASSET_LOADING; diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 0f29a741c1..cbdb057781 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -82,9 +82,10 @@ private: void updateDimensions(); LLUUID mImageID; LLPointer mImage; - BOOL mLoadingFullImage; + S32 mImageOldBoostLevel; std::string mSaveFileName; LLFrameTimer mSavedFileTimer; + BOOL mLoadingFullImage; BOOL mShowKeepDiscard; BOOL mCopyToInv; @@ -94,11 +95,10 @@ private: // This is stored off in a member variable, because the save-as // button and drag and drop functionality need to know. BOOL mIsCopyable; - + BOOL mUpdateDimensions; S32 mLastHeight; S32 mLastWidth; - F32 mAspectRatio; - BOOL mUpdateDimensions; + F32 mAspectRatio; LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; }; diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b68fc3b002..75797dae81 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -176,7 +176,15 @@ void LLScriptFloater::onClose(bool app_quitting) if(getNotificationId().notNull()) { - LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); + // we shouldn't kill notification on exit since it may be used as persistent. + if (app_quitting) + { + LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); + } + else + { + LLScriptFloaterManager::getInstance()->removeNotification(getNotificationId()); + } } } @@ -352,7 +360,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) set_new_message |= !floater->hasFocus(); } - onRemoveNotification(it->first); + removeNotification(it->first); } } @@ -379,6 +387,17 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) toggleScriptFloater(notification_id, set_new_message); } +void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notification_id); + if (notification != NULL && !notification->isCancelled()) + { + LLNotificationsUtil::cancel(notification); + } + + onRemoveNotification(notification_id); +} + void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) { if(notification_id.isNull()) @@ -392,6 +411,8 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) LLIMWellWindow::getInstance()->removeObjectRow(notification_id); + mNotifications.erase(notification_id); + // close floater LLScriptFloater* floater = LLFloaterReg::findTypedInstance("script_floater", notification_id); if(floater) @@ -400,8 +421,6 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) floater->setNotificationId(LLUUID::null); floater->closeFloater(); } - - mNotifications.erase(notification_id); } void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message) diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index dc0cfc2400..6990234fd7 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -64,6 +64,11 @@ public: */ void onAddNotification(const LLUUID& notification_id); + /** + * Removes notification. + */ + void removeNotification(const LLUUID& notification_id); + /** * Handles notification removal. * Removes script notification toast, removes script chiclet, closes script floater diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 98282c1673..7104f3934d 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -230,15 +230,15 @@ LLSideTrayTab* LLSideTrayTab::createInstance () LLSideTray::Params::Params() : collapsed("collapsed",false), - tab_btn_image_normal("tab_btn_image","sidebar_tab_left.tga"), - tab_btn_image_selected("tab_btn_image_selected","button_enabled_selected_32x128.tga"), + tab_btn_image_normal("tab_btn_image",LLUI::getUIImage("sidebar_tab_left.tga")), + tab_btn_image_selected("tab_btn_image_selected",LLUI::getUIImage("button_enabled_selected_32x128.tga")), default_button_width("tab_btn_width",32), default_button_height("tab_btn_height",32), default_button_margin("tab_btn_margin",0) {} //virtual -LLSideTray::LLSideTray(Params& params) +LLSideTray::LLSideTray(const Params& params) : LLPanel(params) ,mActiveTab(0) ,mCollapsed(false) @@ -373,10 +373,10 @@ LLButton* LLSideTray::createButton (const std::string& name,const std::string& i bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); bparams.rect (rect); bparams.tab_stop(false); - bparams.image_unselected.name(sidetray_params.tab_btn_image_normal); - bparams.image_selected.name(sidetray_params.tab_btn_image_selected); - bparams.image_disabled.name(sidetray_params.tab_btn_image_normal); - bparams.image_disabled_selected.name(sidetray_params.tab_btn_image_selected); + bparams.image_unselected(sidetray_params.tab_btn_image_normal); + bparams.image_selected(sidetray_params.tab_btn_image_selected); + bparams.image_disabled(sidetray_params.tab_btn_image_normal); + bparams.image_disabled_selected(sidetray_params.tab_btn_image_selected); LLButton* button = LLUICtrlFactory::create (bparams); button->setLabel(name); diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 3a8d308425..406cdc9055 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -54,13 +54,13 @@ public: : public LLInitParam::Block { // initial state - Optional collapsed; - Optional tab_btn_image_normal; - Optional tab_btn_image_selected; + Optional collapsed; + Optional tab_btn_image_normal, + tab_btn_image_selected; - Optional default_button_width; - Optional default_button_height; - Optional default_button_margin; + Optional default_button_width, + default_button_height, + default_button_margin; Params(); }; @@ -68,7 +68,7 @@ public: static LLSideTray* getInstance (); static bool instanceCreated (); protected: - LLSideTray(Params& params); + LLSideTray(const Params& params); typedef std::vector child_vector_t; typedef child_vector_t::iterator child_vector_iter_t; typedef child_vector_t::const_iterator child_vector_const_iter_t; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index e6b4aeb6c2..1a8c2b8fc0 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -371,7 +371,7 @@ LLIMWellWindow::ObjectRowPanel::~ObjectRowPanel() //--------------------------------------------------------------------------------- void LLIMWellWindow::ObjectRowPanel::onClosePanel() { - LLScriptFloaterManager::getInstance()->onRemoveNotification(mChiclet->getSessionId()); + LLScriptFloaterManager::getInstance()->removeNotification(mChiclet->getSessionId()); } void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& notification_id, bool new_message/* = false*/) @@ -832,7 +832,7 @@ void LLIMWellWindow::closeAllImpl() ObjectRowPanel* obj_panel = dynamic_cast (panel); if (obj_panel) { - LLScriptFloaterManager::instance().onRemoveNotification(*iter); + LLScriptFloaterManager::instance().removeNotification(*iter); } } } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index fcb9deb20b..0b02861b75 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -423,6 +423,10 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mInventoryPanel->setAllowMultiSelect(FALSE); + // Disable auto selecting first filtered item because it takes away + // selection from the item set by LLTextureCtrl owning this floater. + mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); + // Commented out to scroll to currently selected texture. See EXT-5403. // // store this filter as the default one // mInventoryPanel->getRootFolder()->getFilter()->markDefault(); diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index 8488527185..333f682e8f 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -89,9 +89,10 @@ void LLURLLineEditor::copyEscapedURLToClipboard() const std::string unescaped_text = wstring_to_utf8str(mText.getWString().substr(left_pos, length)); LLWString text_to_copy; - if (LLSLURL(unescaped_text).isValid()) + // *HACK: Because LLSLURL is currently broken we cannot use it to check if unescaped_text is a valid SLURL (see EXT-8335). + if (LLStringUtil::startsWith(unescaped_text, "http://")) // SLURL text_to_copy = utf8str_to_wstring(LLWeb::escapeURL(unescaped_text)); - else + else // human-readable location text_to_copy = utf8str_to_wstring(unescaped_text); gClipboard.copyFromString( text_to_copy ); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 1ff4d6db9e..cbc86c89cc 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -847,6 +847,21 @@ LLInventoryCallbackManager::~LLInventoryCallbackManager() sInstance = NULL; } +//static +void LLInventoryCallbackManager::destroyClass() +{ + if (sInstance) + { + for (callback_map_t::iterator it = sInstance->mMap.begin(), end_it = sInstance->mMap.end(); it != end_it; ++it) + { + // drop LLPointer reference to callback + it->second = NULL; + } + sInstance->mMap.clear(); + } +} + + U32 LLInventoryCallbackManager::registerCB(LLPointer cb) { if (cb.isNull()) diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index d0d3ad693e..1dd6597388 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -36,6 +36,7 @@ #include "llinventory.h" #include "llframetimer.h" #include "llwearable.h" +#include "llui.h" //for LLDestroyClass #include // boost::signals2::trackable @@ -299,8 +300,9 @@ private: // misc functions //void inventory_reliable_callback(void**, S32 status); -class LLInventoryCallbackManager +class LLInventoryCallbackManager : public LLDestroyClass { + friend class LLDestroyClass; public: LLInventoryCallbackManager(); ~LLInventoryCallbackManager(); @@ -308,9 +310,12 @@ public: void fire(U32 callback_id, const LLUUID& item_id); U32 registerCB(LLPointer cb); private: - std::map > mMap; + typedef std::map > callback_map_t; + callback_map_t mMap; U32 mLastCallback; static LLInventoryCallbackManager *sInstance; + static void destroyClass(); + public: static bool is_instantiated() { return sInstance != NULL; } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 07b6431c92..53fb01aec3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2585,7 +2585,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.substitutions = substitutions; params.payload = payload; - LLPostponedNotification::add(params, from_id, false); + LLPostponedNotification::add(params, from_id, from_group); } break; case IM_FROM_TASK_AS_ALERT: diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6d93de2383..15bdf126c5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -79,6 +79,7 @@ #include "llviewerparceloverlay.h" #include "llviewerpartsource.h" #include "llviewerregion.h" +#include "llviewerstats.h" #include "llviewertextureanim.h" #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatar.h" @@ -1916,6 +1917,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, avatar->clampAttachmentPositions(); } + + // If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps + if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) ) + { + LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() ); + } } if (new_rot != mLastRot diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index bdc34d0f18..a706e77f19 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -280,6 +280,8 @@ LLViewerStats::LLViewerStats() : { mStats[ST_HAS_BAD_TIMER] = 1.0; } + + mAgentPositionSnaps.reset(); } LLViewerStats::~LLViewerStats() @@ -299,6 +301,8 @@ void LLViewerStats::resetStats() LLViewerStats::getInstance()->mPacketsOutStat.reset(); LLViewerStats::getInstance()->mFPSStat.reset(); LLViewerStats::getInstance()->mTexturePacketsStat.reset(); + + LLViewerStats::getInstance()->mAgentPositionSnaps.reset(); } @@ -393,6 +397,10 @@ void LLViewerStats::addToMessage(LLSD &body) const << llendl; } } + + body["AgentPositionSnaps"] = mAgentPositionSnaps.getData(); + llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev() + << "; Count = " << mAgentPositionSnaps.getCount() << llendl; } // static diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 13d73000d2..694eeaf097 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -197,6 +197,61 @@ public: void addToMessage(LLSD &body) const; + struct StatsAccumulator + { + S32 mCount; + F32 mSum; + F32 mSumOfSquares; + U32 mCountOfNextUpdatesToIgnore; + + inline void push( F32 val ) + { + if ( mCountOfNextUpdatesToIgnore > 0 ) + { + mCountOfNextUpdatesToIgnore--; + return; + } + + mCount++; + mSum += val; + mSumOfSquares += val * val; + } + + inline F32 getMean() const + { + return (mCount == 0) ? 0.f : ((F32)mSum)/mCount; + } + + inline F32 getStdDev() const + { + const F32 mean = getMean(); + return (mCount == 0) ? 0.f : sqrt( mSumOfSquares/mCount - (mean * mean) ); + } + + inline U32 getCount() const + { + return mCount; + } + + inline void reset() + { + mCount = 0; + mSum = mSumOfSquares = 0.f; + mCountOfNextUpdatesToIgnore = 0; + } + + inline LLSD getData() const + { + LLSD data; + data["mean"] = getMean(); + data["std_dev"] = getStdDev(); + data["count"] = (S32)mCount; + return data; + } + }; + + StatsAccumulator mAgentPositionSnaps; + private: F64 mStats[ST_COUNT]; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0afbce7d51..75bb9f84e2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -495,6 +495,7 @@ LLViewerTexture::LLViewerTexture(const U32 width, const U32 height, const U8 com mFullHeight = height ; mUseMipMaps = usemipmaps ; mComponents = components ; + setTexelsPerImage(); mID.generate(); sImageCount++; @@ -522,6 +523,7 @@ void LLViewerTexture::init(bool firstinit) mFullWidth = 0; mFullHeight = 0; + mTexelsPerImage = 0 ; mUseMipMaps = FALSE ; mComponents = 0 ; @@ -530,7 +532,7 @@ void LLViewerTexture::init(bool firstinit) mMaxVirtualSize = 0.f; mNeedsGLTexture = FALSE ; mMaxVirtualSizeResetInterval = 1; - mMaxVirtualSizeResetCounter = 1 ; + mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval ; mAdditionalDecodePriority = 0.f ; mParcelMedia = NULL ; mNumFaces = 0 ; @@ -838,7 +840,8 @@ BOOL LLViewerTexture::createGLTexture(S32 discard_level, const LLImageRaw* image { mFullWidth = mGLTexturep->getCurrentWidth() ; mFullHeight = mGLTexturep->getCurrentHeight() ; - mComponents = mGLTexturep->getComponents() ; + mComponents = mGLTexturep->getComponents() ; + setTexelsPerImage(); } return ret ; @@ -1056,9 +1059,16 @@ void LLViewerTexture::destroyGLTexture() } } +void LLViewerTexture::setTexelsPerImage() +{ + S32 fullwidth = llmin(mFullWidth,(S32)MAX_IMAGE_SIZE_DEFAULT); + S32 fullheight = llmin(mFullHeight,(S32)MAX_IMAGE_SIZE_DEFAULT); + mTexelsPerImage = (F32)fullwidth * fullheight; +} + BOOL LLViewerTexture::isLargeImage() { - return mFullWidth * mFullHeight > LLViewerTexture::sMinLargeImageSize ; + return (S32)mTexelsPerImage > LLViewerTexture::sMinLargeImageSize ; } //virtual @@ -1415,6 +1425,7 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) mFullWidth = mRawImage->getWidth(); mFullHeight = mRawImage->getHeight(); + setTexelsPerImage(); } else { @@ -1619,11 +1630,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() { // priority range = 100,000 - 500,000 S32 desired_discard = mDesiredDiscardLevel; - if (getDontDiscard()) - { - desired_discard -= 2; - } - else if (!isJustBound() && mCachedRawImageReady) + if (!isJustBound() && mCachedRawImageReady) { if(mBoostLevel < BOOST_HIGH) { @@ -1639,7 +1646,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() S32 ddiscard = cur_discard - desired_discard; ddiscard = llclamp(ddiscard, -1, MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY); - priority = (ddiscard + 1) * PRIORITY_DELTA_DISCARD_LEVEL_FACTOR; + priority = (ddiscard + 1) * PRIORITY_DELTA_DISCARD_LEVEL_FACTOR; } // Priority Formula: @@ -1647,19 +1654,51 @@ F32 LLViewerFetchedTexture::calcDecodePriority() // [10,000,000] + [1,000,000-9,000,000] + [100,000-500,000] + [1-20,000] + [0-999] if (priority > 0.0f) { + bool large_enough = mCachedRawImageReady && ((S32)mTexelsPerImage > sMinLargeImageSize) ; + if(large_enough) + { + //Note: + //to give small, low-priority textures some chance to be fetched, + //cut the priority in half if the texture size is larger than 256 * 256 and has a 64*64 ready. + priority *= 0.5f ; + } + pixel_priority = llclamp(pixel_priority, 0.0f, MAX_PRIORITY_PIXEL); priority += pixel_priority + PRIORITY_BOOST_LEVEL_FACTOR * mBoostLevel; if ( mBoostLevel > BOOST_HIGH) { - priority += PRIORITY_BOOST_HIGH_FACTOR; + if(mBoostLevel > BOOST_SUPER_HIGH) + { + //for very important textures, always grant the highest priority. + priority += PRIORITY_BOOST_HIGH_FACTOR; + } + else if(mCachedRawImageReady) + { + //Note: + //to give small, low-priority textures some chance to be fetched, + //if high priority texture has a 64*64 ready, lower its fetching priority. + setAdditionalDecodePriority(0.5f) ; + } + else + { + priority += PRIORITY_BOOST_HIGH_FACTOR; + } } if(mAdditionalDecodePriority > 0.0f) { // priority range += 1,000,000.f-9,000,000.f - priority += PRIORITY_ADDITIONAL_FACTOR * (1.0 + mAdditionalDecodePriority * MAX_ADDITIONAL_LEVEL_FOR_PRIORITY); + F32 additional = PRIORITY_ADDITIONAL_FACTOR * (1.0 + mAdditionalDecodePriority * MAX_ADDITIONAL_LEVEL_FOR_PRIORITY); + if(large_enough) + { + //Note: + //to give small, low-priority textures some chance to be fetched, + //cut the additional priority to a quarter if the texture size is larger than 256 * 256 and has a 64*64 ready. + additional *= 0.25f ; + } + priority += additional; } } return priority; @@ -1702,11 +1741,6 @@ void LLViewerFetchedTexture::updateVirtualSize() addTextureStats(0.f, FALSE) ;//reset } - if(mForceToSaveRawImage) - { - setAdditionalDecodePriority(0.75f) ; //boost the fetching priority - } - for(U32 i = 0 ; i < mNumFaces ; i++) { LLFace* facep = mFaceList[i] ; @@ -1819,6 +1853,7 @@ bool LLViewerFetchedTexture::updateFetch() { mFullWidth = mRawImage->getWidth() << mRawDiscardLevel; mFullHeight = mRawImage->getHeight() << mRawDiscardLevel; + setTexelsPerImage(); if(mFullWidth > MAX_IMAGE_SIZE || mFullHeight > MAX_IMAGE_SIZE) { @@ -2887,10 +2922,6 @@ void LLViewerLODTexture::processTextureStats() //static const F64 log_2 = log(2.0); static const F64 log_4 = log(4.0); - S32 fullwidth = llmin(mFullWidth,(S32)MAX_IMAGE_SIZE_DEFAULT); - S32 fullheight = llmin(mFullHeight,(S32)MAX_IMAGE_SIZE_DEFAULT); - mTexelsPerImage = (F32)fullwidth * fullheight; - F32 discard_level = 0.f; // If we know the output width and height, we can force the discard diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 8b69408e4b..b33d04e8dd 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -126,15 +126,16 @@ public: BOOST_HIGH = 10, BOOST_BUMP , BOOST_TERRAIN , // has to be high priority for minimap / low detail - BOOST_SELECTED , - BOOST_HUD , + BOOST_SELECTED , BOOST_AVATAR_BAKED_SELF , + BOOST_AVATAR_SELF , // needed for baking avatar + BOOST_SUPER_HIGH , //textures higher than this need to be downloaded at the required resolution without delay. + BOOST_HUD , BOOST_ICON , BOOST_UI , BOOST_PREVIEW , BOOST_MAP , - BOOST_MAP_VISIBLE , - BOOST_AVATAR_SELF , // needed for baking avatar + BOOST_MAP_VISIBLE , BOOST_MAX_LEVEL, //other texture Categories @@ -268,6 +269,7 @@ protected: void init(bool firstinit) ; void reorganizeFaceList() ; void reorganizeVolumeList() ; + void setTexelsPerImage(); private: //note: do not make this function public. /*virtual*/ LLImageGL* getGLTexture() const ; @@ -280,6 +282,7 @@ protected: S32 mFullHeight; BOOL mUseMipMaps ; S8 mComponents; + F32 mTexelsPerImage; // Texels per image. mutable S8 mNeedsGLTexture; mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need? mutable S32 mMaxVirtualSizeResetCounter ; @@ -598,8 +601,6 @@ private: void scaleDown() ; private: - - F32 mTexelsPerImage; // Texels per image. F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard F32 mCalculatedDiscardLevel; // Last calculated discard level }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 47e35ca0c4..07b98eaf82 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3189,29 +3189,26 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { // muted avatars update at 16 hz mUpdatePeriod = 16; } - else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible) + else if (mVisibilityRank <= LLVOAvatar::sMaxVisible) { //first 25% of max visible avatars are not impostored mUpdatePeriod = 1; } - else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 4) + else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 4) { //background avatars are REALLY slow updating impostors mUpdatePeriod = 16; } - else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 3) + else if (mVisibilityRank > LLVOAvatar::sMaxVisible * 3) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = 8; } - else if (visible && mImpostorPixelArea <= impostor_area) + else if (mImpostorPixelArea <= impostor_area) { // stuff in between gets an update period based on pixel area mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8); } - else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible) - { // force nearby impostors in ultra crowded areas - mUpdatePeriod = 2; - } else - { // not impostored - mUpdatePeriod = 1; + { + //nearby avatars, update the impostors more frequently. + mUpdatePeriod = 4; } visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE; @@ -4274,10 +4271,12 @@ void LLVOAvatar::checkTextureLoading() return ; } +const F32 SELF_ADDITIONAL_PRI = 0.75f ; +const F32 ADDITIONAL_PRI = 0.5f; void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { //if this function is not called for the last 512 frames, the texture pipeline will stop fetching this texture. - static const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = 512 ; //frames + static const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = 512 ; //frames imagep->resetTextureStats(); imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures. @@ -4287,9 +4286,14 @@ void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel mMinPixelArea = llmin(pixel_area, mMinPixelArea); imagep->addTextureStats(pixel_area / texel_area_ratio); imagep->setBoostLevel(boost_level); - if(boost_level == LLViewerTexture::BOOST_AVATAR_BAKED_SELF) + + if(boost_level != LLViewerTexture::BOOST_AVATAR_BAKED_SELF) + { + imagep->setAdditionalDecodePriority(ADDITIONAL_PRI) ; + } + else { - imagep->setAdditionalDecodePriority(1.0f) ; + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; } } @@ -7300,7 +7304,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() std::sort(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), CompareScreenAreaGreater()); // Update the avatars that have changed status - U32 rank = 0; + U32 rank = 2; //1 is reserved for self. for (std::vector::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -7324,7 +7328,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() if (inst->isSelf()) { - inst->setVisibilityRank(0); + inst->setVisibilityRank(1); } else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible()) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 3dad919875..49b9fe1536 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -868,7 +868,7 @@ private: public: // Responsible for detecting the user's voice signal (and when the // user speaks, it puts a voice symbol over the avatar's head) and gesticulations - LLVoiceVisualizer* mVoiceVisualizer; + LLPointer mVoiceVisualizer; int mCurrentGesticulationLevel; //-------------------------------------------------------------------- @@ -1048,5 +1048,6 @@ protected: // Shared with LLVOAvatarSelf *******************************************************************************/ }; // LLVOAvatar +extern const F32 SELF_ADDITIONAL_PRI; #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4edbbb7402..b80e47e11a 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2034,7 +2034,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe imagep->resetTextureStats(); imagep->setMaxVirtualSizeResetInterval(16); imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->setAdditionalDecodePriority(1.0f) ; + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; imagep->forceUpdateBindStats() ; if (imagep->getDiscardLevel() < 0) { diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 3887f64618..60ebb9416e 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -85,8 +85,8 @@ void LLPanelWearableListItem::onMouseLeave(S32 x, S32 y, MASK mask) reshapeWidgets(); } -LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item) -: LLPanelInventoryListItemBase(item) +LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item, const LLPanelWearableListItem::Params& params) +: LLPanelInventoryListItemBase(item, params) { } @@ -101,15 +101,19 @@ LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryIt LLPanelWearableOutfitItem* list_item = NULL; if (item) { - list_item = new LLPanelWearableOutfitItem(item, worn_indication_enabled); - list_item->init(); + const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); + + list_item = new LLPanelWearableOutfitItem(item, worn_indication_enabled, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item, - bool worn_indication_enabled) -: LLPanelInventoryListItemBase(item) + bool worn_indication_enabled, + const LLPanelWearableOutfitItem::Params& params) +: LLPanelInventoryListItemBase(item, params) , mWornIndicationEnabled(worn_indication_enabled) { } @@ -132,6 +136,17 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelClothingListItem(&typeid(LLPanelClothingListItem::Params), "clothing_list_item"); + + +LLPanelClothingListItem::Params::Params() +: up_btn("up_btn"), + down_btn("down_btn"), + edit_btn("edit_btn"), + lock_panel("lock_panel"), + edit_panel("edit_panel"), + lock_icon("lock_icon") +{} // static LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* item) @@ -139,24 +154,54 @@ LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* LLPanelClothingListItem* list_item = NULL; if(item) { - list_item = new LLPanelClothingListItem(item); - list_item->init(); + const LLPanelClothingListItem::Params& params = LLUICtrlFactory::getDefaultParams(); + list_item = new LLPanelClothingListItem(item, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } -LLPanelClothingListItem::LLPanelClothingListItem(LLViewerInventoryItem* item) - : LLPanelDeletableWearableListItem(item) +LLPanelClothingListItem::LLPanelClothingListItem(LLViewerInventoryItem* item, const LLPanelClothingListItem::Params& params) + : LLPanelDeletableWearableListItem(item, params) +{ + LLButton::Params button_params = params.up_btn; + applyXUILayout(button_params, this); + addChild(LLUICtrlFactory::create(button_params)); + + button_params = params.down_btn; + applyXUILayout(button_params, this); + addChild(LLUICtrlFactory::create(button_params)); + + LLPanel::Params panel_params = params.lock_panel; + applyXUILayout(panel_params, this); + LLPanel* lock_panelp = LLUICtrlFactory::create(panel_params); + addChild(lock_panelp); + + panel_params = params.edit_panel; + applyXUILayout(panel_params, this); + LLPanel* edit_panelp = LLUICtrlFactory::create(panel_params); + addChild(edit_panelp); + + if (lock_panelp) { + LLIconCtrl::Params icon_params = params.lock_icon; + applyXUILayout(icon_params, this); + lock_panelp->addChild(LLUICtrlFactory::create(icon_params)); } -LLPanelClothingListItem::~LLPanelClothingListItem() + if (edit_panelp) { + button_params = params.edit_btn; + applyXUILayout(button_params, this); + edit_panelp->addChild(LLUICtrlFactory::create(button_params)); + } + + setSeparatorVisible(false); } -void LLPanelClothingListItem::init() +LLPanelClothingListItem::~LLPanelClothingListItem() { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_clothing_list_item.xml"); } BOOL LLPanelClothingListItem::postBuild() @@ -178,30 +223,62 @@ BOOL LLPanelClothingListItem::postBuild() ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelBodyPartsListItem(&typeid(LLPanelBodyPartsListItem::Params), "bodyparts_list_item"); + + +LLPanelBodyPartsListItem::Params::Params() +: edit_btn("edit_btn"), + edit_panel("edit_panel"), + lock_panel("lock_panel"), + lock_icon("lock_icon") +{} + // static LLPanelBodyPartsListItem* LLPanelBodyPartsListItem::create(LLViewerInventoryItem* item) { LLPanelBodyPartsListItem* list_item = NULL; if(item) { - list_item = new LLPanelBodyPartsListItem(item); - list_item->init(); + const Params& params = LLUICtrlFactory::getDefaultParams(); + list_item = new LLPanelBodyPartsListItem(item, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } -LLPanelBodyPartsListItem::LLPanelBodyPartsListItem(LLViewerInventoryItem* item) -: LLPanelWearableListItem(item) +LLPanelBodyPartsListItem::LLPanelBodyPartsListItem(LLViewerInventoryItem* item, const LLPanelBodyPartsListItem::Params& params) +: LLPanelWearableListItem(item, params) { + LLPanel::Params panel_params = params.edit_panel; + applyXUILayout(panel_params, this); + LLPanel* edit_panelp = LLUICtrlFactory::create(panel_params); + addChild(edit_panelp); + + panel_params = params.lock_panel; + applyXUILayout(panel_params, this); + LLPanel* lock_panelp = LLUICtrlFactory::create(panel_params); + addChild(lock_panelp); + + if (edit_panelp) + { + LLButton::Params btn_params = params.edit_btn; + applyXUILayout(btn_params, this); + edit_panelp->addChild(LLUICtrlFactory::create(btn_params)); } -LLPanelBodyPartsListItem::~LLPanelBodyPartsListItem() + if (lock_panelp) { + LLIconCtrl::Params icon_params = params.lock_icon; + applyXUILayout(icon_params, this); + lock_panelp->addChild(LLUICtrlFactory::create(icon_params)); + } + + setSeparatorVisible(true); } -void LLPanelBodyPartsListItem::init() +LLPanelBodyPartsListItem::~LLPanelBodyPartsListItem() { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_body_parts_list_item.xml"); } BOOL LLPanelBodyPartsListItem::postBuild() @@ -214,6 +291,11 @@ BOOL LLPanelBodyPartsListItem::postBuild() return TRUE; } +static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelDeletableWearableListItem(&typeid(LLPanelDeletableWearableListItem::Params), "deletable_wearable_list_item"); + +LLPanelDeletableWearableListItem::Params::Params() +: delete_btn("delete_btn") +{} // static LLPanelDeletableWearableListItem* LLPanelDeletableWearableListItem::create(LLViewerInventoryItem* item) @@ -221,20 +303,22 @@ LLPanelDeletableWearableListItem* LLPanelDeletableWearableListItem::create(LLVie LLPanelDeletableWearableListItem* list_item = NULL; if(item) { - list_item = new LLPanelDeletableWearableListItem(item); - list_item->init(); + const Params& params = LLUICtrlFactory::getDefaultParams(); + list_item = new LLPanelDeletableWearableListItem(item, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } -LLPanelDeletableWearableListItem::LLPanelDeletableWearableListItem(LLViewerInventoryItem* item) -: LLPanelWearableListItem(item) +LLPanelDeletableWearableListItem::LLPanelDeletableWearableListItem(LLViewerInventoryItem* item, const LLPanelDeletableWearableListItem::Params& params) +: LLPanelWearableListItem(item, params) { -} + LLButton::Params button_params = params.delete_btn; + applyXUILayout(button_params, this); + addChild(LLUICtrlFactory::create(button_params)); -void LLPanelDeletableWearableListItem::init() -{ - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_deletable_wearable_list_item.xml"); + setSeparatorVisible(true); } BOOL LLPanelDeletableWearableListItem::postBuild() @@ -260,8 +344,11 @@ LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryIt LLPanelAttachmentListItem* list_item = NULL; if(item) { - list_item = new LLPanelAttachmentListItem(item); - list_item->init(); + const Params& params = LLUICtrlFactory::getDefaultParams(); + + list_item = new LLPanelAttachmentListItem(item, params); + list_item->initFromParams(params); + list_item->postBuild(); } return list_item; } @@ -284,27 +371,32 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name, ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// +static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelDummyClothingListItem(&typeid(LLPanelDummyClothingListItem::Params), "dummy_clothing_list_item"); + +LLPanelDummyClothingListItem::Params::Params() +: add_panel("add_panel"), + add_btn("add_btn") +{} LLPanelDummyClothingListItem* LLPanelDummyClothingListItem::create(LLWearableType::EType w_type) { - LLPanelDummyClothingListItem* list_item = new LLPanelDummyClothingListItem(w_type); - list_item->init(); + const Params& params = LLUICtrlFactory::getDefaultParams(); + + LLPanelDummyClothingListItem* list_item = new LLPanelDummyClothingListItem(w_type, params); + list_item->initFromParams(params); + list_item->postBuild(); return list_item; } BOOL LLPanelDummyClothingListItem::postBuild() { - LLIconCtrl* icon = getChild("item_icon"); - setIconCtrl(icon); - setTitleCtrl(getChild("item_name")); - addWidgetToRightSide("btn_add_panel"); setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, FALSE)); updateItem(wearableTypeToString(mWearableType)); // Make it look loke clothing item - reserve space for 'delete' button - setLeftWidgetsWidth(icon->getRect().mLeft); + setLeftWidgetsWidth(getChildView("item_icon")->getRect().mLeft); setWidgetsVisible(false); reshapeWidgets(); @@ -317,15 +409,23 @@ LLWearableType::EType LLPanelDummyClothingListItem::getWearableType() const return mWearableType; } -LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type) - : LLPanelWearableListItem(NULL) - , mWearableType(w_type) +LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type, const LLPanelDummyClothingListItem::Params& params) +: LLPanelWearableListItem(NULL, params), + mWearableType(w_type) { -} + LLPanel::Params panel_params(params.add_panel); + applyXUILayout(panel_params, this); + LLPanel* add_panelp = LLUICtrlFactory::create(panel_params); + addChild(add_panelp); -void LLPanelDummyClothingListItem::init() + if (add_panelp) { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_dummy_clothing_list_item.xml"); + LLButton::Params button_params(params.add_btn); + applyXUILayout(button_params, this); + add_panelp->addChild(LLUICtrlFactory::create(button_params)); +} + + setSeparatorVisible(true); } typedef std::map clothing_to_string_map_t; diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index d16a2a89c8..367b648b3d 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -68,7 +68,7 @@ public: protected: - LLPanelWearableListItem(LLViewerInventoryItem* item); + LLPanelWearableListItem(LLViewerInventoryItem* item, const Params& params); }; /** @@ -93,7 +93,7 @@ public: protected: LLPanelWearableOutfitItem(LLViewerInventoryItem* item, - bool worn_indication_enabled); + bool worn_indication_enabled, const Params& params); private: bool mWornIndicationEnabled; @@ -103,6 +103,13 @@ class LLPanelDeletableWearableListItem : public LLPanelWearableListItem { LOG_CLASS(LLPanelDeletableWearableListItem); public: + struct Params : public LLInitParam::Block + { + Optional delete_btn; + + Params(); + }; + static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item); @@ -116,9 +123,7 @@ public: inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); } protected: - LLPanelDeletableWearableListItem(LLViewerInventoryItem* item); - - /*virtual*/ void init(); + LLPanelDeletableWearableListItem(LLViewerInventoryItem* item, const Params& params); }; /** Outfit list item for an attachment */ @@ -134,7 +139,7 @@ public: EItemState item_state = IS_DEFAULT); protected: - LLPanelAttachmentListItem(LLViewerInventoryItem* item) : LLPanelDeletableWearableListItem(item) {}; + LLPanelAttachmentListItem(LLViewerInventoryItem* item, const Params& params) : LLPanelDeletableWearableListItem(item, params) {}; }; /** @@ -147,6 +152,18 @@ class LLPanelClothingListItem : public LLPanelDeletableWearableListItem LOG_CLASS(LLPanelClothingListItem); public: + struct Params : public LLInitParam::Block + { + Optional up_btn, + down_btn, + edit_btn; + Optional lock_panel, + edit_panel; + Optional lock_icon; + + Params(); + }; + static LLPanelClothingListItem* create(LLViewerInventoryItem* item); virtual ~LLPanelClothingListItem(); @@ -162,18 +179,25 @@ public: inline void setShowLockButton(bool show) { setShowWidget("btn_lock", show); } inline void setShowEditButton(bool show) { setShowWidget("btn_edit_panel", show); } - protected: - LLPanelClothingListItem(LLViewerInventoryItem* item); - - /*virtual*/ void init(); + LLPanelClothingListItem(LLViewerInventoryItem* item, const Params& params); + }; class LLPanelBodyPartsListItem : public LLPanelWearableListItem { LOG_CLASS(LLPanelBodyPartsListItem); public: + struct Params : public LLInitParam::Block + { + Optional edit_btn; + Optional lock_panel, + edit_panel; + Optional lock_icon; + + Params(); + }; static LLPanelBodyPartsListItem* create(LLViewerInventoryItem* item); @@ -188,9 +212,7 @@ public: inline void setShowEditButton(bool show) { setShowWidget("btn_edit_panel", show); } protected: - LLPanelBodyPartsListItem(LLViewerInventoryItem* item); - - /*virtual*/ void init(); + LLPanelBodyPartsListItem(LLViewerInventoryItem* item, const Params& params); }; @@ -202,15 +224,19 @@ protected: class LLPanelDummyClothingListItem : public LLPanelWearableListItem { public: + struct Params : public LLInitParam::Block + { + Optional add_panel; + Optional add_btn; + Params(); + }; static LLPanelDummyClothingListItem* create(LLWearableType::EType w_type); /*virtual*/ BOOL postBuild(); LLWearableType::EType getWearableType() const; protected: - LLPanelDummyClothingListItem(LLWearableType::EType w_type); - - /*virtual*/ void init(); + LLPanelDummyClothingListItem(LLWearableType::EType w_type, const Params& params); static std::string wearableTypeToString(LLWearableType::EType w_type); diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 502fefd4ef..660245b02b 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -97,6 +97,9 @@ void LLWinDebug::init() // Load the dbghelp dll now, instead of waiting for the crash. // Less potential for stack mangling + // Don't install vectored exception handler if being debugged. + if(IsDebuggerPresent()) return; + if (s_first_run) { // First, try loading from the directory that the app resides in. @@ -135,36 +138,42 @@ void LLWinDebug::init() void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename) { - if(f_mdwp == NULL || gDirUtilp == NULL) - { - return; - } - else + // Temporary fix to switch out the code that writes the DMP file. + // Fix coming that doesn't write a mini dump file for regular C++ exceptions. + const bool enable_write_dump_file = false; + if ( enable_write_dump_file ) { - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - - HANDLE hFile = CreateFileA(dump_path.c_str(), - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) + if(f_mdwp == NULL || gDirUtilp == NULL) { - // Write the dump, ignoring the return value - f_mdwp(GetCurrentProcess(), - GetCurrentProcessId(), - hFile, - type, - ExInfop, - NULL, - NULL); - - CloseHandle(hFile); + return; } + else + { + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); + + HANDLE hFile = CreateFileA(dump_path.c_str(), + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hFile != INVALID_HANDLE_VALUE) + { + // Write the dump, ignoring the return value + f_mdwp(GetCurrentProcess(), + GetCurrentProcessId(), + hFile, + type, + ExInfop, + NULL, + NULL); + + CloseHandle(hFile); + } + } } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7d0f763bd1..b578cb9f69 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7111,7 +7111,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { BOOL skip_avatar_update = FALSE; - if (gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) + if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) { skip_avatar_update = TRUE; } diff --git a/indra/newview/skins/default/xui/da/floater_publish_classified.xml b/indra/newview/skins/default/xui/da/floater_publish_classified.xml index 220042f015..0f65e6c18a 100644 --- a/indra/newview/skins/default/xui/da/floater_publish_classified.xml +++ b/indra/newview/skins/default/xui/da/floater_publish_classified.xml @@ -5,7 +5,7 @@ Husk, annonceomkostninger kan ikke refunderes. - + Mere info (link til hjælp om annoncer) diff --git a/indra/newview/skins/default/xui/da/menu_cof_clothing.xml b/indra/newview/skins/default/xui/da/menu_cof_clothing.xml index 73d97cd167..16c225b7d9 100644 --- a/indra/newview/skins/default/xui/da/menu_cof_clothing.xml +++ b/indra/newview/skins/default/xui/da/menu_cof_clothing.xml @@ -1,7 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/da/menu_inventory.xml b/indra/newview/skins/default/xui/da/menu_inventory.xml index 2eafeb3fcc..96da784fe4 100644 --- a/indra/newview/skins/default/xui/da/menu_inventory.xml +++ b/indra/newview/skins/default/xui/da/menu_inventory.xml @@ -73,11 +73,10 @@ - + - diff --git a/indra/newview/skins/default/xui/da/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/da/menu_inventory_gear_default.xml index e643498822..75ce7b22f6 100644 --- a/indra/newview/skins/default/xui/da/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/da/menu_inventory_gear_default.xml @@ -6,9 +6,10 @@ - + + diff --git a/indra/newview/skins/default/xui/da/menu_outfit_gear.xml b/indra/newview/skins/default/xui/da/menu_outfit_gear.xml index 3ed0df9041..8b4c776496 100644 --- a/indra/newview/skins/default/xui/da/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/da/menu_outfit_gear.xml @@ -1,6 +1,7 @@ + diff --git a/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml index 6a84c518ee..00055c8932 100644 --- a/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml @@ -1,6 +1,7 @@ - + + diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml index 5ae329033d..163df5b8d2 100644 --- a/indra/newview/skins/default/xui/da/notifications.xml +++ b/indra/newview/skins/default/xui/da/notifications.xml @@ -230,6 +230,10 @@ Er du sikker pÃ¥ at du vil fortsætte? Slet favorit <nolink>[PICK]</nolink>? + + Slet valgte sæt? + + Cache vil blive tømt ved næste genstart af [APP_NAME]. @@ -935,11 +939,6 @@ Henvis til dette fra en hjemmeside for at give andre nem adgang til denne lokati Uploader billeder fra verdenen og www... (Tager omkring 5 minutter.) - - Omkostninger ved at sende: L$[AMOUNT]. -Ønsker du at fortsætte? - - Du betalte L$[AMOUNT] for at uploade. @@ -1351,9 +1350,6 @@ Fra genstand: [OBJECTNAME], ejer: [NAME]? Det lykkedes ikke at finde [TYPE] med navnet [DESC] i databasen. - - Fejl ved afsendelse af billede til web. - Den genstand du prøver at tage pÃ¥ benytter en funktion din klient ikke kan forstÃ¥. Upgradér venligst din version af [APP_NAME] for at kunne tage denne genstand pÃ¥. diff --git a/indra/newview/skins/default/xui/da/panel_outfit_edit.xml b/indra/newview/skins/default/xui/da/panel_outfit_edit.xml index 3890f07324..99ef3b5411 100644 --- a/indra/newview/skins/default/xui/da/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/da/panel_outfit_edit.xml @@ -34,8 +34,16 @@ - + + - - - @@ -873,8 +866,13 @@ function="File.UploadBulk" parameter="" /> - + + + - Delete the selected outfit/s? + Delete the selected outfit? Load web page [URL]? @@ -5593,7 +5592,6 @@ Grant this request? [FIRST] [LAST]'s '[TITLE]' [MESSAGE] @@ -5608,7 +5606,6 @@ Grant this request? [GROUPNAME]'s '[TITLE]' [MESSAGE] diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml index d8675b3512..584ca8b3b5 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml @@ -104,6 +104,7 @@ follows="top|left" font="SansSerif" left="10" + name="nearby_media_title" width="100"> Nearby Media @@ -114,6 +115,7 @@ font="SansSerif" top_pad="15" left="10" + name="show_text" width="40"> Show: diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml index b43aa0a824..d18f0d57ca 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml @@ -14,9 +14,9 @@ background_visible="true" bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" - no_matched_tabs_text.value="NoOutfitsTabsMatched" + no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]." no_matched_tabs_text.v_pad="10" - no_visible_tabs_text.value="NoOutfits" + no_visible_tabs_text.value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]" follows="all" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0c31fda68b..b91acbe27d 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1956,6 +1956,9 @@ Clears (deletes) the media and all params from the given face. Animations Gestures Favorites + + Favorites Current Outfit My Outfits Accessories @@ -2194,10 +2197,6 @@ Clears (deletes) the media and all params from the given face. The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. - - You don't have any outfits yet. Try [secondlife:///app/search/all/ Search] - Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. - (By name) (Resident) diff --git a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml new file mode 100644 index 0000000000..c08267de82 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml @@ -0,0 +1,73 @@ + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml new file mode 100644 index 0000000000..f7a05e9bc4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml b/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml new file mode 100644 index 0000000000..88a4682e13 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml @@ -0,0 +1,43 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml new file mode 100644 index 0000000000..80a877a6c2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml @@ -0,0 +1,52 @@ + + + + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml index 50be0ac1a1..0a5930c820 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml @@ -1,11 +1,13 @@ + follows="top|right|left" + height="20" + name="inventory_item" + tab_stop="false" + hover_image="ListItem_Over" + selected_image="ListItem_Select" + separator_image="Wearables_Divider" + width="380"> + + diff --git a/indra/newview/skins/default/xui/es/floater_publish_classified.xml b/indra/newview/skins/default/xui/es/floater_publish_classified.xml index 5eed89d522..a1645f0c64 100644 --- a/indra/newview/skins/default/xui/es/floater_publish_classified.xml +++ b/indra/newview/skins/default/xui/es/floater_publish_classified.xml @@ -5,7 +5,7 @@ Recuerda, no se reembolsarán las cantidades abonadas por clasificados. - + Más información (enlace a ayuda de clasificados) diff --git a/indra/newview/skins/default/xui/es/menu_cof_clothing.xml b/indra/newview/skins/default/xui/es/menu_cof_clothing.xml index 4051f64e14..3c0c588284 100644 --- a/indra/newview/skins/default/xui/es/menu_cof_clothing.xml +++ b/indra/newview/skins/default/xui/es/menu_cof_clothing.xml @@ -1,7 +1,6 @@ - - + diff --git a/indra/newview/skins/default/xui/es/menu_inventory.xml b/indra/newview/skins/default/xui/es/menu_inventory.xml index 8f606aef82..2937b0c4e3 100644 --- a/indra/newview/skins/default/xui/es/menu_inventory.xml +++ b/indra/newview/skins/default/xui/es/menu_inventory.xml @@ -76,11 +76,10 @@ - + - diff --git a/indra/newview/skins/default/xui/es/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/es/menu_inventory_gear_default.xml index 80cf78c0b5..8c4488a285 100644 --- a/indra/newview/skins/default/xui/es/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/es/menu_inventory_gear_default.xml @@ -6,9 +6,10 @@ - + + diff --git a/indra/newview/skins/default/xui/es/menu_outfit_gear.xml b/indra/newview/skins/default/xui/es/menu_outfit_gear.xml index 39afa5e60b..3b11bceecf 100644 --- a/indra/newview/skins/default/xui/es/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/es/menu_outfit_gear.xml @@ -1,6 +1,7 @@ + diff --git a/indra/newview/skins/default/xui/es/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/es/menu_wearable_list_item.xml index 96fc3a1e68..5b3d7d8cb3 100644 --- a/indra/newview/skins/default/xui/es/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/es/menu_wearable_list_item.xml @@ -1,6 +1,7 @@ - + + diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 06422a252d..88013df8f5 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -355,6 +355,10 @@ No se reembolsan las cuotas pagadas. ¿Borrar el destacado <nolink>[PICK]</nolink>? + + ¿Eliminar el vestuario seleccionado? + + ¿Ir a la web de eventos de [SECOND_LIFE]? @@ -2042,11 +2046,6 @@ Publícala en una página web para que otros puedan acceder fácilmente a esta p Subiendo fotos del mundo y del sitio web... (tardará unos 5 minutos). - - La subida cuesta [AMOUNT] L$. -¿Quieres continuar? - - Has pagado [AMOUNT] LS por la subida. @@ -2466,9 +2465,6 @@ Del objeto: [OBJECTNAME]; propiedad de: [NAME]? Búsqueda fallida de [TYPE] de nombre [DESC] en la base de datos. - - Fallo al subir la imagen a la web. - El ítem que quieres vestirte tiene una característica que tu visor no puede leer. Por favor, actualiza tu versión de [APP_NAME] para ponerte este ítem. diff --git a/indra/newview/skins/default/xui/es/panel_outfit_edit.xml b/indra/newview/skins/default/xui/es/panel_outfit_edit.xml index ca8b77b49f..f697539502 100644 --- a/indra/newview/skins/default/xui/es/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/es/panel_outfit_edit.xml @@ -34,8 +34,16 @@ - + + diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml index 8b0d726e51..0e12ff68c6 100644 --- a/indra/newview/skins/default/xui/fr/menu_inventory.xml +++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml @@ -76,11 +76,10 @@ - + - diff --git a/indra/newview/skins/default/xui/fr/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/fr/menu_inventory_gear_default.xml index 4cfdfd2614..73770dce5f 100644 --- a/indra/newview/skins/default/xui/fr/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/fr/menu_inventory_gear_default.xml @@ -6,9 +6,10 @@ - + + diff --git a/indra/newview/skins/default/xui/fr/menu_outfit_gear.xml b/indra/newview/skins/default/xui/fr/menu_outfit_gear.xml index 93730c6206..5db7f176b5 100644 --- a/indra/newview/skins/default/xui/fr/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/fr/menu_outfit_gear.xml @@ -1,6 +1,7 @@ + diff --git a/indra/newview/skins/default/xui/fr/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/fr/menu_wearable_list_item.xml index 39e8ca2173..c477471a64 100644 --- a/indra/newview/skins/default/xui/fr/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/fr/menu_wearable_list_item.xml @@ -1,6 +1,7 @@ - + + diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index b245c132bd..59c978bb6b 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -357,6 +357,10 @@ Voulez-vous vraiment continuer ? Supprimer la sélection <nolink>[PICK]</nolink> ? + + Supprimer la ou les tenues sélectionnées ? + + Aller à la page web de [SECOND_LIFE] réservée aux événements ? @@ -1346,7 +1350,7 @@ Télécharger vers le dossier Applications ? Consultez le Wiki sur l'Assurance Qualité de [SECOND_LIFE]. - + Pour signaler des bugs et autres problèmes, utilisez le JIRA de [SECOND_LIFE]. @@ -2032,11 +2036,6 @@ Liez-la à partir d'une page web pour permettre aux autres résidents d&apo Importation de photos SL et Web en cours... (prend environ 5 minutes.) - - Le chargement coûte [AMOUNT] L$. -Continuer ? - - Le chargement a coûté [AMOUNT] L$. @@ -2460,9 +2459,6 @@ Venant de l'objet : [OBJECTNAME], appartenant à : [NAME]? La recherche du [TYPE] nommé(e) [DESC] dans la base de données a échoué. - - Échec de chargement de l'image sur le Web. - L'objet que vous essayez de porter utilise une fonctionnalité que le client ne peut lire. Pour porter cet objet, veuillez télécharger une mise à jour de [APP_NAME]. @@ -2645,7 +2641,7 @@ Elles vont être bloquées pendant quelques secondes pour votre sécurité. Êtes-vous certain de vouloir fermer tous les IM ? - + L'élément joint a été sauvegardé. diff --git a/indra/newview/skins/default/xui/fr/panel_group_general.xml b/indra/newview/skins/default/xui/fr/panel_group_general.xml index ec6d995274..a2655dcd45 100644 --- a/indra/newview/skins/default/xui/fr/panel_group_general.xml +++ b/indra/newview/skins/default/xui/fr/panel_group_general.xml @@ -48,7 +48,7 @@ Faites glisser le pointeur de la souris sur les options pour en savoir plus. - - Sélectionner une catégorie de contenu - + - Catégorie de contenu - diff --git a/indra/newview/skins/default/xui/fr/panel_outfit_edit.xml b/indra/newview/skins/default/xui/fr/panel_outfit_edit.xml index b17803eaad..a3d23b0e70 100644 --- a/indra/newview/skins/default/xui/fr/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/fr/panel_outfit_edit.xml @@ -34,8 +34,16 @@ - + + + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 24582e4be3..e5baf0f98f 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -366,7 +366,7 @@ Sind Sie sicher, dass Sie fortfahren wollen? - Das ausgewählte Outfit löschen? + Das/Die ausgewählte(n) Outfit(s) löschen? @@ -2765,7 +2765,7 @@ Avatar '[NAME]' hat als vollständig gerezzter Avatar die Welt verlass (Seit [EXISTENCE] Sekunden inworld ) -Die [RESOLUTION]-gebakene Textur für '[BODYREGION]' wurde in [TIME] Sekunden hochgeladen. +Die [RESOLUTION]-gebakene Textur für '[BODYREGION]' wurde in [TIME] Sekunden [ACTION]. Möchten Sie dieses Gespräch wirklich verlassen ? @@ -2803,4 +2803,7 @@ Sollte das Problem fortbestehen, finden Sie weitere Hilfestellung unter [SUPPORT Wenn Sie ein Stück Land besitzen, können Sie dies als Ihr Zuhause festlegen. Ansonsten können Sie auf der Karte nachsehen und dort Ort suchen, die als „Infohub“ gekennzeichnet sind. + + Sie sind gestorben und wurden zu Ihrem Zuhause teleportiert. + diff --git a/indra/newview/skins/default/xui/de/panel_group_notices.xml b/indra/newview/skins/default/xui/de/panel_group_notices.xml index f45b5ea7af..8c1df04ed8 100644 --- a/indra/newview/skins/default/xui/de/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/de/panel_group_notices.xml @@ -21,7 +21,7 @@ Maximal 200 pro Gruppe täglich Nicht gefunden. - + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 88013df8f5..e9eda790dd 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -2750,8 +2750,8 @@ Comprueba la configuración de la red y del servidor de seguridad. El avatar '[NAME]' ya estaba totalmente cargado al salir. - ( [EXISTENCE] segundos vivo) -Has cargado una textura obtenida mediante bake de [RESOLUTION] para '[BODYREGION]' después de [TIME] segundos. + ( [EXISTENCE] segundos con vida ) +Has [ACTION] una textura obtenida mediante bake de [RESOLUTION] para '[BODYREGION]' después de [TIME] segundos. ¿Estás seguro de que deseas salir de esta multiconferencia? @@ -2788,4 +2788,7 @@ Si los problemas persisten, por favor, acude a [SUPPORT_SITE]. Si posees un terreno, puedes hacerlo tu Base. También puedes buscar en el Mapa lugares marcados como "Puntos de Información". + + Has muerto y te has teleportado a tu Base. + diff --git a/indra/newview/skins/default/xui/es/panel_group_notices.xml b/indra/newview/skins/default/xui/es/panel_group_notices.xml index 7a3dbad59e..1eaa69abff 100644 --- a/indra/newview/skins/default/xui/es/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/es/panel_group_notices.xml @@ -18,7 +18,7 @@ El máximo es de 200 por día y grupo. No se han encontrado - + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 8fceaa2817..709797cb58 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -2800,8 +2800,8 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚ ã‚¢ãƒã‚¿ãƒ¼ã€Œ NAME ã€ãŒå®Œå…¨ã«èª­ã¿è¾¼ã¾ã‚Œã¾ã—ãŸã€‚ - (作æˆå¾Œ[EXISTENCE]秒経éŽï¼‰ -'[BODYREGION]'ã®[RESOLUTION]ã®ãƒ™ãƒ¼ã‚¯ãƒ‰ãƒ†ã‚¯ã‚¹ãƒãƒ£ã¯[TIME]秒後ã«ã‚¢ãƒƒãƒ—ロードã•れã¾ã—ãŸã€‚ + ( 作æˆå¾Œ[EXISTENCE]秒経éŽï¼‰ +'[BODYREGION]' ã®[RESOLUTION]ã®ãƒ™ãƒ¼ã‚¯ãƒ‰ãƒ†ã‚¯ã‚¹ãƒãƒ£ã¯[TIME]秒後ã«[ACTION]ã•れã¾ã—ãŸã€‚ ã“ã®ã‚³ãƒ¼ãƒ«ã‹ã‚‰æŠœã‘ã¾ã™ã‹ï¼Ÿ @@ -2839,4 +2839,7 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚ 自分ã®åœŸåœ°ã‚’ãŠæŒã¡ã®å ´åˆã€ã€Œãƒ›ãƒ¼ãƒ ã€ã«è¨­å®šã§ãã¾ã™ã€‚ ãŠæŒã¡ã§ãªã„å ´åˆã¯ã€åœ°å›³ã§ã€Œã‚¤ãƒ³ãƒ•ã‚©ãƒãƒ–ã€ã‚’ãŠæŽ¢ã—ãã ã•ã„。 + + 死んã§ã—ã¾ã£ãŸã®ã§ã€ãƒ›ãƒ¼ãƒ ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã•れã¾ã—ãŸã€‚ + diff --git a/indra/newview/skins/default/xui/ja/panel_group_notices.xml b/indra/newview/skins/default/xui/ja/panel_group_notices.xml index 0b508bd79d..96e0382975 100644 --- a/indra/newview/skins/default/xui/ja/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/ja/panel_group_notices.xml @@ -21,7 +21,7 @@ 見ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—㟠- + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 24582e4be3..e5baf0f98f 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -366,7 +366,7 @@ Sind Sie sicher, dass Sie fortfahren wollen? - Das ausgewählte Outfit löschen? + Das/Die ausgewählte(n) Outfit(s) löschen? @@ -2765,7 +2765,7 @@ Avatar '[NAME]' hat als vollständig gerezzter Avatar die Welt verlass (Seit [EXISTENCE] Sekunden inworld ) -Die [RESOLUTION]-gebakene Textur für '[BODYREGION]' wurde in [TIME] Sekunden hochgeladen. +Die [RESOLUTION]-gebakene Textur für '[BODYREGION]' wurde in [TIME] Sekunden [ACTION]. Möchten Sie dieses Gespräch wirklich verlassen ? @@ -2803,4 +2803,7 @@ Sollte das Problem fortbestehen, finden Sie weitere Hilfestellung unter [SUPPORT Wenn Sie ein Stück Land besitzen, können Sie dies als Ihr Zuhause festlegen. Ansonsten können Sie auf der Karte nachsehen und dort Ort suchen, die als „Infohub“ gekennzeichnet sind. + + Sie sind gestorben und wurden zu Ihrem Zuhause teleportiert. + diff --git a/indra/newview/skins/default/xui/de/panel_group_notices.xml b/indra/newview/skins/default/xui/de/panel_group_notices.xml index f45b5ea7af..8c1df04ed8 100644 --- a/indra/newview/skins/default/xui/de/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/de/panel_group_notices.xml @@ -21,7 +21,7 @@ Maximal 200 pro Gruppe täglich Nicht gefunden. - + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 88013df8f5..e9eda790dd 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -2750,8 +2750,8 @@ Comprueba la configuración de la red y del servidor de seguridad. El avatar '[NAME]' ya estaba totalmente cargado al salir. - ( [EXISTENCE] segundos vivo) -Has cargado una textura obtenida mediante bake de [RESOLUTION] para '[BODYREGION]' después de [TIME] segundos. + ( [EXISTENCE] segundos con vida ) +Has [ACTION] una textura obtenida mediante bake de [RESOLUTION] para '[BODYREGION]' después de [TIME] segundos. ¿Estás seguro de que deseas salir de esta multiconferencia? @@ -2788,4 +2788,7 @@ Si los problemas persisten, por favor, acude a [SUPPORT_SITE]. Si posees un terreno, puedes hacerlo tu Base. También puedes buscar en el Mapa lugares marcados como "Puntos de Información". + + Has muerto y te has teleportado a tu Base. + diff --git a/indra/newview/skins/default/xui/es/panel_group_notices.xml b/indra/newview/skins/default/xui/es/panel_group_notices.xml index 7a3dbad59e..1eaa69abff 100644 --- a/indra/newview/skins/default/xui/es/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/es/panel_group_notices.xml @@ -18,7 +18,7 @@ El máximo es de 200 por día y grupo. No se han encontrado - + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 8fceaa2817..709797cb58 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -2800,8 +2800,8 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚ ã‚¢ãƒã‚¿ãƒ¼ã€Œ NAME ã€ãŒå®Œå…¨ã«èª­ã¿è¾¼ã¾ã‚Œã¾ã—ãŸã€‚ - (作æˆå¾Œ[EXISTENCE]秒経éŽï¼‰ -'[BODYREGION]'ã®[RESOLUTION]ã®ãƒ™ãƒ¼ã‚¯ãƒ‰ãƒ†ã‚¯ã‚¹ãƒãƒ£ã¯[TIME]秒後ã«ã‚¢ãƒƒãƒ—ロードã•れã¾ã—ãŸã€‚ + ( 作æˆå¾Œ[EXISTENCE]秒経éŽï¼‰ +'[BODYREGION]' ã®[RESOLUTION]ã®ãƒ™ãƒ¼ã‚¯ãƒ‰ãƒ†ã‚¯ã‚¹ãƒãƒ£ã¯[TIME]秒後ã«[ACTION]ã•れã¾ã—ãŸã€‚ ã“ã®ã‚³ãƒ¼ãƒ«ã‹ã‚‰æŠœã‘ã¾ã™ã‹ï¼Ÿ @@ -2839,4 +2839,7 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚ 自分ã®åœŸåœ°ã‚’ãŠæŒã¡ã®å ´åˆã€ã€Œãƒ›ãƒ¼ãƒ ã€ã«è¨­å®šã§ãã¾ã™ã€‚ ãŠæŒã¡ã§ãªã„å ´åˆã¯ã€åœ°å›³ã§ã€Œã‚¤ãƒ³ãƒ•ã‚©ãƒãƒ–ã€ã‚’ãŠæŽ¢ã—ãã ã•ã„。 + + 死んã§ã—ã¾ã£ãŸã®ã§ã€ãƒ›ãƒ¼ãƒ ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã•れã¾ã—ãŸã€‚ + diff --git a/indra/newview/skins/default/xui/ja/panel_group_notices.xml b/indra/newview/skins/default/xui/ja/panel_group_notices.xml index 0b508bd79d..96e0382975 100644 --- a/indra/newview/skins/default/xui/ja/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/ja/panel_group_notices.xml @@ -21,7 +21,7 @@ 見ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—㟠- + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 2a1b5f995a..a6645d8b13 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -356,7 +356,7 @@ Tem certeza de que quer prosseguir? - Excluir o look selecionado? + Excluir look(s) selecionado(s)? @@ -2729,7 +2729,7 @@ Avatar '[NAME]' saiu totalmente carregado. ( [EXISTENCE] segundos de vida ) -Você carregou uma textura com [RESOLUTION] para o(a) '[BODYREGION]' em [TIME] segundos. +[ACTION] de textura com [RESOLUTION] para o(a) '[BODYREGION]' em [TIME] segundos. Tem certeza de que quer sair desta ligação? @@ -2767,4 +2767,7 @@ Se você continuar a receber esta mensagem, consulte o [SUPPORT_SITE]. Se você tem um terreno, seu terreno pode ser seu início. Outra opção é procurar por lugares com a tag 'Infohub' no mapa. + + Você morreu e foi reenviado ao seu início. + diff --git a/indra/newview/skins/default/xui/pt/panel_group_notices.xml b/indra/newview/skins/default/xui/pt/panel_group_notices.xml index 9ccb85cdf6..21136d06fb 100644 --- a/indra/newview/skins/default/xui/pt/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/pt/panel_group_notices.xml @@ -18,7 +18,7 @@ Cada grupo pode enviar no máximo 200 avisos/dia Nenhum resultado foi encontrado. - + @@ -111,7 +112,6 @@ - diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index 5cb42a0435..6cfc2b5c66 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -358,7 +358,7 @@ Voulez-vous vraiment continuer ? - Supprimer la tenue sélectionnée ? + Supprimer la ou les tenues sélectionnées ? @@ -2746,7 +2746,7 @@ Départ de l'avatar [NAME] entièrement chargé. ([EXISTENCE] secondes d'existence) -Texture figée de [RESOLUTION] chargée pour [BODYREGION] au bout de [TIME] secondes. +Vous avez [ACTION] une texture figée de [RESOLUTION] pour [BODYREGION] au bout de [TIME] secondes. Voulez-vous vraiment quitter cet appel ? @@ -2784,4 +2784,7 @@ Si vous avez toujours des problèmes, veuillez consulter la page [SUPPORT_SITE]. Si vous possédez un terrain, vous pouvez le définir comme domicile. Sinon, consultez la carte et trouvez les " infohubs ". + + Vous êtes mort et avez été téléporté à votre domicile. + diff --git a/indra/newview/skins/default/xui/fr/panel_group_notices.xml b/indra/newview/skins/default/xui/fr/panel_group_notices.xml index 5fc1397763..bcf2cc8ec9 100644 --- a/indra/newview/skins/default/xui/fr/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/fr/panel_group_notices.xml @@ -21,7 +21,7 @@ Vous pouvez désactiver la réception des notices dans l'onglet Général. Aucun résultat - - + -- cgit v1.2.3 From 03128112b8047cbba0aa51247534748d983ad4e7 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Mon, 16 Aug 2010 13:12:19 -0700 Subject: EXT-8370 FIX en_xui_change resizing for IT truncation --- .../skins/default/xui/en/floater_preview_gesture.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 691472633e..1903401988 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -96,19 +96,19 @@ name="replace_text" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!" top_pad="10" - width="200"> + width="210"> Replace with: + width="165" /> + width="150"> Shortcut Key: + width="55" /> + width="50" /> Date: Mon, 16 Aug 2010 23:23:48 +0300 Subject: EXT-8636 FIXED updating wearables (worn) prefix in 'My Outfits' list. - Fixed LLOutfitsList COF changes handler to update worn status of items removed from COF. Now they are updated based on the differences in original items' ids in COF. - Fixed 'My Outfits' items worn status check to update depending on whether the item is linked in COF or not. This is a kind of workaround to fix updating attachments' worn status because LLAppearanceMgr::updateAppearanceFromCOF is triggered erlier than new attachment links are fetched. When dumpItemArray(obj_items,"asset_dump: obj_item") is called from LLAppearanceMgr::updateAppearanceFromCOF, all attachment links have empty asset ids. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/859/. --HG-- branch : product-engine --- indra/newview/lloutfitslist.cpp | 48 +++++++++++++++++++++++------------ indra/newview/lloutfitslist.h | 4 +++ indra/newview/llwearableitemslist.cpp | 10 +++++--- indra/newview/llwearableitemslist.h | 3 +-- 4 files changed, 44 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 2b6c80bac8..a471158c3d 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -1055,25 +1055,37 @@ void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) void LLOutfitsList::onCOFChanged() { - LLInventoryModel::changed_items_t changed_linked_items; + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; - const LLInventoryModel::changed_items_t& changed_items = gInventory.getChangedIDs(); - for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items.begin(); - iter != changed_items.end(); - ++iter) + // Collect current COF items + gInventory.collectDescendents( + LLAppearanceMgr::instance().getCOF(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH); + + uuid_vec_t vnew; + uuid_vec_t vadded; + uuid_vec_t vremoved; + + // From gInventory we get the UUIDs of links that are currently in COF. + // These links UUIDs are not the same UUIDs that we have in each wearable items list. + // So we collect base items' UUIDs to find them or links that point to them in wearable + // items lists and update their worn state there. + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + ++iter) { - LLViewerInventoryItem* item = gInventory.getItem(*iter); - if (item) - { - // From gInventory we get the UUIDs of new links added to COF - // or removed from COF. These links UUIDs are not the same UUIDs - // that we have in each wearable items list. So we collect base items - // UUIDs to find all items or links that point to same base items in wearable - // items lists and update their worn state there. - changed_linked_items.insert(item->getLinkedUUID()); - } + vnew.push_back((*iter)->getLinkedUUID()); } + // We need to update only items that were added or removed from COF. + LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved); + + // Store the ids of items currently linked from COF. + mCOFLinkedItems = vnew; + for (outfits_map_t::iterator iter = mOutfitsMap.begin(); iter != mOutfitsMap.end(); ++iter) @@ -1084,9 +1096,13 @@ void LLOutfitsList::onCOFChanged() LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); if (!list) continue; + // Append removed ids to added ids because we should update all of them. + vadded.reserve(vadded.size() + vremoved.size()); + vadded.insert(vadded.end(), vremoved.begin(), vremoved.end()); + // Every list updates the labels of changed items or // the links that point to these items. - list->updateChangedItems(changed_linked_items); + list->updateChangedItems(vadded); } } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 206854b232..4613bdfeb9 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -214,6 +214,10 @@ private: typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; + // IDs of original items which are worn and linked in COF. + // Used to monitor COF changes for updating items worn state. See EXT-8636. + uuid_vec_t mCOFLinkedItems; + LLOutfitListGearMenu* mGearMenu; LLListContextMenu* mOutfitMenu; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 5e23965f62..bff4b9bcbd 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -124,7 +124,11 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - if (mWornIndicationEnabled && get_is_item_worn(mInventoryItemUUID)) + // Updating item's worn status depending on whether it is linked in COF or not. + // We don't use get_is_item_worn() here because this update is triggered by + // an inventory observer upon link in COF beind added or removed so actual + // worn status of a linked item may still remain unchanged. + if (mWornIndicationEnabled && LLAppearanceMgr::instance().isLinkInCOF(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -659,7 +663,7 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) refreshList(item_array); } -void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) +void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uuids) { // nothing to update if (changed_items_uuids.empty()) return; @@ -681,7 +685,7 @@ void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_ite LLUUID linked_uuid = inv_item->getLinkedUUID(); - for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items_uuids.begin(); + for (uuid_vec_t::const_iterator iter = changed_items_uuids.begin(); iter != changed_items_uuids.end(); ++iter) { diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 237ba1af43..ac4eac4764 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -39,7 +39,6 @@ // newview #include "llinventoryitemslist.h" #include "llinventorylistitem.h" -#include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llwearabletype.h" @@ -441,7 +440,7 @@ public: * Update items that match UUIDs from changed_items_uuids * or links that point at such items. */ - void updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids); + void updateChangedItems(const uuid_vec_t& changed_items_uuids); bool isStandalone() const { return mIsStandalone; } -- cgit v1.2.3 From b53ac25d5c9e04e8e1cabaa4fdf817248431fc72 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Tue, 17 Aug 2010 03:38:45 +0100 Subject: SNOW-585 (VWR-20679) FIXED Build failure when the FMOD lib is not present. Also added Mac version of the same fix, and corrected the warning message in the Linux version that was already there. --- indra/newview/viewer_manifest.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ecca003996..9885d1aa0d 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -316,8 +316,11 @@ class WindowsManifest(ViewerManifest): # For use in crash reporting (generates minidumps) self.path("dbghelp.dll") - # For using FMOD for sound... DJS - self.path("fmod.dll") + try: + # FMOD for sound + self.path("fmod.dll") + except: + print "Skipping FMOD - not found" self.enable_no_crt_manifest_check() @@ -643,8 +646,11 @@ class DarwinManifest(ViewerManifest): ): self.path(os.path.join(libdir, libfile), libfile) - #libfmodwrapper.dylib - self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib") + try: + # FMOD for sound + self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib") + except: + print "Skipping FMOD - not found" # our apps self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app") @@ -933,7 +939,7 @@ class Linux_i686Manifest(LinuxManifest): self.path("libfmod-3.75.so") pass except: - print "Skipping libkdu_v42R.so - not found" + print "Skipping libfmod-3.75.so - not found" pass self.end_prefix("lib") -- cgit v1.2.3 From bbf4bc88b827b1a4f51e032cecca892430236d97 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 17 Aug 2010 17:09:23 +0300 Subject: EXT-7083 FIXED initializing the viewer preferred maturity with the value received from the server on login. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/863/. --HG-- branch : product-engine --- indra/newview/llstartup.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 96088fed9c..3aad39bcbf 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2933,9 +2933,8 @@ bool process_login_success_response() text = response["agent_region_access"].asString(); if (!text.empty()) { - U32 preferredMaturity = - llmin((U32)LLAgent::convertTextToMaturity(text[0]), - gSavedSettings.getU32("PreferredMaturity")); + U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]); + gSavedSettings.setU32("PreferredMaturity", preferredMaturity); } // During the AO transition, this flag will be true. Then the flag will -- cgit v1.2.3 From 492c189e24242cedd10dca47c31ffddccf200fcc Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 17 Aug 2010 17:10:13 +0300 Subject: EXT-8425 ADDITIONAL FIX Fixed broken translation of accelerators which was introduced by fix of this bug in changeset 14331:11122e1fc5cf. Removed "Key_" prefix from new key strings and from function that finds them, because it broke translation of old accelerator strings. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/861/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7a292ab943..04d8c53d97 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2282,8 +2282,8 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Alt+ Shift+ - Esc - Home + Esc + Home File Saved -- cgit v1.2.3 From 048187ff82c9885599bc979914749f9cb07f761d Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Tue, 17 Aug 2010 11:56:40 -0700 Subject: CT-575 WIP Polish global translation edit --- .../skins/default/xui/pl/floater_bulk_perms.xml | 4 +- indra/newview/skins/default/xui/pl/floater_pay.xml | 2 +- .../skins/default/xui/pl/floater_pay_object.xml | 4 +- .../skins/default/xui/pl/floater_post_process.xml | 2 +- .../skins/default/xui/pl/floater_postcard.xml | 8 +- .../default/xui/pl/floater_preview_gesture.xml | 2 +- .../xui/pl/floater_preview_gesture_info.xml | 2 +- .../xui/pl/floater_preview_gesture_shortcut.xml | 2 +- .../xui/pl/floater_preview_gesture_steps.xml | 2 +- .../skins/default/xui/pl/floater_preview_sound.xml | 2 +- .../skins/default/xui/pl/floater_report_abuse.xml | 6 +- .../skins/default/xui/pl/floater_script_search.xml | 2 +- .../skins/default/xui/pl/floater_sell_land.xml | 12 +- .../newview/skins/default/xui/pl/floater_stats.xml | 14 +- .../newview/skins/default/xui/pl/floater_tools.xml | 30 +- .../skins/default/xui/pl/floater_top_objects.xml | 8 +- .../default/xui/pl/floater_windlight_options.xml | 6 +- .../skins/default/xui/pl/floater_world_map.xml | 20 +- .../skins/default/xui/pl/inspect_avatar.xml | 4 +- .../newview/skins/default/xui/pl/inspect_group.xml | 2 +- .../skins/default/xui/pl/inspect_object.xml | 2 +- .../skins/default/xui/pl/menu_attachment_other.xml | 6 +- .../skins/default/xui/pl/menu_attachment_self.xml | 6 +- .../skins/default/xui/pl/menu_avatar_icon.xml | 2 +- .../skins/default/xui/pl/menu_avatar_other.xml | 6 +- .../skins/default/xui/pl/menu_avatar_self.xml | 12 +- .../skins/default/xui/pl/menu_bottomtray.xml | 8 +- .../newview/skins/default/xui/pl/menu_cof_gear.xml | 2 +- .../skins/default/xui/pl/menu_favorites.xml | 2 +- .../skins/default/xui/pl/menu_group_plus.xml | 4 +- .../skins/default/xui/pl/menu_imchiclet_group.xml | 2 +- .../skins/default/xui/pl/menu_imchiclet_p2p.xml | 4 +- .../default/xui/pl/menu_inspect_avatar_gear.xml | 6 +- .../default/xui/pl/menu_inspect_self_gear.xml | 6 +- .../skins/default/xui/pl/menu_inventory.xml | 14 +- .../skins/default/xui/pl/menu_inventory_add.xml | 6 +- .../default/xui/pl/menu_inventory_gear_default.xml | 2 +- indra/newview/skins/default/xui/pl/menu_land.xml | 2 +- indra/newview/skins/default/xui/pl/menu_login.xml | 4 +- indra/newview/skins/default/xui/pl/menu_navbar.xml | 4 +- .../skins/default/xui/pl/menu_outfit_gear.xml | 4 +- .../skins/default/xui/pl/menu_participant_list.xml | 4 +- .../skins/default/xui/pl/menu_people_groups.xml | 2 +- .../xui/pl/menu_people_groups_view_sort.xml | 4 +- .../skins/default/xui/pl/menu_people_nearby.xml | 6 +- .../xui/pl/menu_people_nearby_multiselect.xml | 4 +- .../skins/default/xui/pl/menu_picks_plus.xml | 2 +- indra/newview/skins/default/xui/pl/menu_place.xml | 4 +- .../skins/default/xui/pl/menu_place_add_button.xml | 2 +- .../default/xui/pl/menu_places_gear_folder.xml | 2 +- .../default/xui/pl/menu_places_gear_landmark.xml | 4 +- indra/newview/skins/default/xui/pl/menu_slurl.xml | 4 +- .../default/xui/pl/menu_teleport_history_gear.xml | 2 +- .../skins/default/xui/pl/menu_text_editor.xml | 2 +- .../skins/default/xui/pl/menu_url_agent.xml | 2 +- .../skins/default/xui/pl/menu_url_group.xml | 4 +- .../skins/default/xui/pl/menu_url_inventory.xml | 2 +- .../skins/default/xui/pl/menu_url_parcel.xml | 2 +- .../skins/default/xui/pl/menu_url_slurl.xml | 2 +- .../skins/default/xui/pl/menu_url_teleport.xml | 2 +- indra/newview/skins/default/xui/pl/menu_viewer.xml | 358 ++++++------ .../skins/default/xui/pl/mime_types_mac.xml | 8 +- .../newview/skins/default/xui/pl/notifications.xml | 120 ++-- .../default/xui/pl/panel_active_object_row.xml | 4 +- .../default/xui/pl/panel_adhoc_control_panel.xml | 4 +- .../skins/default/xui/pl/panel_audio_device.xml | 10 +- .../default/xui/pl/panel_block_list_sidetray.xml | 6 +- .../skins/default/xui/pl/panel_bottomtray.xml | 12 +- .../skins/default/xui/pl/panel_bottomtray_lite.xml | 2 +- .../skins/default/xui/pl/panel_edit_alpha.xml | 10 +- .../skins/default/xui/pl/panel_edit_classified.xml | 10 +- .../skins/default/xui/pl/panel_edit_profile.xml | 4 +- .../skins/default/xui/pl/panel_edit_wearable.xml | 8 +- .../newview/skins/default/xui/pl/panel_friends.xml | 4 +- .../default/xui/pl/panel_group_control_panel.xml | 4 +- .../skins/default/xui/pl/panel_group_general.xml | 8 +- .../default/xui/pl/panel_group_info_sidetray.xml | 4 +- .../skins/default/xui/pl/panel_group_invite.xml | 6 +- .../default/xui/pl/panel_group_land_money.xml | 16 +- .../skins/default/xui/pl/panel_group_notices.xml | 8 +- .../skins/default/xui/pl/panel_group_notify.xml | 2 +- .../skins/default/xui/pl/panel_group_roles.xml | 40 +- .../newview/skins/default/xui/pl/panel_groups.xml | 2 +- .../default/xui/pl/panel_im_control_panel.xml | 2 +- .../skins/default/xui/pl/panel_landmark_info.xml | 8 +- indra/newview/skins/default/xui/pl/panel_login.xml | 2 +- .../xui/pl/panel_media_settings_general.xml | 10 +- .../xui/pl/panel_media_settings_permissions.xml | 8 +- .../skins/default/xui/pl/panel_my_profile.xml | 8 +- .../skins/default/xui/pl/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/pl/panel_nearby_media.xml | 8 +- .../skins/default/xui/pl/panel_outfit_edit.xml | 2 +- .../pl/panel_outfits_inventory_gear_default.xml | 10 +- .../newview/skins/default/xui/pl/panel_people.xml | 18 +- .../skins/default/xui/pl/panel_place_profile.xml | 8 +- .../default/xui/pl/panel_preferences_advanced.xml | 8 +- .../default/xui/pl/panel_preferences_alerts.xml | 2 +- .../default/xui/pl/panel_preferences_general.xml | 14 +- .../default/xui/pl/panel_preferences_graphics1.xml | 16 +- .../default/xui/pl/panel_preferences_privacy.xml | 4 +- .../default/xui/pl/panel_preferences_setup.xml | 8 +- .../default/xui/pl/panel_preferences_sound.xml | 14 +- .../default/xui/pl/panel_prim_media_controls.xml | 12 +- .../newview/skins/default/xui/pl/panel_profile.xml | 4 +- .../skins/default/xui/pl/panel_region_covenant.xml | 2 +- .../skins/default/xui/pl/panel_region_estate.xml | 8 +- .../skins/default/xui/pl/panel_region_general.xml | 6 +- .../default/xui/pl/panel_region_general_layout.xml | 6 +- .../skins/default/xui/pl/panel_region_terrain.xml | 6 +- .../skins/default/xui/pl/panel_region_texture.xml | 4 +- .../skins/default/xui/pl/panel_script_ed.xml | 4 +- .../xui/pl/panel_script_limits_my_avatar.xml | 4 +- .../xui/pl/panel_script_limits_region_memory.xml | 4 +- .../skins/default/xui/pl/panel_side_tray.xml | 4 +- .../default/xui/pl/panel_stand_stop_flying.xml | 2 +- .../skins/default/xui/pl/panel_status_bar.xml | 6 +- .../newview/skins/default/xui/pl/role_actions.xml | 76 +-- .../skins/default/xui/pl/sidepanel_appearance.xml | 4 +- .../skins/default/xui/pl/sidepanel_item_info.xml | 4 +- .../skins/default/xui/pl/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/pl/strings.xml | 630 ++++++++++----------- .../skins/default/xui/pl/teleport_strings.xml | 14 +- 122 files changed, 949 insertions(+), 949 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml b/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml index ed2e037d3c..0f49061002 100644 --- a/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml @@ -18,8 +18,8 @@ - - + + diff --git a/indra/newview/skins/default/xui/pl/floater_pay.xml b/indra/newview/skins/default/xui/pl/floater_pay.xml index dccb7ed2bb..c9243fda65 100644 --- a/indra/newview/skins/default/xui/pl/floater_pay.xml +++ b/indra/newview/skins/default/xui/pl/floater_pay.xml @@ -1,7 +1,7 @@ - ZapÅ‚ać Grupie + ZapÅ‚ać grupie ZapÅ‚ać Rezydentowi diff --git a/indra/newview/skins/default/xui/pl/floater_pay_object.xml b/indra/newview/skins/default/xui/pl/floater_pay_object.xml index d0c69a6c21..19032b3e5d 100644 --- a/indra/newview/skins/default/xui/pl/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/pl/floater_pay_object.xml @@ -1,7 +1,7 @@ - ZapÅ‚ać Grupie + ZapÅ‚ać grupie ZapÅ‚ać Rezydentowi @@ -11,7 +11,7 @@ [FIRST] [LAST] - Poprzez Obiekt: + Poprzez obiekt: diff --git a/indra/newview/skins/default/xui/pl/floater_post_process.xml b/indra/newview/skins/default/xui/pl/floater_post_process.xml index a3515915bf..e3dce84933 100644 --- a/indra/newview/skins/default/xui/pl/floater_post_process.xml +++ b/indra/newview/skins/default/xui/pl/floater_post_process.xml @@ -1,7 +1,7 @@ - + Jasność diff --git a/indra/newview/skins/default/xui/pl/floater_postcard.xml b/indra/newview/skins/default/xui/pl/floater_postcard.xml index 095974aa61..fe796c6fa0 100644 --- a/indra/newview/skins/default/xui/pl/floater_postcard.xml +++ b/indra/newview/skins/default/xui/pl/floater_postcard.xml @@ -1,13 +1,13 @@ - Email Odbiorcy: + Email odbiorcy: - Twój Email: + Twój email: - Twoje Dane: + Twoje dane: Temat: @@ -20,7 +20,7 @@ Wpisz treść swojej wiadomoÅ›ci tutaj - Jeżeli Odbiorca tej pocztówki dołączy do [SECOND_LIFE], otrzymasz bonus. + Jeżeli odbiorca tej pocztówki dołączy do [SECOND_LIFE], otrzymasz bonus. - + - + diff --git a/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml b/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml index e1863517a2..a52d8aed3d 100644 --- a/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml +++ b/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml @@ -1,7 +1,7 @@ - Zużycie Skryptów przez Awatara + Zużycie skryptów przez awatara Åadowanie... @@ -9,7 +9,7 @@ - + - - - - + -- cgit v1.2.3 From 6c4b0f82bce84bcd8dda42ccc25edc906c873765 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 19 Aug 2010 15:09:07 +0300 Subject: EXT-8635 FIXED Replaced "no matches found" with "Loading..." in the My Outfits tab. Set no items text to "Loading..." when creating the wearable items list and to "There are no items in this outfit" when category is complete. "Outhfit" is there, because wearable items list nay be empty only for them. This string was introduced, because the only situation when there are no items shown in outfit tab is for empty outfit- because even when applying filter either all items from outfit will be shown or outfit tab won't be shown at all. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/865/ --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 6 ++++++ indra/newview/skins/default/xui/en/strings.xml | 2 ++ 2 files changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index abe629ffe4..9f7ea68e87 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -636,6 +636,7 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3)); } mWornIndicationEnabled = p.worn_indication_enabled; + setNoItemsCommentText(LLTrans::getString("LoadingData")); } // virtual @@ -677,6 +678,11 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) LLInventoryModel::EXCLUDE_TRASH, collector); + if(item_array.empty() && gInventory.isCategoryComplete(category_id)) + { + setNoItemsCommentText(LLTrans::getString("EmptyOutfitText")); + } + refreshList(item_array); } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 04d8c53d97..676bef2d0b 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3265,4 +3265,6 @@ Abuse Report Delete selected items? Delete selected item? + There are no items in this outfit + -- cgit v1.2.3 From b091125a0e53bef47bd968be78b55150807595ed Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 19 Aug 2010 15:11:37 +0300 Subject: EXT-8658 FIXED Made only online participants of Adhoc chat to be shown shown in Recent Tab. Used previously commented code which adds only online paricipants instead of current code that added all. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/860/ --HG-- branch : product-engine --- indra/newview/llimview.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cd35ec5d39..41e505cc58 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1021,19 +1021,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if (is_not_group_id) { - -#if 0 - //use this code to add only online members - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); - LLSpeakerMgr::speaker_list_t speaker_list; - speaker_mgr->getSpeakerList(&speaker_list, true); - for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) - { - const LLPointer& speakerp = *it; - - LLRecentPeople::instance().add(speakerp->mID); - } -#else LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id); if( session == 0)//??? shouldn't really happen { @@ -1048,16 +1035,20 @@ void LLIMModel::sendMessage(const std::string& utf8_text, // Concrete participants will be added into this list once they sent message in chat. if (IM_SESSION_INVITE == dialog) return; - // implemented adding of all participants of an outgoing to Recent People List. See EXT-5694. - for(uuid_vec_t::iterator it = session->mInitialTargetIDs.begin(); - it!=session->mInitialTargetIDs.end();++it) + // Add only online members to recent (EXT-8658) + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); + LLSpeakerMgr::speaker_list_t speaker_list; + if(speaker_mgr != NULL) + { + speaker_mgr->getSpeakerList(&speaker_list, true); + } + for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) { - const LLUUID id = *it; + const LLPointer& speakerp = *it; - LLRecentPeople::instance().add(id); + LLRecentPeople::instance().add(speakerp->mID); } } -#endif } -- cgit v1.2.3 From aabf1b4fa24ea8ce86e11d80f58f79a058237ff4 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Fri, 20 Aug 2010 14:06:32 +0100 Subject: VWR-20847 (SNOW-543/SNOW-517) FIXED Linux packaging fixes. --- indra/newview/CMakeLists.txt | 4 +-- indra/newview/viewer_manifest.py | 66 +++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 65502209f7..1ee7586d5f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1704,12 +1704,12 @@ if (LINUX) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit) - if (NOT INSTALL) + if (PACKAGE) add_custom_target(package ALL DEPENDS ${product}.tar.bz2) add_dependencies(package linux-crash-logger-target) add_dependencies(package linux-updater-target) check_message_template(package) - endif (NOT INSTALL) + endif (PACKAGE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 9885d1aa0d..0eda4007e3 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -833,6 +833,28 @@ class LinuxManifest(ViewerManifest): # Create an appropriate gridargs.dat for this package, denoting required grid. self.put_in_file(self.flags_list(), 'etc/gridargs.dat') + self.path("secondlife-bin","bin/do-not-directly-run-secondlife-bin") + self.path("../linux_crash_logger/linux-crash-logger","bin/linux-crash-logger.bin") + self.path("../linux_updater/linux-updater", "bin/linux-updater.bin") + self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin") + + if self.prefix("res-sdl"): + self.path("*") + # recurse + self.end_prefix("res-sdl") + + # plugins + if self.prefix(src="", dst="bin/llplugin"): + self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so") + self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") + self.end_prefix("bin/llplugin") + + try: + self.path("../llcommon/libllcommon.so", "lib/libllcommon.so") + except: + print "Skipping llcommon.so (assuming llcommon was linked statically)" + + self.path("featuretable_linux.txt") def package_finish(self): if 'installer_name' in self.args: @@ -847,6 +869,10 @@ class LinuxManifest(ViewerManifest): else: installer_name += '_' + self.channel_oneword().upper() + if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer(): + print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build" + self.run_command("find %(d)r/bin %(d)r/lib -type f | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure + # Fix access permissions self.run_command(""" find %(dst)s -type d | xargs --no-run-if-empty chmod 755; @@ -883,36 +909,12 @@ class Linux_i686Manifest(LinuxManifest): # install either the libllkdu we just built, or a prebuilt one, in # decreasing order of preference. for linux package, this goes to bin/ - for lib, destdir in ("llkdu", "bin"), ("llcommon", "lib"): - libfile = "lib%s.so" % lib - try: - self.path(self.find_existing_file(os.path.join(os.pardir, lib, libfile), - '../../libraries/i686-linux/lib_release_client/%s' % libfile), - dst=os.path.join(destdir, libfile)) - # keep this one to preserve syntax, open source mangling removes previous lines - pass - except RuntimeError: - print "Skipping %s - not found" % libfile - pass - - self.path("secondlife-bin","bin/do-not-directly-run-secondlife-bin") - - self.path("../linux_crash_logger/linux-crash-logger","bin/linux-crash-logger.bin") - self.path("../linux_updater/linux-updater", "bin/linux-updater.bin") - self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin") - if self.prefix("res-sdl"): - self.path("*") - # recurse - self.end_prefix("res-sdl") - - # plugins - if self.prefix(src="", dst="bin/llplugin"): - self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so") - self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") - self.end_prefix("bin/llplugin") - - self.path("featuretable_linux.txt") - #self.path("secondlife-i686.supp") + try: + self.path(self.find_existing_file('../llkdu/libllkdu.so', + '../../libraries/i686-linux/lib_release_client/libllkdu.so'), + dst='bin/libllkdu.so') + except: + print "Skipping libllkdu.so - not found" if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): self.path("libapr-1.so.0") @@ -955,10 +957,6 @@ class Linux_i686Manifest(LinuxManifest): self.path("libvivoxplatform.so") self.end_prefix("lib") - if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer(): - print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build" - self.run_command("find %(d)r/bin %(d)r/lib -type f | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure - ################################################################ if __name__ == "__main__": -- cgit v1.2.3 From d179727469692054fc100a9f1d68f181bebcd7de Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 20 Aug 2010 12:38:54 -0700 Subject: fix gcc build error. --- indra/newview/llface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 7c60aabef7..7508cb3a27 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -213,8 +213,8 @@ private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: - static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); - static F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area) ; + static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); + static F32 adjustPixelArea(F32 importance, F32 pixel_area) ; public: -- cgit v1.2.3 From da612aa105b4fddb7a5dac371ceb7a440fe8bf06 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 21 Aug 2010 16:40:47 +0100 Subject: CID-370 Checker: UNINIT_CTOR Function: LLVivoxProtocolParser::LLVivoxProtocolParser() File: /indra/newview/llvoicevivox.cpp --- indra/newview/llvoicevivox.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 15729b5175..2e003dd2b8 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7111,6 +7111,13 @@ void LLVivoxProtocolParser::reset() alias.clear(); numberOfAliases = 0; applicationString.clear(); + id = 0; + nameString.clear(); + descriptionString.clear(); + expirationDate = LLDate(); + hasExpired = false; + fontType = 0; + fontStatus = 0; } //virtual -- cgit v1.2.3 From b5fc9c3254a1bb83d1d454cea95db85f36f40ccf Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 23 Aug 2010 13:12:56 +0100 Subject: VWR-20899 FIXED Minor potential memory leak in LLFlatListView::addItem --- indra/newview/llinventoryitemslist.h | 1 + indra/newview/llwearableitemslist.h | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 17131549e7..ca90427659 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -38,6 +38,7 @@ class LLViewerInventoryItem; class LLInventoryItemsList : public LLFlatListViewEx { + LOG_CLASS(LLInventoryItemsList); public: struct Params : public LLInitParam::Block { diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 4806fb35bf..854c37c2c1 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -384,6 +384,7 @@ private: */ class LLWearableItemsList : public LLInventoryItemsList { + LOG_CLASS(LLWearableItemsList); public: /** * Context menu. -- cgit v1.2.3 From 17553add7c13c4dbed678ef01cb25174722b9bd8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 23 Aug 2010 11:32:58 -0600 Subject: added a toggle "LLGLManager::mDebugGPU" for debugging certain CPUs. added more debug code for EXT-6791: [crashhunters] Intel 965 Crash in glCopyTexSubImage2D --- indra/newview/lldynamictexture.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index bb4e6c7a3e..48b07bcf51 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -170,9 +170,12 @@ void LLViewerDynamicTexture::postRender(BOOL success) if(!mGLTexturep->getHasGLTexture()) { generateGLTexture() ; - } - llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ; + } + if(gGLManager.mDebugGPU) + { + LLGLState::dumpStates() ; + } success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); } } @@ -211,11 +214,16 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { LLViewerDynamicTexture *dynamicTexture = *iter; if (dynamicTexture->needsRender()) - { + { + if(gGLManager.mDebugGPU) + { + llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl; + LLGLState::dumpStates() ; + } + glClear(GL_DEPTH_BUFFER_BIT); gDepthDirty = TRUE; - - + gGL.color4f(1,1,1,1); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; -- cgit v1.2.3 From b064285da360b8f68bcc58a9e1a072a018080e34 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 23 Aug 2010 16:16:41 -0600 Subject: fix for EXT-8730: crash at llrender/llimagegl.cpp(157) : error ERROR: checkTexSize: wrong texture size and discard level: width: 512 Height: 512 Current Level: --- indra/newview/lldynamictexture.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 48b07bcf51..a460a4f618 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -167,10 +167,14 @@ void LLViewerDynamicTexture::postRender(BOOL success) { generateGLTexture() ; } - if(!mGLTexturep->getHasGLTexture()) + else if(!mGLTexturep->getHasGLTexture()) { generateGLTexture() ; } + else if(mGLTexturep->getDiscardLevel() != 0)//do not know how it happens, but regenerate one if it does. + { + generateGLTexture() ; + } if(gGLManager.mDebugGPU) { -- cgit v1.2.3 From 308d9f10147ff31752c90150bc3ee769a63837e9 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 23 Aug 2010 17:32:26 -0600 Subject: fix for EXT-8101: [crashhunters] crash in LLVOSky::calcAtmospherics() --- indra/newview/llvosky.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index d73850cb49..bb80988854 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -975,7 +975,10 @@ void LLVOSky::calcAtmospherics(void) } temp2.mV[1] = llmax(0.f, lighty); - temp2.mV[1] = 1.f / temp2.mV[1]; + if(temp2.mV[1] > 0.f) + { + temp2.mV[1] = 1.f / temp2.mV[1]; + } componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1])); // Distance -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/CMakeLists.txt | 8 +- indra/newview/ViewerInstall.cmake | 4 +- indra/newview/app_settings/high_graphics.xml | 11 +- indra/newview/app_settings/low_graphics.xml | 11 +- indra/newview/app_settings/mid_graphics.xml | 11 +- indra/newview/app_settings/settings.xml | 194 ++-- .../shaders/class1/deferred/alphaF.glsl | 11 + .../shaders/class1/deferred/alphaV.glsl | 25 +- .../shaders/class1/deferred/avatarAlphaV.glsl | 25 +- .../shaders/class1/deferred/avatarF.glsl | 3 +- .../shaders/class1/deferred/avatarShadowF.glsl | 4 +- .../shaders/class1/deferred/blurLightF.glsl | 23 +- .../shaders/class1/deferred/bumpF.glsl | 14 +- .../shaders/class1/deferred/diffuseF.glsl | 10 +- .../shaders/class1/deferred/fullbrightF.glsl | 11 + .../app_settings/shaders/class1/deferred/giF.glsl | 3 +- .../shaders/class1/deferred/impostorF.glsl | 3 +- .../shaders/class1/deferred/multiPointLightF.glsl | 4 +- .../shaders/class1/deferred/multiSpotLightF.glsl | 103 +- .../shaders/class1/deferred/pointLightF.glsl | 3 +- .../shaders/class1/deferred/postgiF.glsl | 9 +- .../shaders/class1/deferred/softenLightF.glsl | 99 +- .../shaders/class1/deferred/spotLightF.glsl | 14 +- .../shaders/class1/deferred/sunLightF.glsl | 191 +++- .../shaders/class1/deferred/sunLightSSAOF.glsl | 124 --- .../shaders/class1/deferred/terrainF.glsl | 3 +- .../shaders/class1/deferred/treeF.glsl | 3 +- .../shaders/class1/deferred/waterF.glsl | 14 +- .../shaders/class1/lighting/lightFuncV.glsl | 9 +- .../shaders/class2/deferred/alphaF.glsl | 11 + .../shaders/class2/deferred/alphaV.glsl | 24 +- .../shaders/class2/deferred/avatarAlphaV.glsl | 25 +- .../shaders/class2/deferred/blurLightF.glsl | 3 +- .../shaders/class2/deferred/edgeF.glsl | 11 +- .../shaders/class2/deferred/multiSpotLightF.glsl | 64 +- .../shaders/class2/deferred/softenLightF.glsl | 86 +- .../shaders/class2/deferred/spotLightF.glsl | 18 +- .../shaders/class2/deferred/sunLightF.glsl | 80 +- .../shaders/class2/deferred/sunLightSSAOF.glsl | 257 ----- .../shaders/class2/lighting/sumLightsV.glsl | 9 +- .../shaders/class3/deferred/giDownsampleF.glsl | 10 +- .../app_settings/shaders/class3/deferred/giF.glsl | 3 +- .../shaders/class3/deferred/softenLightF.glsl | 77 +- .../shaders/class3/deferred/treeF.glsl | 3 +- .../shaders/class3/lighting/sumLightsV.glsl | 27 +- indra/newview/app_settings/ultra_graphics.xml | 13 +- indra/newview/featuretable.txt | 54 +- indra/newview/featuretable_linux.txt | 86 +- indra/newview/featuretable_mac.txt | 1 - indra/newview/llagent.cpp | 4 - indra/newview/llagentcamera.cpp | 18 +- indra/newview/llagentwearables.cpp | 15 +- indra/newview/llagentwearablesfetch.cpp | 2 +- indra/newview/llappearancemgr.cpp | 147 ++- indra/newview/llappearancemgr.h | 8 +- indra/newview/llappviewer.cpp | 74 +- indra/newview/llavatarlist.cpp | 4 +- indra/newview/llavatarlist.h | 2 +- indra/newview/llavatarlistitem.cpp | 6 +- indra/newview/llbottomtray.cpp | 2 +- indra/newview/llcallfloater.cpp | 10 +- indra/newview/llchatbar.cpp | 4 +- indra/newview/llchathistory.cpp | 5 +- indra/newview/llcofwearables.cpp | 24 +- indra/newview/llcofwearables.h | 2 +- indra/newview/llcompilequeue.cpp | 4 +- indra/newview/llcurrencyuimanager.cpp | 28 +- indra/newview/lldrawable.cpp | 2 +- indra/newview/lldrawpool.cpp | 1 - indra/newview/lldrawpool.h | 1 - indra/newview/lldrawpoolalpha.cpp | 185 ++-- indra/newview/lldrawpoolalpha.h | 7 - indra/newview/lldrawpoolavatar.cpp | 31 +- indra/newview/lldrawpoolavatar.h | 4 +- indra/newview/lldrawpoolbump.cpp | 116 +- indra/newview/lldrawpoolbump.h | 16 +- indra/newview/lldrawpoolsimple.cpp | 7 +- indra/newview/lldynamictexture.cpp | 22 +- indra/newview/llexpandabletextbox.cpp | 11 +- indra/newview/llface.cpp | 65 +- indra/newview/llface.h | 5 +- indra/newview/llfloateranimpreview.cpp | 304 ++--- indra/newview/llfloateranimpreview.h | 28 +- indra/newview/llfloaterauction.cpp | 35 +- indra/newview/llfloateravatarpicker.cpp | 44 +- indra/newview/llfloaterbuy.cpp | 8 +- indra/newview/llfloaterbuycontents.cpp | 24 +- indra/newview/llfloaterbuycurrency.cpp | 80 +- indra/newview/llfloaterbuyland.cpp | 104 +- indra/newview/llfloatercamera.cpp | 50 +- indra/newview/llfloatercamera.h | 6 - indra/newview/llfloatercolorpicker.cpp | 12 +- indra/newview/llfloaterdaycycle.cpp | 4 +- indra/newview/llfloaterenvsettings.cpp | 32 +- indra/newview/llfloaterevent.cpp | 32 +- indra/newview/llfloatergesture.cpp | 12 +- indra/newview/llfloatergodtools.cpp | 272 ++--- indra/newview/llfloatergroups.cpp | 31 +- indra/newview/llfloaterhardwaresettings.cpp | 14 +- indra/newview/llfloaterhelpbrowser.cpp | 4 +- indra/newview/llfloaterimagepreview.cpp | 12 +- indra/newview/llfloaterinspect.cpp | 8 +- indra/newview/llfloaterjoystick.cpp | 6 +- indra/newview/llfloaterlagmeter.cpp | 18 +- indra/newview/llfloaterland.cpp | 173 +-- indra/newview/llfloaterland.h | 5 +- indra/newview/llfloaterlandholdings.cpp | 10 +- indra/newview/llfloatermediabrowser.cpp | 34 +- indra/newview/llfloatermemleak.cpp | 20 +- indra/newview/llfloaternamedesc.cpp | 10 +- indra/newview/llfloateropenobject.cpp | 8 +- indra/newview/llfloaterparcel.cpp | 122 ++ indra/newview/llfloaterparcel.h | 53 + indra/newview/llfloaterpay.cpp | 66 +- indra/newview/llfloaterpostcard.cpp | 42 +- indra/newview/llfloaterpostprocess.cpp | 34 +- indra/newview/llfloaterpreference.cpp | 195 +--- indra/newview/llfloaterproperties.cpp | 180 +-- indra/newview/llfloaterregioninfo.cpp | 421 +++---- indra/newview/llfloaterregioninfo.h | 26 +- indra/newview/llfloaterreporter.cpp | 104 +- indra/newview/llfloaterscriptlimits.cpp | 42 +- indra/newview/llfloatersearch.cpp | 8 +- indra/newview/llfloatersellland.cpp | 70 +- indra/newview/llfloatersettingsdebug.cpp | 58 +- indra/newview/llfloatersnapshot.cpp | 290 ++--- indra/newview/llfloatertelehub.cpp | 26 +- indra/newview/llfloatertools.cpp | 72 +- indra/newview/llfloatertopobjects.cpp | 18 +- indra/newview/llfloatertos.cpp | 4 +- indra/newview/llfloateruipreview.cpp | 4 +- indra/newview/llfloaterurldisplay.cpp | 103 ++ indra/newview/llfloaterurldisplay.h | 58 + indra/newview/llfloaterurlentry.cpp | 14 +- indra/newview/llfloatervoicedevicesettings.cpp | 2 +- indra/newview/llfloatervoiceeffect.cpp | 2 +- indra/newview/llfloaterwater.cpp | 42 +- indra/newview/llfloaterwindlight.cpp | 132 +-- indra/newview/llfloaterworldmap.cpp | 82 +- indra/newview/llfolderview.cpp | 67 +- indra/newview/llfolderview.h | 6 +- indra/newview/llfriendcard.cpp | 11 - indra/newview/llgrouplist.cpp | 14 +- indra/newview/llimview.cpp | 68 +- indra/newview/llimview.h | 3 +- indra/newview/llinspectavatar.cpp | 4 +- indra/newview/llinspectgroup.cpp | 2 +- indra/newview/llinventorybridge.cpp | 76 +- indra/newview/llinventorybridge.h | 3 +- indra/newview/llinventoryfunctions.cpp | 18 +- indra/newview/llinventoryfunctions.h | 1 - indra/newview/llinventoryitemslist.cpp | 37 - indra/newview/llinventoryitemslist.h | 7 - indra/newview/llinventorylistitem.cpp | 11 - indra/newview/llinventorylistitem.h | 3 - indra/newview/llinventorypanel.cpp | 18 +- indra/newview/llinventorypanel.h | 4 + indra/newview/llmediactrl.cpp | 14 +- indra/newview/llmediactrl.h | 5 +- indra/newview/llmediadataclient.cpp | 1030 +++++++---------- indra/newview/llmediadataclient.h | 248 ++--- indra/newview/llnavigationbar.cpp | 12 +- indra/newview/llnearbychatbar.cpp | 2 +- indra/newview/lloutfitslist.cpp | 54 +- indra/newview/lloutfitslist.h | 4 - indra/newview/llpanelavatar.cpp | 130 +-- indra/newview/llpanelblockedlist.cpp | 4 +- indra/newview/llpanelclassified.cpp | 1165 +++++++++++++++++++- indra/newview/llpanelclassified.h | 166 ++- indra/newview/llpanelcontents.cpp | 4 +- indra/newview/llpaneleditwearable.cpp | 17 +- indra/newview/llpaneleditwearable.h | 2 - indra/newview/llpanelface.cpp | 144 +-- indra/newview/llpanelgenerictip.cpp | 2 +- indra/newview/llpanelgroup.cpp | 22 +- indra/newview/llpanelgroupgeneral.cpp | 20 +- indra/newview/llpanelgroupgeneral.h | 1 + indra/newview/llpanelgrouplandmoney.cpp | 8 +- indra/newview/llpanelimcontrolpanel.cpp | 30 +- indra/newview/llpanelland.cpp | 69 +- indra/newview/llpanelland.h | 19 +- indra/newview/llpanellandmarkinfo.cpp | 65 +- indra/newview/llpanellandmarks.cpp | 4 +- indra/newview/llpanellandmedia.cpp | 18 +- indra/newview/llpanellogin.cpp | 46 +- indra/newview/llpanelmaininventory.cpp | 112 +- indra/newview/llpanelme.cpp | 36 +- indra/newview/llpanelmediasettingsgeneral.cpp | 26 +- indra/newview/llpanelmediasettingspermissions.cpp | 22 +- indra/newview/llpanelobject.cpp | 58 +- indra/newview/llpanelonlinestatus.cpp | 4 +- indra/newview/llpaneloutfitedit.cpp | 332 +----- indra/newview/llpaneloutfitedit.h | 18 +- indra/newview/llpanelpeople.cpp | 71 +- indra/newview/llpanelpeople.h | 4 + indra/newview/llpanelpermissions.cpp | 356 +++--- indra/newview/llpanelpick.cpp | 28 +- indra/newview/llpanelpicks.cpp | 66 +- indra/newview/llpanelpicks.h | 4 +- indra/newview/llpanelplace.cpp | 421 +++++++ indra/newview/llpanelplace.h | 114 ++ indra/newview/llpanelplaceinfo.cpp | 16 +- indra/newview/llpanelplaces.cpp | 37 - indra/newview/llpanelprofileview.cpp | 4 +- indra/newview/llpanelteleporthistory.cpp | 6 +- indra/newview/llpaneltopinfobar.cpp | 23 - indra/newview/llpaneltopinfobar.h | 5 - indra/newview/llpanelvolume.cpp | 254 ++--- indra/newview/llpanelwearing.cpp | 51 +- indra/newview/llparticipantlist.cpp | 4 +- indra/newview/llpreview.cpp | 12 +- indra/newview/llpreviewanim.cpp | 12 +- indra/newview/llpreviewgesture.cpp | 12 +- indra/newview/llpreviewnotecard.cpp | 22 +- indra/newview/llpreviewscript.cpp | 28 +- indra/newview/llpreviewsound.cpp | 4 +- indra/newview/llpreviewtexture.cpp | 31 +- indra/newview/llremoteparcelrequest.cpp | 1 + indra/newview/llsaveoutfitcombobtn.cpp | 2 +- indra/newview/llscriptfloater.cpp | 2 - indra/newview/llscrollingpanelparam.cpp | 34 +- indra/newview/llselectmgr.cpp | 9 +- indra/newview/llselectmgr.h | 2 +- indra/newview/llsidepanelappearance.cpp | 6 +- indra/newview/llsidepaneliteminfo.cpp | 188 ++-- indra/newview/llsidepaneltaskinfo.cpp | 358 +++--- indra/newview/llspatialpartition.cpp | 43 +- indra/newview/llspatialpartition.h | 18 +- indra/newview/llspeakers.cpp | 5 +- indra/newview/llstartup.cpp | 20 +- indra/newview/llstatusbar.cpp | 103 +- indra/newview/llstatusbar.h | 2 - indra/newview/llstylemap.cpp | 12 +- indra/newview/llsyswellitem.cpp | 4 +- indra/newview/llsyswellitem.h | 1 + indra/newview/lltexlayer.cpp | 4 - indra/newview/lltexturectrl.cpp | 32 +- indra/newview/lltexturefetch.cpp | 131 ++- indra/newview/lltexturefetch.h | 14 +- indra/newview/lltoastgroupnotifypanel.cpp | 2 +- indra/newview/lltoolpie.cpp | 2 +- indra/newview/llurldispatcher.cpp | 20 + indra/newview/llviewchildren.cpp | 4 +- indra/newview/llviewerattachmenu.cpp | 2 +- indra/newview/llviewercontrol.cpp | 25 +- indra/newview/llviewerdisplay.cpp | 19 +- indra/newview/llviewerfloaterreg.cpp | 4 + indra/newview/llviewerinventory.cpp | 2 +- indra/newview/llviewerjoint.cpp | 4 +- indra/newview/llviewerjoint.h | 2 +- indra/newview/llviewerjointattachment.cpp | 37 +- indra/newview/llviewerjointmesh.cpp | 103 +- indra/newview/llviewerjointmesh.h | 2 +- indra/newview/llviewermedia.cpp | 42 +- indra/newview/llviewermedia.h | 5 +- indra/newview/llviewermenu.cpp | 98 +- indra/newview/llviewermessage.cpp | 10 +- indra/newview/llviewernetwork.cpp | 22 +- indra/newview/llviewernetwork.h | 3 - indra/newview/llviewerobject.cpp | 25 - indra/newview/llviewerobject.h | 10 +- indra/newview/llviewershadermgr.cpp | 55 +- indra/newview/llviewerstats.cpp | 2 +- indra/newview/llviewertexture.cpp | 139 +-- indra/newview/llviewertexture.h | 2 - indra/newview/llviewerwindow.cpp | 164 ++- indra/newview/llvoavatar.cpp | 246 ++++- indra/newview/llvoavatar.h | 7 +- indra/newview/llvoavatarself.cpp | 84 +- indra/newview/llvoavatarself.h | 8 - indra/newview/llvosky.cpp | 5 +- indra/newview/llvotree.cpp | 33 +- indra/newview/llvovolume.cpp | 150 +-- indra/newview/llvovolume.h | 6 - indra/newview/llwearable.cpp | 7 +- indra/newview/llwearableitemslist.cpp | 150 +-- indra/newview/llwearableitemslist.h | 38 +- indra/newview/llwebsharing.cpp | 609 ---------- indra/newview/llwebsharing.h | 230 ---- indra/newview/llworld.cpp | 2 - indra/newview/pipeline.cpp | 920 ++++++---------- indra/newview/pipeline.h | 33 +- indra/newview/res/have_artwork_bundle.marker | 1 - indra/newview/res/viewerRes.rc | 2 +- indra/newview/skins/default/colors.xml | 2 +- indra/newview/skins/default/xui/en/floater_aaa.xml | 2 +- .../newview/skins/default/xui/en/floater_about.xml | 2 +- .../newview/skins/default/xui/en/floater_event.xml | 1 + .../skins/default/xui/en/floater_im_session.xml | 2 +- .../skins/default/xui/en/floater_nearby_chat.xml | 2 +- .../default/xui/en/floater_preview_gesture.xml | 16 +- .../default/xui/en/floater_preview_notecard.xml | 2 +- .../skins/default/xui/en/floater_search.xml | 8 +- .../skins/default/xui/en/floater_snapshot.xml | 34 +- .../newview/skins/default/xui/en/floater_tools.xml | 15 +- .../skins/default/xui/en/inspect_object.xml | 2 +- .../default/xui/en/menu_add_wearable_gear.xml | 41 - .../default/xui/en/menu_inspect_object_gear.xml | 9 - indra/newview/skins/default/xui/en/menu_object.xml | 9 - .../default/xui/en/menu_places_gear_folder.xml | 6 - indra/newview/skins/default/xui/en/menu_viewer.xml | 186 +--- .../default/xui/en/menu_wearable_list_item.xml | 2 +- .../skins/default/xui/en/menu_wearing_tab.xml | 18 - .../newview/skins/default/xui/en/notifications.xml | 13 - .../skins/default/xui/en/outfit_accordion_tab.xml | 1 - indra/newview/skins/default/xui/en/panel_bars.xml | 18 + .../default/xui/en/panel_body_parts_list_item.xml | 2 +- .../skins/default/xui/en/panel_chat_header.xml | 27 +- .../skins/default/xui/en/panel_classified_info.xml | 4 +- .../default/xui/en/panel_classifieds_list_item.xml | 1 + .../default/xui/en/panel_clothing_list_item.xml | 2 +- .../xui/en/panel_deletable_wearable_list_item.xml | 2 +- .../xui/en/panel_dummy_clothing_list_item.xml | 2 +- .../skins/default/xui/en/panel_group_list_item.xml | 2 +- .../skins/default/xui/en/panel_group_notify.xml | 2 +- .../skins/default/xui/en/panel_group_roles.xml | 2 +- .../skins/default/xui/en/panel_inventory_item.xml | 2 +- .../skins/default/xui/en/panel_landmark_info.xml | 5 +- .../xui/en/panel_media_settings_permissions.xml | 15 +- .../skins/default/xui/en/panel_my_profile.xml | 3 + .../skins/default/xui/en/panel_navigation_bar.xml | 2 - .../skins/default/xui/en/panel_notification.xml | 2 +- .../skins/default/xui/en/panel_pick_info.xml | 2 +- .../skins/default/xui/en/panel_pick_list_item.xml | 1 + .../skins/default/xui/en/panel_place_profile.xml | 5 +- .../default/xui/en/panel_preferences_graphics1.xml | 274 +++-- .../newview/skins/default/xui/en/panel_profile.xml | 3 + .../default/xui/en/panel_teleport_history_item.xml | 2 +- .../skins/default/xui/en/panel_topinfo_bar.xml | 10 +- indra/newview/skins/default/xui/en/strings.xml | 12 - .../default/xui/en/widgets/bodyparts_list_item.xml | 2 +- .../default/xui/en/widgets/clothing_list_item.xml | 2 +- .../en/widgets/deletable_wearable_list_item.xml | 2 +- .../xui/en/widgets/dummy_clothing_list_item.xml | 2 +- .../default/xui/en/widgets/expandable_text.xml | 3 +- .../default/xui/en/widgets/inventory_list_item.xml | 2 +- .../skins/default/xui/en/widgets/scroll_list.xml | 1 - .../default/xui/en/widgets/simple_text_editor.xml | 4 +- .../newview/skins/default/xui/en/widgets/text.xml | 4 +- .../skins/default/xui/en/widgets/text_editor.xml | 3 +- .../skins/default/xui/fr/floater_postcard.xml | 2 +- .../default/xui/fr/floater_preview_gesture.xml | 2 +- .../newview/skins/default/xui/fr/floater_tools.xml | 4 +- indra/newview/skins/default/xui/fr/menu_object.xml | 6 +- indra/newview/skins/default/xui/fr/menu_picks.xml | 2 +- .../newview/skins/default/xui/fr/notifications.xml | 6 +- .../skins/default/xui/fr/panel_pick_info.xml | 2 +- .../skins/default/xui/fr/panel_script_ed.xml | 2 +- .../skins/default/xui/pl/floater_bulk_perms.xml | 4 +- indra/newview/skins/default/xui/pl/floater_pay.xml | 2 +- .../skins/default/xui/pl/floater_pay_object.xml | 4 +- .../skins/default/xui/pl/floater_post_process.xml | 2 +- .../skins/default/xui/pl/floater_postcard.xml | 8 +- .../default/xui/pl/floater_preview_gesture.xml | 2 +- .../xui/pl/floater_preview_gesture_info.xml | 2 +- .../xui/pl/floater_preview_gesture_shortcut.xml | 2 +- .../xui/pl/floater_preview_gesture_steps.xml | 2 +- .../skins/default/xui/pl/floater_preview_sound.xml | 2 +- .../skins/default/xui/pl/floater_report_abuse.xml | 6 +- .../skins/default/xui/pl/floater_script_search.xml | 2 +- .../skins/default/xui/pl/floater_sell_land.xml | 12 +- .../newview/skins/default/xui/pl/floater_stats.xml | 14 +- .../newview/skins/default/xui/pl/floater_tools.xml | 30 +- .../skins/default/xui/pl/floater_top_objects.xml | 8 +- .../default/xui/pl/floater_windlight_options.xml | 6 +- .../skins/default/xui/pl/floater_world_map.xml | 20 +- .../skins/default/xui/pl/inspect_avatar.xml | 4 +- .../newview/skins/default/xui/pl/inspect_group.xml | 2 +- .../skins/default/xui/pl/inspect_object.xml | 2 +- .../skins/default/xui/pl/menu_attachment_other.xml | 6 +- .../skins/default/xui/pl/menu_attachment_self.xml | 6 +- .../skins/default/xui/pl/menu_avatar_icon.xml | 2 +- .../skins/default/xui/pl/menu_avatar_other.xml | 6 +- .../skins/default/xui/pl/menu_avatar_self.xml | 12 +- .../skins/default/xui/pl/menu_bottomtray.xml | 8 +- .../newview/skins/default/xui/pl/menu_cof_gear.xml | 2 +- .../skins/default/xui/pl/menu_favorites.xml | 2 +- .../skins/default/xui/pl/menu_group_plus.xml | 4 +- .../skins/default/xui/pl/menu_imchiclet_group.xml | 2 +- .../skins/default/xui/pl/menu_imchiclet_p2p.xml | 4 +- .../default/xui/pl/menu_inspect_avatar_gear.xml | 6 +- .../default/xui/pl/menu_inspect_self_gear.xml | 6 +- .../skins/default/xui/pl/menu_inventory.xml | 14 +- .../skins/default/xui/pl/menu_inventory_add.xml | 6 +- .../default/xui/pl/menu_inventory_gear_default.xml | 2 +- indra/newview/skins/default/xui/pl/menu_land.xml | 2 +- indra/newview/skins/default/xui/pl/menu_login.xml | 4 +- indra/newview/skins/default/xui/pl/menu_navbar.xml | 4 +- .../skins/default/xui/pl/menu_outfit_gear.xml | 4 +- .../skins/default/xui/pl/menu_participant_list.xml | 4 +- .../skins/default/xui/pl/menu_people_groups.xml | 2 +- .../xui/pl/menu_people_groups_view_sort.xml | 4 +- .../skins/default/xui/pl/menu_people_nearby.xml | 6 +- .../xui/pl/menu_people_nearby_multiselect.xml | 4 +- .../skins/default/xui/pl/menu_picks_plus.xml | 2 +- indra/newview/skins/default/xui/pl/menu_place.xml | 4 +- .../skins/default/xui/pl/menu_place_add_button.xml | 2 +- .../default/xui/pl/menu_places_gear_folder.xml | 2 +- .../default/xui/pl/menu_places_gear_landmark.xml | 4 +- indra/newview/skins/default/xui/pl/menu_slurl.xml | 4 +- .../default/xui/pl/menu_teleport_history_gear.xml | 2 +- .../skins/default/xui/pl/menu_text_editor.xml | 2 +- .../skins/default/xui/pl/menu_url_agent.xml | 2 +- .../skins/default/xui/pl/menu_url_group.xml | 4 +- .../skins/default/xui/pl/menu_url_inventory.xml | 2 +- .../skins/default/xui/pl/menu_url_parcel.xml | 2 +- .../skins/default/xui/pl/menu_url_slurl.xml | 2 +- .../skins/default/xui/pl/menu_url_teleport.xml | 2 +- indra/newview/skins/default/xui/pl/menu_viewer.xml | 358 +++--- .../skins/default/xui/pl/mime_types_mac.xml | 8 +- .../newview/skins/default/xui/pl/notifications.xml | 124 +-- .../default/xui/pl/panel_active_object_row.xml | 4 +- .../default/xui/pl/panel_adhoc_control_panel.xml | 4 +- .../skins/default/xui/pl/panel_audio_device.xml | 10 +- .../default/xui/pl/panel_block_list_sidetray.xml | 6 +- .../skins/default/xui/pl/panel_bottomtray.xml | 12 +- .../skins/default/xui/pl/panel_bottomtray_lite.xml | 2 +- .../skins/default/xui/pl/panel_edit_alpha.xml | 10 +- .../skins/default/xui/pl/panel_edit_classified.xml | 10 +- .../skins/default/xui/pl/panel_edit_profile.xml | 4 +- .../skins/default/xui/pl/panel_edit_wearable.xml | 8 +- .../newview/skins/default/xui/pl/panel_friends.xml | 4 +- .../default/xui/pl/panel_group_control_panel.xml | 4 +- .../skins/default/xui/pl/panel_group_general.xml | 8 +- .../default/xui/pl/panel_group_info_sidetray.xml | 4 +- .../skins/default/xui/pl/panel_group_invite.xml | 6 +- .../default/xui/pl/panel_group_land_money.xml | 16 +- .../skins/default/xui/pl/panel_group_notices.xml | 8 +- .../skins/default/xui/pl/panel_group_notify.xml | 2 +- .../skins/default/xui/pl/panel_group_roles.xml | 40 +- .../newview/skins/default/xui/pl/panel_groups.xml | 2 +- .../default/xui/pl/panel_im_control_panel.xml | 2 +- .../skins/default/xui/pl/panel_landmark_info.xml | 8 +- indra/newview/skins/default/xui/pl/panel_login.xml | 2 +- .../xui/pl/panel_media_settings_general.xml | 10 +- .../xui/pl/panel_media_settings_permissions.xml | 8 +- .../skins/default/xui/pl/panel_my_profile.xml | 8 +- .../skins/default/xui/pl/panel_nearby_chat_bar.xml | 2 +- .../skins/default/xui/pl/panel_nearby_media.xml | 8 +- .../skins/default/xui/pl/panel_outfit_edit.xml | 2 +- .../pl/panel_outfits_inventory_gear_default.xml | 10 +- .../newview/skins/default/xui/pl/panel_people.xml | 18 +- .../skins/default/xui/pl/panel_place_profile.xml | 8 +- .../default/xui/pl/panel_preferences_advanced.xml | 8 +- .../default/xui/pl/panel_preferences_alerts.xml | 2 +- .../default/xui/pl/panel_preferences_general.xml | 14 +- .../default/xui/pl/panel_preferences_graphics1.xml | 16 +- .../default/xui/pl/panel_preferences_privacy.xml | 4 +- .../default/xui/pl/panel_preferences_setup.xml | 8 +- .../default/xui/pl/panel_preferences_sound.xml | 14 +- .../default/xui/pl/panel_prim_media_controls.xml | 12 +- .../newview/skins/default/xui/pl/panel_profile.xml | 4 +- .../skins/default/xui/pl/panel_region_covenant.xml | 2 +- .../skins/default/xui/pl/panel_region_estate.xml | 8 +- .../skins/default/xui/pl/panel_region_general.xml | 6 +- .../default/xui/pl/panel_region_general_layout.xml | 6 +- .../skins/default/xui/pl/panel_region_terrain.xml | 6 +- .../skins/default/xui/pl/panel_region_texture.xml | 4 +- .../skins/default/xui/pl/panel_script_ed.xml | 4 +- .../xui/pl/panel_script_limits_my_avatar.xml | 4 +- .../xui/pl/panel_script_limits_region_memory.xml | 4 +- .../skins/default/xui/pl/panel_side_tray.xml | 4 +- .../default/xui/pl/panel_stand_stop_flying.xml | 2 +- .../skins/default/xui/pl/panel_status_bar.xml | 6 +- .../newview/skins/default/xui/pl/role_actions.xml | 76 +- .../skins/default/xui/pl/sidepanel_appearance.xml | 4 +- .../skins/default/xui/pl/sidepanel_item_info.xml | 4 +- .../skins/default/xui/pl/sidepanel_task_info.xml | 2 +- indra/newview/skins/default/xui/pl/strings.xml | 630 +++++------ .../skins/default/xui/pl/teleport_strings.xml | 14 +- indra/newview/tests/llmediadataclient_test.cpp | 109 +- indra/newview/tests/llsecapi_test.cpp | 92 +- indra/newview/tests/llslurl_test.cpp | 5 - indra/newview/tests/llviewernetwork_test.cpp | 5 - 474 files changed, 9112 insertions(+), 10316 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl create mode 100644 indra/newview/llfloaterparcel.cpp create mode 100644 indra/newview/llfloaterparcel.h create mode 100644 indra/newview/llfloaterurldisplay.cpp create mode 100644 indra/newview/llfloaterurldisplay.h create mode 100644 indra/newview/llpanelplace.cpp create mode 100644 indra/newview/llpanelplace.h delete mode 100644 indra/newview/llwebsharing.cpp delete mode 100644 indra/newview/llwebsharing.h delete mode 100644 indra/newview/res/have_artwork_bundle.marker delete mode 100644 indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml create mode 100644 indra/newview/skins/default/xui/en/panel_bars.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 653bc13260..1ee7586d5f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -190,6 +190,7 @@ set(viewer_SOURCE_FILES llfloaternamedesc.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp + llfloaterparcel.cpp llfloaterpay.cpp llfloaterperms.cpp llfloaterpostcard.cpp @@ -211,6 +212,7 @@ set(viewer_SOURCE_FILES llfloatertopobjects.cpp llfloatertos.cpp llfloateruipreview.cpp + llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp llfloatervoiceeffect.cpp @@ -347,6 +349,7 @@ set(viewer_SOURCE_FILES llpanelpermissions.cpp llpanelpick.cpp llpanelpicks.cpp + llpanelplace.cpp llpanelplaceinfo.cpp llpanelplaceprofile.cpp llpanelplaces.cpp @@ -549,7 +552,6 @@ set(viewer_SOURCE_FILES llwearablelist.cpp llwearabletype.cpp llweb.cpp - llwebsharing.cpp llwind.cpp llwlanimator.cpp llwldaycycle.cpp @@ -714,6 +716,7 @@ set(viewer_HEADER_FILES llfloaternamedesc.h llfloaternotificationsconsole.h llfloateropenobject.h + llfloaterparcel.h llfloaterpay.h llfloaterperms.h llfloaterpostcard.h @@ -735,6 +738,7 @@ set(viewer_HEADER_FILES llfloatertopobjects.h llfloatertos.h llfloateruipreview.h + llfloaterurldisplay.h llfloaterurlentry.h llfloatervoicedevicesettings.h llfloatervoiceeffect.h @@ -867,6 +871,7 @@ set(viewer_HEADER_FILES llpanelpermissions.h llpanelpick.h llpanelpicks.h + llpanelplace.h llpanelplaceinfo.h llpanelplaceprofile.h llpanelplaces.h @@ -1071,7 +1076,6 @@ set(viewer_HEADER_FILES llwearablelist.h llwearabletype.h llweb.h - llwebsharing.h llwind.h llwlanimator.h llwldaycycle.h diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 0b0d3e2adc..8168e91a06 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -7,8 +7,8 @@ install(DIRECTORY skins app_settings linux_tools PATTERN ".svn" EXCLUDE ) -find_file(IS_ARTWORK_PRESENT NAMES have_artwork_bundle.marker - PATHS ${VIEWER_DIR}/newview/res) +find_file(IS_ARTWORK_PRESENT NAMES avatar_lad.xml + PATHS ${VIEWER_DIR}/newview/character) if (IS_ARTWORK_PRESENT) install(DIRECTORY res res-sdl character diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index 587b2f2a89..6368f7099e 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -12,6 +12,8 @@ + + @@ -29,14 +31,9 @@ + + - - - - - - - diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index a5bbdfc1d0..d02a13a671 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -14,6 +14,8 @@ + + @@ -31,14 +33,9 @@ + + - - - - - - - diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index a1430a58f9..12da77da40 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -12,6 +12,8 @@ + + @@ -29,14 +31,9 @@ + + - - - - - - - diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 07418d1b5e..810b2d9a1d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1741,17 +1741,6 @@ Value 0 - DebugAvatarLocalTexLoadedTime - - Comment - Display time for loading avatar local textures. - Persist - 1 - Type - Boolean - Value - 0 - DebugBeaconLineWidth Comment @@ -5384,6 +5373,17 @@ Value 0 + MultipleAttachments + + Comment + Allow multiple objects to be attached to a single attachment point. + Persist + 1 + Type + Boolean + Value + 0 + MuteAmbient Comment @@ -6748,7 +6748,7 @@ Type U32 Value - 200 + 60 RenderSSAOFactor @@ -7123,64 +7123,6 @@ 0.01 - RenderShadowBiasError - - Comment - Error scale for shadow bias (based on altitude). - Persist - 1 - Type - F32 - Value - 0 - - RenderShadowOffsetError - - Comment - Error scale for shadow offset (based on altitude). - Persist - 1 - Type - F32 - Value - 0 - - - RenderSpotLightsInNondeferred - - Comment - Whether to support projectors as spotlights when Lighting and Shadows is disabled - Persist - 1 - Type - Boolean - Value - 0 - - - RenderSpotShadowBias - - Comment - Bias value for shadows (prevent shadow acne). - Persist - 1 - Type - F32 - Value - 0.0 - - RenderSpotShadowOffset - - Comment - Offset value for shadows (prevent shadow acne). - Persist - 1 - Type - F32 - Value - 0.04 - - RenderShadowResolutionScale Comment @@ -7193,6 +7135,8 @@ 1.0 + + RenderDeferredTreeShadowBias Comment @@ -7314,7 +7258,7 @@ Type F32 Value - 8 + 1 RenderDeferred @@ -7329,6 +7273,18 @@ 0 + RenderDeferredShadow + + Comment + Enable shadows in deferred renderer. + Persist + 1 + Type + Boolean + Value + 1 + + RenderDeferredGI Comment @@ -7341,10 +7297,10 @@ 0 - RenderDeferredSun + RenderDeferredSunShadow Comment - Execute sunlight shader in deferred renderer. + Generate shadows from the sun. Persist 1 Type @@ -7353,10 +7309,10 @@ 1 - RenderDeferredAtmospheric + RenderDeferredSun Comment - Execute atmospheric shader in deferred renderer. + Execute sunlight shader in deferred renderer. Persist 1 Type @@ -7365,10 +7321,10 @@ 1 - RenderDeferredSSAO + RenderDeferredAtmospheric Comment - Execute screen space ambient occlusion shader in deferred renderer. + Execute atmospheric shader in deferred renderer. Persist 1 Type @@ -7627,10 +7583,10 @@ Value 256.0 - RenderAutoMaskAlphaNonDeferred + RenderFastAlpha Comment - Use alpha masks where appropriate, in the non-deferred (non-'Lighting and Shadows') graphics mode + Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces). Persist 1 Type @@ -7638,17 +7594,6 @@ Value 0 - RenderAutoMaskAlphaDeferred - - Comment - Use alpha masks where appropriate, in the deferred ('Lighting and Shadows') graphics mode - Persist - 1 - Type - Boolean - Value - 1 - RenderFastUI Comment @@ -7910,6 +7855,17 @@ Value 0 + RenderLightingDetail + + Comment + Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights) + Persist + 1 + Type + S32 + Value + 1 + RenderMaxPartCount Comment @@ -8009,18 +7965,6 @@ Value 2 - RenderShadowDetail - - Comment - Detail of shadows. - Persist - 1 - Type - S32 - Value - 2 - - RenderReflectionRes Comment @@ -8151,7 +8095,7 @@ Type Boolean Value - 1 + 0 RenderUIBuffer @@ -8307,6 +8251,17 @@ Value 512 + RenderWaterReflections + + Comment + Reflect the environment in the water. + Persist + 1 + Type + Boolean + Value + 0 + RotateRight Comment @@ -8329,6 +8284,17 @@ Value 1.0 + RunMultipleThreads + + Comment + If TRUE keep background threads active during render + Persist + 1 + Type + Boolean + Value + 0 + SafeMode Comment @@ -9495,28 +9461,6 @@ Value 75 - SnapshotSharingEnabled - - Comment - Enable uploading of snapshots to a web service. - Persist - 1 - Type - Boolean - Value - 0 - - SnapshotConfigURL - - Comment - URL to fetch Snapshot Sharing configuration data from. - Persist - 1 - Type - String - Value - http://photos.apps.staging.avatarsunited.com/viewer_config - SnapshotTextureLastResolution Comment diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index fea2e16090..4fb109d687 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -24,6 +24,8 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; +uniform float alpha_soften; + uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -55,6 +57,15 @@ void main() color.rgb = scaleSoftClip(color.rgb); + if (samp_pos.z != 0.0 && gl_Color.a < 1.0) + { + float dist_factor = alpha_soften; + float a = gl_Color.a; + a *= a; + dist_factor *= 1.0/(1.0-a); + color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); + } + //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 04e556c11a..1a7d58b07b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -41,22 +41,23 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col; + col.a = gl_Color.a; + + // Add windlight lights + col.rgb = atmosAmbient(vec3(0.)); + col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); - vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index 650fbcc3f5..c1988d3c78 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -47,22 +47,23 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col; + col.a = gl_Color.a; + + // Add windlight lights + col.rgb = atmosAmbient(vec3(0.)); + col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index afbe08a579..75df388941 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -20,7 +20,6 @@ void main() gl_FragData[0] = vec4(diff.rgb, 0.0); gl_FragData[1] = vec4(0,0,0,0); - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 085ffddeec..00083eb6b3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -10,7 +10,7 @@ uniform sampler2D diffuseMap; void main() { - //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); - gl_FragColor = vec4(1,1,1,1); + gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); + //gl_FragColor = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index d1c5d7cb19..bd5e9dd758 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -10,11 +10,13 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; +uniform sampler2DRect giLightMap; uniform float dist_factor; uniform float blur_size; uniform vec2 delta; -uniform vec3 kern[4]; +uniform vec3 kern[32]; +uniform int kern_length; uniform float kern_scale; varying vec2 vary_fragcoord; @@ -37,8 +39,7 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; vec3 pos = getPosition(vary_fragcoord.xy).xyz; vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; @@ -49,7 +50,7 @@ void main() vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; - for (int i = 1; i < 4; i++) + for (int i = 1; i < kern_length; i++) { vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; vec3 samppos = getPosition(tc).xyz; @@ -60,22 +61,12 @@ void main() defined_weight += kern[i].xy; } } - for (int i = 1; i < 4; i++) - { - vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; - vec3 samppos = getPosition(tc).xyz; - float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane - if (d*d <= 0.003) - { - col += texture2DRect(lightMap, tc)*kern[i].xyxx; - defined_weight += kern[i].xy; - } - } col /= defined_weight.xyxx; gl_FragColor = col; + + //gl_FragColor = ccol; } - diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 2197744a37..1c29dae5f7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -14,16 +14,14 @@ varying vec3 vary_mat2; void main() { - vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0; vec3 tnorm = vec3(dot(norm,vary_mat0), - dot(norm,vary_mat1), - dot(norm,vary_mat2)); + dot(norm,vary_mat1), + dot(norm,vary_mat2)); - gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = gl_Color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested - vec3 nvn = normalize(tnorm); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); + gl_FragData[1] = vec4(col*gl_Color.a, gl_Color.a); + gl_FragData[2] = vec4(normalize(tnorm)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 3803119cda..5895ebda84 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -11,10 +11,8 @@ varying vec3 vary_normal; void main() { - vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; - gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = gl_Color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); + gl_FragData[1] = vec4(col*(gl_Color.a*1.5), gl_Color.a); + gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 0db9586a88..e518bddb98 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,6 +23,8 @@ varying vec4 vary_position; varying vec3 vary_normal; varying vec3 vary_fragcoord; +uniform float alpha_soften; + uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -54,6 +56,15 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); + if (samp_pos.z != 0.0 && color.a < 1.0) + { + float dist_factor = alpha_soften; + float a = color.a; + a *= a; + dist_factor *= 1.0/(1.0-a); + color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); + } + //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index d4b153c4af..b351eec6e5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -159,8 +159,7 @@ void main() { vec2 pos_screen = vary_fragcoord.xy; vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; gl_FragData[0].xyz = giAmbient(pos, norm); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 508bbf415e..8c140a7b4f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -11,8 +11,7 @@ uniform sampler2D specularMap; void main() { - vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); - gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); + gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index b494b521ca..797b9e9f3b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -53,9 +53,7 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - norm = normalize(norm); + vec3 norm = normalize(texture2DRect(normalMap, frag.xy).xyz*2.0-1.0); vec4 spec = texture2DRect(specularRect, frag.xy); vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; float noise = texture2D(noiseMap, frag.xy/128.0).b; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 82e9450e68..28bcd720c0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -5,9 +5,8 @@ * $License$ */ -#version 120 -//class 1 -- no shadows +#version 120 #extension GL_ARB_texture_rectangle : enable @@ -27,15 +26,12 @@ uniform vec3 proj_n; uniform float proj_focus; //distance from plane to begin blurring uniform float proj_lod; //(number of mips in proj map) uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; uniform float proj_ambiance; uniform float near_clip; uniform float far_clip; uniform vec3 proj_origin; //origin of projection to be used for angular attenuation uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; varying vec4 vary_light; @@ -44,52 +40,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -118,7 +68,7 @@ void main() { discard; } - + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); @@ -133,11 +83,7 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = gl_Color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten <= 0.0) - { - discard; - } + float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); lv = proj_origin-pos.xyz; lv = normalize(lv); @@ -155,32 +101,32 @@ void main() proj_tc.y > 0.0) { float lit = 0.0; - float amb_da = proj_ambiance; - if (da > 0.0) { float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; col = lcol*lit*diff_tex; - amb_da += (da*0.5)*proj_ambiance; } - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - + float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); + float lod = diff * proj_lod; + vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + //float amb_da = mix(proj_ambiance, proj_ambiance*max(-da, 0.0), max(da, 0.0)); + float amb_da = proj_ambiance; + amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; + amb_da *= dist_atten * noise; + amb_da = min(amb_da, 1.0-lit); - + col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -198,28 +144,35 @@ void main() { vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); + vec3 stc = (proj_mat * vec4(pfinal.xyz, 1.0)).xyz; if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - + stc.xy /= stc.z+proj_near; + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; } } } } + /*if (spec.a > 0.0) + { + //vec3 ref = reflect(normalize(pos), norm); + float sa = dot(normalize(lv-normalize(pos)),norm);; + //sa = max(sa, 0.0); + //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa *= noise; + col += da*sa*lcol*spec.rgb; + }*/ + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 3aecbc5f23..78256e20cc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -55,8 +55,7 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; float da = dot(norm, lv); if (da < 0.0) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index bd554c2d84..9612aee405 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -38,10 +38,10 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; vec3 pos = getPosition(vary_fragcoord.xy).xyz; + vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; vec2 dlt = kern_scale * delta/(1.0+norm.xy*norm.xy); dlt /= max(-pos.z*dist_factor, 1.0); @@ -51,10 +51,9 @@ void main() for (int i = 0; i < kern_length; i++) { vec2 tc = vary_fragcoord.xy + kern[i].y*dlt; - vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz; - sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm + vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz*2.0-1.0; - float d = dot(norm.xyz, sampNorm); + float d = dot(norm.xyz, sampNorm); if (d > 0.8) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index bef91e735d..b4b0d0ce9d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -11,7 +11,6 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect positionMap; uniform sampler2DRect normalMap; -uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; @@ -41,7 +40,7 @@ uniform float scene_light_strength; uniform vec3 env_mat[3]; //uniform mat4 shadow_matrix[3]; //uniform vec4 shadow_clip; -uniform mat3 ssao_effect_mat; +//uniform mat3 ssao_effect_mat; varying vec4 vary_light; varying vec2 vary_fragcoord; @@ -56,8 +55,9 @@ vec3 vary_AtmosAttenuation; uniform mat4 inv_proj; uniform vec2 screen_res; -vec4 getPosition_d(vec2 pos_screen, float depth) -{ +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -68,12 +68,6 @@ vec4 getPosition_d(vec2 pos_screen, float depth) return pos; } -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; - return getPosition_d(pos_screen, depth); -} - vec3 getPositionEye() { return vary_PositionEye; @@ -184,17 +178,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { temp2.x += .25; //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); - */ - tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); + vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; //haze color setAdditiveColor( @@ -257,10 +241,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - float depth = texture2DRect(depthMap, tc.xy).a; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 pos = getPosition(tc).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -268,76 +250,23 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; - float scol = max(scol_ambocc.r, diffuse.a); - float ambocc = scol_ambocc.g; - - calcAtmospherics(pos.xyz, ambocc); + calcAtmospherics(pos.xyz, 0.0); vec3 col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); + col += atmosAffectDirectionalLight(clamp(da, diffuse.a, 1.0)); col *= diffuse.rgb; - if (spec.a > 0.0) // specular reflection + if (spec.a > 0.0) { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; - - /* - // screen-space cheap fakey reflection map - // - vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); - depth -= 0.5; // unbias depth - // first figure out where we'll make our 2D guess from - vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; - // Offset the guess source a little according to a trivial - // checkerboard dither function and spec.a. - // This is meant to be similar to sampling a blurred version - // of the diffuse map. LOD would be better in that regard. - // The goal of the blur is to soften reflections in surfaces - // with low shinyness, and also to disguise our lameness. - float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); - ref2d += vec2(checkoffset, checkoffset); - ref2d += tc.xy; // use as offset from destination - // Get attributes from the 2D guess point. - // We average two samples of diffuse (not of anything else) per - // pixel to try to reduce aliasing some more. - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + - texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); - float refdepth = texture2DRect(depthMap, ref2d).a; - vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - vec3 refn = texture2DRect(normalMap, ref2d).rgb; - refn = normalize(vec3((refn.xy-0.5)*2.0,refn.z)); // unpack norm - // figure out how appropriate our guess actually was - float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); - // darken reflections from points which face away from the reflected ray - our guess was a back-face - //refapprop *= step(dot(refnorm, refn), 0.0); - refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point. - // reflect light direction to increase the illusion that - // these are reflections. - vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = max(dot(refn, reflight.xyz), 0.0); - // apply sun color to guess-point, dampen according to inappropriateness of guess - float refmod = min(refapprop, reflit); - vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; - vec3 ssshiny = (refprod * spec.a); - ssshiny *= 0.3; // dampen it even more - */ - vec3 ssshiny = vec3(0,0,0); - - // add the two types of shiny together - col += (ssshiny + dumbshiny) * spec.rgb; + vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(ref, vary_light.xyz); + col.rgb += vary_SunlitColor*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); col = scaleSoftClip(col); - + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 1b95b253c3..2a7234fd83 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -68,8 +68,7 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -162,6 +161,17 @@ void main() } } + /*if (spec.a > 0.0) + { + //vec3 ref = reflect(normalize(pos), norm); + float sa = dot(normalize(lv-normalize(pos)),norm);; + //sa = max(sa, 0.0); + //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa *= noise; + col += da*sa*lcol*spec.rgb; + }*/ + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 56e4055c02..22bdd2c7f3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -5,11 +5,196 @@ * $License$ */ -//class 1, no shadow, no SSAO, should never be called - #extension GL_ARB_texture_rectangle : enable +uniform sampler2DRect depthMap; +uniform sampler2DRect normalMap; +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DRectShadow shadowMap4; +uniform sampler2DRectShadow shadowMap5; +uniform sampler2D noiseMap; + +uniform sampler2D lightFunc; + + +// Inputs +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform float ssao_radius; +uniform float ssao_max_radius; +uniform float ssao_factor; +uniform float ssao_factor_inv; + +varying vec2 vary_fragcoord; +varying vec4 vary_light; + +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform float shadow_bias; +uniform float shadow_offset; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + return (1.0 - (float(points != 0) * angle_hidden)); +} + void main() { - gl_FragColor = vec4(0,0,0,0); + vec2 pos_screen = vary_fragcoord.xy; + + //try doing an unproject here + + vec4 pos = getPosition(pos_screen); + + vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + + /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL + { + gl_FragColor = vec4(0.0); // doesn't matter + return; + }*/ + + float shadow = 1.0; + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + + vec4 spos = vec4(pos.xyz + norm.xyz * (-pos.z/64.0*shadow_offset+shadow_bias), 1.0); + + //vec3 debug = vec3(0,0,0); + + if (dp_directional_light == 0.0) + { + // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup + shadow = 0.0; + } + else if (spos.z > -shadow_clip.w) + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= screen_res; + shadow = shadow2DRectProj(shadowMap3, lpos).x; + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= screen_res; + shadow = shadow2DRectProj(shadowMap2, lpos).x; + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= screen_res; + shadow = shadow2DRectProj(shadowMap1, lpos).x; + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= screen_res; + shadow = shadow2DRectProj(shadowMap0, lpos).x; + } + + // take the most-shadowed value out of these two: + // * the blurred sun shadow in the light (shadow) map + // * an unblurred dot product between the sun and this norm + // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting + shadow = min(shadow, dp_directional_light); + + /*debug.r = lpos.y / (lpos.w*screen_res.y); + + lpos.xy /= lpos.w*32.0; + if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) + { + debug.gb = vec2(0.5, 0.5); + } + + debug += (1.0-shadow)*0.5;*/ + + } + else + { + // more distant than the shadow map covers - just use directional shading as shadow + shadow = dp_directional_light; + } + + gl_FragColor[0] = shadow; + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + + //spotlight shadow 1 + vec4 lpos = shadow_matrix[4]*spos; + lpos.xy *= screen_res; + gl_FragColor[2] = shadow2DRectProj(shadowMap4, lpos).x; + + //spotlight shadow 2 + lpos = shadow_matrix[5]*spos; + lpos.xy *= screen_res; + gl_FragColor[3] = shadow2DRectProj(shadowMap5, lpos).x; + + //gl_FragColor.rgb = pos.xyz; + //gl_FragColor.b = shadow; + //gl_FragColor.rgb = debug; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl deleted file mode 100644 index cdbed4b791..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @file sunLightSSAOF.glsl - * - * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. - * $License$ - */ - -#extension GL_ARB_texture_rectangle : enable - -//class 1 -- no shadow, SSAO only - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - float ret = 1.0; - - float dist = dot(pos.xyz,pos.xyz); - - if (dist < 64.0*64.0) - { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); - } - - return min(ret, 1.0); -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - - //try doing an unproject here - - vec4 pos = getPosition(pos_screen); - - vec3 norm = texture2DRect(normalMap, pos_screen).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - gl_FragColor[0] = 1.0; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - gl_FragColor[2] = 1.0; - gl_FragColor[3] = 1.0; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index fa0a60c98d..3cccfb7202 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -29,7 +29,6 @@ void main() gl_FragData[0] = vec4(outColor.rgb, 0.0); gl_FragData[1] = vec4(outColor.rgb*0.2, 0.2); - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index 5b33ea5bfe..258acee08c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -14,6 +14,5 @@ void main() vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = vec4(0,0,0,0); - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 361ae8dc84..d21575119d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -115,7 +115,7 @@ void main() vec4 fb = texture2D(screenTex, distort2); //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug + // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); float shadow = 1.0; @@ -131,11 +131,11 @@ void main() //color.rgb = scaleSoftClip(color.rgb); //color.a = spec * sunAngle2; - //wavef.z *= 0.1f; - //wavef = normalize(wavef); - vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; + //wavef.z = -0.25f; + wavef = normalize(wavef); + wavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse - gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace + gl_FragData[0] = vec4(color.rgb, 0.75); + gl_FragData[1] = vec4(1,1,1, 0.8); + gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index da49e59b89..3e8fdfb3e4 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -12,8 +12,7 @@ float calcDirectionalLight(vec3 n, vec3 l) return a; } - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) { //get light vector vec3 lv = lp.xyz-v; @@ -27,13 +26,9 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa //distance attenuation float da = clamp(1.0/(la * d), 0.0, 1.0); - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - //angular attenuation da *= calcDirectionalLight(n, lv); - + return da; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 665fe16b43..ad16de6d81 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -29,6 +29,8 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; +uniform float alpha_soften; + uniform float shadow_bias; uniform mat4 inv_proj; @@ -113,6 +115,15 @@ void main() color.rgb = scaleSoftClip(color.rgb); + if (samp_pos.z != 0.0 && gl_Color.a < 1.0) + { + float dist_factor = alpha_soften; + float a = gl_Color.a; + a *= a; + dist_factor *= 1.0/(1.0-a); + color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); + } + //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 1fae8c4da3..5991e1f3b5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -42,21 +42,23 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col; + col.a = gl_Color.a; + + // Add windlight lights + col.rgb = atmosAmbient(vec3(0.)); + col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); - vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index f8dd1b7431..a939499b17 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -53,22 +53,23 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col; + col.a = gl_Color.a; + + // Add windlight lights + col.rgb = atmosAmbient(vec3(0.)); + col.rgb = scaleUpLight(col.rgb); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl index d1c5d7cb19..0fad5b4b50 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl @@ -37,8 +37,7 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; vec3 pos = getPosition(vary_fragcoord.xy).xyz; vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index e32e9f4b32..02beddd43b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -31,8 +31,7 @@ float getDepth(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; float depth = getDepth(vary_fragcoord.xy); vec2 tc = vary_fragcoord.xy; @@ -47,12 +46,8 @@ void main() de = step(depth_cutoff, de); vec2 ne; - vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb; - nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm - ne.x = dot(nexnorm, norm); - vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb; - neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm - ne.y = dot(neynorm, norm); + ne.x = dot(texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb*2.0-1.0, norm); + ne.y = dot(texture2DRect(normalMap, tc+vec2(sc,sc)).rgb*2.0-1.0, norm); ne = 1.0-ne; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 22ffb58c63..651959413c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -43,52 +43,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -129,8 +83,7 @@ void main() shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -173,7 +126,7 @@ void main() float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; @@ -184,7 +137,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); + vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_ambient_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; @@ -214,23 +167,22 @@ void main() if (stc.z > 0.0) { stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; } } } } + //attenuate point light contribution by SSAO component + col *= texture2DRect(lightMap, frag.xy).g; + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index fd6ae2b960..531f7376a3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -11,7 +11,6 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; -uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; @@ -42,6 +41,7 @@ uniform vec3 env_mat[3]; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; +uniform sampler2DRect depthMap; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -55,8 +55,9 @@ vec3 vary_AmblitColor; vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; -vec4 getPosition_d(vec2 pos_screen, float depth) -{ +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -67,12 +68,6 @@ vec4 getPosition_d(vec2 pos_screen, float depth) return pos; } -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; - return getPosition_d(pos_screen, depth); -} - vec3 getPositionEye() { return vary_PositionEye; @@ -256,10 +251,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - float depth = texture2DRect(depthMap, tc.xy).a; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 pos = getPosition(tc).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -278,67 +271,24 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) // specular reflection + if (spec.a > 0.0) { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; - - /* - // screen-space cheap fakey reflection map - // - vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); - depth -= 0.5; // unbias depth - // first figure out where we'll make our 2D guess from - vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; - // Offset the guess source a little according to a trivial - // checkerboard dither function and spec.a. - // This is meant to be similar to sampling a blurred version - // of the diffuse map. LOD would be better in that regard. - // The goal of the blur is to soften reflections in surfaces - // with low shinyness, and also to disguise our lameness. - float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); - ref2d += vec2(checkoffset, checkoffset); - ref2d += tc.xy; // use as offset from destination - // Get attributes from the 2D guess point. - // We average two samples of diffuse (not of anything else) per - // pixel to try to reduce aliasing some more. - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + - texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); - float refdepth = texture2DRect(depthMap, ref2d).a; - vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - float refshad = texture2DRect(lightMap, ref2d).r; - vec3 refn = texture2DRect(normalMap, ref2d).rgb; - refn = vec3((refn.xy-0.5)*2.0,refn.z); // unpack norm - refn = normalize(refn); - // figure out how appropriate our guess actually was - float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); - // darken reflections from points which face away from the reflected ray - our guess was a back-face - //refapprop *= step(dot(refnorm, refn), 0.0); - refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point - // reflect light direction to increase the illusion that - // these are reflections. - vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); - // apply sun color to guess-point, dampen according to inappropriateness of guess - float refmod = min(refapprop, reflit); - vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; - vec3 ssshiny = (refprod * spec.a); - ssshiny *= 0.3; // dampen it even more - */ - vec3 ssshiny = vec3(0,0,0); - - // add the two types of shiny together - col += (ssshiny + dumbshiny) * spec.rgb; + vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(ref, vary_light.xyz); + col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); col = scaleSoftClip(col); gl_FragColor.rgb = col; + + //gl_FragColor.rgb = gi_col.rgb; gl_FragColor.a = 0.0; + + //gl_FragColor.rg = scol_ambocc.rg; + //gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb; + //gl_FragColor.rgb = norm.rgb*0.5+0.5; + //gl_FragColor.rgb = vec3(ambocc); + //gl_FragColor.rgb = vec3(scol); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 8a90199b7c..d6534083cf 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -82,8 +82,7 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -180,6 +179,21 @@ void main() } } + /*if (spec.a > 0.0) + { + //vec3 ref = reflect(normalize(pos), norm); + float sa = dot(normalize(lv-normalize(pos)),norm);; + //sa = max(sa, 0.0); + //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa *= noise; + col += da*sa*lcol*spec.rgb; + }*/ + + //attenuate point light contribution by SSAO component + col *= texture2DRect(lightMap, frag.xy).g; + + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 7423347346..a0026edcd2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -7,8 +7,6 @@ #extension GL_ARB_texture_rectangle : enable -//class 2, shadows, no SSAO - uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRectShadow shadowMap0; @@ -41,9 +39,6 @@ uniform vec2 proj_shadow_res; uniform float shadow_bias; uniform float shadow_offset; -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -57,6 +52,56 @@ vec4 getPosition(vec2 pos_screen) return pos; } +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + return (1.0 - (float(points != 0) * angle_hidden)); +} + float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; @@ -78,7 +123,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; + stc.z += shadow_bias*scl; float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -89,7 +134,8 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - + + return shadow/5.0; //return shadow; @@ -103,10 +149,7 @@ void main() vec4 pos = getPosition(pos_screen); - vec4 nmap4 = texture2DRect(normalMap, pos_screen); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; + vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { @@ -115,12 +158,9 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); + vec4 spos = vec4(pos.xyz + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { @@ -180,17 +220,15 @@ void main() } gl_FragColor[0] = shadow; - gl_FragColor[1] = 1.0; - - spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.1).x; //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.1).x; //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl deleted file mode 100644 index 4e33a1af45..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ /dev/null @@ -1,257 +0,0 @@ -/** - * @file sunLightSSAOF.glsl - * - * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. - * $License$ - */ - -#extension GL_ARB_texture_rectangle : enable - -//class 2 -- shadows and SSAO - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DShadow shadowMap4; -uniform sampler2DShadow shadowMap5; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; -uniform vec2 shadow_res; -uniform vec2 proj_shadow_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - float ret = 1.0; - - float dist = dot(pos.xyz,pos.xyz); - - if (dist < 64.0*64.0) - { - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); - } - - return min(ret, 1.0); -} - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - vec2 off = 1.5/proj_shadow_res; - - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - - - return shadow/5.0; - - //return shadow; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - - //try doing an unproject here - - vec4 pos = getPosition(pos_screen); - - vec4 nmap4 = texture2DRect(normalMap, pos_screen); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - - /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL - { - gl_FragColor = vec4(0.0); // doesn't matter - return; - }*/ - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); - - if (spos.z > -shadow_clip.w) - { - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 0.25); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 0.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 0.75); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.0); - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - //lpos.xy /= lpos.w*32.0; - //if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) - //{ - // shadow = 0.0; - //} - - } - } - else - { - // more distant than the shadow map covers - shadow = 1.0; - } - - gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - - spos.xyz = shadow_pos+offset*spot_shadow_offset; - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); - - //gl_FragColor.rgb = pos.xyz; - //gl_FragColor.b = shadow; -} diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index 19800d96dc..f4c59734a4 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -18,10 +18,9 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl index 66606233cd..7325825d6d 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl @@ -44,8 +44,7 @@ float getDepth(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; float depth = getDepth(vary_fragcoord.xy); vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; @@ -57,10 +56,9 @@ void main() for (int i = 0; i < kern_length; i++) { vec2 tc = vary_fragcoord.xy + kern[i].y*dlt; - vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz; - sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm - - float d = dot(norm.xyz, sampNorm); + vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz*2.0-1.0; + + float d = dot(norm.xyz, sampNorm); if (d > 0.5) { diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl index 1b8354dbd1..939710cb56 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl @@ -178,8 +178,7 @@ void main() float rad = gi_range*0.5; - vec3 norm = texture2DRect(normalMap, pos_screen).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; float dist = max(length(pos.xyz)-rad, 0.0); float da = clamp(1.0-dist/rad, 0.0, 1.0); diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index c88edd0a60..96a083b522 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -56,8 +56,9 @@ vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; uniform float gi_ambiance; -vec4 getPosition_d(vec2 pos_screen, float depth) -{ +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -68,12 +69,6 @@ vec4 getPosition_d(vec2 pos_screen, float depth) return pos; } -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; - return getPosition_d(pos_screen, depth); -} - vec3 getPositionEye() { return vary_PositionEye; @@ -257,10 +252,8 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - float depth = texture2DRect(depthMap, tc.xy).a; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 pos = getPosition(tc).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -281,63 +274,11 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) // specular reflection + if (spec.a > 0.0) { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; - - /* - // screen-space cheap fakey reflection map - // - vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); - depth -= 0.5; // unbias depth - // first figure out where we'll make our 2D guess from - vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; - // Offset the guess source a little according to a trivial - // checkerboard dither function and spec.a. - // This is meant to be similar to sampling a blurred version - // of the diffuse map. LOD would be better in that regard. - // The goal of the blur is to soften reflections in surfaces - // with low shinyness, and also to disguise our lameness. - float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 - float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); - - ref2d += vec2(checkoffset, checkoffset); - ref2d += tc.xy; // use as offset from destination - // Get attributes from the 2D guess point. - // We average two samples of diffuse (not of anything else) per - // pixel to try to reduce aliasing some more. - vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + - texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); - float refdepth = texture2DRect(depthMap, ref2d).a; - vec3 refpos = getPosition_d(ref2d, refdepth).xyz; - float refshad = texture2DRect(lightMap, ref2d).r; - vec3 refn = texture2DRect(normalMap, ref2d).rgb; - refn = vec3((refn.xy-0.5)*2.0,refn.z); // unpack norm - refn = normalize(refn); - // figure out how appropriate our guess actually was - float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); - // darken reflections from points which face away from the reflected ray - our guess was a back-face - //refapprop *= step(dot(refnorm, refn), 0.0); - refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant - // get appropriate light strength for guess-point. - // reflect light direction to increase the illusion that - // these are reflections. - vec3 reflight = reflect(lightnorm.xyz, norm.xyz); - float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); - // apply sun color to guess-point, dampen according to inappropriateness of guess - float refmod = min(refapprop, reflit); - vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; - vec3 ssshiny = (refprod * spec.a); - ssshiny *= 0.3; // dampen it even more - */ - vec3 ssshiny = vec3(0,0,0); - - // add the two types of shiny together - col += (ssshiny + dumbshiny) * spec.rgb; + vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(ref, vary_light.xyz); + col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl index 5b33ea5bfe..258acee08c 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl @@ -14,6 +14,5 @@ void main() vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = vec4(0,0,0,0); - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index f129a1517b..1c5234c450 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); +float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -15,21 +15,24 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col = vec4(0.0, 0.0, 0.0, color.a); + vec4 col; + col.a = color.a; + // Add windlight lights + col.rgb = atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAmbient(baseLight.rgb); + col.rgb = scaleUpLight(col.rgb); + // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - - // Add windlight lights - col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); - col.rgb += atmosAmbient(baseLight.rgb); + col.rgb = min(col.rgb*color.rgb, 1.0); diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index f741089ca2..f16ec6c30f 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -12,12 +12,14 @@ + + - + @@ -29,14 +31,9 @@ + + - - - - - - - diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 9440e877df..ccdb109d95 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -23,7 +23,7 @@ version 22 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 1 +RenderAnisotropic 1 0 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 @@ -36,16 +36,18 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 +RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 4 +RenderReflectionDetail 1 3 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 +RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -56,12 +58,10 @@ Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderShaderLightingMaxLevel 1 3 SkyUseClassicClouds 1 1 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 WatchdogDisabled 1 1 RenderUseStreamVBO 1 1 + // // Low Graphics Settings // @@ -74,6 +74,7 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 +RenderLightingDetail 1 0 RenderMaxPartCount 1 0 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -82,14 +83,11 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0 +RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // Mid Graphics Settings @@ -102,6 +100,7 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 +RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -110,13 +109,10 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 +RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // High Graphics Settings (purty) @@ -129,6 +125,7 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 +RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -137,13 +134,10 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 +RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // Ultra graphics (REALLY PURTY!) @@ -156,20 +150,19 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 +RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 4 +RenderReflectionDetail 1 3 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 +RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 // // Class Unknown Hardware (unknown) @@ -207,12 +200,9 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -220,30 +210,24 @@ RenderShadowDetail 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 -// // "Default" setups for safe, low, medium, high // list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 +RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 // // CPU based feature masks @@ -267,9 +251,11 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 +RenderLightingDetail 1 0 list GeForce2 RenderAnisotropic 1 0 +RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 85b8564138..45de51f3cf 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -23,7 +23,7 @@ version 21 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 1 +RenderAnisotropic 1 0 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 @@ -36,16 +36,18 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 +RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 4 +RenderReflectionDetail 1 3 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 +RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -55,10 +57,6 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 SkyUseClassicClouds 1 1 -RenderShaderLightingMaxLevel 1 3 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 WatchdogDisabled 1 1 // @@ -73,6 +71,7 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 +RenderLightingDetail 1 0 RenderMaxPartCount 1 0 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -81,14 +80,11 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0 +RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // Mid Graphics Settings @@ -101,6 +97,7 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 +RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -109,13 +106,10 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 +RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // High Graphics Settings (purty) @@ -128,6 +122,7 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 +RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -136,13 +131,10 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 +RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // Ultra graphics (REALLY PURTY!) @@ -155,21 +147,19 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 +RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 4 +RenderReflectionDetail 1 3 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 +RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 - // // Class Unknown Hardware (unknown) @@ -207,12 +197,9 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -220,13 +207,9 @@ RenderShadowDetail 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 - // "Default" setups for safe, low, medium, high // @@ -234,17 +217,14 @@ list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 +RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderReflectionDetail 0 0 +RenderWaterReflections 0 0 WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderShadowDetail 0 0 - // // CPU based feature masks @@ -268,11 +248,13 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 +RenderLightingDetail 1 0 // Avoid some Intel crashes on Linux RenderCubeMap 0 0 list GeForce2 RenderAnisotropic 1 0 +RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 @@ -484,47 +466,17 @@ list NVIDIA_GeForce_Go_6 RenderVBOEnable 1 0 Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_7000 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7100 -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7200 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7300 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7400 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7500 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7600 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7700 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7800 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7900 -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7200 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7300 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7300_LE -RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7400 Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7600 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7700 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7800 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7900 -RenderShaderLightingMaxLevel 1 2 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 2095f3a81d..e89b0cc49d 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -371,7 +371,6 @@ list ATI_Radeon_X1500 Disregard128DefaultDrawDistance 1 0 list ATI_Radeon_X1600 Disregard128DefaultDrawDistance 1 0 -RenderUseFBO 0 0 list ATI_Radeon_X1700 Disregard128DefaultDrawDistance 1 0 list ATI_Mobility_Radeon_X1xxx diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 37cd289b1b..42b78a84af 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1779,8 +1779,6 @@ void LLAgent::endAnimationUpdateUI() } gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); - - LLFloaterCamera::onAvatarEditingAppearance(false); } //--------------------------------------------------------------------- @@ -1887,8 +1885,6 @@ void LLAgent::endAnimationUpdateUI() { mPauseRequest = gAgentAvatarp->requestPause(); } - - LLFloaterCamera::onAvatarEditingAppearance(true); } if (isAgentAvatarValid()) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 68e408d3e4..6c050a1309 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1143,9 +1143,10 @@ void LLAgentCamera::updateCamera() static LLFastTimer::DeclareTimer ftm("Camera"); LLFastTimer t(ftm); - // - changed camera_skyward to the new global "mCameraUpVector" + //Ventrella - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); + //end Ventrella U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; @@ -1155,8 +1156,10 @@ void LLAgentCamera::updateCamera() gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { + //Ventrella //changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); + //end Ventrella } if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) @@ -1164,11 +1167,13 @@ void LLAgentCamera::updateCamera() changeCameraToFollow(); } + //Ventrella //NOTE - this needs to be integrated into a general upVector system here within llAgent. if ( camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar ) { mCameraUpVector = mFollowCam.getUpVector(); } + //end Ventrella if (mSitCameraEnabled) { @@ -1245,6 +1250,7 @@ void LLAgentCamera::updateCamera() // lerp camera focus offset mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); + //Ventrella if ( mCameraMode == CAMERA_MODE_FOLLOW ) { if (isAgentAvatarValid()) @@ -1271,6 +1277,7 @@ void LLAgentCamera::updateCamera() } } } + // end Ventrella BOOL hit_limit; LLVector3d camera_pos_global; @@ -1401,8 +1408,10 @@ void LLAgentCamera::updateCamera() // Move the camera + //Ventrella LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); + //end Ventrella // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1517,11 +1526,12 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() clearFocusObject(); } + // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedFocus()); return mFocusTargetGlobal; - } + }// End Ventrella else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { LLVector3d at_axis(1.0, 0.0, 0.0); @@ -1690,10 +1700,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3d camera_position_global; + // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { camera_position_global = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedPosition()); - } + }// End Ventrella else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) @@ -2113,6 +2124,7 @@ void LLAgentCamera::changeCameraToDefault() } +// Ventrella //----------------------------------------------------------------------------- // changeCameraToFollow() //----------------------------------------------------------------------------- diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 4c2caae2c6..a1ce556458 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -382,9 +382,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 const std::string new_name) { LLWearable* old_wearable = getWearable(type, index); - if(!old_wearable) return; - bool name_changed = !new_name.empty() && (new_name != old_wearable->getName()); - if (name_changed || old_wearable->isDirty() || old_wearable->isOldVersion()) + if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion())) { LLUUID old_item_id = old_wearable->getItemID(); LLWearable* new_wearable = LLWearableList::instance().createCopy(old_wearable); @@ -400,10 +398,12 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 if (item) { std::string item_name = item->getName(); - if (name_changed) + bool name_changed = false; + if (!new_name.empty() && (new_name != item->getName())) { llinfos << "saveWearable changing name from " << item->getName() << " to " << new_name << llendl; item_name = new_name; + name_changed = true; } // Update existing inventory item LLPointer template_item = @@ -1750,7 +1750,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj LLViewerObject *objectp = (*attachment_iter); if (objectp) { - LLUUID object_item_id = objectp->getAttachmentItemID(); + LLUUID object_item_id = objectp->getItemID(); if (requested_item_ids.find(object_item_id) != requested_item_ids.end()) { // Object currently worn, was requested. @@ -1879,7 +1879,10 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point + if (gSavedSettings.getBOOL("MultipleAttachments")) + msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD ); + else + msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); msg->addStringFast(_PREHASH_Description, item->getDescription()); diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index f7ae320a6f..9e15f24bea 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -209,7 +209,7 @@ void LLInitialWearablesFetch::processWearablesMessage() { LLViewerObject* attached_object = (*attachment_iter); if (!attached_object) continue; - const LLUUID& item_id = attached_object->getAttachmentItemID(); + const LLUUID& item_id = attached_object->getItemID(); if (item_id.isNull()) continue; ids.push_back(item_id); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 94286fd799..04a5bcc256 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1006,7 +1006,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up addCOFItemLink(item_to_wear, do_update, cb); break; case LLAssetType::AT_OBJECT: - rez_attachment(item_to_wear, NULL, replace); + rez_attachment(item_to_wear, NULL); break; default: return false;; } @@ -1299,8 +1299,16 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) return false; } - // Check whether the outfit contains the full set of body parts (shape+skin+hair+eyes). - return getCanMakeFolderIntoOutfit(outfit_cat_id); + // Check whether the outfit contains any non-worn wearables. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); + gInventory.collectDescendentsIf(outfit_cat_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + not_worn); + return items.size() > 0; } void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) @@ -1594,56 +1602,46 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, } } -S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, - LLAssetType::EType type, - S32 max_items, - LLInventoryModel::item_array_t& items_to_kill) +void LLAppearanceMgr::enforceItemCountLimits() { - S32 to_kill_count = 0; - - LLInventoryModel::item_array_t items; - getDescendentsOfAssetType(cat_id, items, type, false); - LLInventoryModel::item_array_t curr_items = items; - removeDuplicateItems(items); - if (max_items > 0) + S32 purge_count = 0; + + LLInventoryModel::item_array_t body_items; + getDescendentsOfAssetType(getCOF(), body_items, LLAssetType::AT_BODYPART, false); + LLInventoryModel::item_array_t curr_body_items = body_items; + removeDuplicateItems(body_items); + filterWearableItems(body_items, 1); + LLInventoryModel::item_array_t kill_body_items; + item_array_diff(curr_body_items,body_items,kill_body_items); + for (LLInventoryModel::item_array_t::iterator it = kill_body_items.begin(); + it != kill_body_items.end(); + ++it) { - filterWearableItems(items, max_items); + LLViewerInventoryItem *item = *it; + llinfos << "purging dup body part " << item->getName() << llendl; + gInventory.purgeObject(item->getUUID()); + purge_count++; } - LLInventoryModel::item_array_t kill_items; - item_array_diff(curr_items,items,kill_items); - for (LLInventoryModel::item_array_t::iterator it = kill_items.begin(); - it != kill_items.end(); + + LLInventoryModel::item_array_t wear_items; + getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false); + LLInventoryModel::item_array_t curr_wear_items = wear_items; + removeDuplicateItems(wear_items); + filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); + LLInventoryModel::item_array_t kill_wear_items; + item_array_diff(curr_wear_items,wear_items,kill_wear_items); + for (LLInventoryModel::item_array_t::iterator it = kill_wear_items.begin(); + it != kill_wear_items.end(); ++it) { - items_to_kill.push_back(*it); - to_kill_count++; + LLViewerInventoryItem *item = *it; + llinfos << "purging excess clothing item " << item->getName() << llendl; + gInventory.purgeObject(item->getUUID()); + purge_count++; } - return to_kill_count; -} - - -void LLAppearanceMgr::enforceItemRestrictions() -{ - S32 purge_count = 0; - LLInventoryModel::item_array_t items_to_kill; - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_BODYPART, - 1, items_to_kill); - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_CLOTHING, - LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill); - purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_OBJECT, - -1, items_to_kill); - - if (items_to_kill.size()>0) + if (purge_count>0) { - for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); - it != items_to_kill.end(); - ++it) - { - LLViewerInventoryItem *item = *it; - llinfos << "purging duplicate or excess item " << item->getName() << llendl; - gInventory.purgeObject(item->getUUID()); - } gInventory.notifyObservers(); } } @@ -1666,7 +1664,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but // this should catch anything that gets through. - enforceItemRestrictions(); + enforceItemCountLimits(); // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link @@ -1832,9 +1830,9 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool llinfos << "wearInventoryCategory( " << category->getName() << " )" << llendl; - callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, - &LLAppearanceMgr::instance(), - category->getUUID(), copy, append)); + callAfterCategoryFetch(category->getUUID(), boost::bind(&LLAppearanceMgr::wearCategoryFinal, + &LLAppearanceMgr::instance(), + category->getUUID(), copy, append)); } void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) @@ -2500,17 +2498,29 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) switch (item_to_remove->getType()) { - case LLAssetType::AT_CLOTHING: - if (get_is_item_worn(id_to_remove)) + case LLAssetType::AT_CLOTHING: + if (get_is_item_worn(id_to_remove)) + { + //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future + LLWearableBridge::removeItemFromAvatar(item_to_remove); + } + break; + case LLAssetType::AT_OBJECT: + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_to_remove->getLinkedUUID()); + gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); + + { + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject(item_to_remove->getLinkedUUID()); + if (found_obj) { - //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future - LLWearableBridge::removeItemFromAvatar(item_to_remove); - } - break; - case LLAssetType::AT_OBJECT: - LLVOAvatarSelf::detachAttachmentIntoInventory(item_to_remove->getLinkedUUID()); - default: - break; + LLSelectMgr::getInstance()->remove(found_obj); + }; + } + default: break; } // *HACK: Force to remove garbage from COF. @@ -2650,6 +2660,7 @@ void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val) mAttachmentInvLinkEnabled = val; } +// BAP TODO - mRegisteredAttachments is currently maintained but not used for anything. Consider yanking. void dumpAttachmentSet(const std::set& atts, const std::string& msg) { llinfos << msg << llendl; @@ -2669,6 +2680,7 @@ void dumpAttachmentSet(const std::set& atts, const std::string& msg) void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) { + mRegisteredAttachments.insert(item_id); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); if (mAttachmentInvLinkEnabled) @@ -2686,6 +2698,7 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) { + mRegisteredAttachments.erase(item_id); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); if (mAttachmentInvLinkEnabled) @@ -2698,6 +2711,18 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) } } +void LLAppearanceMgr::linkRegisteredAttachments() +{ + for (std::set::iterator it = mRegisteredAttachments.begin(); + it != mRegisteredAttachments.end(); + ++it) + { + LLUUID item_id = *it; + addCOFItemLink(item_id, false); + } + mRegisteredAttachments.clear(); +} + BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const { return gInventory.isObjectDescendentOf(obj_id, getCOF()); @@ -2710,8 +2735,8 @@ bool LLAppearanceMgr::isLinkInCOF(const LLUUID& obj_id) LLInventoryModel::item_array_t items; LLLinkedItemIDMatches find_links(gInventory.getLinkedItemID(obj_id)); gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), - cats, - items, + cats, + items, LLInventoryModel::EXCLUDE_TRASH, find_links); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 78c2142ea5..e7442537d2 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -60,11 +60,7 @@ public: void renameOutfit(const LLUUID& outfit_id); void takeOffOutfit(const LLUUID& cat_id); void addCategoryToCurrentOutfit(const LLUUID& cat_id); - S32 findExcessOrDuplicateItems(const LLUUID& cat_id, - LLAssetType::EType type, - S32 max_items, - LLInventoryModel::item_array_t& items_to_kill); - void enforceItemRestrictions(); + void enforceItemCountLimits(); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, @@ -117,6 +113,7 @@ public: void unregisterAttachment(const LLUUID& item_id); void registerAttachment(const LLUUID& item_id); void setAttachmentInvLinkEnable(bool val); + void linkRegisteredAttachments(); // utility function for bulk linking. void linkAll(const LLUUID& category, @@ -203,6 +200,7 @@ private: void setOutfitLocked(bool locked); + std::set mRegisteredAttachments; bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bfe3e52657..7f4ba2f2d2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -955,11 +955,6 @@ static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); -static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares"); -static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service"); -static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); -static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); -static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); bool LLAppViewer::mainLoop() { @@ -1069,20 +1064,10 @@ bool LLAppViewer::mainLoop() LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP); pingMainloopTimeout("Main:ServicePump"); LLFastTimer t4(FTM_PUMP); - { - LLFastTimer t(FTM_PUMP_ARES); - gAres->process(); - } - { - LLFastTimer t(FTM_PUMP_SERVICE); - // this pump is necessary to make the login screen show up - gServicePump->pump(); - - { - LLFastTimer t(FTM_SERVICE_CALLBACK); - gServicePump->callback(); - } - } + gAres->process(); + // this pump is necessary to make the login screen show up + gServicePump->pump(); + gServicePump->callback(); } resumeMainloopTimeout(); @@ -1117,7 +1102,8 @@ bool LLAppViewer::mainLoop() { LLMemType mt_sleep(LLMemType::MTYPE_SLEEP); LLFastTimer t2(FTM_SLEEP); - + bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); + // yield some time to the os based on command line option if(mYieldTime >= 0) { @@ -1155,7 +1141,9 @@ bool LLAppViewer::mainLoop() } static const F64 FRAME_SLOW_THRESHOLD = 0.5; //2 frames per seconds - const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second + const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps + const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms + const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second idleTimer.reset(); bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ; S32 total_work_pending = 0; @@ -1193,24 +1181,34 @@ bool LLAppViewer::mainLoop() total_work_pending += work_pending ; total_io_pending += io_pending ; - - if (!work_pending || idleTimer.getElapsedTimeF64() >= max_idle_time) + F64 frame_time = frameTimer.getElapsedTimeF64(); + F64 idle_time = idleTimer.getElapsedTimeF64(); + if (frame_time >= min_frame_time && + idle_time >= min_idle_time && + (!work_pending || idle_time >= max_idle_time)) { break; } } - if(!total_work_pending) //pause texture fetching threads if nothing to process. + // Prevent the worker threads from running while rendering. + // if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client... + if (run_multiple_threads == FALSE) { - LLAppViewer::getTextureCache()->pause(); - LLAppViewer::getImageDecodeThread()->pause(); - LLAppViewer::getTextureFetch()->pause(); - } - if(!total_io_pending) //pause file threads if nothing to process. - { - LLVFSThread::sLocal->pause(); - LLLFSThread::sLocal->pause(); - } + //LLFastTimer ftm(FTM_PAUSE_THREADS); //not necessary. + + if(!total_work_pending) //pause texture fetching threads if nothing to process. + { + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + LLAppViewer::getTextureFetch()->pause(); + } + if(!total_io_pending) //pause file threads if nothing to process. + { + LLVFSThread::sLocal->pause(); + LLLFSThread::sLocal->pause(); + } + } if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) @@ -3562,12 +3560,9 @@ void LLAppViewer::idle() gAgent.moveYaw(-1.f); } - { - LLFastTimer t(FTM_AGENT_AUTOPILOT); - // Handle automatic walking towards points - gAgentPilot.updateTarget(); - gAgent.autoPilot(&yaw); - } + // Handle automatic walking towards points + gAgentPilot.updateTarget(); + gAgent.autoPilot(&yaw); static LLFrameTimer agent_update_timer; static U32 last_control_flags; @@ -3578,7 +3573,6 @@ void LLAppViewer::idle() if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { - LLFastTimer t(FTM_AGENT_UPDATE); // Send avatar and camera info last_control_flags = gAgent.getControlFlags(); send_agent_update(TRUE); diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 1cd705c2f9..76ad9b4afb 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -378,7 +378,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->setShowProfileBtn(mShowProfileBtn); item->showSpeakingIndicator(mShowSpeakingIndicator); - item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoubleClicked, this, _1, _2, _3, _4)); + item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoucleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); } @@ -441,7 +441,7 @@ void LLAvatarList::updateLastInteractionTimes() } } -void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +void LLAvatarList::onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { mItemDoubleClickSignal(ctrl, x, y, mask); } diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 83faa53c28..84800842e9 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -104,7 +104,7 @@ protected: uuid_vec_t& vadded, uuid_vec_t& vremoved); void updateLastInteractionTimes(); - void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); + void onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); private: diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 341913edf7..706f20404d 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -121,7 +121,7 @@ S32 LLAvatarListItem::notifyParent(const LLSD& info) void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( true); + childSetVisible("hovered_icon", true); mInfoBtn->setVisible(mShowInfoBtn); mProfileBtn->setVisible(mShowProfileBtn); @@ -132,7 +132,7 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( false); + childSetVisible("hovered_icon", false); mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); @@ -309,7 +309,7 @@ void LLAvatarListItem::setValue( const LLSD& value ) { if (!value.isMap()) return;; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); } const LLUUID& LLAvatarListItem::getAvatarId() const diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 6ee4387236..c4177a420b 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -53,7 +53,7 @@ static void update_build_button_enable_state() { bool can_edit = LLToolMgr::getInstance()->canEdit(); - LLBottomTray::getInstance()->getChildView("build_btn")->setEnabled(can_edit); + LLBottomTray::getInstance()->childSetEnabled("build_btn", can_edit); } // Build time optimization, generate extern template once in .cpp file diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c78f73c3b8..f0e231e3d7 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -290,7 +290,7 @@ void LLCallFloater::updateSession() // Hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - getChildView("leave_call_btn_panel")->setVisible( !is_local_chat); + childSetVisible("leave_call_btn_panel", !is_local_chat); refreshParticipantList(); updateAgentModeratorState(); @@ -413,11 +413,11 @@ void LLCallFloater::initAgentData() if ( mAgentPanel ) { - mAgentPanel->getChild("user_icon")->setValue(gAgentID); + mAgentPanel->childSetValue("user_icon", gAgentID); std::string name; gCacheName->getFullName(gAgentID, name); - mAgentPanel->getChild("user_text")->setValue(name); + mAgentPanel->childSetValue("user_text", name); mSpeakingIndicator = mAgentPanel->getChild("speaking_indicator"); mSpeakingIndicator->setSpeakerId(gAgentID); @@ -455,7 +455,7 @@ void LLCallFloater::updateAgentModeratorState() } } } - mAgentPanel->getChild("user_text")->setValue(name); + mAgentPanel->childSetValue("user_text", name); } static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids) @@ -760,7 +760,7 @@ void LLCallFloater::reset(const LLVoiceChannel::EState& new_state) { // hides "Leave Call" when call is ended in parcel with disabled voice- hiding usually happens in // updateSession() which won't be called here because connect to nearby voice never happens - getChildView("leave_call_btn_panel")->setVisible( false); + childSetVisible("leave_call_btn_panel", false); // setting title to nearby chat an "no one near..." text- because in region with disabled // voice we won't have chance to really connect to nearby, so VCP is changed here manually setTitle(getString("title_nearby")); diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 967db21244..577b26a211 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -185,7 +185,7 @@ void LLChatBar::refresh() gAgent.stopTyping(); } - getChildView("Say")->setEnabled(mInputEditor->getText().size() > 0); + childSetEnabled("Say", mInputEditor->getText().size() > 0); } @@ -387,7 +387,7 @@ void LLChatBar::sendChat( EChatType type ) } } - getChild("Chat Editor")->setValue(LLStringUtil::null); + childSetValue("Chat Editor", LLStringUtil::null); gAgent.stopTyping(); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 1f67a659bd..0fdef20f4a 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -693,9 +693,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL { LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(link_params.link_href, false, style_params); - mEditor->appendText(delimiter, false, style_params); + // Convert the name to a hotlink and add to message. + mEditor->appendText(chat.mFromName + delimiter, false, link_params); } else { diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 194d461f94..04623c03be 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -514,10 +514,10 @@ LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventory //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); - item_panel->childSetAction("btn_move_up", boost::bind(mCOFCallbacks.mMoveWearableFurther)); - item_panel->childSetAction("btn_move_down", boost::bind(mCOFCallbacks.mMoveWearableCloser)); - item_panel->childSetAction("btn_edit", boost::bind(mCOFCallbacks.mEditWearable)); + item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); + item_panel->childSetAction("btn_move_up", mCOFCallbacks.mMoveWearableFurther); + item_panel->childSetAction("btn_move_down", mCOFCallbacks.mMoveWearableCloser); + item_panel->childSetAction("btn_edit", mCOFCallbacks.mEditWearable); //turning on gray separator line for the last item in the items group of the same wearable type item_panel->setSeparatorVisible(last); @@ -543,8 +543,8 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); - item_panel->childSetAction("btn_edit", boost::bind(mCOFCallbacks.mEditWearable)); + item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); + item_panel->childSetAction("btn_edit", mCOFCallbacks.mEditWearable); return item_panel; } @@ -559,7 +559,7 @@ LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLView //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); + item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); return item_panel; } @@ -605,7 +605,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by LLWearableType::EType w_type = static_cast(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; - item_panel->childSetAction("btn_add", boost::bind(mCOFCallbacks.mAddWearable)); + item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable); mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); } } @@ -657,20 +657,20 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() { const LLAccordionCtrlTab* expanded_tab = mAccordionCtrl->getExpandedTab(); - return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); + return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); } return LLAssetType::AT_NONE; } LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() - { +{ if (mAccordionCtrl != NULL) { const LLAccordionCtrlTab* selected_tab = mAccordionCtrl->getSelectedTab(); - return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); -} + return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); + } return LLAssetType::AT_NONE; } diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index d981fa4196..e426b10810 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -54,7 +54,7 @@ public: LLCOFCallbacks() {}; virtual ~LLCOFCallbacks() {}; - typedef boost::function cof_callback_t; + typedef boost::function cof_callback_t; cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 268d9958d1..117a0bb568 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -100,7 +100,7 @@ LLFloaterScriptQueue::~LLFloaterScriptQueue() BOOL LLFloaterScriptQueue::postBuild() { childSetAction("close",onCloseBtn,this); - getChildView("close")->setEnabled(FALSE); + childSetEnabled("close",FALSE); return TRUE; } @@ -213,7 +213,7 @@ BOOL LLFloaterScriptQueue::nextObject() { mDone = true; getChild("queue output")->setCommentText(getString("Done")); - getChildView("close")->setEnabled(TRUE); + childSetEnabled("close",TRUE); } return successful_start; } diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 654daa770e..adb291ede8 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -406,8 +406,8 @@ void LLCurrencyUIManager::Impl::currencyKey(S32 value) //cannot just simply refresh the whole UI, as the edit field will // get reset and the cursor will change... - mPanel.getChildView("currency_est")->setVisible(FALSE); - mPanel.getChildView("getting_data")->setVisible(TRUE); + mPanel.childHide("currency_est"); + mPanel.childSetVisible("getting_data",TRUE); } mCurrencyChanged = true; @@ -436,13 +436,13 @@ void LLCurrencyUIManager::Impl::updateUI() { if (mHidden) { - mPanel.getChildView("currency_action")->setVisible(FALSE); - mPanel.getChildView("currency_amt")->setVisible(FALSE); - mPanel.getChildView("currency_est")->setVisible(FALSE); + mPanel.childHide("currency_action"); + mPanel.childHide("currency_amt"); + mPanel.childHide("currency_est"); return; } - mPanel.getChildView("currency_action")->setVisible(TRUE); + mPanel.childShow("currency_action"); LLLineEditor* lindenAmount = mPanel.getChild("currency_amt"); if (lindenAmount) @@ -465,17 +465,17 @@ void LLCurrencyUIManager::Impl::updateUI() } } - mPanel.getChild("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate()); - mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0); + mPanel.childSetTextArg("currency_est", "[LOCALAMOUNT]", getLocalEstimate()); + mPanel.childSetVisible("currency_est", hasEstimate() && mUserCurrencyBuy > 0); - mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling); - mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling); + mPanel.childSetVisible("currency_links", mSupportsInternationalBilling); + mPanel.childSetVisible("exchange_rate_note", mSupportsInternationalBilling); - if (mPanel.getChildView("buy_btn")->getEnabled() - ||mPanel.getChildView("currency_est")->getVisible() - || mPanel.getChildView("error_web")->getVisible()) + if (mPanel.childIsEnabled("buy_btn") + ||mPanel.childIsVisible("currency_est") + || mPanel.childIsVisible("error_web")) { - mPanel.getChildView("getting_data")->setVisible(FALSE); + mPanel.childSetVisible("getting_data",FALSE); } } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 583bb54160..0447b06fcc 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -517,7 +517,7 @@ F32 LLDrawable::updateXform(BOOL undamped) { // snap to final position dist_squared = 0.0f; - if (getVOVolume() && !isRoot()) + if (!isRoot()) { //child prim snapping to some position, needs a rebuild gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index cb651f9d3a..6d8344f4e8 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -468,7 +468,6 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) { if (params.mTexture.notNull()) { - params.mTexture->addTextureStats(params.mVSize); gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; if (params.mTextureMatrix) { diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 221f81ec25..4a728bc8a5 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -127,7 +127,6 @@ public: PASS_FULLBRIGHT_SHINY, PASS_SHINY, PASS_BUMP, - PASS_POST_BUMP, PASS_GLOW, PASS_ALPHA, PASS_ALPHA_MASK, diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index a2428d2de0..5d1a0ee9de 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -54,9 +54,7 @@ static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL), - mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), - mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) + simple_shader(NULL), fullbright_shader(NULL) { } @@ -174,16 +172,9 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLSPipelineAlpha gls_pipeline_alpha; - gGL.setColorMask(true, true); - - if (LLPipeline::sAutoMaskAlphaNonDeferred && !deferred_render) + if (LLPipeline::sFastAlpha && !deferred_render) { - mColorSFactor = LLRender::BF_ONE; // } - mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow - mAlphaSFactor = LLRender::BF_ZERO; - mAlphaDFactor = LLRender::BF_ZERO; // block (zero-out) glow where the alpha test succeeds - gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - + LLGLDisable blend_disable(GL_BLEND); gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); if (mVertexShaderLevel > 0) { @@ -207,17 +198,8 @@ void LLDrawPoolAlpha::render(S32 pass) } LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); - - mColorSFactor = LLRender::BF_SOURCE_ALPHA; // } regular alpha blend - mColorDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } - mAlphaSFactor = LLRender::BF_ZERO; // } glow suppression - mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } - gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - renderAlpha(getVertexDataMask()); - gGL.setColorMask(true, false); - if (deferred_render && current_shader != NULL) { gPipeline.unbindDeferredShader(*current_shader); @@ -295,18 +277,9 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; - llassert(group); - llassert(group->mSpatialPartition); - if (group->mSpatialPartition->mRenderByGroup && - !group->isDead()) + !group->isDead()) { - bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. - // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_CLOUD && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; - LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) @@ -315,118 +288,96 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) LLRenderPass::applyModelMatrix(params); + if (params.mFullbright) { - if (params.mFullbright) - { - // Turn off lighting if it hasn't already been so. - if (light_enabled || !initialized_lighting) - { - initialized_lighting = TRUE; - if (use_shaders) - { - target_shader = fullbright_shader; - } - else - { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - } - light_enabled = FALSE; - } - } - // Turn on lighting if it isn't already. - else if (!light_enabled || !initialized_lighting) + // Turn off lighting if it hasn't already been so. + if (light_enabled || !initialized_lighting) { initialized_lighting = TRUE; if (use_shaders) { - target_shader = simple_shader; + target_shader = fullbright_shader; } else { - gPipeline.enableLightsDynamic(); + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } - light_enabled = TRUE; + light_enabled = FALSE; } - - // If we need shaders, and we're not ALREADY using the proper shader, then bind it - // (this way we won't rebind shaders unnecessarily). - if(use_shaders && (current_shader != target_shader)) + } + // Turn on lighting if it isn't already. + else if (!light_enabled || !initialized_lighting) + { + initialized_lighting = TRUE; + if (use_shaders) { - llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } - current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else - { - current_shader->bind(); - } + target_shader = simple_shader; } - else if (!use_shaders && current_shader != NULL) + else { - if (deferred_render) - { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } - LLGLSLShader::bindNoShader(); - current_shader = NULL; + gPipeline.enableLightsDynamic(); } + light_enabled = TRUE; + } - if (params.mGroup) + // If we need shaders, and we're not ALREADY using the proper shader, then bind it + // (this way we won't rebind shaders unnecessarily). + if(use_shaders && (current_shader != target_shader)) + { + llassert(target_shader != NULL); + if (deferred_render && current_shader != NULL) { - params.mGroup->rebuildMesh(); + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; } + current_shader = target_shader; + if (deferred_render) + { + gPipeline.bindDeferredShader(*current_shader); + diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + } + else + { + current_shader->bind(); + } + } + else if (!use_shaders && current_shader != NULL) + { + if (deferred_render) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + LLGLSLShader::bindNoShader(); + current_shader = NULL; + } + + if (params.mGroup) + { + params.mGroup->rebuildMesh(); + } - - if (params.mTexture.notNull()) + + if (params.mTexture.notNull()) + { + gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); + if(params.mTexture.notNull()) { - gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); - if(params.mTexture.notNull()) - { - params.mTexture->addTextureStats(params.mVSize); - } - if (params.mTextureMatrix) - { - gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); - gPipeline.mTextureMatrixOps++; - } + params.mTexture->addTextureStats(params.mVSize); + } + if (params.mTextureMatrix) + { + gGL.getTexUnit(0)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; } } params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - - // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. - if (draw_glow_for_this_partition && - params.mGlowColor.mV[3] > 0) - { - // install glow-accumulating blend mode - gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color - LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) - // glow doesn't use vertex colors from the mesh data - params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR); - glColor4ubv(params.mGlowColor.mV); - - // do the actual drawing, again - params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - - // restore our alpha blend mode - gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - } - if (params.mTextureMatrix && params.mTexture.notNull()) { gGL.getTexUnit(0)->activate(); diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 12a7ae92b1..0477093afa 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -28,7 +28,6 @@ #define LL_LLDRAWPOOLALPHA_H #include "lldrawpool.h" -#include "llrender.h" #include "llframetimer.h" class LLFace; @@ -78,12 +77,6 @@ private: LLGLSLShader* target_shader; LLGLSLShader* simple_shader; LLGLSLShader* fullbright_shader; - - // our 'normal' alpha blend function for this pass - LLRender::eBlendFactor mColorSFactor; - LLRender::eBlendFactor mColorDFactor; - LLRender::eBlendFactor mAlphaSFactor; - LLRender::eBlendFactor mAlphaDFactor; }; class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8cf4dc1b95..600ffa492e 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -117,7 +117,7 @@ void LLDrawPoolAvatar::prerender() if (sShaderLevel > 0) { - sBufferUsage = GL_DYNAMIC_DRAW_ARB; + sBufferUsage = GL_STATIC_DRAW_ARB; } else { @@ -151,8 +151,6 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); - sSkipTransparent = TRUE; - if (LLPipeline::sImpostorRender) { beginDeferredSkinned(); @@ -177,8 +175,6 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); - sSkipTransparent = FALSE; - if (LLPipeline::sImpostorRender) { endDeferredSkinned(); @@ -248,6 +244,7 @@ S32 LLDrawPoolAvatar::getNumShadowPasses() void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); + sVertexProgram = &gDeferredAvatarShadowProgram; if (sShaderLevel > 0) { @@ -269,6 +266,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); + if (sShaderLevel > 0) { sRenderingSkinned = FALSE; @@ -306,11 +304,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } - if (sShaderLevel > 0) - { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } @@ -347,7 +340,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) switch (pass) { case 0: - beginImpostor(); + beginFootShadow(); break; case 1: beginRigid(); @@ -371,7 +364,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) switch (pass) { case 0: - endImpostor(); + endFootShadow(); break; case 1: endRigid(); @@ -381,7 +374,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) } } -void LLDrawPoolAvatar::beginImpostor() +void LLDrawPoolAvatar::beginFootShadow() { if (!LLPipeline::sReflectionRender) { @@ -393,7 +386,7 @@ void LLDrawPoolAvatar::beginImpostor() diffuse_channel = 0; } -void LLDrawPoolAvatar::endImpostor() +void LLDrawPoolAvatar::endFootShadow() { gPipeline.enableLightsDynamic(); } @@ -565,6 +558,7 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginDeferredSkinned() { + sSkipTransparent = TRUE; sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarProgram; @@ -579,6 +573,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned() void LLDrawPoolAvatar::endDeferredSkinned() { + sSkipTransparent = FALSE; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); @@ -692,6 +687,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } avatarp->renderImpostor(LLColor4U(255,255,255,255), diffuse_channel); } + else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS) && !LLPipeline::sRenderDeferred) + { + avatarp->renderFootShadows(); + } return; } @@ -845,7 +844,9 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, - GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets + LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 ? + GL_DYNAMIC_DRAW_ARB : + GL_STREAM_DRAW_ARB) { } diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index c46fed824e..171152b72d 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -82,11 +82,11 @@ public: /*virtual*/ void renderShadow(S32 pass); void beginRigid(); - void beginImpostor(); + void beginFootShadow(); void beginSkinned(); void endRigid(); - void endImpostor(); + void endFootShadow(); void endSkinned(); void beginDeferredImpostor(); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 223e4a438c..7c09826c9d 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -88,16 +88,7 @@ void LLStandardBumpmap::shutdown() // static void LLStandardBumpmap::restoreGL() { - addstandard(); -} - -// static -void LLStandardBumpmap::addstandard() -{ - // can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps. - //llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 ); - clear(); - llinfos << "Adding standard bumpmaps." << llendl; + llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 ); gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("None"); // BE_NO_BUMP gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Brightness"); // BE_BRIGHTNESS gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS @@ -160,9 +151,8 @@ void LLStandardBumpmap::addstandard() } // static -void LLStandardBumpmap::clear() +void LLStandardBumpmap::destroyGL() { - llinfos << "Clearing standard bumpmaps." << llendl; for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ ) { gStandardBumpmapList[i].mLabel.assign(""); @@ -171,12 +161,6 @@ void LLStandardBumpmap::clear() sStandardBumpmapCount = 0; } -// static -void LLStandardBumpmap::destroyGL() -{ - clear(); -} - //////////////////////////////////////////////////////////////// @@ -629,9 +613,9 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel) } //static -void LLDrawPoolBump::beginBump(U32 pass) +void LLDrawPoolBump::beginBump() { - if (!gPipeline.hasRenderBatches(pass)) + if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) { return; } @@ -674,9 +658,9 @@ void LLDrawPoolBump::beginBump(U32 pass) } //static -void LLDrawPoolBump::renderBump(U32 pass) +void LLDrawPoolBump::renderBump() { - if (!gPipeline.hasRenderBatches(pass)) + if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) { return; } @@ -689,13 +673,13 @@ void LLDrawPoolBump::renderBump(U32 pass) /// Get rid of z-fighting with non-bump pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -1.0f); - renderBump(pass, sVertexMask); + renderBump(LLRenderPass::PASS_BUMP, sVertexMask); } //static -void LLDrawPoolBump::endBump(U32 pass) +void LLDrawPoolBump::endBump() { - if (!gPipeline.hasRenderBatches(pass)) + if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) { return; } @@ -712,18 +696,6 @@ void LLDrawPoolBump::endBump(U32 pass) gGL.setSceneBlendType(LLRender::BT_ALPHA); } -S32 LLDrawPoolBump::getNumDeferredPasses() -{ - if (gSavedSettings.getBOOL("RenderObjectBump")) - { - return 1; - } - else - { - return 0; - } -} - void LLDrawPoolBump::beginDeferredPass(S32 pass) { if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) @@ -778,45 +750,21 @@ void LLDrawPoolBump::renderDeferred(S32 pass) void LLDrawPoolBump::beginPostDeferredPass(S32 pass) { - switch (pass) - { - case 0: - beginFullbrightShiny(); - break; - case 1: - beginBump(LLRenderPass::PASS_POST_BUMP); - break; - } + beginFullbrightShiny(); } void LLDrawPoolBump::endPostDeferredPass(S32 pass) { - switch (pass) - { - case 0: - endFullbrightShiny(); - break; - case 1: - endBump(LLRenderPass::PASS_POST_BUMP); - break; - } + endFullbrightShiny(); } void LLDrawPoolBump::renderPostDeferred(S32 pass) { - switch (pass) - { - case 0: - renderFullbrightShiny(); - break; - case 1: - renderBump(LLRenderPass::PASS_POST_BUMP); - break; - } + renderFullbrightShiny(); } //////////////////////////////////////////////////////////////// -// List of bump-maps created from other textures. +// List of one-component bump-maps created from other texures. //const LLUUID TEST_BUMP_ID("3d33eaf2-459c-6f97-fd76-5fce3fc29447"); @@ -829,32 +777,24 @@ void LLBumpImageList::init() LLStandardBumpmap::init(); } -void LLBumpImageList::clear() +void LLBumpImageList::shutdown() { - llinfos << "Clearing dynamic bumpmaps." << llendl; - // these will be re-populated on-demand mBrightnessEntries.clear(); mDarknessEntries.clear(); - - LLStandardBumpmap::clear(); -} - -void LLBumpImageList::shutdown() -{ - clear(); LLStandardBumpmap::shutdown(); } void LLBumpImageList::destroyGL() { - clear(); + mBrightnessEntries.clear(); + mDarknessEntries.clear(); LLStandardBumpmap::destroyGL(); } void LLBumpImageList::restoreGL() { - LLStandardBumpmap::restoreGL(); // Images will be recreated as they are needed. + LLStandardBumpmap::restoreGL(); } @@ -906,7 +846,6 @@ void LLBumpImageList::updateImages() } } } - for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -1059,8 +998,8 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr LLVector3 right = LLVector3(norm_scale, 0, (F32) src_data[(j*resX+rX)*src_cmp+src_cmp-1]-cH); LLVector3 left = LLVector3(-norm_scale, 0, (F32) src_data[(j*resX+lX)*src_cmp+src_cmp-1]-cH); - LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH); - LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH); + LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH); + LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH); LLVector3 norm = right%down + down%left + left%up + up%right; @@ -1085,7 +1024,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI { bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries ); bump_image_map_t::iterator iter = entries_list.find(source_asset_id); - if (iter != entries_list.end()) // bump not cached yet + if (iter != entries_list.end()) { LLPointer dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1); U8* dst_data = dst_image->getData(); @@ -1170,8 +1109,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI F32 twice_one_over_range = 2.f / (maximum - minimum); S32 i; - const F32 ARTIFICIAL_SCALE = 2.f; // Advantage: exaggerates the effect in midrange. Disadvantage: clamps at the extremes. - if (BE_DARKNESS == bump_code) + const F32 ARTIFICIAL_SCALE = 2.f; // Advantage: exagerates the effect in midrange. Disadvantage: clamps at the extremes. + if( BE_DARKNESS == bump_code ) { for( i = minimum; i <= maximum; i++ ) { @@ -1181,6 +1120,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } else { + // BE_LIGHTNESS for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f; @@ -1195,9 +1135,9 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } //--------------------------------------------------- - // immediately assign bump to a global smart pointer in case some local smart pointer - // accidentally releases it. - LLPointer bump = LLViewerTextureManager::getLocalTexture( TRUE ); + //immediately assign bump to a global smart pointer in case some local smart pointer + //accidently releases it. + LLPointer bump = LLViewerTextureManager::getLocalTexture( TRUE); if (!LLPipeline::sRenderDeferred) { @@ -1206,8 +1146,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } else { - LLPointer nrm_image = new LLImageRaw(dst_image->getWidth(), dst_image->getHeight(), 4); - generateNormalMapFromAlpha(dst_image, nrm_image); + LLPointer nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4); + generateNormalMapFromAlpha(src, nrm_image); bump->setExplicitFormat(GL_RGBA, GL_RGBA); bump->createGLTexture(0, nrm_image); } diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 65a813ab94..d9c5e6ce87 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -69,16 +69,16 @@ public: void renderFullbrightShiny(); void endFullbrightShiny(); - void beginBump(U32 pass = LLRenderPass::PASS_BUMP); - void renderBump(U32 pass = LLRenderPass::PASS_BUMP); - void endBump(U32 pass = LLRenderPass::PASS_BUMP); + void beginBump(); + void renderBump(); + void endBump(); - virtual S32 getNumDeferredPasses(); + virtual S32 getNumDeferredPasses() { return 1; } /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); /*virtual*/ void renderDeferred(S32 pass); - virtual S32 getNumPostDeferredPasses() { return 2; } + virtual S32 getNumPostDeferredPasses() { return 1; } /*virtual*/ void beginPostDeferredPass(S32 pass); /*virtual*/ void endPostDeferredPass(S32 pass); /*virtual*/ void renderPostDeferred(S32 pass); @@ -109,12 +109,9 @@ public: static U32 sStandardBumpmapCount; // Number of valid values in gStandardBumpmapList[] - static void clear(); - static void addstandard(); - static void init(); static void shutdown(); - static void restoreGL(); + static void restoreGL(); static void destroyGL(); }; @@ -133,7 +130,6 @@ public: void init(); void shutdown(); - void clear(); void destroyGL(); void restoreGL(); void updateImages(); diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 2e83167851..2c1430b834 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -49,10 +49,6 @@ void LLDrawPoolGlow::render(S32 pass) LLFastTimer t(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); - gGL.flush(); - /// Get rid of z-fighting with non-glow pass. - LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(-1.0f, -1.0f); gGL.setSceneBlendType(LLRender::BT_ADD); U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); @@ -145,8 +141,7 @@ void LLDrawPoolSimple::render(S32 pass) renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask()); if (LLPipeline::sRenderDeferred) - { //if deferred rendering is enabled, bump faces aren't registered as simple - //render bump faces here as simple so bump faces will appear under water + { renderTexture(LLRenderPass::PASS_BUMP, getVertexDataMask()); } } diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index ed35546ca3..466cb4709e 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -161,19 +161,12 @@ void LLViewerDynamicTexture::postRender(BOOL success) { generateGLTexture() ; } - else if(!mGLTexturep->getHasGLTexture()) - { - generateGLTexture() ; - } - else if(mGLTexturep->getDiscardLevel() != 0)//do not know how it happens, but regenerate one if it does. + if(!mGLTexturep->getHasGLTexture()) { generateGLTexture() ; } + llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ; - if(gGLManager.mDebugGPU) - { - LLGLState::dumpStates() ; - } success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); } } @@ -212,16 +205,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { LLViewerDynamicTexture *dynamicTexture = *iter; if (dynamicTexture->needsRender()) - { - if(gGLManager.mDebugGPU) - { - llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl; - LLGLState::dumpStates() ; - } - + { glClear(GL_DEPTH_BUFFER_BIT); gDepthDirty = TRUE; - + + gGL.color4f(1,1,1,1); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index f0c2469977..80cf99fc43 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -28,7 +28,6 @@ #include "llexpandabletextbox.h" #include "llscrollcontainer.h" -#include "lltrans.h" #include "llwindow.h" #include "llviewerwindow.h" @@ -112,7 +111,7 @@ LLExpandableTextBox::LLTextBoxEx::Params::Params() LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) : LLTextEditor(p), - mExpanderLabel(p.label.isProvided() ? p.label : LLTrans::getString("More")), + mExpanderLabel(p.label), mExpanderVisible(false) { setIsChrome(TRUE); @@ -135,7 +134,13 @@ void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,cons // LLTextBox::setText will obliterate the expander segment, so make sure // we generate it again by clearing mExpanderVisible mExpanderVisible = false; - LLTextEditor::setText(text, input_params); + + // Workaround for EXT-8259: trim text before rendering it. + { + std::string trimmed_text(text); + LLStringUtil::trim(trimmed_text); + LLTextEditor::setText(trimmed_text, input_params); + } // text contents have changed, segments are cleared out // so hide the expander and determine if we need it diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index defd882fe4..e0e7fb4647 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -856,26 +856,6 @@ void LLFace::updateRebuildFlags() } } - -bool LLFace::canRenderAsMask() -{ - const LLTextureEntry* te = getTextureEntry(); - return ( - ( - (LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaDeferred) || - - (!LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaNonDeferred) - ) // do we want masks at all? - && - (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha - !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid - (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - - getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive) - ); -} - - static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); BOOL LLFace::getGeometryVolume(const LLVolume& volume, @@ -1406,13 +1386,24 @@ F32 LLFace::getTextureVirtualSize() face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); } - face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area) ; - if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. + if(face_area > LLViewerTexture::sMaxSmallImageSize) { - if(mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture.notNull() && mTexture->isLargeImage()) - { - face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius ); - } + if(mImportanceToCamera < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res. + { + static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ; + face_area = llmin(face_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ; + } + else if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. + { + if(mImportanceToCamera < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res. + { + face_area = LLViewerTexture::sMinLargeImageSize ; + } + else if(mTexture.notNull() && mTexture->isLargeImage()) + { + face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius ); + } + } } setVirtualSize(face_area) ; @@ -1539,28 +1530,6 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) return importance ; } -//static -F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area) -{ - if(pixel_area > LLViewerTexture::sMaxSmallImageSize) - { - if(importance < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res. - { - static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ; - pixel_area = llmin(pixel_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ; - } - else if(pixel_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. - { - if(importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res. - { - pixel_area = LLViewerTexture::sMinLargeImageSize ; - } - } - } - - return pixel_area ; -} - BOOL LLFace::verify(const U32* indices_array) const { BOOL ok = TRUE; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index d95057f3ef..351d48a671 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -132,10 +132,10 @@ public: void unsetFaceColor(); // switch back to material color const LLColor4& getFaceColor() const { return mFaceColor; } const LLColor4& getRenderColor() const; + //for volumes void updateRebuildFlags(); - bool canRenderAsMask(); // logic helper BOOL getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, @@ -207,8 +207,7 @@ private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: - static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); - static F32 adjustPixelArea(F32 importance, F32 pixel_area) ; + static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); public: diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index deebd69ec1..8e0b348037 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -155,27 +155,27 @@ LLFloaterAnimPreview::LLFloaterAnimPreview(const std::string& filename) : //----------------------------------------------------------------------------- void LLFloaterAnimPreview::setAnimCallbacks() { - getChild("playback_slider")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onSliderMove, this)); + childSetCommitCallback("playback_slider", onSliderMove, this); - getChild("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitBaseAnim, this)); - getChild("preview_base_anim")->setValue("Standing"); + childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this); + childSetValue("preview_base_anim", "Standing"); - getChild("priority")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitPriority, this)); - getChild("loop_check")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoop, this)); - getChild("loop_in_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopIn, this)); - getChild("loop_in_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1)); - getChild("loop_out_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopOut, this)); - getChild("loop_out_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1)); + childSetCommitCallback("priority", onCommitPriority, this); + childSetCommitCallback("loop_check", onCommitLoop, this); + childSetCommitCallback("loop_in_point", onCommitLoopIn, this); + childSetValidate("loop_in_point", boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1)); + childSetCommitCallback("loop_out_point", onCommitLoopOut, this); + childSetValidate("loop_out_point", boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1)); - getChild("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitHandPose, this)); + childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); - getChild("emote_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEmote, this)); - getChild("emote_combo")->setValue("[None]"); + childSetCommitCallback("emote_combo", onCommitEmote, this); + childSetValue("emote_combo", "[None]"); - getChild("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseIn, this)); - getChild("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1)); - getChild("ease_out_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseOut, this)); - getChild("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1)); + childSetCommitCallback("ease_in_time", onCommitEaseIn, this); + childSetValidate("ease_in_time", boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1)); + childSetCommitCallback("ease_out_time", onCommitEaseOut, this); + childSetValidate("ease_out_time", boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1)); } //----------------------------------------------------------------------------- @@ -191,7 +191,7 @@ BOOL LLFloaterAnimPreview::postBuild() return FALSE; } - getChild("name_form")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitName, this)); + childSetCommitCallback("name_form", onCommitName, this); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); @@ -203,17 +203,17 @@ BOOL LLFloaterAnimPreview::postBuild() mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); mPlayButton = getChild( "play_btn"); - mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay, this)); + mPlayButton->setClickedCallback(onBtnPlay, this); mPlayButton->setVisible(true); mPauseButton = getChild( "pause_btn"); - mPauseButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPause, this)); + mPauseButton->setClickedCallback(onBtnPause, this); mPauseButton->setVisible(false); mStopButton = getChild( "stop_btn"); - mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this)); + mStopButton->setClickedCallback(onBtnStop, this); - getChildView("bad_animation_text")->setVisible(FALSE); + childHide("bad_animation_text"); std::string exten = gDirUtilp->getExtension(mFilename); if (exten == "bvh") @@ -305,19 +305,19 @@ BOOL LLFloaterAnimPreview::postBuild() mAnimPreview->setZoom(camera_zoom); - motionp->setName(getChild("name_form")->getValue().asString()); + motionp->setName(childGetValue("name_form").asString()); mAnimPreview->getDummyAvatar()->startMotion(mMotionID); getChild("playback_slider")->setMinValue(0.0); getChild("playback_slider")->setMaxValue(1.0); - getChild("loop_check")->setValue(LLSD(motionp->getLoop())); - getChild("loop_in_point")->setValue(LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); - getChild("loop_out_point")->setValue(LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); - getChild("priority")->setValue(LLSD((F32)motionp->getPriority())); - getChild("hand_pose_combo")->setValue(LLHandMotion::getHandPoseName(motionp->getHandPose())); - getChild("ease_in_time")->setValue(LLSD(motionp->getEaseInDuration())); - getChild("ease_out_time")->setValue(LLSD(motionp->getEaseOutDuration())); + childSetValue("loop_check", LLSD(motionp->getLoop())); + childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); + childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); + childSetValue("priority", LLSD((F32)motionp->getPriority())); + childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose())); + childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration())); + childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration())); setEnabled(TRUE); std::string seconds_string; seconds_string = llformat(" - %.2f seconds", motionp->getDuration()); @@ -328,7 +328,7 @@ BOOL LLFloaterAnimPreview::postBuild() { mAnimPreview = NULL; mMotionID.setNull(); - getChild("bad_animation_text")->setValue(getString("failed_to_initialize")); + childSetValue("bad_animation_text", getString("failed_to_initialize")); } } else @@ -340,13 +340,13 @@ BOOL LLFloaterAnimPreview::postBuild() LLUIString out_str = getString("anim_too_long"); out_str.setArg("[LENGTH]", llformat("%.1f", loaderp->getDuration())); out_str.setArg("[MAX_LENGTH]", llformat("%.1f", MAX_ANIM_DURATION)); - getChild("bad_animation_text")->setValue(out_str.getString()); + childSetValue("bad_animation_text", out_str.getString()); } else { LLUIString out_str = getString("failed_file_read"); out_str.setArg("[STATUS]", getString(STATUS[loaderp->getStatus()])); - getChild("bad_animation_text")->setValue(out_str.getString()); + childSetValue("bad_animation_text", out_str.getString()); } } @@ -423,17 +423,17 @@ void LLFloaterAnimPreview::resetMotion() LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); // Set emotion - std::string emote = getChild("emote_combo")->getValue().asString(); + std::string emote = childGetValue("emote_combo").asString(); motionp->setEmote(mIDList[emote]); - LLUUID base_id = mIDList[getChild("preview_base_anim")->getValue().asString()]; + LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()]; avatarp->deactivateAllMotions(); avatarp->startMotion(mMotionID, 0.0f); avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); - getChild("playback_slider")->setValue(0.0f); + childSetValue("playback_slider", 0.0f); // Set pose - std::string handpose = getChild("hand_pose_combo")->getValue().asString(); + std::string handpose = childGetValue("hand_pose_combo").asString(); avatarp->startMotion( ANIM_AGENT_HAND_MOTION, 0.0f ); motionp->setHandPose(LLHandMotion::getHandPose(handpose)); @@ -552,23 +552,24 @@ void LLFloaterAnimPreview::onMouseCaptureLost() //----------------------------------------------------------------------------- // onBtnPlay() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnPlay() +void LLFloaterAnimPreview::onBtnPlay(void* user_data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; + if (!previewp->getEnabled()) return; - if (mMotionID.notNull() && mAnimPreview) + if (previewp->mMotionID.notNull() && previewp->mAnimPreview) { - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - if (!avatarp->isMotionActive(mMotionID)) + if (!avatarp->isMotionActive(previewp->mMotionID)) { - resetMotion(); - mPauseRequest = NULL; + previewp->resetMotion(); + previewp->mPauseRequest = NULL; } else if (avatarp->areAnimationsPaused()) { - mPauseRequest = NULL; + previewp->mPauseRequest = NULL; } } } @@ -576,20 +577,21 @@ void LLFloaterAnimPreview::onBtnPlay() //----------------------------------------------------------------------------- // onBtnPause() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnPause() +void LLFloaterAnimPreview::onBtnPause(void* user_data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; + if (!previewp->getEnabled()) return; - if (mMotionID.notNull() && mAnimPreview) + if (previewp->mMotionID.notNull() && previewp->mAnimPreview) { - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - if (avatarp->isMotionActive(mMotionID)) + if (avatarp->isMotionActive(previewp->mMotionID)) { if (!avatarp->areAnimationsPaused()) { - mPauseRequest = avatarp->requestPause(); + previewp->mPauseRequest = avatarp->requestPause(); } } } @@ -598,40 +600,42 @@ void LLFloaterAnimPreview::onBtnPause() //----------------------------------------------------------------------------- // onBtnStop() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnStop() +void LLFloaterAnimPreview::onBtnStop(void* user_data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; + if (!previewp->getEnabled()) return; - if (mMotionID.notNull() && mAnimPreview) + if (previewp->mMotionID.notNull() && previewp->mAnimPreview) { - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - resetMotion(); - mPauseRequest = avatarp->requestPause(); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + previewp->resetMotion(); + previewp->mPauseRequest = avatarp->requestPause(); } } //----------------------------------------------------------------------------- // onSliderMove() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onSliderMove() +void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; + if (!previewp->getEnabled()) return; - if (mAnimPreview) + if (previewp->mAnimPreview) { - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - F32 slider_value = (F32)getChild("playback_slider")->getValue().asReal(); - LLUUID base_id = mIDList[getChild("preview_base_anim")->getValue().asString()]; - LLMotion* motionp = avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal(); + LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()]; + LLMotion* motionp = avatarp->findMotion(previewp->mMotionID); F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration(); F32 delta_time = duration * slider_value; avatarp->deactivateAllMotions(); avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET); - avatarp->startMotion(mMotionID, delta_time); - mPauseRequest = avatarp->requestPause(); - refresh(); + avatarp->startMotion(previewp->mMotionID, delta_time); + previewp->mPauseRequest = avatarp->requestPause(); + previewp->refresh(); } } @@ -639,28 +643,29 @@ void LLFloaterAnimPreview::onSliderMove() //----------------------------------------------------------------------------- // onCommitBaseAnim() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitBaseAnim() +void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - if (mAnimPreview) + if (previewp->mAnimPreview) { - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); BOOL paused = avatarp->areAnimationsPaused(); // stop all other possible base motions - avatarp->stopMotion(mIDList["Standing"], TRUE); - avatarp->stopMotion(mIDList["Walking"], TRUE); - avatarp->stopMotion(mIDList["Sitting"], TRUE); - avatarp->stopMotion(mIDList["Flying"], TRUE); + avatarp->stopMotion(previewp->mIDList["Standing"], TRUE); + avatarp->stopMotion(previewp->mIDList["Walking"], TRUE); + avatarp->stopMotion(previewp->mIDList["Sitting"], TRUE); + avatarp->stopMotion(previewp->mIDList["Flying"], TRUE); - resetMotion(); + previewp->resetMotion(); if (!paused) { - mPauseRequest = NULL; + previewp->mPauseRequest = NULL; } } } @@ -668,145 +673,154 @@ void LLFloaterAnimPreview::onCommitBaseAnim() //----------------------------------------------------------------------------- // onCommitLoop() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoop() +void LLFloaterAnimPreview::onCommitLoop(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); if (motionp) { - motionp->setLoop(getChild("loop_check")->getValue().asBoolean()); - motionp->setLoopIn((F32)getChild("loop_in_point")->getValue().asReal() * 0.01f * motionp->getDuration()); - motionp->setLoopOut((F32)getChild("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); + motionp->setLoop(previewp->childGetValue("loop_check").asBoolean()); + motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() * 0.01f * motionp->getDuration()); + motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); } } //----------------------------------------------------------------------------- // onCommitLoopIn() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoopIn() +void LLFloaterAnimPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); if (motionp) { - motionp->setLoopIn((F32)getChild("loop_in_point")->getValue().asReal() / 100.f); - resetMotion(); - getChild("loop_check")->setValue(LLSD(TRUE)); - onCommitLoop(); + motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() / 100.f); + previewp->resetMotion(); + previewp->childSetValue("loop_check", LLSD(TRUE)); + onCommitLoop(ctrl, data); } } //----------------------------------------------------------------------------- // onCommitLoopOut() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoopOut() +void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); if (motionp) { - motionp->setLoopOut((F32)getChild("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); - resetMotion(); - getChild("loop_check")->setValue(LLSD(TRUE)); - onCommitLoop(); + motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); + previewp->resetMotion(); + previewp->childSetValue("loop_check", LLSD(TRUE)); + onCommitLoop(ctrl, data); } } //----------------------------------------------------------------------------- // onCommitName() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitName() +void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); if (motionp) { - motionp->setName(getChild("name_form")->getValue().asString()); + motionp->setName(previewp->childGetValue("name_form").asString()); } - doCommit(); + previewp->doCommit(); } //----------------------------------------------------------------------------- // onCommitHandPose() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitHandPose() +void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - resetMotion(); // sets hand pose + previewp->resetMotion(); // sets hand pose } //----------------------------------------------------------------------------- // onCommitEmote() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEmote() +void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - resetMotion(); // ssts emote + previewp->resetMotion(); // ssts emote } //----------------------------------------------------------------------------- // onCommitPriority() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitPriority() +void LLFloaterAnimPreview::onCommitPriority(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); - motionp->setPriority(llfloor((F32)getChild("priority")->getValue().asReal())); + motionp->setPriority(llfloor((F32)previewp->childGetValue("priority").asReal())); } //----------------------------------------------------------------------------- // onCommitEaseIn() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEaseIn() +void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); - motionp->setEaseIn((F32)getChild("ease_in_time")->getValue().asReal()); - resetMotion(); + motionp->setEaseIn((F32)previewp->childGetValue("ease_in_time").asReal()); + previewp->resetMotion(); } //----------------------------------------------------------------------------- // onCommitEaseOut() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEaseOut() +void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) { - if (!getEnabled()) + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) return; - LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); - motionp->setEaseOut((F32)getChild("ease_out_time")->getValue().asReal()); - resetMotion(); + motionp->setEaseOut((F32)previewp->childGetValue("ease_out_time").asReal()); + previewp->resetMotion(); } //----------------------------------------------------------------------------- @@ -822,8 +836,8 @@ bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data) if (!motionp->getLoop()) { - F32 new_ease_in = llclamp((F32)getChild("ease_in_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); - getChild("ease_in_time")->setValue(LLSD(new_ease_in)); + F32 new_ease_in = llclamp((F32)childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); + childSetValue("ease_in_time", LLSD(new_ease_in)); } return true; @@ -842,8 +856,8 @@ bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data) if (!motionp->getLoop()) { - F32 new_ease_out = llclamp((F32)getChild("ease_out_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); - getChild("ease_out_time")->setValue(LLSD(new_ease_out)); + F32 new_ease_out = llclamp((F32)childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); + childSetValue("ease_out_time", LLSD(new_ease_out)); } return true; @@ -857,8 +871,8 @@ bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data) if (!getEnabled()) return false; - F32 loop_in_value = (F32)getChild("loop_in_point")->getValue().asReal(); - F32 loop_out_value = (F32)getChild("loop_out_point")->getValue().asReal(); + F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); + F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); if (loop_in_value < 0.f) { @@ -873,7 +887,7 @@ bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data) loop_in_value = loop_out_value; } - getChild("loop_in_point")->setValue(LLSD(loop_in_value)); + childSetValue("loop_in_point", LLSD(loop_in_value)); return true; } @@ -885,8 +899,8 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) if (!getEnabled()) return false; - F32 loop_out_value = (F32)getChild("loop_out_point")->getValue().asReal(); - F32 loop_in_value = (F32)getChild("loop_in_point")->getValue().asReal(); + F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); + F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); if (loop_out_value < 0.f) { @@ -901,7 +915,7 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) loop_out_value = loop_in_value; } - getChild("loop_out_point")->setValue(LLSD(loop_out_value)); + childSetValue("loop_out_point", LLSD(loop_out_value)); return true; } @@ -915,15 +929,15 @@ void LLFloaterAnimPreview::refresh() bool show_play = true; if (!mAnimPreview) { - getChildView("bad_animation_text")->setVisible(TRUE); + childShow("bad_animation_text"); // play button visible but disabled mPlayButton->setEnabled(FALSE); mStopButton->setEnabled(FALSE); - getChildView("ok_btn")->setEnabled(FALSE); + childDisable("ok_btn"); } else { - getChildView("bad_animation_text")->setVisible(FALSE); + childHide("bad_animation_text"); // re-enabled in case previous animation was bad mPlayButton->setEnabled(TRUE); mStopButton->setEnabled(TRUE); @@ -938,7 +952,7 @@ void LLFloaterAnimPreview::refresh() if (motionp) { F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); - getChild("playback_slider")->setValue(fraction_complete); + childSetValue("playback_slider", fraction_complete); } show_play = false; } @@ -948,7 +962,7 @@ void LLFloaterAnimPreview::refresh() // Motion just finished playing mPauseRequest = avatarp->requestPause(); } - getChildView("ok_btn")->setEnabled(TRUE); + childEnable("ok_btn"); mAnimPreview->requestUpdate(); } mPlayButton->setVisible(show_play); @@ -979,8 +993,8 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) file.setMaxSize(size); if (file.write((U8*)buffer, size)) { - std::string name = floaterp->getChild("name_form")->getValue().asString(); - std::string desc = floaterp->getChild("description_form")->getValue().asString(); + std::string name = floaterp->childGetValue("name_form").asString(); + std::string desc = floaterp->childGetValue("description_form").asString(); LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index f1ffb6547f..80d4716ff2 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -83,22 +83,22 @@ public: void refresh(); - void onBtnPlay(); - void onBtnPause(); - void onBtnStop(); - void onSliderMove(); - void onCommitBaseAnim(); - void onCommitLoop(); - void onCommitLoopIn(); - void onCommitLoopOut(); + static void onBtnPlay(void*); + static void onBtnPause(void*); + static void onBtnStop(void*); + static void onSliderMove(LLUICtrl*, void*); + static void onCommitBaseAnim(LLUICtrl*, void*); + static void onCommitLoop(LLUICtrl*, void*); + static void onCommitLoopIn(LLUICtrl*, void*); + static void onCommitLoopOut(LLUICtrl*, void*); bool validateLoopIn(const LLSD& data); bool validateLoopOut(const LLSD& data); - void onCommitName(); - void onCommitHandPose(); - void onCommitEmote(); - void onCommitPriority(); - void onCommitEaseIn(); - void onCommitEaseOut(); + static void onCommitName(LLUICtrl*, void*); + static void onCommitHandPose(LLUICtrl*, void*); + static void onCommitEmote(LLUICtrl*, void*); + static void onCommitPriority(LLUICtrl*, void*); + static void onCommitEaseIn(LLUICtrl*, void*); + static void onCommitEaseOut(LLUICtrl*, void*); bool validateEaseIn(const LLSD& data); bool validateEaseOut(const LLSD& data); static void onBtnOK(void*); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 5cab770c42..04611a33c0 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -109,20 +109,20 @@ void LLFloaterAuction::initialize() mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); - getChild("parcel_text")->setValue(parcelp->getName()); - getChildView("snapshot_btn")->setEnabled(TRUE); - getChildView("reset_parcel_btn")->setEnabled(TRUE); - getChildView("start_auction_btn")->setEnabled(TRUE); + 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(); - getChildView("sell_to_anyone_btn")->setEnabled((estate_id == ESTATE_TEEN || estate_id == 0)); + 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 - getChildView("sell_to_anyone_btn")->setEnabled(TRUE); + childEnable("sell_to_anyone_btn"); } } else @@ -130,17 +130,17 @@ void LLFloaterAuction::initialize() mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { - getChild("parcel_text")->setValue(getString("already for sale")); + childSetText("parcel_text", getString("already for sale")); } else { - getChild("parcel_text")->setValue(LLStringUtil::null); + childSetText("parcel_text", LLStringUtil::null); } mParcelID = -1; - getChildView("snapshot_btn")->setEnabled(false); - getChildView("reset_parcel_btn")->setEnabled(false); - getChildView("sell_to_anyone_btn")->setEnabled(false); - getChildView("start_auction_btn")->setEnabled(false); + childSetEnabled("snapshot_btn", false); + childSetEnabled("reset_parcel_btn", false); + childSetEnabled("sell_to_anyone_btn", false); + childSetEnabled("start_auction_btn", false); } mImageID.setNull(); @@ -153,10 +153,9 @@ void LLFloaterAuction::draw() if(!isMinimized() && mImage.notNull()) { - LLView* snapshot_icon = findChildView("snapshot_icon"); - if (snapshot_icon) + LLRect rect; + if (childGetRect("snapshot_icon", rect)) { - LLRect rect = snapshot_icon->getRect(); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); @@ -183,7 +182,7 @@ void LLFloaterAuction::onClickSnapshot(void* data) LLPointer raw = new LLImageRaw; - gForceRenderLandFence = self->getChild("fence_check")->getValue().asBoolean(); + gForceRenderLandFence = self->childGetValue("fence_check").asBoolean(); BOOL success = gViewerWindow->rawSnapshot(raw, gViewerWindow->getWindowWidthScaled(), gViewerWindow->getWindowHeightScaled(), @@ -231,7 +230,7 @@ void LLFloaterAuction::onClickStartAuction(void* data) if(self->mImageID.notNull()) { - LLSD parcel_name = self->getChild("parcel_text")->getValue(); + LLSD parcel_name = self->childGetValue("parcel_text"); // create the asset std::string* name = new std::string(parcel_name.asString()); @@ -340,7 +339,7 @@ void LLFloaterAuction::doResetParcel() std::string new_name(parcel_name.str().c_str()); body["name"] = new_name; - getChild("parcel_text")->setValue(new_name); // Set name in dialog as well, since it won't get updated otherwise + childSetText("parcel_text", new_name); // Set name in dialog as well, since it won't get updated otherwise body["sale_price"] = (S32) 0; body["description"] = empty; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 9391c761b7..501cf4ce99 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -88,14 +88,14 @@ BOOL LLFloaterAvatarPicker::postBuild() getChild("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL); childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this)); - getChildView("Find")->setEnabled(FALSE); + childDisable("Find"); childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this)); getChild("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this)); LLScrollListCtrl* searchresults = getChild("SearchResults"); searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); - getChildView("SearchResults")->setEnabled(FALSE); + childDisable("SearchResults"); LLScrollListCtrl* nearme = getChild("NearMe"); nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); @@ -106,10 +106,10 @@ BOOL LLFloaterAvatarPicker::postBuild() getChild("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); - getChildView("ok_btn")->setEnabled(FALSE); + childDisable("ok_btn"); childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this)); - getChild("Edit")->setFocus(TRUE); + childSetFocus("Edit"); LLPanel* search_panel = getChild("SearchPanel"); if (search_panel) @@ -139,7 +139,7 @@ void LLFloaterAvatarPicker::setOkBtnEnableCb(validate_callback_t cb) void LLFloaterAvatarPicker::onTabChanged() { - getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); + childSetEnabled("ok_btn", isSelectBtnEnabled()); } // Destroys the object @@ -178,7 +178,7 @@ void LLFloaterAvatarPicker::onBtnSelect() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); if(active_panel) { acvtive_panel_name = active_panel->getName(); @@ -233,7 +233,7 @@ void LLFloaterAvatarPicker::onRangeAdjust() void LLFloaterAvatarPicker::onList() { - getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); + childSetEnabled("ok_btn", isSelectBtnEnabled()); } void LLFloaterAvatarPicker::populateNearMe() @@ -267,14 +267,14 @@ void LLFloaterAvatarPicker::populateNearMe() if (empty) { - getChildView("NearMe")->setEnabled(FALSE); - getChildView("ok_btn")->setEnabled(FALSE); + childDisable("NearMe"); + childDisable("ok_btn"); near_me_scroller->setCommentText(getString("no_one_near")); } else { - getChildView("NearMe")->setEnabled(TRUE); - getChildView("ok_btn")->setEnabled(TRUE); + childEnable("NearMe"); + childEnable("ok_btn"); near_me_scroller->selectFirstItem(); onList(); near_me_scroller->setFocus(TRUE); @@ -321,7 +321,7 @@ void LLFloaterAvatarPicker::draw() } LLFloater::draw(); - if (!mNearMeListComplete && getChild("ResidentChooserTabs")->getCurrentPanel() == getChild("NearMePanel")) + if (!mNearMeListComplete && childGetVisibleTab("ResidentChooserTabs") == getChild("NearMePanel")) { populateNearMe(); } @@ -329,7 +329,7 @@ void LLFloaterAvatarPicker::draw() BOOL LLFloaterAvatarPicker::visibleItemsSelected() const { - LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); if(active_panel == getChild("SearchPanel")) { @@ -348,7 +348,7 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const void LLFloaterAvatarPicker::find() { - std::string text = getChild("Edit")->getValue().asString(); + std::string text = childGetValue("Edit").asString(); mQueryID.generate(); @@ -367,7 +367,7 @@ void LLFloaterAvatarPicker::find() getChild("SearchResults")->deleteAllItems(); getChild("SearchResults")->setCommentText(getString("searching")); - getChildView("ok_btn")->setEnabled(FALSE); + childSetEnabled("ok_btn", FALSE); mNumResultsReturned = 0; } @@ -382,7 +382,7 @@ LLScrollListCtrl* LLFloaterAvatarPicker::getActiveList() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); if(active_panel) { acvtive_panel_name = active_panel->getName(); @@ -496,10 +496,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* if (avatar_id.isNull()) { LLStringUtil::format_map_t map; - map["[TEXT]"] = floater->getChild("Edit")->getValue().asString(); + map["[TEXT]"] = floater->childGetText("Edit"); avatar_name = floater->getString("not_found", map); search_results->setEnabled(FALSE); - floater->getChildView("ok_btn")->setEnabled(FALSE); + floater->childDisable("ok_btn"); } else { @@ -515,7 +515,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* if (found_one) { - floater->getChildView("ok_btn")->setEnabled(TRUE); + floater->childEnable("ok_btn"); search_results->selectFirstItem(); floater->onList(); search_results->setFocus(TRUE); @@ -525,7 +525,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* //static void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { - getChildView("Find")->setEnabled(caller->getText().size() >= 3); + childSetEnabled("Find", caller->getText().size() >= 3); } // virtual @@ -533,7 +533,7 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) { if (key == KEY_RETURN && mask == MASK_NONE) { - if (getChild("Edit")->hasFocus()) + if (childHasFocus("Edit")) { onBtnFind(); } @@ -560,7 +560,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); if(active_panel) { diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 32add57737..616383f1a5 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -56,8 +56,8 @@ LLFloaterBuy::LLFloaterBuy(const LLSD& key) BOOL LLFloaterBuy::postBuild() { - getChildView("object_list")->setEnabled(FALSE); - getChildView("item_list")->setEnabled(FALSE); + childDisable("object_list"); + childDisable("item_list"); getChild("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickCancel, this)); getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickBuy, this)); @@ -177,8 +177,8 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // Add after columns added so appropriate heights are correct. object_list->addElement(row); - floater->getChild("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - floater->getChild("buy_text")->setTextArg("[NAME]", owner_name); + floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->childSetTextArg("buy_text", "[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 77fb5590df..405d318720 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -63,9 +63,9 @@ BOOL LLFloaterBuyContents::postBuild() getChild("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickCancel, this)); getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); - getChildView("item_list")->setEnabled(FALSE); - getChildView("buy_btn")->setEnabled(FALSE); - getChildView("wear_check")->setEnabled(FALSE); + childDisable("item_list"); + childDisable("buy_btn"); + childDisable("wear_check"); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) @@ -123,9 +123,9 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) gCacheName->getGroupName(owner_id, owner_name); } - floater->getChild("contains_text")->setTextArg("[NAME]", node->mName); - floater->getChild("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - floater->getChild("buy_text")->setTextArg("[NAME]", owner_name); + floater->childSetTextArg("contains_text", "[NAME]", node->mName); + floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->childSetTextArg("buy_text", "[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and @@ -163,7 +163,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } // default to turning off the buy button. - getChildView("buy_btn")->setEnabled(FALSE); + childDisable("buy_btn"); LLUUID owner_id; BOOL is_group_owned; @@ -204,7 +204,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, // There will be at least one item shown in the display, so go // ahead and enable the buy button. - getChildView("buy_btn")->setEnabled(TRUE); + childEnable("buy_btn"); // Create the line in the list LLSD row; @@ -250,8 +250,8 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, if (wearable_count > 0) { - getChildView("wear_check")->setEnabled(TRUE); - getChild("wear_check")->setValue(LLSD(false) ); + childEnable("wear_check"); + childSetValue("wear_check", LLSD(false) ); } removeVOInventoryListener(); @@ -262,7 +262,7 @@ void LLFloaterBuyContents::onClickBuy() { // Make sure this wasn't selected through other mechanisms // (ie, being the default button and pressing enter. - if(!getChildView("buy_btn")->getEnabled()) + if(!childIsEnabled("buy_btn")) { // We shouldn't be enabled. Just close. closeFloater(); @@ -270,7 +270,7 @@ void LLFloaterBuyContents::onClickBuy() } // We may want to wear this item - if (getChild("wear_check")->getValue()) + if (childGetValue("wear_check")) { LLInventoryState::sWearNewClothing = TRUE; } diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 58c79fdf15..35020d84e2 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -156,7 +156,7 @@ void LLFloaterBuyCurrencyUI::draw() } // disable the Buy button when we are not able to buy - getChildView("buy_btn")->setEnabled(mManager.canBuy()); + childSetEnabled("buy_btn", mManager.canBuy()); LLFloater::draw(); } @@ -172,27 +172,27 @@ void LLFloaterBuyCurrencyUI::updateUI() mManager.updateUI(!hasError && !mManager.buying()); // hide most widgets - we'll turn them on as needed next - getChildView("info_buying")->setVisible(FALSE); - getChildView("info_cannot_buy")->setVisible(FALSE); - getChildView("info_need_more")->setVisible(FALSE); - getChildView("purchase_warning_repurchase")->setVisible(FALSE); - getChildView("purchase_warning_notenough")->setVisible(FALSE); - getChildView("contacting")->setVisible(FALSE); - getChildView("buy_action")->setVisible(FALSE); + childHide("info_buying"); + childHide("info_cannot_buy"); + childHide("info_need_more"); + childHide("purchase_warning_repurchase"); + childHide("purchase_warning_notenough"); + childHide("contacting"); + childHide("buy_action"); if (hasError) { // display an error from the server - getChildView("normal_background")->setVisible(FALSE); - getChildView("error_background")->setVisible(TRUE); - getChildView("info_cannot_buy")->setVisible(TRUE); - getChildView("cannot_buy_message")->setVisible(TRUE); - getChildView("balance_label")->setVisible(FALSE); - getChildView("balance_amount")->setVisible(FALSE); - getChildView("buying_label")->setVisible(FALSE); - getChildView("buying_amount")->setVisible(FALSE); - getChildView("total_label")->setVisible(FALSE); - getChildView("total_amount")->setVisible(FALSE); + childHide("normal_background"); + childShow("error_background"); + childShow("info_cannot_buy"); + childShow("cannot_buy_message"); + childHide("balance_label"); + childHide("balance_amount"); + childHide("buying_label"); + childHide("buying_amount"); + childHide("total_label"); + childHide("total_amount"); LLTextBox* message = getChild("cannot_buy_message"); if (message) @@ -200,67 +200,67 @@ void LLFloaterBuyCurrencyUI::updateUI() message->setText(mManager.errorMessage()); } - getChildView("error_web")->setVisible( !mManager.errorURI().empty()); + childSetVisible("error_web", !mManager.errorURI().empty()); } else { // display the main Buy L$ interface - getChildView("normal_background")->setVisible(TRUE); - getChildView("error_background")->setVisible(FALSE); - getChildView("cannot_buy_message")->setVisible(FALSE); - getChildView("error_web")->setVisible(FALSE); + childShow("normal_background"); + childHide("error_background"); + childHide("cannot_buy_message"); + childHide("error_web"); if (mHasTarget) { - getChildView("info_need_more")->setVisible(TRUE); + childShow("info_need_more"); } else { - getChildView("info_buying")->setVisible(TRUE); + childShow("info_buying"); } if (mManager.buying()) { - getChildView("contacting")->setVisible( true); + childSetVisible("contacting", true); } else { if (mHasTarget) { - getChildView("buy_action")->setVisible( true); - getChild("buy_action")->setTextArg("[ACTION]", mTargetName); + childSetVisible("buy_action", true); + childSetTextArg("buy_action", "[ACTION]", mTargetName); } } S32 balance = gStatusBar->getBalance(); - getChildView("balance_label")->setVisible(TRUE); - getChildView("balance_amount")->setVisible(TRUE); - getChild("balance_amount")->setTextArg("[AMT]", llformat("%d", balance)); + childShow("balance_label"); + childShow("balance_amount"); + childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance)); S32 buying = mManager.getAmount(); - getChildView("buying_label")->setVisible(TRUE); - getChildView("buying_amount")->setVisible(TRUE); - getChild("buying_amount")->setTextArg("[AMT]", llformat("%d", buying)); + childShow("buying_label"); + childShow("buying_amount"); + childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying)); S32 total = balance + buying; - getChildView("total_label")->setVisible(TRUE); - getChildView("total_amount")->setVisible(TRUE); - getChild("total_amount")->setTextArg("[AMT]", llformat("%d", total)); + childShow("total_label"); + childShow("total_amount"); + childSetTextArg("total_amount", "[AMT]", llformat("%d", total)); if (mHasTarget) { if (total >= mTargetPrice) { - getChildView("purchase_warning_repurchase")->setVisible( true); + childSetVisible("purchase_warning_repurchase", true); } else { - getChildView("purchase_warning_notenough")->setVisible( true); + childSetVisible("purchase_warning_notenough", true); } } } - getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError); + childSetVisible("getting_data", !mManager.canBuy() && !hasError); } void LLFloaterBuyCurrencyUI::onClickBuy() diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 69824b3843..3f9d1dc8e8 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -726,7 +726,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) return; } - BOOL remove_contribution = getChild("remove_contribution")->getValue().asBoolean(); + BOOL remove_contribution = childGetValue("remove_contribution").asBoolean(); mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(), gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution); @@ -1020,13 +1020,13 @@ void LLFloaterBuyLandUI::refreshUI() if (mParcelValid) { - getChild("info_parcel")->setValue(mParcelLocation); + childSetText("info_parcel", mParcelLocation); LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea); string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects); - getChild("info_size")->setValue(getString("meters_supports_object", string_args)); + childSetText("info_size", getString("meters_supports_object", string_args)); F32 cost_per_sqm = 0.0f; if (mParcelActualArea > 0) @@ -1045,17 +1045,17 @@ void LLFloaterBuyLandUI::refreshUI() { info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects"); } - getChild("info_price")->setValue(getString("info_price_string", info_price_args)); - getChildView("info_price")->setVisible( mParcelIsForSale); + childSetText("info_price", getString("info_price_string", info_price_args)); + childSetVisible("info_price", mParcelIsForSale); } else { - getChild("info_parcel")->setValue(getString("no_parcel_selected")); - getChild("info_size")->setValue(LLStringUtil::null); - getChild("info_price")->setValue(LLStringUtil::null); + childSetText("info_parcel", getString("no_parcel_selected")); + childSetText("info_size", LLStringUtil::null); + childSetText("info_price", LLStringUtil::null); } - getChild("info_action")->setValue( + childSetText("info_action", mCanBuy ? mIsForGroup @@ -1086,13 +1086,14 @@ void LLFloaterBuyLandUI::refreshUI() message->setValue(LLSD(!mCanBuy ? mCannotBuyReason : "(waiting for data)")); } - getChildView("error_web")->setVisible(mCannotBuyIsError && !mCannotBuyURI.empty()); + childSetVisible("error_web", + mCannotBuyIsError && !mCannotBuyURI.empty()); } else { - getChildView("step_error")->setVisible(FALSE); - getChildView("error_message")->setVisible(FALSE); - getChildView("error_web")->setVisible(FALSE); + childHide("step_error"); + childHide("error_message"); + childHide("error_web"); } @@ -1103,8 +1104,8 @@ void LLFloaterBuyLandUI::refreshUI() mSiteMembershipUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); - getChild("account_action")->setValue(mSiteMembershipAction); - getChild("account_reason")->setValue( + childSetText("account_action", mSiteMembershipAction); + childSetText("account_reason", mSiteMembershipUpgrade ? getString("must_upgrade") : getString("cant_own_land") @@ -1127,16 +1128,16 @@ void LLFloaterBuyLandUI::refreshUI() levels->setCurrentByIndex(mUserPlanChoice); } - getChildView("step_1")->setVisible(TRUE); - getChildView("account_action")->setVisible(TRUE); - getChildView("account_reason")->setVisible(TRUE); + childShow("step_1"); + childShow("account_action"); + childShow("account_reason"); } else { - getChildView("step_1")->setVisible(FALSE); - getChildView("account_action")->setVisible(FALSE); - getChildView("account_reason")->setVisible(FALSE); - getChildView("account_level")->setVisible(FALSE); + childHide("step_1"); + childHide("account_action"); + childHide("account_reason"); + childHide("account_level"); } // section two: land use fees @@ -1146,7 +1147,7 @@ void LLFloaterBuyLandUI::refreshUI() mSiteLandUseUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); - getChild("land_use_action")->setValue(mSiteLandUseAction); + childSetText("land_use_action", mSiteLandUseAction); std::string message; @@ -1192,17 +1193,17 @@ void LLFloaterBuyLandUI::refreshUI() } } - getChild("land_use_reason")->setValue(message); + childSetValue("land_use_reason", message); - getChildView("step_2")->setVisible(TRUE); - getChildView("land_use_action")->setVisible(TRUE); - getChildView("land_use_reason")->setVisible(TRUE); + childShow("step_2"); + childShow("land_use_action"); + childShow("land_use_reason"); } else { - getChildView("step_2")->setVisible(FALSE); - getChildView("land_use_action")->setVisible(FALSE); - getChildView("land_use_reason")->setVisible(FALSE); + childHide("step_2"); + childHide("land_use_action"); + childHide("land_use_reason"); } // section three: purchase & currency @@ -1226,8 +1227,8 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice); string_args["[SELLER]"] = mParcelSellerName; - getChild("purchase_action")->setValue(getString("pay_to_for_land", string_args)); - getChildView("purchase_action")->setVisible( mParcelValid); + childSetText("purchase_action", getString("pay_to_for_land", string_args)); + childSetVisible("purchase_action", mParcelValid); std::string reasonString; @@ -1236,7 +1237,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); - getChild("currency_reason")->setValue(getString("have_enough_lindens", string_args)); + childSetText("currency_reason", getString("have_enough_lindens", string_args)); } else { @@ -1244,9 +1245,9 @@ void LLFloaterBuyLandUI::refreshUI() string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); string_args["[AMOUNT2]"] = llformat("%d", mParcelPrice - mAgentCashBalance); - getChild("currency_reason")->setValue(getString("not_enough_lindens", string_args)); + childSetText("currency_reason", getString("not_enough_lindens", string_args)); - getChild("currency_est")->setTextArg("[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); + childSetTextArg("currency_est", "[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); } if (willHaveEnough) @@ -1254,7 +1255,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", finalBalance); - getChild("currency_balance")->setValue(getString("balance_left", string_args)); + childSetText("currency_balance", getString("balance_left", string_args)); } else @@ -1262,30 +1263,30 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance); - getChild("currency_balance")->setValue(getString("balance_needed", string_args)); + childSetText("currency_balance", getString("balance_needed", string_args)); } - getChild("remove_contribution")->setValue(LLSD(groupContributionEnough)); - getChildView("remove_contribution")->setEnabled(groupContributionEnough); + childSetValue("remove_contribution", LLSD(groupContributionEnough)); + childSetEnabled("remove_contribution", groupContributionEnough); bool showRemoveContribution = mParcelIsGroupLand && (mParcelGroupContribution > 0); - getChildView("remove_contribution")->setLabelArg("[AMOUNT]", + childSetLabelArg("remove_contribution", "[AMOUNT]", llformat("%d", minContribution)); - getChildView("remove_contribution")->setVisible( showRemoveContribution); + childSetVisible("remove_contribution", showRemoveContribution); - getChildView("step_3")->setVisible(TRUE); - getChildView("purchase_action")->setVisible(TRUE); - getChildView("currency_reason")->setVisible(TRUE); - getChildView("currency_balance")->setVisible(TRUE); + childShow("step_3"); + childShow("purchase_action"); + childShow("currency_reason"); + childShow("currency_balance"); } else { - getChildView("step_3")->setVisible(FALSE); - getChildView("purchase_action")->setVisible(FALSE); - getChildView("currency_reason")->setVisible(FALSE); - getChildView("currency_balance")->setVisible(FALSE); - getChildView("remove_group_donation")->setVisible(FALSE); + childHide("step_3"); + childHide("purchase_action"); + childHide("currency_reason"); + childHide("currency_balance"); + childHide("remove_group_donation"); } @@ -1296,7 +1297,8 @@ void LLFloaterBuyLandUI::refreshUI() agrees_to_covenant = check->get(); } - getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); + childSetEnabled("buy_btn", + mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); } void LLFloaterBuyLandUI::startBuyPreConfirm() diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index d4067452b0..24fba61315 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -56,7 +56,6 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; #define CONTROLS "controls" bool LLFloaterCamera::sFreeCamera = false; -bool LLFloaterCamera::sAppearanceEditing = false; // Zoom the camera in and out class LLPanelCameraZoom @@ -120,15 +119,10 @@ LLPanelCameraItem::LLPanelCameraItem(const LLPanelCameraItem::Params& p) } } -void set_view_visible(LLView* parent, const std::string& name, bool visible) -{ - parent->getChildView(name)->setVisible(visible); -} - BOOL LLPanelCameraItem::postBuild() { - setMouseEnterCallback(boost::bind(set_view_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(set_view_visible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(&LLPanelCameraItem::childSetVisible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&LLPanelCameraItem::childSetVisible, this, "hovered_icon", false)); setMouseDownCallback(boost::bind(&LLPanelCameraItem::onAnyMouseClick, this)); setRightMouseDownCallback(boost::bind(&LLPanelCameraItem::onAnyMouseClick, this)); return TRUE; @@ -143,9 +137,9 @@ void LLPanelCameraItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); - getChildView("picture")->setVisible( !value["selected"]); - getChildView("selected_picture")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); + childSetVisible("picture", !value["selected"]); + childSetVisible("selected_picture", value["selected"]); } static LLRegisterPanelClassWrapper t_camera_zoom_panel("camera_zoom_panel"); @@ -243,25 +237,6 @@ void LLFloaterCamera::resetCameraMode() floater_camera->switchMode(CAMERA_CTRL_MODE_PAN); } -void LLFloaterCamera::onAvatarEditingAppearance(bool editing) -{ - sAppearanceEditing = editing; - LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); - if (!floater_camera) return; - floater_camera->handleAvatarEditingAppearance(editing); -} - -void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) -{ - //camera presets (rear, front, etc.) - getChildView("preset_views_list")->setEnabled(!editing); - getChildView("presets_btn")->setEnabled(!editing); - - //camera modes (object view, mouselook view) - getChildView("camera_modes_list")->setEnabled(!editing); - getChildView("avatarview_btn")->setEnabled(!editing); -} - void LLFloaterCamera::update() { ECameraControlMode mode = determineMode(); @@ -354,9 +329,6 @@ BOOL LLFloaterCamera::postBuild() update(); - // ensure that appearance mode is handled while building. See EXT-7796. - handleAvatarEditingAppearance(sAppearanceEditing); - return LLDockableFloater::postBuild(); } @@ -379,12 +351,6 @@ void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* pane ECameraControlMode LLFloaterCamera::determineMode() { - if (sAppearanceEditing) - { - // this is the only enabled camera mode while editing agent appearance. - return CAMERA_CTRL_MODE_PAN; - } - LLTool* curr_tool = LLToolMgr::getInstance()->getCurrentTool(); if (curr_tool == LLToolCamera::getInstance()) { @@ -498,15 +464,15 @@ void LLFloaterCamera::assignButton2Mode(ECameraControlMode mode, const std::stri void LLFloaterCamera::updateState() { - getChildView(ZOOM)->setVisible(CAMERA_CTRL_MODE_PAN == mCurrMode); + childSetVisible(ZOOM, CAMERA_CTRL_MODE_PAN == mCurrMode); bool show_presets = (CAMERA_CTRL_MODE_PRESETS == mCurrMode) || (CAMERA_CTRL_MODE_FREE_CAMERA == mCurrMode && CAMERA_CTRL_MODE_PRESETS == mPrevMode); - getChildView(PRESETS)->setVisible(show_presets); + childSetVisible(PRESETS, show_presets); bool show_camera_modes = CAMERA_CTRL_MODE_MODES == mCurrMode || (CAMERA_CTRL_MODE_FREE_CAMERA == mCurrMode && CAMERA_CTRL_MODE_MODES == mPrevMode); - getChildView("camera_modes_list")->setVisible( show_camera_modes); + childSetVisible("camera_modes_list", show_camera_modes); updateItemsSelection(); diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 424191ef26..a76e2f75de 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -62,9 +62,6 @@ public: /** resets current camera mode to orbit mode */ static void resetCameraMode(); - /** Called when Avatar is entered/exited editing appearance mode */ - static void onAvatarEditingAppearance(bool editing); - /* determines actual mode and updates ui */ void update(); @@ -118,12 +115,9 @@ private: // fills flatlist with items from given panel void fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel); - void handleAvatarEditingAppearance(bool editing); - // set to true when free camera mode is selected in modes list // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed static bool sFreeCamera; - static bool sAppearanceEditing; BOOL mClosed; ECameraControlMode mPrevMode; ECameraControlMode mCurrMode; diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 89e745f651..7b86d62c81 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -686,12 +686,12 @@ void LLFloaterColorPicker::drawPalette () void LLFloaterColorPicker::updateTextEntry () { // set values in spinners - getChild("rspin")->setValue(( getCurR () * 255.0f ) ); - getChild("gspin")->setValue(( getCurG () * 255.0f ) ); - getChild("bspin")->setValue(( getCurB () * 255.0f ) ); - getChild("hspin")->setValue(( getCurH () * 360.0f ) ); - getChild("sspin")->setValue(( getCurS () * 100.0f ) ); - getChild("lspin")->setValue(( getCurL () * 100.0f ) ); + childSetValue("rspin", ( getCurR () * 255.0f ) ); + childSetValue("gspin", ( getCurG () * 255.0f ) ); + childSetValue("bspin", ( getCurB () * 255.0f ) ); + childSetValue("hspin", ( getCurH () * 360.0f ) ); + childSetValue("sspin", ( getCurS () * 100.0f ) ); + childSetValue("lspin", ( getCurL () * 100.0f ) ); } ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index aacb543267..8135fb85d1 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -152,11 +152,11 @@ void LLFloaterDayCycle::syncMenu() // turn off Use Estate Time button if it's already being used if( LLWLParamManager::instance()->mAnimator.mUseLindenTime == true) { - getChildView("WLUseLindenTime")->setEnabled(FALSE); + childDisable("WLUseLindenTime"); } else { - getChildView("WLUseLindenTime")->setEnabled(TRUE); + childEnable("WLUseLindenTime"); } } diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 337d4934e1..2e0e7600d8 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -107,7 +107,7 @@ void LLFloaterEnvSettings::syncMenu() // sync cloud coverage bool err; - getChild("EnvCloudSlider")->setValue(LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); + childSetValue("EnvCloudSlider", LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); // sync water params @@ -116,43 +116,43 @@ void LLFloaterEnvSettings::syncMenu() col.mV[3] = 1.0f; colCtrl->set(col); - getChild("EnvWaterFogSlider")->setValue(param_mgr->mFogDensity.mExp); + 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) { - getChildView("EnvUseEstateTimeButton")->setEnabled(FALSE); + childDisable("EnvUseEstateTimeButton"); } else { - getChildView("EnvUseEstateTimeButton")->setEnabled(TRUE); + childEnable("EnvUseEstateTimeButton"); } if(!gPipeline.canUseVertexShaders()) { - getChildView("EnvWaterColor")->setEnabled(FALSE); - getChildView("EnvWaterColorText")->setEnabled(FALSE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(FALSE); + childDisable("EnvWaterColor"); + childDisable("EnvWaterColorText"); + //childDisable("EnvAdvancedWaterButton"); } else { - getChildView("EnvWaterColor")->setEnabled(TRUE); - getChildView("EnvWaterColorText")->setEnabled(TRUE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(TRUE); + childEnable("EnvWaterColor"); + childEnable("EnvWaterColorText"); + //childEnable("EnvAdvancedWaterButton"); } // only allow access to these if they are using windlight if(!gPipeline.canUseWindLightShaders()) { - getChildView("EnvCloudSlider")->setEnabled(FALSE); - getChildView("EnvCloudText")->setEnabled(FALSE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(FALSE); + childDisable("EnvCloudSlider"); + childDisable("EnvCloudText"); + //childDisable("EnvAdvancedSkyButton"); } else { - getChildView("EnvCloudSlider")->setEnabled(TRUE); - getChildView("EnvCloudText")->setEnabled(TRUE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(TRUE); + childEnable("EnvCloudSlider"); + childEnable("EnvCloudText"); + //childEnable("EnvAdvancedSkyButton"); } } diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index ee2ba2ba54..ade4492174 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -209,10 +209,10 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) std::string desc = floater->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z); floater->mTBLocation->setText(desc); - floater->getChildView("rating_icon_m")->setVisible( FALSE); - floater->getChildView("rating_icon_r")->setVisible( FALSE); - floater->getChildView("rating_icon_pg")->setVisible( FALSE); - floater->getChild("rating_value")->setValue(floater->getString("unknown")); + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("unknown")); //for some reason there's not adult flags for now, so see if region is adult and then //set flags @@ -253,25 +253,25 @@ void LLFloaterEvent::regionInfoCallback(U32 event_id, U64 region_handle) // update the event with the maturity info if (sim_info->isAdult()) { - floater->getChildView("rating_icon_m")->setVisible( FALSE); - floater->getChildView("rating_icon_r")->setVisible( TRUE); - floater->getChildView("rating_icon_pg")->setVisible( FALSE); - floater->getChild("rating_value")->setValue(floater->getString("adult")); + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", TRUE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("adult")); } else if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) { - floater->getChildView("rating_icon_m")->setVisible( TRUE); - floater->getChildView("rating_icon_r")->setVisible( FALSE); - floater->getChildView("rating_icon_pg")->setVisible( FALSE); - floater->getChild("rating_value")->setValue(floater->getString("moderate")); + floater->childSetVisible("rating_icon_m", TRUE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("moderate")); } else { - floater->getChildView("rating_icon_m")->setVisible( FALSE); - floater->getChildView("rating_icon_r")->setVisible( FALSE); - floater->getChildView("rating_icon_pg")->setVisible( TRUE); - floater->getChild("rating_value")->setValue(floater->getString("general")); + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", TRUE); + floater->childSetValue("rating_value", floater->getString("general")); } } } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index ef3c8b764e..989f32c7c1 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -188,8 +188,8 @@ BOOL LLFloaterGesture::postBuild() getChild("new_gesture_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickNew, this)); getChild("del_btn")->setClickedCallback(boost::bind(&LLFloaterGesture::onDeleteSelected, this)); - getChildView("play_btn")->setVisible( true); - getChildView("stop_btn")->setVisible( false); + childSetVisible("play_btn", true); + childSetVisible("stop_btn", false); setDefaultBtn("play_btn"); mGestureFolderID = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE, false); @@ -557,13 +557,13 @@ void LLFloaterGesture::onCommitList() mSelectedID = item_id; if (LLGestureMgr::instance().isGesturePlaying(item_id)) { - getChildView("play_btn")->setVisible( false); - getChildView("stop_btn")->setVisible( true); + childSetVisible("play_btn", false); + childSetVisible("stop_btn", true); } else { - getChildView("play_btn")->setVisible( true); - getChildView("stop_btn")->setVisible( false); + childSetVisible("play_btn", true); + childSetVisible("stop_btn", false); } } diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index f95112a8ab..fa8d7a57d5 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -82,7 +82,7 @@ void LLFloaterGodTools::onOpen(const LLSD& key) { center(); setFocus(TRUE); -// LLPanel *panel = getChild("GodTools Tabs")->getCurrentPanel(); +// LLPanel *panel = childGetVisibleTab("GodTools Tabs"); // if (panel) // panel->setFocus(TRUE); if (mPanelObjectTools) @@ -128,7 +128,7 @@ LLFloaterGodTools::LLFloaterGodTools(const LLSD& key) BOOL LLFloaterGodTools::postBuild() { sendRegionInfoRequest(); - getChild("GodTools Tabs")->selectTabByName("region"); + childShowTab("GodTools Tabs", "region"); return TRUE; } // static @@ -197,9 +197,9 @@ void LLFloaterGodTools::draw() void LLFloaterGodTools::showPanel(const std::string& panel_name) { - getChild("GodTools Tabs")->selectTabByName(panel_name); + childShowTab("GodTools Tabs", panel_name); openFloater(); - LLPanel *panel = getChild("GodTools Tabs")->getCurrentPanel(); + LLPanel *panel = childGetVisibleTab("GodTools Tabs"); if (panel) panel->setFocus(TRUE); } @@ -410,17 +410,17 @@ LLPanelRegionTools::LLPanelRegionTools() BOOL LLPanelRegionTools::postBuild() { getChild("region name")->setKeystrokeCallback(onChangeSimName, this); - getChild("region name")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); - getChild("estate")->setPrevalidate(&LLTextValidate::validatePositiveS32); - getChild("parentestate")->setPrevalidate(&LLTextValidate::validatePositiveS32); - getChildView("parentestate")->setEnabled(FALSE); - getChild("gridposx")->setPrevalidate(&LLTextValidate::validatePositiveS32); - getChildView("gridposx")->setEnabled(FALSE); - getChild("gridposy")->setPrevalidate(&LLTextValidate::validatePositiveS32); - getChildView("gridposy")->setEnabled(FALSE); + childSetPrevalidate("region name", &LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("estate", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("parentestate", &LLTextValidate::validatePositiveS32); + childDisable("parentestate"); + childSetPrevalidate("gridposx", &LLTextValidate::validatePositiveS32); + childDisable("gridposx"); + childSetPrevalidate("gridposy", &LLTextValidate::validatePositiveS32); + childDisable("gridposy"); - getChild("redirectx")->setPrevalidate(&LLTextValidate::validatePositiveS32); - getChild("redirecty")->setPrevalidate(&LLTextValidate::validatePositiveS32); + childSetPrevalidate("redirectx", &LLTextValidate::validatePositiveS32); + childSetPrevalidate("redirecty", &LLTextValidate::validatePositiveS32); return TRUE; } @@ -447,42 +447,42 @@ void LLPanelRegionTools::refresh() void LLPanelRegionTools::clearAllWidgets() { // clear all widgets - getChild("region name")->setValue("unknown"); - getChild("region name")->setFocus( FALSE); + childSetValue("region name", "unknown"); + childSetFocus("region name", FALSE); - getChild("check prelude")->setValue(FALSE); - getChildView("check prelude")->setEnabled(FALSE); + childSetValue("check prelude", FALSE); + childDisable("check prelude"); - getChild("check fixed sun")->setValue(FALSE); - getChildView("check fixed sun")->setEnabled(FALSE); + childSetValue("check fixed sun", FALSE); + childDisable("check fixed sun"); - getChild("check reset home")->setValue(FALSE); - getChildView("check reset home")->setEnabled(FALSE); + childSetValue("check reset home", FALSE); + childDisable("check reset home"); - getChild("check damage")->setValue(FALSE); - getChildView("check damage")->setEnabled(FALSE); + childSetValue("check damage", FALSE); + childDisable("check damage"); - getChild("check visible")->setValue(FALSE); - getChildView("check visible")->setEnabled(FALSE); + childSetValue("check visible", FALSE); + childDisable("check visible"); - getChild("block terraform")->setValue(FALSE); - getChildView("block terraform")->setEnabled(FALSE); + childSetValue("block terraform", FALSE); + childDisable("block terraform"); - getChild("block dwell")->setValue(FALSE); - getChildView("block dwell")->setEnabled(FALSE); + childSetValue("block dwell", FALSE); + childDisable("block dwell"); - getChild("is sandbox")->setValue(FALSE); - getChildView("is sandbox")->setEnabled(FALSE); + childSetValue("is sandbox", FALSE); + childDisable("is sandbox"); - getChild("billable factor")->setValue(BILLABLE_FACTOR_DEFAULT); - getChildView("billable factor")->setEnabled(FALSE); + childSetValue("billable factor", BILLABLE_FACTOR_DEFAULT); + childDisable("billable factor"); - getChild("land cost")->setValue(PRICE_PER_METER_DEFAULT); - getChildView("land cost")->setEnabled(FALSE); + childSetValue("land cost", PRICE_PER_METER_DEFAULT); + childDisable("land cost"); - getChildView("Apply")->setEnabled(FALSE); - getChildView("Bake Terrain")->setEnabled(FALSE); - getChildView("Autosave now")->setEnabled(FALSE); + childDisable("Apply"); + childDisable("Bake Terrain"); + childDisable("Autosave now"); } @@ -490,21 +490,21 @@ void LLPanelRegionTools::enableAllWidgets() { // enable all of the widgets - getChildView("check prelude")->setEnabled(TRUE); - getChildView("check fixed sun")->setEnabled(TRUE); - getChildView("check reset home")->setEnabled(TRUE); - getChildView("check damage")->setEnabled(TRUE); - getChildView("check visible")->setEnabled(FALSE); // use estates to update... - getChildView("block terraform")->setEnabled(TRUE); - getChildView("block dwell")->setEnabled(TRUE); - getChildView("is sandbox")->setEnabled(TRUE); + childEnable("check prelude"); + childEnable("check fixed sun"); + childEnable("check reset home"); + childEnable("check damage"); + childDisable("check visible"); // use estates to update... + childEnable("block terraform"); + childEnable("block dwell"); + childEnable("is sandbox"); - getChildView("billable factor")->setEnabled(TRUE); - getChildView("land cost")->setEnabled(TRUE); + childEnable("billable factor"); + childEnable("land cost"); - getChildView("Apply")->setEnabled(FALSE); // don't enable this one - getChildView("Bake Terrain")->setEnabled(TRUE); - getChildView("Autosave now")->setEnabled(TRUE); + childDisable("Apply"); // don't enable this one + childEnable("Bake Terrain"); + childEnable("Autosave now"); } void LLPanelRegionTools::onSaveState(void* userdata) @@ -524,74 +524,74 @@ void LLPanelRegionTools::onSaveState(void* userdata) const std::string LLPanelRegionTools::getSimName() const { - return getChild("region name")->getValue(); + return childGetValue("region name"); } U32 LLPanelRegionTools::getEstateID() const { - U32 id = (U32)getChild("estate")->getValue().asInteger(); + U32 id = (U32)childGetValue("estate").asInteger(); return id; } U32 LLPanelRegionTools::getParentEstateID() const { - U32 id = (U32)getChild("parentestate")->getValue().asInteger(); + U32 id = (U32)childGetValue("parentestate").asInteger(); return id; } S32 LLPanelRegionTools::getRedirectGridX() const { - return getChild("redirectx")->getValue().asInteger(); + return childGetValue("redirectx").asInteger(); } S32 LLPanelRegionTools::getRedirectGridY() const { - return getChild("redirecty")->getValue().asInteger(); + return childGetValue("redirecty").asInteger(); } S32 LLPanelRegionTools::getGridPosX() const { - return getChild("gridposx")->getValue().asInteger(); + return childGetValue("gridposx").asInteger(); } S32 LLPanelRegionTools::getGridPosY() const { - return getChild("gridposy")->getValue().asInteger(); + return childGetValue("gridposy").asInteger(); } U32 LLPanelRegionTools::getRegionFlags() const { U32 flags = 0x0; - flags = getChild("check prelude")->getValue().asBoolean() + flags = childGetValue("check prelude").asBoolean() ? set_prelude_flags(flags) : unset_prelude_flags(flags); // override prelude - if (getChild("check fixed sun")->getValue().asBoolean()) + if (childGetValue("check fixed sun").asBoolean()) { flags |= REGION_FLAGS_SUN_FIXED; } - if (getChild("check reset home")->getValue().asBoolean()) + if (childGetValue("check reset home").asBoolean()) { flags |= REGION_FLAGS_RESET_HOME_ON_TELEPORT; } - if (getChild("check visible")->getValue().asBoolean()) + if (childGetValue("check visible").asBoolean()) { flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; } - if (getChild("check damage")->getValue().asBoolean()) + if (childGetValue("check damage").asBoolean()) { flags |= REGION_FLAGS_ALLOW_DAMAGE; } - if (getChild("block terraform")->getValue().asBoolean()) + if (childGetValue("block terraform").asBoolean()) { flags |= REGION_FLAGS_BLOCK_TERRAFORM; } - if (getChild("block dwell")->getValue().asBoolean()) + if (childGetValue("block dwell").asBoolean()) { flags |= REGION_FLAGS_BLOCK_DWELL; } - if (getChild("is sandbox")->getValue().asBoolean()) + if (childGetValue("is sandbox").asBoolean()) { flags |= REGION_FLAGS_SANDBOX; } @@ -601,35 +601,35 @@ U32 LLPanelRegionTools::getRegionFlags() const U32 LLPanelRegionTools::getRegionFlagsMask() const { U32 flags = 0xffffffff; - flags = getChild("check prelude")->getValue().asBoolean() + flags = childGetValue("check prelude").asBoolean() ? set_prelude_flags(flags) : unset_prelude_flags(flags); - if (!getChild("check fixed sun")->getValue().asBoolean()) + if (!childGetValue("check fixed sun").asBoolean()) { flags &= ~REGION_FLAGS_SUN_FIXED; } - if (!getChild("check reset home")->getValue().asBoolean()) + if (!childGetValue("check reset home").asBoolean()) { flags &= ~REGION_FLAGS_RESET_HOME_ON_TELEPORT; } - if (!getChild("check visible")->getValue().asBoolean()) + if (!childGetValue("check visible").asBoolean()) { flags &= ~REGION_FLAGS_EXTERNALLY_VISIBLE; } - if (!getChild("check damage")->getValue().asBoolean()) + if (!childGetValue("check damage").asBoolean()) { flags &= ~REGION_FLAGS_ALLOW_DAMAGE; } - if (!getChild("block terraform")->getValue().asBoolean()) + if (!childGetValue("block terraform").asBoolean()) { flags &= ~REGION_FLAGS_BLOCK_TERRAFORM; } - if (!getChild("block dwell")->getValue().asBoolean()) + if (!childGetValue("block dwell").asBoolean()) { flags &= ~REGION_FLAGS_BLOCK_DWELL; } - if (!getChild("is sandbox")->getValue().asBoolean()) + if (!childGetValue("is sandbox").asBoolean()) { flags &= ~REGION_FLAGS_SANDBOX; } @@ -638,86 +638,86 @@ U32 LLPanelRegionTools::getRegionFlagsMask() const F32 LLPanelRegionTools::getBillableFactor() const { - return (F32)getChild("billable factor")->getValue().asReal(); + return (F32)childGetValue("billable factor").asReal(); } S32 LLPanelRegionTools::getPricePerMeter() const { - return getChild("land cost")->getValue(); + return childGetValue("land cost"); } void LLPanelRegionTools::setSimName(const std::string& name) { - getChild("region name")->setValue(name); + childSetValue("region name", name); } void LLPanelRegionTools::setEstateID(U32 id) { - getChild("estate")->setValue((S32)id); + childSetValue("estate", (S32)id); } void LLPanelRegionTools::setGridPosX(S32 pos) { - getChild("gridposx")->setValue(pos); + childSetValue("gridposx", pos); } void LLPanelRegionTools::setGridPosY(S32 pos) { - getChild("gridposy")->setValue(pos); + childSetValue("gridposy", pos); } void LLPanelRegionTools::setRedirectGridX(S32 pos) { - getChild("redirectx")->setValue(pos); + childSetValue("redirectx", pos); } void LLPanelRegionTools::setRedirectGridY(S32 pos) { - getChild("redirecty")->setValue(pos); + childSetValue("redirecty", pos); } void LLPanelRegionTools::setParentEstateID(U32 id) { - getChild("parentestate")->setValue((S32)id); + childSetValue("parentestate", (S32)id); } void LLPanelRegionTools::setCheckFlags(U32 flags) { - getChild("check prelude")->setValue(is_prelude(flags) ? TRUE : FALSE); - getChild("check fixed sun")->setValue(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE); - getChild("check reset home")->setValue(flags & REGION_FLAGS_RESET_HOME_ON_TELEPORT ? TRUE : FALSE); - getChild("check damage")->setValue(flags & REGION_FLAGS_ALLOW_DAMAGE ? TRUE : FALSE); - getChild("check visible")->setValue(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE); - getChild("block terraform")->setValue(flags & REGION_FLAGS_BLOCK_TERRAFORM ? TRUE : FALSE); - getChild("block dwell")->setValue(flags & REGION_FLAGS_BLOCK_DWELL ? TRUE : FALSE); - getChild("is sandbox")->setValue(flags & REGION_FLAGS_SANDBOX ? TRUE : FALSE ); + childSetValue("check prelude", is_prelude(flags) ? TRUE : FALSE); + childSetValue("check fixed sun", flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE); + childSetValue("check reset home", flags & REGION_FLAGS_RESET_HOME_ON_TELEPORT ? TRUE : FALSE); + childSetValue("check damage", flags & REGION_FLAGS_ALLOW_DAMAGE ? TRUE : FALSE); + childSetValue("check visible", flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE); + childSetValue("block terraform", flags & REGION_FLAGS_BLOCK_TERRAFORM ? TRUE : FALSE); + childSetValue("block dwell", flags & REGION_FLAGS_BLOCK_DWELL ? TRUE : FALSE); + childSetValue("is sandbox", flags & REGION_FLAGS_SANDBOX ? TRUE : FALSE ); } void LLPanelRegionTools::setBillableFactor(F32 billable_factor) { - getChild("billable factor")->setValue(billable_factor); + childSetValue("billable factor", billable_factor); } void LLPanelRegionTools::setPricePerMeter(S32 price) { - getChild("land cost")->setValue(price); + childSetValue("land cost", price); } void LLPanelRegionTools::onChangeAnything() { if (gAgent.isGodlike()) { - getChildView("Apply")->setEnabled(TRUE); + childEnable("Apply"); } } void LLPanelRegionTools::onChangePrelude() { // checking prelude auto-checks fixed sun - if (getChild("check prelude")->getValue().asBoolean()) + if (childGetValue("check prelude").asBoolean()) { - getChild("check fixed sun")->setValue(TRUE); - getChild("check reset home")->setValue(TRUE); + childSetValue("check fixed sun", TRUE); + childSetValue("check reset home", TRUE); onChangeAnything(); } // pass on to default onChange handler @@ -730,7 +730,7 @@ void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) if (userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; - region_tools->getChildView("Apply")->setEnabled(TRUE); + region_tools->childEnable("Apply"); } } @@ -755,7 +755,7 @@ void LLPanelRegionTools::onApplyChanges() LLViewerRegion *region = gAgent.getRegion(); if (region && gAgent.isGodlike()) { - getChildView("Apply")->setEnabled(FALSE); + childDisable("Apply"); god_tools->sendGodUpdateRegionInfo(); //LLFloaterReg::getTypedInstance("god_tools")->sendGodUpdateRegionInfo(); } @@ -925,7 +925,7 @@ void LLPanelObjectTools::setTargetAvatar(const LLUUID &target_id) mTargetAvatar = target_id; if (target_id.isNull()) { - getChild("target_avatar_name")->setValue(getString("no_target")); + childSetValue("target_avatar_name", getString("no_target")); } } @@ -935,14 +935,14 @@ void LLPanelObjectTools::refresh() LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - getChild("region name")->setValue(regionp->getName()); + childSetText("region name", regionp->getName()); } } U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { - if (getChild("disable scripts")->getValue().asBoolean()) + if (childGetValue("disable scripts").asBoolean()) { flags |= REGION_FLAGS_SKIP_SCRIPTS; } @@ -950,7 +950,7 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { flags &= ~REGION_FLAGS_SKIP_SCRIPTS; } - if (getChild("disable collisions")->getValue().asBoolean()) + if (childGetValue("disable collisions").asBoolean()) { flags |= REGION_FLAGS_SKIP_COLLISIONS; } @@ -958,7 +958,7 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { flags &= ~REGION_FLAGS_SKIP_COLLISIONS; } - if (getChild("disable physics")->getValue().asBoolean()) + if (childGetValue("disable physics").asBoolean()) { flags |= REGION_FLAGS_SKIP_PHYSICS; } @@ -972,36 +972,36 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const void LLPanelObjectTools::setCheckFlags(U32 flags) { - getChild("disable scripts")->setValue(flags & REGION_FLAGS_SKIP_SCRIPTS ? TRUE : FALSE); - getChild("disable collisions")->setValue(flags & REGION_FLAGS_SKIP_COLLISIONS ? TRUE : FALSE); - getChild("disable physics")->setValue(flags & REGION_FLAGS_SKIP_PHYSICS ? TRUE : FALSE); + childSetValue("disable scripts", flags & REGION_FLAGS_SKIP_SCRIPTS ? TRUE : FALSE); + childSetValue("disable collisions", flags & REGION_FLAGS_SKIP_COLLISIONS ? TRUE : FALSE); + childSetValue("disable physics", flags & REGION_FLAGS_SKIP_PHYSICS ? TRUE : FALSE); } void LLPanelObjectTools::clearAllWidgets() { - getChild("disable scripts")->setValue(FALSE); - getChildView("disable scripts")->setEnabled(FALSE); + childSetValue("disable scripts", FALSE); + childDisable("disable scripts"); - getChildView("Apply")->setEnabled(FALSE); - getChildView("Set Target")->setEnabled(FALSE); - getChildView("Delete Target's Scripted Objects On Others Land")->setEnabled(FALSE); - getChildView("Delete Target's Scripted Objects On *Any* Land")->setEnabled(FALSE); - getChildView("Delete *ALL* Of Target's Objects")->setEnabled(FALSE); + childDisable("Apply"); + childDisable("Set Target"); + childDisable("Delete Target's Scripted Objects On Others Land"); + childDisable("Delete Target's Scripted Objects On *Any* Land"); + childDisable("Delete *ALL* Of Target's Objects"); } void LLPanelObjectTools::enableAllWidgets() { - getChildView("disable scripts")->setEnabled(TRUE); + childEnable("disable scripts"); - getChildView("Apply")->setEnabled(FALSE); // don't enable this one - getChildView("Set Target")->setEnabled(TRUE); - getChildView("Delete Target's Scripted Objects On Others Land")->setEnabled(TRUE); - getChildView("Delete Target's Scripted Objects On *Any* Land")->setEnabled(TRUE); - getChildView("Delete *ALL* Of Target's Objects")->setEnabled(TRUE); - getChildView("Get Top Colliders")->setEnabled(TRUE); - getChildView("Get Top Scripts")->setEnabled(TRUE); + 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"); } @@ -1051,7 +1051,7 @@ void LLPanelObjectTools::onClickDeletePublicOwnedBy() SWD_SCRIPTED_ONLY | SWD_OTHERS_LAND_ONLY; LLSD args; - args["AVATAR_NAME"] = getChild("target_avatar_name")->getValue().asString(); + args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1071,7 +1071,7 @@ void LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy() mSimWideDeletesFlags = SWD_SCRIPTED_ONLY; LLSD args; - args["AVATAR_NAME"] = getChild("target_avatar_name")->getValue().asString(); + args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1091,7 +1091,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() mSimWideDeletesFlags = 0; LLSD args; - args["AVATAR_NAME"] = getChild("target_avatar_name")->getValue().asString(); + args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1142,14 +1142,14 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) args["[OBJECT]"] = node->mName; args["[OWNER]"] = owner_name; std::string name = LLTrans::getString("GodToolsObjectOwnedBy", args); - panelp->getChild("target_avatar_name")->setValue(name); + panelp->childSetValue("target_avatar_name", name); } void LLPanelObjectTools::callbackAvatarID(const std::vector& names, const uuid_vec_t& ids) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - getChild("target_avatar_name")->setValue(names[0]); + childSetValue("target_avatar_name", names[0]); refresh(); } @@ -1157,7 +1157,7 @@ void LLPanelObjectTools::onChangeAnything() { if (gAgent.isGodlike()) { - getChildView("Apply")->setEnabled(TRUE); + childEnable("Apply"); } } @@ -1169,7 +1169,7 @@ void LLPanelObjectTools::onApplyChanges() if (region && gAgent.isGodlike()) { // TODO -- implement this - getChildView("Apply")->setEnabled(FALSE); + childDisable("Apply"); god_tools->sendGodUpdateRegionInfo(); //LLFloaterReg::getTypedInstance("god_tools")->sendGodUpdateRegionInfo(); } @@ -1202,7 +1202,7 @@ BOOL LLPanelRequestTools::postBuild() void LLPanelRequestTools::refresh() { - std::string buffer = getChild("destination")->getValue(); + std::string buffer = childGetValue("destination"); LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; @@ -1257,12 +1257,12 @@ void LLPanelRequestTools::sendRequest(const std::string& request, void LLPanelRequestTools::onClickRequest() { - const std::string dest = getChild("destination")->getValue().asString(); + const std::string dest = childGetValue("destination").asString(); if(dest == SELECTION) { - std::string req =getChild("request")->getValue(); + std::string req =childGetValue("request"); req = req.substr(0, req.find_first_of(" ")); - std::string param = getChild("parameter")->getValue(); + std::string param = childGetValue("parameter"); LLSelectMgr::getInstance()->sendGodlikeRequest(req, param); } else if(dest == AGENT_REGION) @@ -1301,7 +1301,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) { // intercept viewer local actions here - std::string req = getChild("request")->getValue(); + std::string req = childGetValue("request"); if (req == "terrain download") { gXferManager->requestFile(std::string("terrain.raw"), std::string("terrain.raw"), LL_PATH_NONE, @@ -1313,7 +1313,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) else { req = req.substr(0, req.find_first_of(" ")); - sendRequest(req, getChild("parameter")->getValue().asString(), host); + sendRequest(req, childGetValue("parameter").asString(), host); } } diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 3cd2154531..f3a3a3c41a 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -41,6 +41,7 @@ #include "llbutton.h" #include "llgroupactions.h" #include "llscrolllistctrl.h" +#include "llselectmgr.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "lltrans.h" @@ -83,13 +84,15 @@ BOOL LLFloaterGroupPicker::postBuild() list_ctrl->setContextMenu(LLScrollListCtrl::MENU_GROUP); } + LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterGroupPicker::onBtnCancel, this)); + childSetAction("OK", onBtnOK, this); childSetAction("Cancel", onBtnCancel, this); setDefaultBtn("OK"); - getChildView("OK")->setEnabled(TRUE); + childEnable("OK"); return TRUE; } @@ -170,8 +173,8 @@ void LLPanelGroups::reset() { group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); } - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); - getChild("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS)); + childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); + childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); init_group_list(getChild("group list"), gAgent.getGroupID()); enableButtons(); @@ -181,8 +184,8 @@ BOOL LLPanelGroups::postBuild() { childSetCommitCallback("group list", onGroupList, this); - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); - getChild("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS)); + childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); + childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); LLScrollListCtrl *list = getChild("group list"); if (list) @@ -222,25 +225,25 @@ void LLPanelGroups::enableButtons() if(group_id != gAgent.getGroupID()) { - getChildView("Activate")->setEnabled(TRUE); + childEnable("Activate"); } else { - getChildView("Activate")->setEnabled(FALSE); + childDisable("Activate"); } if (group_id.notNull()) { - getChildView("Info")->setEnabled(TRUE); - getChildView("IM")->setEnabled(TRUE); - getChildView("Leave")->setEnabled(TRUE); + childEnable("Info"); + childEnable("IM"); + childEnable("Leave"); } else { - getChildView("Info")->setEnabled(FALSE); - getChildView("IM")->setEnabled(FALSE); - getChildView("Leave")->setEnabled(FALSE); + childDisable("Info"); + childDisable("IM"); + childDisable("Leave"); } - getChildView("Create")->setEnabled(gAgent.canJoinGroups()); + childSetEnabled("Create", gAgent.canJoinGroups()); } diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 2985626bd7..af761010c1 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -81,7 +81,7 @@ void LLFloaterHardwareSettings::refresh() mFogRatio = gSavedSettings.getF32("RenderFogRatio"); mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); - getChild("fsaa")->setValue((LLSD::Integer) mFSAASamples); + childSetValue("fsaa", (LLSD::Integer) mFSAASamples); refreshEnabledState(); } @@ -95,13 +95,13 @@ void LLFloaterHardwareSettings::refreshEnabledState() if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { - getChildView("vbo")->setEnabled(FALSE); + childSetEnabled("vbo", FALSE); } // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - getChildView("gamma")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + childSetEnabled("gamma", !gPipeline.canUseWindLightShaders()); + childSetEnabled("(brightness, lower is brighter)", !gPipeline.canUseWindLightShaders()); + childSetEnabled("fog", !gPipeline.canUseWindLightShaders()); } @@ -124,9 +124,9 @@ void LLFloaterHardwareSettings::apply() { // Anisotropic rendering BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; - LLImageGL::sGlobalUseAnisotropic = getChild("ani")->getValue(); + LLImageGL::sGlobalUseAnisotropic = childGetValue("ani"); - U32 fsaa = (U32) getChild("fsaa")->getValue().asInteger(); + U32 fsaa = (U32) childGetValue("fsaa").asInteger(); U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples"); BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index cec98e9992..86e373cff6 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -86,11 +86,11 @@ void LLFloaterHelpBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEven break; case MEDIA_EVENT_NAVIGATE_BEGIN: - getChild("status_text")->setValue(getString("loading_text")); + childSetText("status_text", getString("loading_text")); break; case MEDIA_EVENT_NAVIGATE_COMPLETE: - getChild("status_text")->setValue(getString("done_text")); + childSetText("status_text", getString("done_text")); break; default: diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index c7fbdd5745..c6f03e7308 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -103,7 +103,7 @@ BOOL LLFloaterImagePreview::postBuild() PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); - getChildView("bad_image_text")->setVisible(FALSE); + childHide("bad_image_text"); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { @@ -114,19 +114,19 @@ BOOL LLFloaterImagePreview::postBuild() mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) - getChildView("lossless_check")->setEnabled(TRUE); + childEnable("lossless_check"); } else { mAvatarPreview = NULL; mSculptedPreview = NULL; - getChildView("bad_image_text")->setVisible(TRUE); - getChildView("clothing_type_combo")->setEnabled(FALSE); - getChildView("ok_btn")->setEnabled(FALSE); + childShow("bad_image_text"); + childDisable("clothing_type_combo"); + childDisable("ok_btn"); if(!mImageLoadError.empty()) { - getChild("bad_image_text")->setValue(mImageLoadError.c_str()); + childSetValue("bad_image_text",mImageLoadError.c_str()); } } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 8e7f7e083c..a24048374d 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -148,8 +148,8 @@ void LLFloaterInspect::onSelectObject() { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) { - getChildView("button owner")->setEnabled(true); - getChildView("button creator")->setEnabled(true); + childSetEnabled("button owner", true); + childSetEnabled("button creator", true); } } @@ -172,8 +172,8 @@ void LLFloaterInspect::refresh() LLUUID creator_id; std::string creator_name; S32 pos = mObjectList->getScrollPos(); - getChildView("button owner")->setEnabled(false); - getChildView("button creator")->setEnabled(false); + childSetEnabled("button owner", false); + childSetEnabled("button creator", false); LLUUID selected_uuid; S32 selected_index = mObjectList->getFirstSelectedIndex(); if(selected_index > -1) diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index e1994bb8bc..cc1958b396 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -52,11 +52,11 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) void LLFloaterJoystick::draw() { bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized(); - getChildView("enable_joystick")->setEnabled(joystick_inited); - getChildView("joystick_type")->setEnabled(joystick_inited); + childSetEnabled("enable_joystick", joystick_inited); + childSetEnabled("joystick_type", joystick_inited); std::string desc = LLViewerJoystick::getInstance()->getDescription(); if (desc.empty()) desc = getString("NoDevice"); - getChild("joystick_type")->setValue(desc); + childSetText("joystick_type", desc); LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); for (U32 i = 0; i < 6; i++) diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index a92273521f..dda4e81242 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -323,9 +323,9 @@ void LLFloaterLagMeter::updateControls(bool shrink) setRect(r); reshape(mMaxWidth, getRect().getHeight()); - getChild("client")->setValue(getString("client_text_msg", mStringArgs) + ":"); - getChild("network")->setValue(getString("network_text_msg",mStringArgs) + ":"); - getChild("server")->setValue(getString("server_text_msg", mStringArgs) + ":"); + childSetText("client", getString("client_text_msg", mStringArgs) + ":"); + childSetText("network", getString("network_text_msg",mStringArgs) + ":"); + childSetText("server", getString("server_text_msg", mStringArgs) + ":"); // usually "<<" button->setLabel( getString("smaller_label", mStringArgs) ); @@ -338,9 +338,9 @@ void LLFloaterLagMeter::updateControls(bool shrink) setRect(r); reshape(mMinWidth, getRect().getHeight()); - getChild("client")->setValue(getString("client_text_msg", mStringArgs) ); - getChild("network")->setValue(getString("network_text_msg",mStringArgs) ); - getChild("server")->setValue(getString("server_text_msg", mStringArgs) ); + childSetText("client", getString("client_text_msg", mStringArgs) ); + childSetText("network",getString("network_text_msg",mStringArgs) ); + childSetText("server", getString("server_text_msg", mStringArgs) ); // usually ">>" button->setLabel( getString("bigger_label", mStringArgs) ); @@ -350,15 +350,15 @@ void LLFloaterLagMeter::updateControls(bool shrink) // self->mClientText->setVisible(self->mShrunk); // self->mClientCause->setVisible(self->mShrunk); -// self->getChildView("client_help")->setVisible( self->mShrunk); +// self->childSetVisible("client_help", self->mShrunk); // self->mNetworkText->setVisible(self->mShrunk); // self->mNetworkCause->setVisible(self->mShrunk); -// self->getChildView("network_help")->setVisible( self->mShrunk); +// self->childSetVisible("network_help", self->mShrunk); // self->mServerText->setVisible(self->mShrunk); // self->mServerCause->setVisible(self->mShrunk); -// self->getChildView("server_help")->setVisible( self->mShrunk); +// self->childSetVisible("server_help", self->mShrunk); // self->mShrunk = !self->mShrunk; } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 2f080ab334..027a32c832 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -365,7 +365,7 @@ BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild("Name"); mEditName->setCommitCallback(onCommitAny, this); - getChild("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("Name", LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild("Description"); mEditDesc->setCommitOnFocusLost(TRUE); @@ -382,7 +382,7 @@ BOOL LLPanelLandGeneral::postBuild() mLandType = getChild("LandTypeText"); mBtnProfile = getChild("Profile..."); - mBtnProfile->setClickedCallback(boost::bind(&LLPanelLandGeneral::onClickProfile, this)); + mBtnProfile->setClickedCallback(onClickProfile, this); mTextGroupLabel = getChild("Group:"); @@ -859,9 +859,11 @@ void LLPanelLandGeneral::onClickSetGroup() } } -void LLPanelLandGeneral::onClickProfile() +// static +void LLPanelLandGeneral::onClickProfile(void* data) { - LLParcel* parcel = mParcel->getParcel(); + LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; + LLParcel* parcel = panelp->mParcel->getParcel(); if (!parcel) return; if (parcel->getIsGroupOwned()) @@ -912,6 +914,13 @@ void LLPanelLandGeneral::onClickScriptLimits(void* data) } } +BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) +{ + LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; + LLParcel* parcel = panelp->mParcel->getParcel(); + return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); +} + // static void LLPanelLandGeneral::onClickDeed(void*) { @@ -1125,7 +1134,7 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this)); mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); - getChild("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + childSetPrevalidate("clean other time", LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); @@ -2390,18 +2399,18 @@ void LLPanelLandAccess::refresh() BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); BOOL public_access = !use_access_list && !use_group; - getChild("public_access")->setValue(public_access ); - getChild("GroupCheck")->setValue(use_group ); + childSetValue("public_access", public_access ); + childSetValue("GroupCheck", use_group ); std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); - getChild("GroupCheck")->setLabelArg("[GROUP]", group_name ); + childSetLabelArg("GroupCheck", "[GROUP]", group_name ); // Allow list { S32 count = parcel->mAccessList.size(); - getChild("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); - getChild("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); + childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count)); + childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mAccessList.begin(); cit != parcel->mAccessList.end(); ++cit) @@ -2442,8 +2451,8 @@ void LLPanelLandAccess::refresh() { S32 count = parcel->mBanList.size(); - getChild("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); - getChild("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); + childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count)); + childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mBanList.begin(); cit != parcel->mBanList.end(); ++cit) @@ -2502,27 +2511,27 @@ void LLPanelLandAccess::refresh() if(parcel->getRegionDenyAnonymousOverride()) { - getChild("limit_payment")->setValue(TRUE); - getChild("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); + childSetValue("limit_payment", TRUE); + childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); } else { - getChild("limit_payment")->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS))); - getChild("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() ); + childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS))); + childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", std::string() ); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { - getChild("limit_age_verified")->setValue(TRUE); - getChild("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); + childSetValue("limit_age_verified", TRUE); + childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); } else { - getChild("limit_age_verified")->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); - getChild("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() ); + childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); + childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", std::string() ); } BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - getChild("PassCheck")->setValue(use_pass ); + childSetValue("PassCheck", use_pass ); LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); if (passcombo) { @@ -2533,40 +2542,40 @@ void LLPanelLandAccess::refresh() } S32 pass_price = parcel->getPassPrice(); - getChild("PriceSpin")->setValue((F32)pass_price ); + childSetValue( "PriceSpin", (F32)pass_price ); F32 pass_hours = parcel->getPassHours(); - getChild("HoursSpin")->setValue(pass_hours ); + childSetValue( "HoursSpin", pass_hours ); } else { - getChild("public_access")->setValue(FALSE); - getChild("limit_payment")->setValue(FALSE); - getChild("limit_age_verified")->setValue(FALSE); - getChild("GroupCheck")->setValue(FALSE); - getChild("GroupCheck")->setLabelArg("[GROUP]", LLStringUtil::null ); - getChild("PassCheck")->setValue(FALSE); - getChild("PriceSpin")->setValue((F32)PARCEL_PASS_PRICE_DEFAULT); - getChild("HoursSpin")->setValue(PARCEL_PASS_HOURS_DEFAULT ); - getChild("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); - getChild("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); - getChild("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); - getChild("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); + childSetValue("public_access", FALSE); + childSetValue("limit_payment", FALSE); + childSetValue("limit_age_verified", FALSE); + childSetValue("GroupCheck", FALSE); + childSetLabelArg("GroupCheck", "[GROUP]", LLStringUtil::null ); + childSetValue("PassCheck", FALSE); + childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); + childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); + childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",0)); + childSetToolTipArg("AccessList", "[MAX]", llformat("%d",0)); + childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",0)); + childSetToolTipArg("BannedList", "[MAX]", llformat("%d",0)); } } void LLPanelLandAccess::refresh_ui() { - getChildView("public_access")->setEnabled(FALSE); - getChildView("limit_payment")->setEnabled(FALSE); - getChildView("limit_age_verified")->setEnabled(FALSE); - getChildView("GroupCheck")->setEnabled(FALSE); - getChildView("PassCheck")->setEnabled(FALSE); - getChildView("pass_combo")->setEnabled(FALSE); - getChildView("PriceSpin")->setEnabled(FALSE); - getChildView("HoursSpin")->setEnabled(FALSE); - getChildView("AccessList")->setEnabled(FALSE); - getChildView("BannedList")->setEnabled(FALSE); + childSetEnabled("public_access", FALSE); + childSetEnabled("limit_payment", FALSE); + childSetEnabled("limit_age_verified", FALSE); + childSetEnabled("GroupCheck", FALSE); + childSetEnabled("PassCheck", FALSE); + childSetEnabled("pass_combo", FALSE); + childSetEnabled("PriceSpin", FALSE); + childSetEnabled("HoursSpin", FALSE); + childSetEnabled("AccessList", FALSE); + childSetEnabled("BannedList", FALSE); LLParcel *parcel = mParcel->getParcel(); if (parcel) @@ -2574,73 +2583,73 @@ void LLPanelLandAccess::refresh_ui() BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); - getChildView("public_access")->setEnabled(can_manage_allowed); - BOOL public_access = getChild("public_access")->getValue().asBoolean(); + childSetEnabled("public_access", can_manage_allowed); + BOOL public_access = childGetValue("public_access").asBoolean(); if (public_access) { bool override = false; if(parcel->getRegionDenyAnonymousOverride()) { override = true; - getChildView("limit_payment")->setEnabled(FALSE); + childSetEnabled("limit_payment", FALSE); } else { - getChildView("limit_payment")->setEnabled(can_manage_allowed); + childSetEnabled("limit_payment", can_manage_allowed); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { override = true; - getChildView("limit_age_verified")->setEnabled(FALSE); + childSetEnabled("limit_age_verified", FALSE); } else { - getChildView("limit_age_verified")->setEnabled(can_manage_allowed); + childSetEnabled("limit_age_verified", can_manage_allowed); } if (override) { - getChildView("Only Allow")->setToolTip(getString("estate_override")); + childSetToolTip("Only Allow", getString("estate_override")); } else { - getChildView("Only Allow")->setToolTip(std::string()); + childSetToolTip("Only Allow", std::string()); } - getChildView("GroupCheck")->setEnabled(FALSE); - getChildView("PassCheck")->setEnabled(FALSE); - getChildView("pass_combo")->setEnabled(FALSE); - getChildView("AccessList")->setEnabled(FALSE); + childSetEnabled("GroupCheck", FALSE); + childSetEnabled("PassCheck", FALSE); + childSetEnabled("pass_combo", FALSE); + childSetEnabled("AccessList", FALSE); } else { - getChildView("limit_payment")->setEnabled(FALSE); - getChildView("limit_age_verified")->setEnabled(FALSE); + childSetEnabled("limit_payment", FALSE); + childSetEnabled("limit_age_verified", FALSE); std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - getChildView("GroupCheck")->setEnabled(can_manage_allowed); + childSetEnabled("GroupCheck", can_manage_allowed); } - BOOL group_access = getChild("GroupCheck")->getValue().asBoolean(); - BOOL sell_passes = getChild("PassCheck")->getValue().asBoolean(); - getChildView("PassCheck")->setEnabled(can_manage_allowed); + BOOL group_access = childGetValue("GroupCheck").asBoolean(); + BOOL sell_passes = childGetValue("PassCheck").asBoolean(); + childSetEnabled("PassCheck", can_manage_allowed); if (sell_passes) { - getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed); - getChildView("PriceSpin")->setEnabled(can_manage_allowed); - getChildView("HoursSpin")->setEnabled(can_manage_allowed); + childSetEnabled("pass_combo", group_access && can_manage_allowed); + childSetEnabled("PriceSpin", can_manage_allowed); + childSetEnabled("HoursSpin", can_manage_allowed); } } - getChildView("AccessList")->setEnabled(can_manage_allowed); + childSetEnabled("AccessList", can_manage_allowed); S32 allowed_list_count = parcel->mAccessList.size(); - getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); + childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0; - getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected); + childSetEnabled("remove_allowed", can_manage_allowed && has_selected); - getChildView("BannedList")->setEnabled(can_manage_banned); + childSetEnabled("BannedList", can_manage_banned); S32 banned_list_count = parcel->mBanList.size(); - getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); + childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0; - getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected); + childSetEnabled("remove_banned", can_manage_banned && has_selected); } } @@ -2654,7 +2663,7 @@ void LLPanelLandAccess::refreshNames() { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - getChild("GroupCheck")->setLabelArg("[GROUP]", group_name); + childSetLabelArg("GroupCheck", "[GROUP]", group_name); } @@ -2677,13 +2686,13 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) } // If we disabled public access, enable group access by default (if applicable) - BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); + BOOL public_access = self->childGetValue("public_access").asBoolean(); if (public_access == FALSE) { std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - self->getChild("GroupCheck")->setValue(public_access ? FALSE : TRUE); + self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); } } @@ -2702,8 +2711,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); - BOOL use_access_group = self->getChild("GroupCheck")->getValue().asBoolean(); + BOOL public_access = self->childGetValue("public_access").asBoolean(); + BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean(); if (use_access_group) { std::string group_name; @@ -2721,13 +2730,13 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { use_access_list = FALSE; use_access_group = FALSE; - limit_payment = self->getChild("limit_payment")->getValue().asBoolean(); - limit_age_verified = self->getChild("limit_age_verified")->getValue().asBoolean(); + limit_payment = self->childGetValue("limit_payment").asBoolean(); + limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); } else { use_access_list = TRUE; - use_pass_list = self->getChild("PassCheck")->getValue().asBoolean(); + use_pass_list = self->childGetValue("PassCheck").asBoolean(); if (use_access_group && use_pass_list) { LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); @@ -2741,8 +2750,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } } - S32 pass_price = llfloor((F32)self->getChild("PriceSpin")->getValue().asReal()); - F32 pass_hours = (F32)self->getChild("HoursSpin")->getValue().asReal(); + S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal()); + F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 309e0ee4e1..868b4cf29b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -138,8 +138,9 @@ public: virtual void draw(); void setGroup(const LLUUID& group_id); - void onClickProfile(); - void onClickSetGroup(); + static void onClickProfile(void*); + void onClickSetGroup(); + static BOOL enableDeedToGroup(void*); static void onClickDeed(void*); static void onClickBuyLand(void* data); static void onClickScriptLimits(void* data); diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 31f20fbd29..0ffb3492e0 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -139,8 +139,8 @@ void LLFloaterLandHoldings::refresh() enable_btns = TRUE; } - getChildView("Teleport")->setEnabled(enable_btns); - getChildView("Show on Map")->setEnabled(enable_btns); + childSetEnabled("Teleport", enable_btns); + childSetEnabled("Show on Map", enable_btns); refreshAggregates(); } @@ -328,7 +328,7 @@ void LLFloaterLandHoldings::refreshAggregates() S32 current_area = gStatusBar->getSquareMetersCommitted(); S32 available_area = gStatusBar->getSquareMetersLeft(); - getChild("allowed_text")->setTextArg("[AREA]", llformat("%d",allowed_area)); - getChild("current_text")->setTextArg("[AREA]", llformat("%d",current_area)); - getChild("available_text")->setTextArg("[AREA]", llformat("%d",available_area)); + childSetTextArg("allowed_text", "[AREA]", llformat("%d",allowed_area)); + childSetTextArg("current_text", "[AREA]", llformat("%d",current_area)); + childSetTextArg("available_text", "[AREA]", llformat("%d",available_area)); } diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp index 434d0681ab..08307d11a7 100644 --- a/indra/newview/llfloatermediabrowser.cpp +++ b/indra/newview/llfloatermediabrowser.cpp @@ -59,12 +59,12 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key) void LLFloaterMediaBrowser::draw() { - getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty()); + childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if(parcel) { - getChildView("parcel_owner_controls")->setVisible( LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); - getChildView("assign")->setEnabled(!mAddressCombo->getValue().asString().empty()); + childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); + childSetEnabled("assign", !mAddressCombo->getValue().asString().empty()); } bool show_time_controls = false; bool media_playing = false; @@ -77,17 +77,17 @@ void LLFloaterMediaBrowser::draw() media_playing = media_plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING; } } - getChildView("rewind")->setVisible( show_time_controls); - getChildView("play")->setVisible( show_time_controls && ! media_playing); - getChildView("pause")->setVisible( show_time_controls && media_playing); - getChildView("stop")->setVisible( show_time_controls); - getChildView("seek")->setVisible( show_time_controls); + childSetVisible("rewind", show_time_controls); + childSetVisible("play", show_time_controls && ! media_playing); + childSetVisible("pause", show_time_controls && media_playing); + childSetVisible("stop", show_time_controls); + childSetVisible("seek", show_time_controls); - getChildView("play")->setEnabled(! media_playing); - getChildView("stop")->setEnabled(media_playing); + childSetEnabled("play", ! media_playing); + childSetEnabled("stop", media_playing); - getChildView("back")->setEnabled(mBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); + childSetEnabled("back", mBrowser->canNavigateBack()); + childSetEnabled("forward", mBrowser->canNavigateForward()); LLFloater::draw(); } @@ -167,8 +167,8 @@ void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEve else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // This is the event these flags are sent with. - getChildView("back")->setEnabled(self->getHistoryBackAvailable()); - getChildView("forward")->setEnabled(self->getHistoryForwardAvailable()); + childSetEnabled("back", self->getHistoryBackAvailable()); + childSetEnabled("forward", self->getHistoryForwardAvailable()); } } void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) @@ -186,9 +186,9 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) LLURLHistory::removeURL("browser", mCurrentURL); LLURLHistory::addURL("browser", mCurrentURL); } - getChildView("back")->setEnabled(mBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); - getChildView("reload")->setEnabled(TRUE); + childSetEnabled("back", mBrowser->canNavigateBack()); + childSetEnabled("forward", mBrowser->canNavigateForward()); + childSetEnabled("reload", TRUE); } void LLFloaterMediaBrowser::onOpen(const LLSD& media_url) diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index 58931d112e..c0ffa59883 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -58,7 +58,7 @@ LLFloaterMemLeak::LLFloaterMemLeak(const LLSD& key) BOOL LLFloaterMemLeak::postBuild(void) { F32 a, b ; - a = getChild("leak_speed")->getValue().asReal(); + a = childGetValue("leak_speed").asReal(); if(a > (F32)(0xFFFFFFFF)) { sMemLeakingSpeed = 0xFFFFFFFF ; @@ -67,7 +67,7 @@ BOOL LLFloaterMemLeak::postBuild(void) { sMemLeakingSpeed = (U32)a ; } - b = getChild("max_leak")->getValue().asReal(); + b = childGetValue("max_leak").asReal(); if(b > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -144,7 +144,7 @@ void LLFloaterMemLeak::idle() void LLFloaterMemLeak::onChangeLeakingSpeed() { F32 tmp ; - tmp =getChild("leak_speed")->getValue().asReal(); + tmp =childGetValue("leak_speed").asReal(); if(tmp > (F32)0xFFFFFFFF) { @@ -161,7 +161,7 @@ void LLFloaterMemLeak::onChangeMaxMemLeaking() { F32 tmp ; - tmp =getChild("max_leak")->getValue().asReal(); + tmp =childGetValue("max_leak").asReal(); if(tmp > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -200,22 +200,22 @@ void LLFloaterMemLeak::draw() { std::string bytes_string; LLResMgr::getInstance()->getIntegerString(bytes_string, sTotalLeaked >> 10 ); - getChild("total_leaked_label")->setTextArg("[SIZE]", bytes_string); + childSetTextArg("total_leaked_label", "[SIZE]", bytes_string); } else { - getChild("total_leaked_label")->setTextArg("[SIZE]", LLStringExplicit("0")); + childSetTextArg("total_leaked_label", "[SIZE]", LLStringExplicit("0")); } if(sbAllocationFailed) { - getChild("note_label_1")->setTextArg("[NOTE1]", LLStringExplicit("Memory leaking simulation stops. Reduce leaking speed or")); - getChild("note_label_2")->setTextArg("[NOTE2]", LLStringExplicit("increase max leaked memory, then press Start to continue.")); + childSetTextArg("note_label_1", "[NOTE1]", LLStringExplicit("Memory leaking simulation stops. Reduce leaking speed or")); + childSetTextArg("note_label_2", "[NOTE2]", LLStringExplicit("increase max leaked memory, then press Start to continue.")); } else { - getChild("note_label_1")->setTextArg("[NOTE1]", LLStringExplicit("")); - getChild("note_label_2")->setTextArg("[NOTE2]", LLStringExplicit("")); + childSetTextArg("note_label_1", "[NOTE1]", LLStringExplicit("")); + childSetTextArg("note_label_2", "[NOTE2]", LLStringExplicit("")); } LLFloater::draw(); diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index ae95d4392a..956b387518 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -99,7 +99,7 @@ BOOL LLFloaterNameDesc::postBuild() r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); getChild("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); - getChild("name_form")->setValue(LLSD(asset_name)); + childSetValue("name_form", LLSD(asset_name)); LLLineEditor *NameEditor = getChild("name_form"); if (NameEditor) @@ -125,7 +125,7 @@ BOOL LLFloaterNameDesc::postBuild() // Cancel button getChild("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); - getChild("ok_btn")->setLabelArg("[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); + childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); setDefaultBtn("ok_btn"); @@ -161,15 +161,15 @@ void LLFloaterNameDesc::doCommit() //----------------------------------------------------------------------------- void LLFloaterNameDesc::onBtnOK( ) { - getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads + childDisable("ok_btn"); // don't allow inadvertent extra uploads LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). void *nruserdata = NULL; std::string display_name = LLStringUtil::null; upload_new_resource(mFilenameAndPath, // file - getChild("name_form")->getValue().asString(), - getChild("description_form")->getValue().asString(), + childGetValue("name_form").asString(), + childGetValue("description_form").asString(), 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), display_name, callback, expected_upload_cost, nruserdata); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index d6f6ba9e5b..8e92a20bc1 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -69,7 +69,7 @@ LLFloaterOpenObject::~LLFloaterOpenObject() // virtual BOOL LLFloaterOpenObject::postBuild() { - getChild("object_name")->setTextArg("[DESC]", std::string("Object") ); // *Note: probably do not want to translate this + childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this mPanelInventoryObject = getChild("object_contents"); refresh(); @@ -113,9 +113,9 @@ void LLFloaterOpenObject::refresh() enabled = FALSE; } - getChild("object_name")->setTextArg("[DESC]", name); - getChildView("copy_to_inventory_button")->setEnabled(enabled); - getChildView("copy_and_wear_button")->setEnabled(enabled); + childSetTextArg("object_name", "[DESC]", name); + childSetEnabled("copy_to_inventory_button", enabled); + childSetEnabled("copy_and_wear_button", enabled); } diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp new file mode 100644 index 0000000000..c4a51e8e7f --- /dev/null +++ b/indra/newview/llfloaterparcel.cpp @@ -0,0 +1,122 @@ +/** + * @file llfloaterparcel.cpp + * @brief LLFloaterParcel class implementation + * Parcel information as shown in a floating window from secondlife:// command + * handler. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llfloaterparcel.h" + +#include "llfloaterreg.h" + +// viewer project includes +#include "llcommandhandler.h" +#include "llpanelplace.h" +#include "llsidetray.h" + +// linden library includes +#include "lluuid.h" +#include "lluictrlfactory.h" + +//----------------------------------------------------------------------------- +// Globals +//----------------------------------------------------------------------------- + +class LLParcelHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 2) + { + return false; + } + LLUUID parcel_id; + if (!parcel_id.set(params[0], FALSE)) + { + return false; + } + if (params[1].asString() == "about") + { + if (parcel_id.notNull()) + { + LLSD key; + key["type"] = "remote_place"; + key["id"] = parcel_id; + LLSideTray::getInstance()->showPanel("panel_places", key); + return true; + } + } + return false; + } +}; +LLParcelHandler gParcelHandler; + +//----------------------------------------------------------------------------- +// Member functions +//----------------------------------------------------------------------------- + +//---------------------------------------------------------------------------- + +void* LLFloaterParcelInfo::createPanelPlace(void* data) +{ + LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; + self->mPanelParcelp = new LLPanelPlace(); // allow edit self + LLUICtrlFactory::getInstance()->buildPanel(self->mPanelParcelp, "panel_place.xml"); + return self->mPanelParcelp; +} + +//---------------------------------------------------------------------------- + + +LLFloaterParcelInfo::LLFloaterParcelInfo(const LLSD& parcel_id) +: LLFloater(parcel_id), + mParcelID( parcel_id.asUUID() ), + mPanelParcelp(NULL) +{ + mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); +} + +// virtual +LLFloaterParcelInfo::~LLFloaterParcelInfo() +{ + +} + +BOOL LLFloaterParcelInfo::postBuild() +{ + if (mPanelParcelp) + { + mPanelParcelp->setParcelID(mParcelID); + } + center(); + return LLFloater::postBuild(); +} + + diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llfloaterparcel.h new file mode 100644 index 0000000000..7463edcb90 --- /dev/null +++ b/indra/newview/llfloaterparcel.h @@ -0,0 +1,53 @@ +/** + * @file llfloaterparcel.h + * @brief Parcel information as shown in a floating window from a sl-url. + * Just a wrapper for LLPanelPlace, shared with the Find directory. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#ifndef LL_FLOATERPARCELINFO_H +#define LL_FLOATERPARCELINFO_H + +#include "llfloater.h" + +class LLPanelPlace; + +class LLFloaterParcelInfo +: public LLFloater +{ +public: + static void* createPanelPlace(void* data); + + LLFloaterParcelInfo( const LLSD& parcel_id ); + /*virtual*/ ~LLFloaterParcelInfo(); + + /*virtual*/ BOOL postBuild(); + + void displayParcelInfo(const LLUUID& parcel_id); + +private: + LLUUID mParcelID; // for which parcel is this window? + LLPanelPlace* mPanelParcelp; +}; + + +#endif diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 151a76285b..ebc0b90fa9 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -152,7 +152,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 1",&LLFloaterPay::onGive,info); - getChildView("fastpay 1")->setVisible( FALSE); + childSetVisible("fastpay 1", FALSE); mQuickPayButton[i] = getChild("fastpay 1"); mQuickPayInfo[i] = info; @@ -162,7 +162,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 5",&LLFloaterPay::onGive,info); - getChildView("fastpay 5")->setVisible( FALSE); + childSetVisible("fastpay 5", FALSE); mQuickPayButton[i] = getChild("fastpay 5"); mQuickPayInfo[i] = info; @@ -172,7 +172,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 10",&LLFloaterPay::onGive,info); - getChildView("fastpay 10")->setVisible( FALSE); + childSetVisible("fastpay 10", FALSE); mQuickPayButton[i] = getChild("fastpay 10"); mQuickPayInfo[i] = info; @@ -182,14 +182,14 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 20",&LLFloaterPay::onGive,info); - getChildView("fastpay 20")->setVisible( FALSE); + childSetVisible("fastpay 20", FALSE); mQuickPayButton[i] = getChild("fastpay 20"); mQuickPayInfo[i] = info; ++i; - getChildView("amount text")->setVisible( FALSE); + childSetVisible("amount text", FALSE); std::string last_amount; if(sLastAmount > 0) @@ -197,19 +197,19 @@ BOOL LLFloaterPay::postBuild() last_amount = llformat("%d", sLastAmount); } - getChildView("amount")->setVisible( FALSE); + childSetVisible("amount", FALSE); getChild("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this); - getChild("amount")->setValue(last_amount); - getChild("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + childSetText("amount", last_amount); + childSetPrevalidate("amount", LLTextValidate::validateNonNegativeS32); info = new LLGiveMoneyInfo(this, 0); mCallbackData.push_back(info); childSetAction("pay btn",&LLFloaterPay::onGive,info); setDefaultBtn("pay btn"); - getChildView("pay btn")->setVisible( FALSE); - getChildView("pay btn")->setEnabled((sLastAmount > 0)); + childSetVisible("pay btn", FALSE); + childSetEnabled("pay btn", (sLastAmount > 0)); childSetAction("cancel btn",&LLFloaterPay::onCancel,this); @@ -243,27 +243,27 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) if (PAY_PRICE_HIDE == price) { - self->getChildView("amount")->setVisible( FALSE); - self->getChildView("pay btn")->setVisible( FALSE); - self->getChildView("amount text")->setVisible( FALSE); + self->childSetVisible("amount", FALSE); + self->childSetVisible("pay btn", FALSE); + self->childSetVisible("amount text", FALSE); } else if (PAY_PRICE_DEFAULT == price) { - self->getChildView("amount")->setVisible( TRUE); - self->getChildView("pay btn")->setVisible( TRUE); - self->getChildView("amount text")->setVisible( TRUE); + self->childSetVisible("amount", TRUE); + self->childSetVisible("pay btn", TRUE); + self->childSetVisible("amount text", TRUE); } else { // PAY_PRICE_HIDE and PAY_PRICE_DEFAULT are negative values // So we take the absolute value here after we have checked for those cases - self->getChildView("amount")->setVisible( TRUE); - self->getChildView("pay btn")->setVisible( TRUE); - self->getChildView("pay btn")->setEnabled(TRUE); - self->getChildView("amount text")->setVisible( TRUE); + self->childSetVisible("amount", TRUE); + self->childSetVisible("pay btn", TRUE); + self->childSetEnabled("pay btn", TRUE); + self->childSetVisible("amount text", TRUE); - self->getChild("amount")->setValue(llformat("%d", llabs(price))); + self->childSetText("amount", llformat("%d", llabs(price))); } S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_ButtonData); @@ -286,7 +286,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->mQuickPayButton[i]->setLabelUnselected(button_str); self->mQuickPayButton[i]->setVisible(TRUE); self->mQuickPayInfo[i]->mAmount = pay_button; - self->getChildView("fastpay text")->setVisible(TRUE); + self->childSetVisible("fastpay text",TRUE); if ( pay_button > max_pay_amount ) { @@ -393,7 +393,7 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandlemPermissions->getOwnership(owner_id, is_group); - floater->getChild("object_name_text")->setValue(node->mName); + floater->childSetText("object_name_text",node->mName); floater->finishPayUI(owner_id, is_group); } @@ -409,11 +409,11 @@ void LLFloaterPay::payDirectly(money_callback callback, floater->setCallback(callback); floater->mObjectSelection = NULL; - floater->getChildView("amount")->setVisible( TRUE); - floater->getChildView("pay btn")->setVisible( TRUE); - floater->getChildView("amount text")->setVisible( TRUE); + floater->childSetVisible("amount", TRUE); + floater->childSetVisible("pay btn", TRUE); + floater->childSetVisible("amount text", TRUE); - floater->getChildView("fastpay text")->setVisible(TRUE); + floater->childSetVisible("fastpay text",TRUE); for(S32 i=0;imQuickPayButton[i]->setVisible(TRUE); @@ -428,7 +428,7 @@ void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) // Make sure the amount field has focus - getChild("amount")->setFocus( TRUE); + childSetFocus("amount", TRUE); LLLineEditor* amount = getChild("amount"); amount->selectAll(); @@ -449,8 +449,8 @@ void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, setTitle(getString("payee_resident")); } - getChild("payee_name")->setTextArg("[FIRST]", firstname); - getChild("payee_name")->setTextArg("[LAST]", lastname); + childSetTextArg("payee_name", "[FIRST]", firstname); + childSetTextArg("payee_name", "[LAST]", lastname); } // static @@ -470,8 +470,8 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) if(self) { // enable the Pay button when amount is non-empty and positive, disable otherwise - std::string amtstr = self->getChild("amount")->getValue().asString(); - self->getChildView("pay btn")->setEnabled(!amtstr.empty() && atoi(amtstr.c_str()) > 0); + std::string amtstr = self->childGetText("amount"); + self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0); } } @@ -494,7 +494,7 @@ void LLFloaterPay::give(S32 amount) // text field. if(amount == 0) { - amount = atoi(getChild("amount")->getValue().asString().c_str()); + amount = atoi(childGetText("amount").c_str()); } sLastAmount = amount; diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index bcdcd50288..0a321b999f 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -93,16 +93,16 @@ BOOL LLFloaterPostcard::postBuild() childSetAction("cancel_btn", onClickCancel, this); childSetAction("send_btn", onClickSend, this); - getChildView("from_form")->setEnabled(FALSE); + childDisable("from_form"); std::string name_string; LLAgentUI::buildFullname(name_string); - getChild("name_form")->setValue(LLSD(name_string)); + childSetValue("name_form", LLSD(name_string)); // For the first time a user focusess to .the msg box, all text will be selected. getChild("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this)); - getChild("to_form")->setFocus(TRUE); + childSetFocus("to_form", TRUE); return TRUE; } @@ -209,8 +209,8 @@ void LLFloaterPostcard::onClickSend(void* data) { LLFloaterPostcard *self = (LLFloaterPostcard *)data; - std::string from(self->getChild("from_form")->getValue().asString()); - std::string to(self->getChild("to_form")->getValue().asString()); + std::string from(self->childGetValue("from_form").asString()); + std::string to(self->childGetValue("to_form").asString()); boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); @@ -226,7 +226,7 @@ void LLFloaterPostcard::onClickSend(void* data) return; } - std::string subject(self->getChild("subject_form")->getValue().asString()); + std::string subject(self->childGetValue("subject_form").asString()); if(subject.empty() || !self->mHasFirstMsgFocus) { LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2)); @@ -269,11 +269,11 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, msg->addUUID("SessionID", gAgent.getSessionID()); msg->addUUID("AssetID", self->mAssetID); msg->addVector3d("PosGlobal", self->mPosTakenGlobal); - msg->addString("To", self->getChild("to_form")->getValue().asString()); - msg->addString("From", self->getChild("from_form")->getValue().asString()); - msg->addString("Name", self->getChild("name_form")->getValue().asString()); - msg->addString("Subject", self->getChild("subject_form")->getValue().asString()); - msg->addString("Msg", self->getChild("msg_form")->getValue().asString()); + msg->addString("To", self->childGetValue("to_form").asString()); + msg->addString("From", self->childGetValue("from_form").asString()); + msg->addString("Name", self->childGetValue("name_form").asString()); + msg->addString("Subject", self->childGetValue("subject_form").asString()); + msg->addString("Msg", self->childGetValue("msg_form").asString()); msg->addBOOL("AllowPublish", FALSE); msg->addBOOL("MaturePublish", FALSE); gAgent.sendReliableMessage(); @@ -290,11 +290,11 @@ void LLFloaterPostcard::updateUserInfo(const std::string& email) iter != inst_list.end(); ++iter) { LLFloater* instance = *iter; - const std::string& text = instance->getChild("from_form")->getValue().asString(); + const std::string& text = instance->childGetValue("from_form").asString(); if (text.empty()) { // there's no text in this field yet, pre-populate - instance->getChild("from_form")->setValue(LLSD(email)); + instance->childSetValue("from_form", LLSD(email)); } } } @@ -319,17 +319,17 @@ bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, co if(0 == option) { // User clicked OK - if((getChild("subject_form")->getValue().asString()).empty()) + if((childGetValue("subject_form").asString()).empty()) { // Stuff the subject back into the form. - getChild("subject_form")->setValue(getString("default_subject")); + childSetValue("subject_form", getString("default_subject")); } if(!mHasFirstMsgFocus) { // The user never switched focus to the messagee window. // Using the default string. - getChild("msg_form")->setValue(getString("default_message")); + childSetValue("msg_form", getString("default_message")); } sendPostcard(); @@ -351,11 +351,11 @@ void LLFloaterPostcard::sendPostcard() LLSD body = LLSD::emptyMap(); // the capability already encodes: agent ID, region ID body["pos-global"] = mPosTakenGlobal.getValue(); - body["to"] = getChild("to_form")->getValue().asString(); - body["from"] = getChild("from_form")->getValue().asString(); - body["name"] = getChild("name_form")->getValue().asString(); - body["subject"] = getChild("subject_form")->getValue().asString(); - body["msg"] = getChild("msg_form")->getValue().asString(); + body["to"] = childGetValue("to_form").asString(); + body["from"] = childGetValue("from_form").asString(); + body["name"] = childGetValue("name_form").asString(); + body["subject"] = childGetValue("subject_form").asString(); + body["msg"] = childGetValue("msg_form").asString(); LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, mAssetID, LLAssetType::AT_IMAGE_JPEG)); } else diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index 7f27caf68f..5092bef724 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -206,25 +206,25 @@ void LLFloaterPostProcess::syncMenu() comboBox->selectByValue(gPostProcess->getSelectedEffect()); /// Sync Color Filter Menu - getChild("ColorFilterToggle")->setValue(gPostProcess->tweaks.useColorFilter()); - //getChild("ColorFilterGamma")->setValue(gPostProcess->tweaks.gamma()); - getChild("ColorFilterBrightness")->setValue(gPostProcess->tweaks.brightness()); - getChild("ColorFilterSaturation")->setValue(gPostProcess->tweaks.saturation()); - getChild("ColorFilterContrast")->setValue(gPostProcess->tweaks.contrast()); - getChild("ColorFilterBaseR")->setValue(gPostProcess->tweaks.contrastBaseR()); - getChild("ColorFilterBaseG")->setValue(gPostProcess->tweaks.contrastBaseG()); - getChild("ColorFilterBaseB")->setValue(gPostProcess->tweaks.contrastBaseB()); - getChild("ColorFilterBaseI")->setValue(gPostProcess->tweaks.contrastBaseIntensity()); + childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter()); + //childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma()); + childSetValue("ColorFilterBrightness", gPostProcess->tweaks.brightness()); + childSetValue("ColorFilterSaturation", gPostProcess->tweaks.saturation()); + childSetValue("ColorFilterContrast", gPostProcess->tweaks.contrast()); + childSetValue("ColorFilterBaseR", gPostProcess->tweaks.contrastBaseR()); + childSetValue("ColorFilterBaseG", gPostProcess->tweaks.contrastBaseG()); + childSetValue("ColorFilterBaseB", gPostProcess->tweaks.contrastBaseB()); + childSetValue("ColorFilterBaseI", gPostProcess->tweaks.contrastBaseIntensity()); /// Sync Night Vision Menu - getChild("NightVisionToggle")->setValue(gPostProcess->tweaks.useNightVisionShader()); - getChild("NightVisionBrightMult")->setValue(gPostProcess->tweaks.brightMult()); - getChild("NightVisionNoiseSize")->setValue(gPostProcess->tweaks.noiseSize()); - getChild("NightVisionNoiseStrength")->setValue(gPostProcess->tweaks.noiseStrength()); + childSetValue("NightVisionToggle", gPostProcess->tweaks.useNightVisionShader()); + childSetValue("NightVisionBrightMult", gPostProcess->tweaks.brightMult()); + childSetValue("NightVisionNoiseSize", gPostProcess->tweaks.noiseSize()); + childSetValue("NightVisionNoiseStrength", gPostProcess->tweaks.noiseStrength()); /// Sync Bloom Menu - getChild("BloomToggle")->setValue(LLSD(gPostProcess->tweaks.useBloomShader())); - getChild("BloomExtract")->setValue(gPostProcess->tweaks.extractLow()); - getChild("BloomSize")->setValue(gPostProcess->tweaks.bloomWidth()); - getChild("BloomStrength")->setValue(gPostProcess->tweaks.bloomStrength()); + childSetValue("BloomToggle", LLSD(gPostProcess->tweaks.useBloomShader())); + childSetValue("BloomExtract", gPostProcess->tweaks.extractLow()); + childSetValue("BloomSize", gPostProcess->tweaks.bloomWidth()); + childSetValue("BloomStrength", gPostProcess->tweaks.bloomStrength()); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3804a1b858..ee8836bb47 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -138,7 +138,7 @@ LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key) BOOL LLVoiceSetKeyDialog::postBuild() { childSetAction("Cancel", onCancel, this); - getChild("Cancel")->setFocus(TRUE); + childSetFocus("Cancel"); gFocusMgr.setKeystrokesOnly(TRUE); @@ -324,7 +324,7 @@ BOOL LLFloaterPreference::postBuild() tabcontainer->selectFirstTab(); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - getChild("cache_location")->setValue(cache_location); + childSetText("cache_location", cache_location); // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -420,28 +420,28 @@ void LLFloaterPreference::apply() fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - getChild("cache_location")->setValue(cache_location); + childSetText("cache_location", cache_location); - LLViewerMedia::setCookiesEnabled(getChild("cookies_enabled")->getValue()); + LLViewerMedia::setCookiesEnabled(childGetValue("cookies_enabled")); if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) { - bool proxy_enable = getChild("web_proxy_enabled")->getValue(); - std::string proxy_address = getChild("web_proxy_editor")->getValue(); - int proxy_port = getChild("web_proxy_port")->getValue(); + bool proxy_enable = childGetValue("web_proxy_enabled"); + std::string proxy_address = childGetValue("web_proxy_editor"); + int proxy_port = childGetValue("web_proxy_port"); LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); } // LLWString busy_response = utf8str_to_wstring(getChild("busy_response")->getValue().asString()); // LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); - gSavedSettings.setBOOL("PlainTextChatHistory", getChild("plain_text_chat_history")->getValue().asBoolean()); + gSavedSettings.setBOOL("PlainTextChatHistory", childGetValue("plain_text_chat_history").asBoolean()); if(mGotPersonalInfo) { // gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response))); - bool new_im_via_email = getChild("send_im_to_email")->getValue().asBoolean(); - bool new_hide_online = getChild("online_visibility")->getValue().asBoolean(); + bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); + bool new_hide_online = childGetValue("online_visibility").asBoolean(); if((new_im_via_email != mOriginalIMViaEmail) ||(new_hide_online != mOriginalHideOnlineStatus)) @@ -539,13 +539,13 @@ void LLFloaterPreference::onOpen(const LLSD& key) maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT)); } } - getChildView("maturity_desired_combobox")->setVisible( true); - getChildView("maturity_desired_textbox")->setVisible( false); + childSetVisible("maturity_desired_combobox", true); + childSetVisible("maturity_desired_textbox", false); } else { - getChild("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel()); - getChildView("maturity_desired_combobox")->setVisible( false); + childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel()); + childSetVisible("maturity_desired_combobox", false); } // Display selected maturity icons. @@ -838,7 +838,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLComboBox* ctrl_reflections = getChild("Reflections"); + LLCheckBoxCtrl* ctrl_reflections = getChild("Reflections"); LLRadioGroup* radio_reflection_detail = getChild("ReflectionDetailRadio"); // Reflections @@ -851,7 +851,7 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); getChild("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE); - radio_reflection_detail->setEnabled(reflections); + radio_reflection_detail->setEnabled(ctrl_reflections->get() && reflections); // Avatar Mode // Enable Avatar Shaders @@ -897,47 +897,20 @@ void LLFloaterPreference::refreshEnabledState() // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); - - //Deferred/SSAO/Shadows - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") && - LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - shaders) - { - BOOL enabled = (ctrl_wind_light->get()) ? TRUE : FALSE; - - ctrl_deferred->setEnabled(enabled); - - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); - LLComboBox* ctrl_shadow = getChild("ShadowDetail"); - - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); - - ctrl_ssao->setEnabled(enabled); - - enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); - - ctrl_shadow->setEnabled(enabled); - } - - // now turn off any features that are unavailable disableUnavailableSettings(); - getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); + childSetEnabled ("block_list", LLLoginInstance::getInstance()->authSuccess()); } void LLFloaterPreference::disableUnavailableSettings() { - LLComboBox* ctrl_reflections = getChild("Reflections"); + LLCheckBoxCtrl* ctrl_reflections = getChild("Reflections"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); - LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - LLComboBox* ctrl_shadows = getChild("ShadowDetail"); - LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); // if vertex shaders off, disable all shader related products if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) @@ -949,22 +922,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setValue(FALSE); ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(0); + ctrl_reflections->setValue(FALSE); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); - - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); } // disabled windlight @@ -972,47 +936,10 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); - - //deferred needs windlight, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); - } - - // disabled deferred SSAO - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) - { - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); } - // disabled deferred shadows - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) - { - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - } - // disabled reflections - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections")) { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); @@ -1026,25 +953,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); - - //deferred needs AvatarVP, disable deferred - ctrl_shadows->setEnabled(FALSE); - ctrl_shadows->setValue(0); - - ctrl_ssao->setEnabled(FALSE); - ctrl_ssao->setValue(FALSE); - - ctrl_deferred->setEnabled(FALSE); - ctrl_deferred->setValue(FALSE); } - // disabled cloth if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) { ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); } - // disabled impostors if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) { @@ -1095,7 +1010,7 @@ void LLFloaterPreference::onClickSetKey() void LLFloaterPreference::setKey(KEY key) { - getChild("modifier_combo")->setValue(LLKeyboard::stringFromKey(key)); + childSetValue("modifier_combo", LLKeyboard::stringFromKey(key)); // update the control right away since we no longer wait for apply getChild("modifier_combo")->onCommit(); } @@ -1208,46 +1123,46 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im if(visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; - getChildView("online_visibility")->setEnabled(TRUE); + childEnable("online_visibility"); } else if(visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; - getChildView("online_visibility")->setEnabled(TRUE); + childEnable("online_visibility"); } else { mOriginalHideOnlineStatus = true; } - getChildView("include_im_in_chat_history")->setEnabled(TRUE); - getChildView("show_timestamps_check_im")->setEnabled(TRUE); - getChildView("friends_online_notify_checkbox")->setEnabled(TRUE); - - getChild("online_visibility")->setValue(mOriginalHideOnlineStatus); - getChild("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); - getChildView("send_im_to_email")->setEnabled(TRUE); - getChild("send_im_to_email")->setValue(im_via_email); - getChildView("plain_text_chat_history")->setEnabled(TRUE); - getChild("plain_text_chat_history")->setValue(gSavedSettings.getBOOL("PlainTextChatHistory")); - getChildView("log_instant_messages")->setEnabled(TRUE); -// getChildView("log_chat")->setEnabled(TRUE); -// getChildView("busy_response")->setEnabled(TRUE); -// getChildView("log_instant_messages_timestamp")->setEnabled(TRUE); -// getChildView("log_chat_timestamp")->setEnabled(TRUE); - getChildView("log_chat_IM")->setEnabled(TRUE); - getChildView("log_date_timestamp")->setEnabled(TRUE); - -// getChild("busy_response")->setValue(gSavedSettings.getString("BusyModeResponse2")); - - getChildView("log_nearby_chat")->setEnabled(TRUE); - getChildView("log_instant_messages")->setEnabled(TRUE); - getChildView("show_timestamps_check_im")->setEnabled(TRUE); - getChildView("log_path_string")->setEnabled(FALSE);// LineEditor becomes readonly in this case. - getChildView("log_path_button")->setEnabled(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); - getChild("email_address")->setValue(display_email); + childSetText("email_address",display_email); } @@ -1346,8 +1261,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("voice_unavailable")) { BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); - getChildView("voice_unavailable")->setVisible( voice_disabled); - getChildView("enable_voice_check")->setVisible( !voice_disabled); + childSetVisible("voice_unavailable", voice_disabled); + childSetVisible("enable_voice_check", !voice_disabled); } //////////////////////PanelSkins /////////////////// @@ -1367,8 +1282,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("online_visibility") && hasChild("send_im_to_email")) { - getChild("email_address")->setValue(getString("log_in_to_change") ); -// getChild("busy_response")->setValue(getString("log_in_to_change")); + childSetText("email_address",getString("log_in_to_change") ); +// childSetText("busy_response", getString("log_in_to_change")); } //////////////////////PanelPrivacy /////////////////// @@ -1392,9 +1307,9 @@ BOOL LLPanelPreference::postBuild() if (hasChild("modifier_combo")) { //localizing if push2talk button is set to middle mouse - if (MIDDLE_MOUSE_CV == getChild("modifier_combo")->getValue().asString()) + if (MIDDLE_MOUSE_CV == childGetValue("modifier_combo").asString()) { - getChild("modifier_combo")->setValue(getString("middle_mouse")); + childSetValue("modifier_combo", getString("middle_mouse")); } } diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index e4e4713dbc..ebe98eb2e1 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -124,9 +124,9 @@ BOOL LLFloaterProperties::postBuild() { // build the UI // item name & description - getChild("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); getChild("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this)); - getChild("LabelItemDesc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); getChild("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties:: onCommitDescription, this)); // Creator information getChild("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this)); @@ -195,7 +195,7 @@ void LLFloaterProperties::refresh() }; for(size_t t=0; tsetEnabled(false); + childSetEnabled(enableNames[t],false); } const char* hideNames[]={ "BaseMaskDebug", @@ -206,7 +206,7 @@ void LLFloaterProperties::refresh() }; for(size_t t=0; tsetVisible(false); + childSetVisible(hideNames[t],false); } } } @@ -259,13 +259,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete; - getChildView("LabelItemNameTitle")->setEnabled(TRUE); - getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards - getChild("LabelItemName")->setValue(item->getName()); - getChildView("LabelItemDescTitle")->setEnabled(TRUE); - getChildView("LabelItemDesc")->setEnabled(is_modifiable); - getChildView("IconLocked")->setVisible(!is_modifiable); - getChild("LabelItemDesc")->setValue(item->getDescription()); + childSetEnabled("LabelItemNameTitle",TRUE); + childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards + childSetText("LabelItemName",item->getName()); + childSetEnabled("LabelItemDescTitle",TRUE); + childSetEnabled("LabelItemDesc",is_modifiable); + childSetVisible("IconLocked",!is_modifiable); + childSetText("LabelItemDesc",item->getDescription()); ////////////////// // CREATOR NAME // @@ -277,17 +277,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) { std::string name; gCacheName->getFullName(item->getCreatorUUID(), name); - getChildView("BtnCreator")->setEnabled(TRUE); - getChildView("LabelCreatorTitle")->setEnabled(TRUE); - getChildView("LabelCreatorName")->setEnabled(TRUE); - getChild("LabelCreatorName")->setValue(name); + childSetEnabled("BtnCreator",TRUE); + childSetEnabled("LabelCreatorTitle",TRUE); + childSetEnabled("LabelCreatorName",TRUE); + childSetText("LabelCreatorName",name); } else { - getChildView("BtnCreator")->setEnabled(FALSE); - getChildView("LabelCreatorTitle")->setEnabled(FALSE); - getChildView("LabelCreatorName")->setEnabled(FALSE); - getChild("LabelCreatorName")->setValue(getString("unknown")); + childSetEnabled("BtnCreator",FALSE); + childSetEnabled("LabelCreatorTitle",FALSE); + childSetEnabled("LabelCreatorName",FALSE); + childSetText("LabelCreatorName",getString("unknown")); } //////////////// @@ -304,17 +304,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) { gCacheName->getFullName(perm.getOwner(), name); } - getChildView("BtnOwner")->setEnabled(TRUE); - getChildView("LabelOwnerTitle")->setEnabled(TRUE); - getChildView("LabelOwnerName")->setEnabled(TRUE); - getChild("LabelOwnerName")->setValue(name); + childSetEnabled("BtnOwner",TRUE); + childSetEnabled("LabelOwnerTitle",TRUE); + childSetEnabled("LabelOwnerName",TRUE); + childSetText("LabelOwnerName",name); } else { - getChildView("BtnOwner")->setEnabled(FALSE); - getChildView("LabelOwnerTitle")->setEnabled(FALSE); - getChildView("LabelOwnerName")->setEnabled(FALSE); - getChild("LabelOwnerName")->setValue(getString("public")); + childSetEnabled("BtnOwner",FALSE); + childSetEnabled("LabelOwnerTitle",FALSE); + childSetEnabled("LabelOwnerName",FALSE); + childSetText("LabelOwnerName",getString("public")); } ////////////////// @@ -324,7 +324,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) time_t time_utc = item->getCreationDate(); if (0 == time_utc) { - getChild("LabelAcquiredDate")->setValue(getString("unknown")); + childSetText("LabelAcquiredDate",getString("unknown")); } else { @@ -332,7 +332,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); - getChild("LabelAcquiredDate")->setValue(timeStr); + childSetText ("LabelAcquiredDate", timeStr); } /////////////////////// @@ -340,11 +340,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) /////////////////////// if(can_agent_manipulate) { - getChild("OwnerLabel")->setValue(getString("you_can")); + childSetText("OwnerLabel",getString("you_can")); } else { - getChild("OwnerLabel")->setValue(getString("owner_can")); + childSetText("OwnerLabel",getString("owner_can")); } U32 base_mask = perm.getMaskBase(); @@ -353,13 +353,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - getChildView("OwnerLabel")->setEnabled(TRUE); - getChildView("CheckOwnerModify")->setEnabled(FALSE); - getChild("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); - getChildView("CheckOwnerCopy")->setEnabled(FALSE); - getChild("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY))); - getChildView("CheckOwnerTransfer")->setEnabled(FALSE); - getChild("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + childSetEnabled("OwnerLabel",TRUE); + childSetEnabled("CheckOwnerModify",FALSE); + childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY))); + childSetEnabled("CheckOwnerCopy",FALSE); + childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY))); + childSetEnabled("CheckOwnerTransfer",FALSE); + childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); /////////////////////// // DEBUG PERMISSIONS // @@ -383,39 +383,39 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); - getChild("BaseMaskDebug")->setValue(perm_string); - getChildView("BaseMaskDebug")->setVisible(TRUE); + childSetText("BaseMaskDebug",perm_string); + childSetVisible("BaseMaskDebug",TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); - getChild("OwnerMaskDebug")->setValue(perm_string); - getChildView("OwnerMaskDebug")->setVisible(TRUE); + childSetText("OwnerMaskDebug",perm_string); + childSetVisible("OwnerMaskDebug",TRUE); perm_string = "G"; perm_string += overwrite_group ? "*: " : ": "; perm_string += mask_to_string(group_mask); - getChild("GroupMaskDebug")->setValue(perm_string); - getChildView("GroupMaskDebug")->setVisible(TRUE); + childSetText("GroupMaskDebug",perm_string); + childSetVisible("GroupMaskDebug",TRUE); perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); - getChild("EveryoneMaskDebug")->setValue(perm_string); - getChildView("EveryoneMaskDebug")->setVisible(TRUE); + childSetText("EveryoneMaskDebug",perm_string); + childSetVisible("EveryoneMaskDebug",TRUE); perm_string = "N"; perm_string += slam_perm ? "*: " : ": "; perm_string += mask_to_string(next_owner_mask); - getChild("NextMaskDebug")->setValue(perm_string); - getChildView("NextMaskDebug")->setVisible(TRUE); + childSetText("NextMaskDebug",perm_string); + childSetVisible("NextMaskDebug",TRUE); } else { - getChildView("BaseMaskDebug")->setVisible(FALSE); - getChildView("OwnerMaskDebug")->setVisible(FALSE); - getChildView("GroupMaskDebug")->setVisible(FALSE); - getChildView("EveryoneMaskDebug")->setVisible(FALSE); - getChildView("NextMaskDebug")->setVisible(FALSE); + childSetVisible("BaseMaskDebug",FALSE); + childSetVisible("OwnerMaskDebug",FALSE); + childSetVisible("GroupMaskDebug",FALSE); + childSetVisible("EveryoneMaskDebug",FALSE); + childSetVisible("NextMaskDebug",FALSE); } ///////////// @@ -425,18 +425,18 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) // Check for ability to change values. if (is_link || cannot_restrict_permissions) { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } else if (is_obj_modify && can_agent_manipulate) { - getChildView("CheckShareWithGroup")->setEnabled(TRUE); - getChildView("CheckEveryoneCopy")->setEnabled((owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); + childSetEnabled("CheckShareWithGroup",TRUE); + childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); } else { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } // Set values. @@ -446,7 +446,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (is_group_copy && is_group_modify && is_group_move) { - getChild("CheckShareWithGroup")->setValue(LLSD((BOOL)TRUE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); LLCheckBoxCtrl* ctl = getChild("CheckShareWithGroup"); if(ctl) @@ -456,7 +456,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } else if (!is_group_copy && !is_group_modify && !is_group_move) { - getChild("CheckShareWithGroup")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); LLCheckBoxCtrl* ctl = getChild("CheckShareWithGroup"); if(ctl) { @@ -473,7 +473,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } } - getChild("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY))); + childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); /////////////// // SALE INFO // @@ -485,40 +485,40 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - getChildView("SaleLabel")->setEnabled(is_complete); - getChildView("CheckPurchase")->setEnabled(is_complete); + childSetEnabled("SaleLabel",is_complete); + childSetEnabled("CheckPurchase",is_complete); - getChildView("NextOwnerLabel")->setEnabled(TRUE); - getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("NextOwnerLabel",TRUE); + childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("RadioSaleType")->setEnabled(is_complete && is_for_sale); - getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); - getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); + childSetEnabled("RadioSaleType",is_complete && is_for_sale); + childSetEnabled("TextPrice",is_complete && is_for_sale); + childSetEnabled("Edit Cost",is_complete && is_for_sale); } else { - getChildView("SaleLabel")->setEnabled(FALSE); - getChildView("CheckPurchase")->setEnabled(FALSE); + childSetEnabled("SaleLabel",FALSE); + childSetEnabled("CheckPurchase",FALSE); - getChildView("NextOwnerLabel")->setEnabled(FALSE); - getChildView("CheckNextOwnerModify")->setEnabled(FALSE); - getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); - getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); + childSetEnabled("NextOwnerLabel",FALSE); + childSetEnabled("CheckNextOwnerModify",FALSE); + childSetEnabled("CheckNextOwnerCopy",FALSE); + childSetEnabled("CheckNextOwnerTransfer",FALSE); - getChildView("RadioSaleType")->setEnabled(FALSE); - getChildView("TextPrice")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("RadioSaleType",FALSE); + childSetEnabled("TextPrice",FALSE); + childSetEnabled("Edit Cost",FALSE); } // Set values. - getChild("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); - getChild("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); - getChild("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); - getChild("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); + childSetValue("CheckPurchase", is_for_sale); + childSetEnabled("combobox sale copy", is_for_sale); + childSetEnabled("Edit Cost", is_for_sale); + childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY))); + childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); + childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); LLRadioGroup* radioSaleType = getChild("RadioSaleType"); if (is_for_sale) @@ -526,12 +526,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); S32 numerical_price; numerical_price = sale_info.getSalePrice(); - getChild("Edit Cost")->setValue(llformat("%d",numerical_price)); + childSetText("Edit Cost",llformat("%d",numerical_price)); } else { radioSaleType->setSelectedIndex(-1); - getChild("Edit Cost")->setValue(llformat("%d",0)); + childSetText("Edit Cost",llformat("%d",0)); } } @@ -752,10 +752,10 @@ void LLFloaterProperties::updateSaleInfo() LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) { - getChild("CheckPurchase")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckPurchase",LLSD((BOOL)FALSE)); } - if((BOOL)getChild("CheckPurchase")->getValue()) + if((BOOL)childGetValue("CheckPurchase")) { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 29ad0f3b9c..fa7a4a5759 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -326,20 +326,20 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) // GENERAL PANEL panel = tab->getChild("General"); - panel->getChild("region_text")->setValue(LLSD(sim_name)); - panel->getChild("region_type")->setValue(LLSD(sim_type)); - panel->getChild("version_channel_text")->setValue(gLastVersionChannel); - - panel->getChild("block_terraform_check")->setValue((region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); - panel->getChild("block_fly_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); - panel->getChild("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); - panel->getChild("restrict_pushobject")->setValue((region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); - panel->getChild("allow_land_resell_check")->setValue((region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); - panel->getChild("allow_parcel_changes_check")->setValue((region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); - panel->getChild("block_parcel_search_check")->setValue((region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); - panel->getChild("agent_limit_spin")->setValue(LLSD((F32)agent_limit) ); - panel->getChild("object_bonus_spin")->setValue(LLSD(object_bonus_factor) ); - panel->getChild("access_combo")->setValue(LLSD(sim_access) ); + panel->childSetValue("region_text", LLSD(sim_name)); + panel->childSetValue("region_type", LLSD(sim_type)); + panel->childSetValue("version_channel_text", gLastVersionChannel); + + panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); + panel->childSetValue("block_fly_check", (region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); + panel->childSetValue("allow_damage_check", (region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); + panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); + panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); + panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); + panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); + panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); + panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); + panel->childSetValue("access_combo", LLSD(sim_access) ); // detect teen grid for maturity @@ -347,32 +347,32 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) U32 parent_estate_id; msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id); BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that - panel->getChildView("access_combo")->setEnabled(gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid)); + panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid)); panel->setCtrlsEnabled(allow_modify); // DEBUG PANEL panel = tab->getChild("Debug"); - panel->getChild("region_text")->setValue(LLSD(sim_name) ); - panel->getChild("disable_scripts_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); - panel->getChild("disable_collisions_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) ); - panel->getChild("disable_physics_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) ); + panel->childSetValue("region_text", LLSD(sim_name) ); + panel->childSetValue("disable_scripts_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); + panel->childSetValue("disable_collisions_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) ); + panel->childSetValue("disable_physics_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) ); panel->setCtrlsEnabled(allow_modify); // TERRAIN PANEL panel = tab->getChild("Terrain"); - panel->getChild("region_text")->setValue(LLSD(sim_name)); - panel->getChild("water_height_spin")->setValue(LLSD(water_height)); - panel->getChild("terrain_raise_spin")->setValue(LLSD(terrain_raise_limit)); - panel->getChild("terrain_lower_spin")->setValue(LLSD(terrain_lower_limit)); - panel->getChild("use_estate_sun_check")->setValue(LLSD(use_estate_sun)); + panel->childSetValue("region_text", LLSD(sim_name)); + panel->childSetValue("water_height_spin", LLSD(water_height)); + panel->childSetValue("terrain_raise_spin", LLSD(terrain_raise_limit)); + panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit)); + panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun)); - panel->getChild("fixed_sun_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); - panel->getChildView("fixed_sun_check")->setEnabled(allow_modify && !use_estate_sun); - panel->getChild("sun_hour_slider")->setValue(LLSD(sun_hour)); - panel->getChildView("sun_hour_slider")->setEnabled(allow_modify && !use_estate_sun); + panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); + panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun); + panel->childSetValue("sun_hour_slider", LLSD(sun_hour)); + panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun); panel->setCtrlsEnabled(allow_modify); floater->refreshFromRegion( gAgent.getRegion() ); @@ -479,7 +479,7 @@ void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data) BOOL LLPanelRegionInfo::postBuild() { getChild("apply_btn")->setCommitCallback(boost::bind(&LLPanelRegionInfo::onBtnSet, this)); - getChildView("apply_btn")->setEnabled(FALSE); + childDisable("apply_btn"); refresh(); return TRUE; } @@ -531,12 +531,12 @@ void LLPanelRegionInfo::sendEstateOwnerMessage( void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable) { - getChildView(btn_name)->setEnabled(enable); + childSetEnabled(btn_name, enable); } void LLPanelRegionInfo::disableButton(const std::string& btn_name) { - getChildView(btn_name)->setEnabled(FALSE); + childDisable(btn_name); } void LLPanelRegionInfo::initCtrl(const std::string& name) @@ -557,14 +557,14 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - getChildView("apply_btn")->setEnabled(FALSE); - getChildView("access_text")->setEnabled(allow_modify); - // getChildView("access_combo")->setEnabled(allow_modify); + childDisable("apply_btn"); + childSetEnabled("access_text", allow_modify); + // childSetEnabled("access_combo", allow_modify); // now set in processRegionInfo for teen grid detection - getChildView("kick_btn")->setEnabled(allow_modify); - getChildView("kick_all_btn")->setEnabled(allow_modify); - getChildView("im_btn")->setEnabled(allow_modify); - getChildView("manage_telehub_btn")->setEnabled(allow_modify); + childSetEnabled("kick_btn", allow_modify); + childSetEnabled("kick_all_btn", allow_modify); + childSetEnabled("im_btn", allow_modify); + childSetEnabled("manage_telehub_btn", allow_modify); // Data gets filled in by processRegionInfo @@ -713,16 +713,16 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo"); if (!url.empty()) { - body["block_terraform"] = getChild("block_terraform_check")->getValue(); - body["block_fly"] = getChild("block_fly_check")->getValue(); - body["allow_damage"] = getChild("allow_damage_check")->getValue(); - body["allow_land_resell"] = getChild("allow_land_resell_check")->getValue(); - body["agent_limit"] = getChild("agent_limit_spin")->getValue(); - body["prim_bonus"] = getChild("object_bonus_spin")->getValue(); - body["sim_access"] = getChild("access_combo")->getValue(); - body["restrict_pushobject"] = getChild("restrict_pushobject")->getValue(); - body["allow_parcel_changes"] = getChild("allow_parcel_changes_check")->getValue(); - body["block_parcel_search"] = getChild("block_parcel_search_check")->getValue(); + body["block_terraform"] = childGetValue("block_terraform_check"); + body["block_fly"] = childGetValue("block_fly_check"); + body["allow_damage"] = childGetValue("allow_damage_check"); + body["allow_land_resell"] = childGetValue("allow_land_resell_check"); + body["agent_limit"] = childGetValue("agent_limit_spin"); + body["prim_bonus"] = childGetValue("object_bonus_spin"); + body["sim_access"] = childGetValue("access_combo"); + body["restrict_pushobject"] = childGetValue("restrict_pushobject"); + body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); + body["block_parcel_search"] = childGetValue("block_parcel_search_check"); LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); } @@ -731,33 +731,33 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() strings_t strings; std::string buffer; - buffer = llformat("%s", (getChild("block_terraform_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (getChild("block_fly_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (getChild("allow_damage_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (getChild("allow_land_resell_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - F32 value = (F32)getChild("agent_limit_spin")->getValue().asReal(); + F32 value = (F32)childGetValue("agent_limit_spin").asReal(); buffer = llformat("%f", value); strings.push_back(strings_t::value_type(buffer)); - value = (F32)getChild("object_bonus_spin")->getValue().asReal(); + value = (F32)childGetValue("object_bonus_spin").asReal(); buffer = llformat("%f", value); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%d", getChild("access_combo")->getValue().asInteger()); + buffer = llformat("%d", childGetValue("access_combo").asInteger()); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (getChild("restrict_pushobject")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (getChild("allow_parcel_changes_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); @@ -766,7 +766,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() // if we changed access levels, tell user about it LLViewerRegion* region = gAgent.getRegion(); - if (region && (getChild("access_combo")->getValue().asInteger() != region->getSimAccess()) ) + if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) ) { LLNotificationsUtil::add("RegionMaturityChange"); } @@ -799,18 +799,18 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - getChildView("apply_btn")->setEnabled(FALSE); - getChildView("target_avatar_name")->setEnabled(FALSE); + childDisable("apply_btn"); + childDisable("target_avatar_name"); - getChildView("choose_avatar_btn")->setEnabled(allow_modify); - getChildView("return_scripts")->setEnabled(allow_modify && !mTargetAvatar.isNull()); - getChildView("return_other_land")->setEnabled(allow_modify && !mTargetAvatar.isNull()); - getChildView("return_estate_wide")->setEnabled(allow_modify && !mTargetAvatar.isNull()); - getChildView("return_btn")->setEnabled(allow_modify && !mTargetAvatar.isNull()); - getChildView("top_colliders_btn")->setEnabled(allow_modify); - getChildView("top_scripts_btn")->setEnabled(allow_modify); - getChildView("restart_btn")->setEnabled(allow_modify); - getChildView("cancel_restart_btn")->setEnabled(allow_modify); + childSetEnabled("choose_avatar_btn", allow_modify); + childSetEnabled("return_scripts", allow_modify && !mTargetAvatar.isNull()); + childSetEnabled("return_other_land", allow_modify && !mTargetAvatar.isNull()); + childSetEnabled("return_estate_wide", allow_modify && !mTargetAvatar.isNull()); + childSetEnabled("return_btn", allow_modify && !mTargetAvatar.isNull()); + childSetEnabled("top_colliders_btn", allow_modify); + childSetEnabled("top_scripts_btn", allow_modify); + childSetEnabled("restart_btn", allow_modify); + childSetEnabled("cancel_restart_btn", allow_modify); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -822,13 +822,13 @@ BOOL LLPanelRegionDebugInfo::sendUpdate() strings_t strings; std::string buffer; - buffer = llformat("%s", (getChild("disable_scripts_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (getChild("disable_collisions_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (getChild("disable_physics_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); strings.push_back(buffer); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); @@ -846,7 +846,7 @@ void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector& na { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - getChild("target_avatar_name")->setValue(LLSD(names[0])); + childSetValue("target_avatar_name", LLSD(names[0])); refreshFromRegion( gAgent.getRegion() ); } @@ -857,23 +857,23 @@ void LLPanelRegionDebugInfo::onClickReturn(void* data) if (panelp->mTargetAvatar.isNull()) return; LLSD args; - args["USER_NAME"] = panelp->getChild("target_avatar_name")->getValue().asString(); + args["USER_NAME"] = panelp->childGetValue("target_avatar_name").asString(); LLSD payload; payload["avatar_id"] = panelp->mTargetAvatar; U32 flags = SWD_ALWAYS_RETURN_OBJECTS; - if (panelp->getChild("return_scripts")->getValue().asBoolean()) + if (panelp->childGetValue("return_scripts").asBoolean()) { flags |= SWD_SCRIPTED_ONLY; } - if (panelp->getChild("return_other_land")->getValue().asBoolean()) + if (panelp->childGetValue("return_other_land").asBoolean()) { flags |= SWD_OTHERS_LAND_ONLY; } payload["flags"] = int(flags); - payload["return_estate_wide"] = panelp->getChild("return_estate_wide")->getValue().asBoolean(); + payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean(); LLNotificationsUtil::add("EstateObjectReturn", args, payload, boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2)); } @@ -979,15 +979,15 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - getChildView("apply_btn")->setEnabled(FALSE); + childDisable("apply_btn"); if (region) { - getChild("region_text")->setValue(LLSD(region->getName())); + childSetValue("region_text", LLSD(region->getName())); } else { - getChild("region_text")->setValue(LLSD("")); + childSetValue("region_text", LLSD("")); } if (!region) return LLPanelRegionInfo::refreshFromRegion(region); @@ -1011,9 +1011,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) for(S32 i = 0; i < CORNER_COUNT; ++i) { buffer = llformat("height_start_spin_%d", i); - getChild(buffer)->setValue(LLSD(compp->getStartHeight(i))); + childSetValue(buffer, LLSD(compp->getStartHeight(i))); buffer = llformat("height_range_spin_%d", i); - getChild(buffer)->setValue(LLSD(compp->getHeightRange(i))); + childSetValue(buffer, LLSD(compp->getHeightRange(i))); } // Call the parent for common book-keeping @@ -1082,7 +1082,7 @@ BOOL LLPanelRegionTextureInfo::sendUpdate() { buffer = llformat("height_start_spin_%d", i); std::string buffer2 = llformat("height_range_spin_%d", i); - std::string buffer3 = llformat("%d %f %f", i, (F32)getChild(buffer)->getValue().asReal(), (F32)getChild(buffer2)->getValue().asReal()); + std::string buffer3 = llformat("%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); strings.push_back(buffer3); } sendEstateOwnerMessage(msg, "textureheights", invoice, strings); @@ -1175,11 +1175,11 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); setCtrlsEnabled(owner_or_god_or_manager); - getChildView("apply_btn")->setEnabled(FALSE); + childDisable("apply_btn"); - getChildView("download_raw_btn")->setEnabled(owner_or_god); - getChildView("upload_raw_btn")->setEnabled(owner_or_god); - getChildView("bake_terrain_btn")->setEnabled(owner_or_god); + childSetEnabled("download_raw_btn", owner_or_god); + childSetEnabled("upload_raw_btn", owner_or_god); + childSetEnabled("bake_terrain_btn", owner_or_god); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -1192,17 +1192,17 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() strings_t strings; LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - buffer = llformat("%f", (F32)getChild("water_height_spin")->getValue().asReal()); + buffer = llformat("%f", (F32)childGetValue("water_height_spin").asReal()); strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild("terrain_raise_spin")->getValue().asReal()); + buffer = llformat("%f", (F32)childGetValue("terrain_raise_spin").asReal()); strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild("terrain_lower_spin")->getValue().asReal()); + buffer = llformat("%f", (F32)childGetValue("terrain_lower_spin").asReal()); strings.push_back(buffer); - buffer = llformat("%s", (getChild("use_estate_sun_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (getChild("fixed_sun_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild("sun_hour_slider")->getValue().asReal() ); + buffer = llformat("%f", (F32)childGetValue("sun_hour_slider").asReal() ); strings.push_back(buffer); // Grab estate information in case the user decided to set the @@ -1241,27 +1241,27 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() void LLPanelRegionTerrainInfo::onChangeUseEstateTime() { - BOOL use_estate_sun = getChild("use_estate_sun_check")->getValue().asBoolean(); - getChildView("fixed_sun_check")->setEnabled(!use_estate_sun); - getChildView("sun_hour_slider")->setEnabled(!use_estate_sun); + BOOL use_estate_sun = childGetValue("use_estate_sun_check").asBoolean(); + childSetEnabled("fixed_sun_check", !use_estate_sun); + childSetEnabled("sun_hour_slider", !use_estate_sun); if (use_estate_sun) { - getChild("fixed_sun_check")->setValue(LLSD(FALSE)); - getChild("sun_hour_slider")->setValue(LLSD(0.f)); + childSetValue("fixed_sun_check", LLSD(FALSE)); + childSetValue("sun_hour_slider", LLSD(0.f)); } - getChildView("apply_btn")->setEnabled(TRUE); + childEnable("apply_btn"); } void LLPanelRegionTerrainInfo::onChangeFixedSun() { // Just enable the apply button. We let the sun-hour slider be enabled // for both fixed-sun and non-fixed-sun. JC - getChildView("apply_btn")->setEnabled(TRUE); + childEnable("apply_btn"); } void LLPanelRegionTerrainInfo::onChangeSunHour() { - getChildView("apply_btn")->setEnabled(TRUE); + childEnable("apply_btn"); } // static @@ -1357,19 +1357,19 @@ void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) // Disables the sun-hour slider and the use fixed time check if the use global time is check void LLPanelEstateInfo::onChangeUseGlobalTime() { - bool enabled = !getChild("use_global_time_check")->getValue().asBoolean(); - getChildView("sun_hour_slider")->setEnabled(enabled); - getChildView("fixed_sun_check")->setEnabled(enabled); - getChild("fixed_sun_check")->setValue(LLSD(FALSE)); + bool enabled = !childGetValue("use_global_time_check").asBoolean(); + childSetEnabled("sun_hour_slider", enabled); + childSetEnabled("fixed_sun_check", enabled); + childSetValue("fixed_sun_check", LLSD(FALSE)); enableButton("apply_btn"); } // Enables the sun-hour slider if the fixed-sun checkbox is set void LLPanelEstateInfo::onChangeFixedSun() { - bool enabled = !getChild("fixed_sun_check")->getValue().asBoolean(); - getChildView("use_global_time_check")->setEnabled(enabled); - getChild("use_global_time_check")->setValue(LLSD(FALSE)); + bool enabled = !childGetValue("fixed_sun_check").asBoolean(); + childSetEnabled("use_global_time_check", enabled); + childSetValue("use_global_time_check", LLSD(FALSE)); enableButton("apply_btn"); } @@ -1379,19 +1379,21 @@ void LLPanelEstateInfo::onChangeFixedSun() //--------------------------------------------------------------------------- // Add/Remove estate access button callbacks //--------------------------------------------------------------------------- -void LLPanelEstateInfo::onClickEditSky() +void LLPanelEstateInfo::onClickEditSky(void* user_data) { LLFloaterReg::showInstance("env_windlight"); } -void LLPanelEstateInfo::onClickEditDayCycle() +void LLPanelEstateInfo::onClickEditDayCycle(void* user_data) { LLFloaterReg::showInstance("env_day_cycle"); } -void LLPanelEstateInfo::onClickAddAllowedAgent() +// static +void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data) { - LLCtrlListInterface *list = childGetListInterface("allowed_avatar_name_list"); + LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; + LLCtrlListInterface *list = self->childGetListInterface("allowed_avatar_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1405,7 +1407,8 @@ void LLPanelEstateInfo::onClickAddAllowedAgent() accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); } -void LLPanelEstateInfo::onClickRemoveAllowedAgent() +// static +void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data) { accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); } @@ -1457,14 +1460,17 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re return false; } -void LLPanelEstateInfo::onClickRemoveAllowedGroup() +// static +void LLPanelEstateInfo::onClickRemoveAllowedGroup(void* user_data) { accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list"); } -void LLPanelEstateInfo::onClickAddBannedAgent() +// static +void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data) { - LLCtrlListInterface *list = childGetListInterface("banned_avatar_name_list"); + LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; + LLCtrlListInterface *list = self->childGetListInterface("banned_avatar_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1476,15 +1482,17 @@ void LLPanelEstateInfo::onClickAddBannedAgent() accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); } -void LLPanelEstateInfo::onClickRemoveBannedAgent() +// static +void LLPanelEstateInfo::onClickRemoveBannedAgent(void* user_data) { accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list"); } // static -void LLPanelEstateInfo::onClickAddEstateManager() +void LLPanelEstateInfo::onClickAddEstateManager(void* user_data) { - LLCtrlListInterface *list = childGetListInterface("estate_manager_name_list"); + LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; + LLCtrlListInterface *list = self->childGetListInterface("estate_manager_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_MANAGERS) { // Tell user they can't add more managers @@ -1499,7 +1507,7 @@ void LLPanelEstateInfo::onClickAddEstateManager() } // static -void LLPanelEstateInfo::onClickRemoveEstateManager() +void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data) { accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list"); } @@ -1952,20 +1960,20 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) BOOL manager = (region && region->isEstateManager()); setCtrlsEnabled(god || owner || manager); - getChildView("apply_btn")->setEnabled(FALSE); - getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager); - getChildView("remove_allowed_avatar_btn")->setEnabled(god || owner || manager); - getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager); - getChildView("remove_allowed_group_btn")->setEnabled(god || owner || manager); - getChildView("add_banned_avatar_btn")->setEnabled(god || owner || manager); - getChildView("remove_banned_avatar_btn")->setEnabled(god || owner || manager); - getChildView("message_estate_btn")->setEnabled(god || owner || manager); - getChildView("kick_user_from_estate_btn")->setEnabled(god || owner || manager); + childDisable("apply_btn"); + childSetEnabled("add_allowed_avatar_btn", god || owner || manager); + childSetEnabled("remove_allowed_avatar_btn", god || owner || manager); + childSetEnabled("add_allowed_group_btn", god || owner || manager); + childSetEnabled("remove_allowed_group_btn", god || owner || manager); + childSetEnabled("add_banned_avatar_btn", god || owner || manager); + childSetEnabled("remove_banned_avatar_btn", god || owner || manager); + childSetEnabled("message_estate_btn", god || owner || manager); + childSetEnabled("kick_user_from_estate_btn", god || owner || manager); // estate managers can't add estate managers - getChildView("add_estate_manager_btn")->setEnabled(god || owner); - getChildView("remove_estate_manager_btn")->setEnabled(god || owner); - getChildView("estate_manager_name_list")->setEnabled(god || owner); + childSetEnabled("add_estate_manager_btn", god || owner); + childSetEnabled("remove_estate_manager_btn", god || owner); + childSetEnabled("estate_manager_name_list", god || owner); } bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) @@ -2040,8 +2048,8 @@ BOOL LLPanelEstateInfo::postBuild() avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddAllowedAgent, this)); - childSetAction("remove_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedAgent, this)); + childSetAction("add_allowed_avatar_btn", onClickAddAllowedAgent, this); + childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this); getChild("allowed_group_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* group_name_list = getChild("allowed_group_name_list"); @@ -2052,7 +2060,7 @@ BOOL LLPanelEstateInfo::postBuild() } getChild("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); - childSetAction("remove_allowed_group_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedGroup, this)); + childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); getChild("banned_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* banned_name_list = getChild("banned_avatar_name_list"); @@ -2062,8 +2070,8 @@ BOOL LLPanelEstateInfo::postBuild() banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddBannedAgent, this)); - childSetAction("remove_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveBannedAgent, this)); + childSetAction("add_banned_avatar_btn", onClickAddBannedAgent, this); + childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this); getChild("estate_manager_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* manager_name_list = getChild("estate_manager_name_list"); @@ -2073,28 +2081,28 @@ BOOL LLPanelEstateInfo::postBuild() manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue } - childSetAction("add_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickAddEstateManager, this)); - childSetAction("remove_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveEstateManager, this)); - childSetAction("message_estate_btn", boost::bind(&LLPanelEstateInfo::onClickMessageEstate, this)); + childSetAction("add_estate_manager_btn", onClickAddEstateManager, this); + childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this); + childSetAction("message_estate_btn", onClickMessageEstate, this); childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this)); - childSetAction("WLEditSky", boost::bind(&LLPanelEstateInfo::onClickEditSky, this)); - childSetAction("WLEditDayCycle", boost::bind(&LLPanelEstateInfo::onClickEditDayCycle, this)); + childSetAction("WLEditSky", onClickEditSky, this); + childSetAction("WLEditDayCycle", onClickEditDayCycle, this); return LLPanelRegionInfo::postBuild(); } void LLPanelEstateInfo::refresh() { - bool public_access = getChild("externally_visible_check")->getValue().asBoolean(); - getChildView("Only Allow")->setEnabled(public_access); - getChildView("limit_payment")->setEnabled(public_access); - getChildView("limit_age_verified")->setEnabled(public_access); + bool public_access = childGetValue("externally_visible_check").asBoolean(); + childSetEnabled("Only Allow", public_access); + childSetEnabled("limit_payment", public_access); + childSetEnabled("limit_age_verified", public_access); // if this is set to false, then the limit fields are meaningless and should be turned off if (public_access == false) { - getChild("limit_payment")->setValue(false); - getChild("limit_age_verified")->setValue(false); + childSetValue("limit_payment", false); + childSetValue("limit_age_verified", false); } } @@ -2217,19 +2225,19 @@ bool LLPanelEstateInfo::commitEstateInfoCaps() LLSD body; body["estate_name"] = getEstateName(); - body["is_externally_visible"] = getChild("externally_visible_check")->getValue().asBoolean(); - body["allow_direct_teleport"] = getChild("allow_direct_teleport")->getValue().asBoolean(); - body["is_sun_fixed" ] = getChild("fixed_sun_check")->getValue().asBoolean(); - body["deny_anonymous" ] = getChild("limit_payment")->getValue().asBoolean(); - body["deny_age_unverified" ] = getChild("limit_age_verified")->getValue().asBoolean(); - body["allow_voice_chat" ] = getChild("voice_chat_check")->getValue().asBoolean(); + body["is_externally_visible"] = childGetValue("externally_visible_check").asBoolean(); + body["allow_direct_teleport"] = childGetValue("allow_direct_teleport").asBoolean(); + body["is_sun_fixed" ] = childGetValue("fixed_sun_check").asBoolean(); + body["deny_anonymous" ] = childGetValue("limit_payment").asBoolean(); + body["deny_age_unverified" ] = childGetValue("limit_age_verified").asBoolean(); + body["allow_voice_chat" ] = childGetValue("voice_chat_check").asBoolean(); body["invoice" ] = LLFloaterRegionInfo::getLastInvoice(); // block fly is in estate database but not in estate UI, so we're not supporting it - //body["block_fly" ] = getChild("")->getValue().asBoolean(); + //body["block_fly" ] = childGetValue("").asBoolean(); F32 sun_hour = getSunHour(); - if (getChild("use_global_time_check")->getValue().asBoolean()) + if (childGetValue("use_global_time_check").asBoolean()) { sun_hour = 0.f; // 0 = global time } @@ -2269,7 +2277,7 @@ void LLPanelEstateInfo::commitEstateInfoDataserver() msg->addString("Parameter", buffer); F32 sun_hour = getSunHour(); - if (getChild("use_global_time_check")->getValue().asBoolean()) + if (childGetValue("use_global_time_check").asBoolean()) { sun_hour = 0.f; // 0 = global time } @@ -2283,13 +2291,14 @@ void LLPanelEstateInfo::commitEstateInfoDataserver() void LLPanelEstateInfo::setEstateFlags(U32 flags) { - getChild("externally_visible_check")->setValue(LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); - getChild("fixed_sun_check")->setValue(LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); - getChild("voice_chat_check")->setValue( + childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); + childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); + childSetValue( + "voice_chat_check", LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE)); - getChild("allow_direct_teleport")->setValue(LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); - getChild("limit_payment")->setValue(LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); - getChild("limit_age_verified")->setValue(LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); + childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); + childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); + childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); refresh(); } @@ -2298,32 +2307,32 @@ U32 LLPanelEstateInfo::computeEstateFlags() { U32 flags = 0; - if (getChild("externally_visible_check")->getValue().asBoolean()) + if (childGetValue("externally_visible_check").asBoolean()) { flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; } - if ( getChild("voice_chat_check")->getValue().asBoolean() ) + if ( childGetValue("voice_chat_check").asBoolean() ) { flags |= REGION_FLAGS_ALLOW_VOICE; } - if (getChild("allow_direct_teleport")->getValue().asBoolean()) + if (childGetValue("allow_direct_teleport").asBoolean()) { flags |= REGION_FLAGS_ALLOW_DIRECT_TELEPORT; } - if (getChild("fixed_sun_check")->getValue().asBoolean()) + if (childGetValue("fixed_sun_check").asBoolean()) { flags |= REGION_FLAGS_SUN_FIXED; } - if (getChild("limit_payment")->getValue().asBoolean()) + if (childGetValue("limit_payment").asBoolean()) { flags |= REGION_FLAGS_DENY_ANONYMOUS; } - if (getChild("limit_age_verified")->getValue().asBoolean()) + if (childGetValue("limit_age_verified").asBoolean()) { flags |= REGION_FLAGS_DENY_AGEUNVERIFIED; } @@ -2334,24 +2343,24 @@ U32 LLPanelEstateInfo::computeEstateFlags() BOOL LLPanelEstateInfo::getGlobalTime() { - return getChild("use_global_time_check")->getValue().asBoolean(); + return childGetValue("use_global_time_check").asBoolean(); } void LLPanelEstateInfo::setGlobalTime(bool b) { - getChild("use_global_time_check")->setValue(LLSD(b)); - getChildView("fixed_sun_check")->setEnabled(LLSD(!b)); - getChildView("sun_hour_slider")->setEnabled(LLSD(!b)); + childSetValue("use_global_time_check", LLSD(b)); + childSetEnabled("fixed_sun_check", LLSD(!b)); + childSetEnabled("sun_hour_slider", LLSD(!b)); if (b) { - getChild("sun_hour_slider")->setValue(LLSD(0.f)); + childSetValue("sun_hour_slider", LLSD(0.f)); } } BOOL LLPanelEstateInfo::getFixedSun() { - return getChild("fixed_sun_check")->getValue().asBoolean(); + return childGetValue("fixed_sun_check").asBoolean(); } void LLPanelEstateInfo::setSunHour(F32 sun_hour) @@ -2360,61 +2369,61 @@ void LLPanelEstateInfo::setSunHour(F32 sun_hour) { sun_hour = 24.0f + sun_hour; } - getChild("sun_hour_slider")->setValue(LLSD(sun_hour)); + childSetValue("sun_hour_slider", LLSD(sun_hour)); } F32 LLPanelEstateInfo::getSunHour() { - if (getChildView("sun_hour_slider")->getEnabled()) + if (childIsEnabled("sun_hour_slider")) { - return (F32)getChild("sun_hour_slider")->getValue().asReal(); + return (F32)childGetValue("sun_hour_slider").asReal(); } return 0.f; } const std::string LLPanelEstateInfo::getEstateName() const { - return getChild("estate_name")->getValue().asString(); + return childGetValue("estate_name").asString(); } void LLPanelEstateInfo::setEstateName(const std::string& name) { - getChild("estate_name")->setValue(LLSD(name)); + childSetValue("estate_name", LLSD(name)); } const std::string LLPanelEstateInfo::getOwnerName() const { - return getChild("estate_owner")->getValue().asString(); + return childGetValue("estate_owner").asString(); } void LLPanelEstateInfo::setOwnerName(const std::string& name) { - getChild("estate_owner")->setValue(LLSD(name)); + childSetValue("estate_owner", LLSD(name)); } void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban) { - getChildView("allow_resident_label")->setEnabled(enable_agent); - getChildView("allowed_avatar_name_list")->setEnabled(enable_agent); - getChildView("allowed_avatar_name_list")->setVisible( enable_agent); - getChildView("add_allowed_avatar_btn")->setEnabled(enable_agent); - getChildView("remove_allowed_avatar_btn")->setEnabled(enable_agent); + childSetEnabled("allow_resident_label", enable_agent); + childSetEnabled("allowed_avatar_name_list", enable_agent); + childSetVisible("allowed_avatar_name_list", enable_agent); + childSetEnabled("add_allowed_avatar_btn", enable_agent); + childSetEnabled("remove_allowed_avatar_btn", enable_agent); // Groups - getChildView("allow_group_label")->setEnabled(enable_group); - getChildView("allowed_group_name_list")->setEnabled(enable_group); - getChildView("allowed_group_name_list")->setVisible( enable_group); - getChildView("add_allowed_group_btn")->setEnabled(enable_group); - getChildView("remove_allowed_group_btn")->setEnabled(enable_group); + childSetEnabled("allow_group_label", enable_group); + childSetEnabled("allowed_group_name_list", enable_group); + childSetVisible("allowed_group_name_list", enable_group); + childSetEnabled("add_allowed_group_btn", enable_group); + childSetEnabled("remove_allowed_group_btn", enable_group); // Ban - getChildView("ban_resident_label")->setEnabled(enable_ban); - getChildView("banned_avatar_name_list")->setEnabled(enable_ban); - getChildView("banned_avatar_name_list")->setVisible( enable_ban); - getChildView("add_banned_avatar_btn")->setEnabled(enable_ban); - getChildView("remove_banned_avatar_btn")->setEnabled(enable_ban); + childSetEnabled("ban_resident_label", enable_ban); + childSetEnabled("banned_avatar_name_list", enable_ban); + childSetVisible("banned_avatar_name_list", enable_ban); + childSetEnabled("add_banned_avatar_btn", enable_ban); + childSetEnabled("remove_banned_avatar_btn", enable_ban); // Update removal buttons if needed if (enable_agent) @@ -2476,7 +2485,7 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name) // enable the remove button if something is selected LLNameListCtrl* name_list = getChild(name); - getChildView(btn_name)->setEnabled(name_list && name_list->getFirstSelected() ? TRUE : FALSE); + childSetEnabled(btn_name, name_list && name_list->getFirstSelected() ? TRUE : FALSE); return (btn_name != ""); } @@ -3011,7 +3020,7 @@ bool LLDispatchSetEstateAccess::operator()( args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); - panel->getChild("allow_resident_label")->setValue(LLSD(msg)); + panel->childSetValue("allow_resident_label", LLSD(msg)); if (allowed_agent_name_list) { @@ -3022,7 +3031,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ allowed_agent_name_list->addNameItem(id); } - panel->getChildView("remove_allowed_avatar_btn")->setEnabled(allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); + panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); allowed_agent_name_list->sortByColumnIndex(0, TRUE); } } @@ -3036,7 +3045,7 @@ bool LLDispatchSetEstateAccess::operator()( args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); - panel->getChild("allow_group_label")->setValue(LLSD(msg)); + panel->childSetValue("allow_group_label", LLSD(msg)); if (allowed_group_name_list) { @@ -3047,7 +3056,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ allowed_group_name_list->addGroupNameItem(id); } - panel->getChildView("remove_allowed_group_btn")->setEnabled(allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); + panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); allowed_group_name_list->sortByColumnIndex(0, TRUE); } } @@ -3068,7 +3077,7 @@ bool LLDispatchSetEstateAccess::operator()( std::string msg = llformat("Banned residents: (%d, max %d)", totalBannedAgents, ESTATE_MAX_ACCESS_IDS); - panel->getChild("ban_resident_label")->setValue(LLSD(msg)); + panel->childSetValue("ban_resident_label", LLSD(msg)); if (banned_agent_name_list) { @@ -3079,7 +3088,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ banned_agent_name_list->addNameItem(id); } - panel->getChildView("remove_banned_avatar_btn")->setEnabled(banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); + panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); banned_agent_name_list->sortByColumnIndex(0, TRUE); } } @@ -3089,7 +3098,7 @@ bool LLDispatchSetEstateAccess::operator()( std::string msg = llformat("Estate Managers: (%d, max %d)", num_estate_managers, ESTATE_MAX_MANAGERS); - panel->getChild("estate_manager_label")->setValue(LLSD(msg)); + panel->childSetValue("estate_manager_label", LLSD(msg)); LLNameListCtrl* estate_manager_name_list = panel->getChild("estate_manager_name_list"); @@ -3106,7 +3115,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ estate_manager_name_list->addNameItem(id); } - panel->getChildView("remove_estate_manager_btn")->setEnabled(estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); + panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); estate_manager_name_list->sortByColumnIndex(0, TRUE); } } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 2393c74c45..342ce535fe 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -256,19 +256,19 @@ public: void onChangeFixedSun(); void onChangeUseGlobalTime(); - void onClickEditSky(); - void onClickEditSkyHelp(); - void onClickEditDayCycle(); - void onClickEditDayCycleHelp(); - - void onClickAddAllowedAgent(); - void onClickRemoveAllowedAgent(); - void onClickAddAllowedGroup(); - void onClickRemoveAllowedGroup(); - void onClickAddBannedAgent(); - void onClickRemoveBannedAgent(); - void onClickAddEstateManager(); - void onClickRemoveEstateManager(); + static void onClickEditSky(void* userdata); + static void onClickEditSkyHelp(void* userdata); + static void onClickEditDayCycle(void* userdata); + static void onClickEditDayCycleHelp(void* userdata); + + static void onClickAddAllowedAgent(void* user_data); + static void onClickRemoveAllowedAgent(void* user_data); + void onClickAddAllowedGroup(); + static void onClickRemoveAllowedGroup(void* user_data); + static void onClickAddBannedAgent(void* user_data); + static void onClickRemoveBannedAgent(void* user_data); + static void onClickAddEstateManager(void* user_data); + static void onClickRemoveEstateManager(void* user_data); void onClickKickUser(); // Group picker callback is different, can't use core methods below diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 97f192a708..da0301394c 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -122,7 +122,7 @@ BOOL LLFloaterReporter::postBuild() { LLSLURL slurl; LLAgentUI::buildSLURL(slurl); - getChild("abuse_location_edit")->setValue(slurl.getSLURLString()); + childSetText("abuse_location_edit", slurl.getSLURLString()); enableControls(TRUE); @@ -131,7 +131,7 @@ BOOL LLFloaterReporter::postBuild() LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - getChild("sim_field")->setValue(regionp->getName()); + childSetText("sim_field", regionp->getName()); pos -= regionp->getOriginGlobal(); } setPosBox(pos); @@ -142,13 +142,13 @@ BOOL LLFloaterReporter::postBuild() setVisible(TRUE); // Default text to be blank - getChild("object_name")->setValue(LLStringUtil::null); - getChild("owner_name")->setValue(LLStringUtil::null); + childSetText("object_name", LLStringUtil::null); + childSetText("owner_name", LLStringUtil::null); mOwnerName = LLStringUtil::null; - getChild("summary_edit")->setFocus(TRUE); + childSetFocus("summary_edit"); - mDefaultSummary = getChild("details_edit")->getValue().asString(); + mDefaultSummary = childGetText("details_edit"); // send a message and ask for information about this region - // result comes back in processRegionInfo(..) @@ -178,7 +178,7 @@ BOOL LLFloaterReporter::postBuild() // grab the user's name std::string fullname; LLAgentUI::buildFullname(fullname); - getChild("reporter_field")->setValue(fullname); + childSetText("reporter_field", fullname); center(); @@ -206,22 +206,22 @@ LLFloaterReporter::~LLFloaterReporter() // virtual void LLFloaterReporter::draw() { - getChildView("screen_check")->setEnabled(TRUE ); + childSetEnabled("screen_check", TRUE ); LLFloater::draw(); } void LLFloaterReporter::enableControls(BOOL enable) { - getChildView("category_combo")->setEnabled(enable); - getChildView("chat_check")->setEnabled(enable); - getChildView("screen_check")->setEnabled(enable); - getChildView("screenshot")->setEnabled(FALSE); - getChildView("pick_btn")->setEnabled(enable); - getChildView("summary_edit")->setEnabled(enable); - getChildView("details_edit")->setEnabled(enable); - getChildView("send_btn")->setEnabled(enable); - getChildView("cancel_btn")->setEnabled(enable); + childSetEnabled("category_combo", enable); + childSetEnabled("chat_check", enable); + childSetEnabled("screen_check", enable); + childDisable("screenshot"); + childSetEnabled("pick_btn", enable); + childSetEnabled("summary_edit", enable); + childSetEnabled("details_edit", enable); + childSetEnabled("send_btn", enable); + childSetEnabled("cancel_btn", enable); } void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) @@ -253,7 +253,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) LLViewerRegion *regionp = objectp->getRegion(); if (regionp) { - getChild("sim_field")->setValue(regionp->getName()); + childSetText("sim_field", regionp->getName()); LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); @@ -307,7 +307,7 @@ void LLFloaterReporter::callbackAvatarID(const std::vector& names, { if (ids.empty() || names.empty()) return; - getChild("abuser_name_edit")->setValue(names[0] ); + childSetText("abuser_name_edit", names[0] ); mAbuserID = ids[0]; @@ -322,9 +322,9 @@ void LLFloaterReporter::setFromAvatar(const LLUUID& avatar_id, const std::string std::string avatar_link = LLSLURL("agent", mObjectID, "inspect").getSLURLString(); - getChild("owner_name")->setValue(avatar_link); - getChild("object_name")->setValue(avatar_name); - getChild("abuser_name_edit")->setValue(avatar_name); + childSetText("owner_name", avatar_link); + childSetText("object_name", avatar_name); + childSetText("abuser_name_edit", avatar_name); } // static @@ -348,9 +348,9 @@ void LLFloaterReporter::onClickSend(void *userdata) if ( ! self->mCopyrightWarningSeen ) { - std::string details_lc = self->getChild("details_edit")->getValue().asString(); + std::string details_lc = self->childGetText("details_edit"); LLStringUtil::toLower( details_lc ); - std::string summary_lc = self->getChild("summary_edit")->getValue().asString(); + std::string summary_lc = self->childGetText("summary_edit"); LLStringUtil::toLower( summary_lc ); if ( details_lc.find( "copyright" ) != std::string::npos || summary_lc.find( "copyright" ) != std::string::npos || @@ -381,10 +381,10 @@ void LLFloaterReporter::onClickSend(void *userdata) } else { - if(self->getChild("screen_check")->getValue()) + if(self->childGetValue("screen_check")) { - self->getChildView("send_btn")->setEnabled(FALSE); - self->getChildView("cancel_btn")->setEnabled(FALSE); + self->childDisable("send_btn"); + self->childDisable("cancel_btn"); // the callback from uploading the image calls sendReportViaLegacy() self->uploadImage(); } @@ -422,8 +422,8 @@ void LLFloaterReporter::onClickObjPicker(void *userdata) LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self); LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance()); self->mPicking = TRUE; - self->getChild("object_name")->setValue(LLStringUtil::null); - self->getChild("owner_name")->setValue(LLStringUtil::null); + self->childSetText("object_name", LLStringUtil::null); + self->childSetText("owner_name", LLStringUtil::null); self->mOwnerName = LLStringUtil::null; LLButton* pick_btn = self->getChild("pick_btn"); if (pick_btn) pick_btn->setToggleState(TRUE); @@ -469,7 +469,7 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ // grab the user's name std::string fullname; LLAgentUI::buildFullname(fullname); - f->getChild("reporter_field")->setValue(fullname); + f->childSetText("reporter_field", fullname); if (avatar_name.empty()) // Request info for this object @@ -498,11 +498,11 @@ void LLFloaterReporter::showFromAvatar(const LLUUID& avatar_id, const std::strin void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) { - getChild("object_name")->setValue(object_name); + childSetText("object_name", object_name); std::string owner_link = LLSLURL("agent", owner_id, "inspect").getSLURLString(); - getChild("owner_name")->setValue(owner_link); - getChild("abuser_name_edit")->setValue(owner_name); + childSetText("owner_name", owner_link); + childSetText("abuser_name_edit", owner_name); mAbuserID = owner_id; mOwnerName = owner_name; } @@ -511,7 +511,7 @@ void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name bool LLFloaterReporter::validateReport() { // Ensure user selected a category from the list - LLSD category_sd = getChild("category_combo")->getValue(); + LLSD category_sd = childGetValue("category_combo"); U8 category = (U8)category_sd.asInteger(); if (category == 0) { @@ -520,32 +520,32 @@ bool LLFloaterReporter::validateReport() } - if ( getChild("abuser_name_edit")->getValue().asString().empty() ) + if ( childGetText("abuser_name_edit").empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserNameEmpty"); return false; }; - if ( getChild("abuse_location_edit")->getValue().asString().empty() ) + if ( childGetText("abuse_location_edit").empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; - if ( getChild("abuse_location_edit")->getValue().asString().empty() ) + if ( childGetText("abuse_location_edit").empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; - if ( getChild("summary_edit")->getValue().asString().empty() ) + if ( childGetText("summary_edit").empty() ) { LLNotificationsUtil::add("HelpReportAbuseSummaryEmpty"); return false; }; - if ( getChild("details_edit")->getValue().asString() == mDefaultSummary ) + if ( childGetText("details_edit") == mDefaultSummary ) { LLNotificationsUtil::add("HelpReportAbuseDetailsEmpty"); return false; @@ -591,17 +591,17 @@ LLSD LLFloaterReporter::gatherReport() summary << "" << " |" << regionp->getName() << "|" // region reporter is currently in. - << " (" << getChild("abuse_location_edit")->getValue().asString() << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) + << " (" << childGetText("abuse_location_edit") << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) << " [" << category_name << "] " // updated category - << " {" << getChild("abuser_name_edit")->getValue().asString() << "} " // name of abuse entered in report (chosen using LLAvatarPicker) - << " \"" << getChild("summary_edit")->getValue().asString() << "\""; // summary as entered + << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) + << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered std::ostringstream details; details << "V" << LLVersionInfo::getVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports - std::string object_name = getChild("object_name")->getValue().asString(); + std::string object_name = childGetText("object_name"); if (!object_name.empty() && !mOwnerName.empty()) { details << "Object: " << object_name << "\n"; @@ -609,10 +609,10 @@ LLSD LLFloaterReporter::gatherReport() } - details << "Abuser name: " << getChild("abuser_name_edit")->getValue().asString() << " \n"; - details << "Abuser location: " << getChild("abuse_location_edit")->getValue().asString() << " \n"; + details << "Abuser name: " << childGetText("abuser_name_edit") << " \n"; + details << "Abuser location: " << childGetText("abuse_location_edit") << " \n"; - details << getChild("details_edit")->getValue().asString(); + details << childGetValue("details_edit").asString(); std::string version_string; version_string = llformat( @@ -626,14 +626,14 @@ LLSD LLFloaterReporter::gatherReport() // only send a screenshot ID if we're asked to and the email is // going to LL - Estate Owners cannot see the screenshot asset LLUUID screenshot_id = LLUUID::null; - if (getChild("screen_check")->getValue()) + if (childGetValue("screen_check")) { - screenshot_id = getChild("screenshot")->getValue(); + screenshot_id = childGetValue("screenshot"); }; LLSD report = LLSD::emptyMap(); report["report-type"] = (U8) mReportType; - report["category"] = getChild("category_combo")->getValue(); + report["category"] = childGetValue("category_combo"); report["position"] = mPosition.getValue(); report["check-flags"] = (U8)0; // this is not used report["screenshot-id"] = screenshot_id; @@ -715,7 +715,7 @@ public: void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url, const LLSD& report) { - if(getChild("screen_check")->getValue().asBoolean() && !sshot_url.empty()) + if(childGetValue("screen_check").asBoolean() && !sshot_url.empty()) { // try to upload screenshot LLHTTPClient::post(sshot_url, report, new LLUserReportScreenshotResponder(report, @@ -847,7 +847,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) mPosition.mV[VX], mPosition.mV[VY], mPosition.mV[VZ]); - getChild("pos_field")->setValue(pos_string); + childSetText("pos_field", pos_string); } // void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) @@ -855,7 +855,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) // LLFloaterReporter *self = LLFloaterReg::findTypedInstance("reporter"); // if (self) // { -// self->getChild("details_edit")->setValue(description); +// self->childSetText("details_edit", description); // for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer()); // self->mMCDList.clear(); diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 571f26e09f..c0c664496d 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -292,7 +292,7 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild("script_limits_region_memory_panel"); if(panel_memory) { - panel_memory->getChild("loading_text")->setValue(LLSD(std::string(""))); + panel_memory->childSetValue("loading_text", LLSD(std::string(""))); LLButton* btn = panel_memory->getChild("refresh_list_btn"); if(btn) @@ -489,7 +489,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild("script_limits_my_avatar_panel"); if(panel) { - panel->getChild("loading_text")->setValue(LLSD(std::string(""))); + panel->childSetValue("loading_text", LLSD(std::string(""))); LLButton* btn = panel->getChild("refresh_list_btn"); if(btn) @@ -554,12 +554,12 @@ void LLPanelScriptLimitsRegionMemory::processParcelInfo(const LLParcelData& parc if(!getLandScriptResources()) { std::string msg_error = LLTrans::getString("ScriptLimitsRequestError"); - getChild("loading_text")->setValue(LLSD(msg_error)); + childSetValue("loading_text", LLSD(msg_error)); } else { std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); } } @@ -579,7 +579,7 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id) else { std::string msg_error = LLTrans::getString("ScriptLimitsRequestError"); - getChild("loading_text")->setValue(LLSD(msg_error)); + childSetValue("loading_text", LLSD(msg_error)); } } @@ -635,7 +635,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) LLStringUtil::format_map_t args_parcels; args_parcels["[PARCELS]"] = llformat ("%d", number_parcels); std::string msg_parcels = LLTrans::getString("ScriptLimitsParcelsOwned", args_parcels); - getChild("parcels_listed")->setValue(LLSD(msg_parcels)); + childSetValue("parcels_listed", LLSD(msg_parcels)); uuid_vec_t names_requested; @@ -812,7 +812,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax); args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available); std::string msg_parcel_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_parcel_memory); - getChild("memory_used")->setValue(LLSD(msg_parcel_memory)); + childSetValue("memory_used", LLSD(msg_parcel_memory)); } if((mParcelURLsUsed >= 0) && (mParcelURLsMax >= 0)) @@ -824,7 +824,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) args_parcel_urls["[MAX]"] = llformat ("%d", mParcelURLsMax); args_parcel_urls["[AVAILABLE]"] = llformat ("%d", parcel_urls_available); std::string msg_parcel_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_parcel_urls); - getChild("urls_used")->setValue(LLSD(msg_parcel_urls)); + childSetValue("urls_used", LLSD(msg_parcel_urls)); } } @@ -835,7 +835,7 @@ BOOL LLPanelScriptLimitsRegionMemory::postBuild() childSetAction("return_btn", onClickReturn, this); std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); LLScrollListCtrl *list = getChild("scripts_list"); if(!list) @@ -860,7 +860,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() LLFloaterLand* instance = LLFloaterReg::getTypedInstance("about_land"); if(!instance) { - getChild("loading_text")->setValue(LLSD(std::string(""))); + childSetValue("loading_text", LLSD(std::string(""))); //might have to do parent post build here //if not logic below could use early outs return FALSE; @@ -879,7 +879,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() if(region_id != current_region_id) { std::string msg_wrong_region = LLTrans::getString("ScriptLimitsRequestWrongRegion"); - getChild("loading_text")->setValue(LLSD(msg_wrong_region)); + childSetValue("loading_text", LLSD(msg_wrong_region)); return FALSE; } @@ -908,13 +908,13 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() << " does not support RemoteParcelRequest" << llendl; std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); } } else { std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestNoParcelSelected"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); } return LLPanelScriptLimitsInfo::postBuild(); @@ -936,9 +936,9 @@ void LLPanelScriptLimitsRegionMemory::clearList() LLStringUtil::format_map_t args_parcel_memory; std::string msg_empty_string(""); - getChild("memory_used")->setValue(LLSD(msg_empty_string)); - getChild("urls_used")->setValue(LLSD(msg_empty_string)); - getChild("parcels_listed")->setValue(LLSD(msg_empty_string)); + childSetValue("memory_used", LLSD(msg_empty_string)); + childSetValue("urls_used", LLSD(msg_empty_string)); + childSetValue("parcels_listed", LLSD(msg_empty_string)); mObjectListItems.clear(); } @@ -1207,7 +1207,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentDetails(LLSD content) setAttachmentSummary(content); - getChild("loading_text")->setValue(LLSD(std::string(""))); + childSetValue("loading_text", LLSD(std::string(""))); LLButton* btn = getChild("refresh_list_btn"); if(btn) @@ -1221,7 +1221,7 @@ BOOL LLPanelScriptLimitsAttachment::postBuild() childSetAction("refresh_list_btn", onClickRefresh, this); std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); return requestAttachmentDetails(); } @@ -1235,7 +1235,7 @@ void LLPanelScriptLimitsAttachment::clearList() } std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - getChild("loading_text")->setValue(LLSD(msg_waiting)); + childSetValue("loading_text", LLSD(msg_waiting)); } void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) @@ -1285,7 +1285,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) args_attachment_memory["[MAX]"] = llformat ("%d", mAttachmentMemoryMax); args_attachment_memory["[AVAILABLE]"] = llformat ("%d", attachment_memory_available); std::string msg_attachment_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_attachment_memory); - getChild("memory_used")->setValue(LLSD(msg_attachment_memory)); + childSetValue("memory_used", LLSD(msg_attachment_memory)); } if((mAttachmentURLsUsed >= 0) && (mAttachmentURLsMax >= 0)) @@ -1297,7 +1297,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) args_attachment_urls["[MAX]"] = llformat ("%d", mAttachmentURLsMax); args_attachment_urls["[AVAILABLE]"] = llformat ("%d", attachment_urls_available); std::string msg_attachment_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_attachment_urls); - getChild("urls_used")->setValue(LLSD(msg_attachment_urls)); + childSetValue("urls_used", LLSD(msg_attachment_urls)); } } diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 7661e50eba..31c82c1464 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -122,11 +122,11 @@ void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent eve switch (event) { case MEDIA_EVENT_NAVIGATE_BEGIN: - getChild("status_text")->setValue(getString("loading_text")); + childSetText("status_text", getString("loading_text")); break; case MEDIA_EVENT_NAVIGATE_COMPLETE: - getChild("status_text")->setValue(getString("done_text")); + childSetText("status_text", getString("done_text")); break; default: @@ -140,7 +140,7 @@ void LLFloaterSearch::godLevelChanged(U8 godlevel) // changes god level, then give them a warning (we don't refresh // the search as this might undo any page navigation or // AJAX-driven changes since the last search). - getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); + childSetVisible("refresh_search", (godlevel != mSearchGodLevel)); } void LLFloaterSearch::search(const LLSD &key) @@ -151,7 +151,7 @@ void LLFloaterSearch::search(const LLSD &key) } // reset the god level warning as we're sending the latest state - getChildView("refresh_search")->setVisible(FALSE); + childHide("refresh_search"); mSearchGodLevel = gAgent.getGodLevel(); // work out the subdir to use based on the requested category diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 3d87904dbe..af97fb90e1 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -157,7 +157,7 @@ BOOL LLFloaterSellLandUI::postBuild() { childSetCommitCallback("sell_to", onChangeValue, this); childSetCommitCallback("price", onChangeValue, this); - getChild("price")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + childSetPrevalidate("price", LLTextValidate::validateNonNegativeS32); childSetCommitCallback("sell_objects", onChangeValue, this); childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this)); childSetAction("cancel_btn", doCancel, this); @@ -201,20 +201,20 @@ void LLFloaterSellLandUI::updateParcelInfo() mParcelSoldWithObjects = parcelp->getSellWithObjects(); if (mParcelIsForSale) { - getChild("price")->setValue(mParcelPrice); + childSetValue("price", mParcelPrice); if (mParcelSoldWithObjects) { - getChild("sell_objects")->setValue("yes"); + childSetValue("sell_objects", "yes"); } else { - getChild("sell_objects")->setValue("no"); + childSetValue("sell_objects", "no"); } } else { - getChild("price")->setValue(""); - getChild("sell_objects")->setValue("none"); + childSetValue("price", ""); + childSetValue("sell_objects", "none"); } mParcelSnapshot = parcelp->getSnapshotID(); @@ -226,7 +226,7 @@ void LLFloaterSellLandUI::updateParcelInfo() { std::string name; gCacheName->getFullName(mAuthorizedBuyer, name); - getChild("sell_to_agent")->setValue(name); + childSetText("sell_to_agent", name); } } @@ -247,7 +247,7 @@ void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) case BADGE_ERROR: badgeName = badgeError; break; } - getChild(id)->setValue(badgeName); + childSetValue(id, badgeName); } void LLFloaterSellLandUI::refreshUI() @@ -258,10 +258,10 @@ void LLFloaterSellLandUI::refreshUI() LLTextureCtrl* snapshot = getChild("info_image"); snapshot->setImageAssetID(mParcelSnapshot); - getChild("info_parcel")->setValue(parcelp->getName()); - getChild("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea)); + childSetText("info_parcel", parcelp->getName()); + childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); - std::string price_str = getChild("price")->getValue().asString(); + std::string price_str = childGetValue("price").asString(); bool valid_price = false; valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str)); @@ -269,14 +269,14 @@ void LLFloaterSellLandUI::refreshUI() { F32 per_meter_price = 0; per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea); - getChild("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price)); - getChildView("price_per_m")->setVisible(TRUE); + childSetTextArg("price_per_m", "[PER_METER]", llformat("%0.2f", per_meter_price)); + childShow("price_per_m"); setBadge("step_price", BADGE_OK); } else { - getChildView("price_per_m")->setVisible(FALSE); + childHide("price_per_m"); if ("" == price_str) { @@ -290,26 +290,26 @@ void LLFloaterSellLandUI::refreshUI() if (mSellToBuyer) { - getChild("sell_to")->setValue("user"); - getChildView("sell_to_agent")->setVisible(TRUE); - getChildView("sell_to_select_agent")->setVisible(TRUE); + childSetValue("sell_to", "user"); + childShow("sell_to_agent"); + childShow("sell_to_select_agent"); } else { if (mChoseSellTo) { - getChild("sell_to")->setValue("anyone"); + childSetValue("sell_to", "anyone"); } else { - getChild("sell_to")->setValue("select"); + childSetValue("sell_to", "select"); } - getChildView("sell_to_agent")->setVisible(FALSE); - getChildView("sell_to_select_agent")->setVisible(FALSE); + childHide("sell_to_agent"); + childHide("sell_to_select_agent"); } // Must select Sell To: Anybody, or User (with a specified username) - std::string sell_to = getChild("sell_to")->getValue().asString(); + std::string sell_to = childGetValue("sell_to").asString(); bool valid_sell_to = "select" != sell_to && ("user" != sell_to || mAuthorizedBuyer.notNull()); @@ -322,7 +322,7 @@ void LLFloaterSellLandUI::refreshUI() setBadge("step_sell_to", BADGE_OK); } - bool valid_sell_objects = ("none" != getChild("sell_objects")->getValue().asString()); + bool valid_sell_objects = ("none" != childGetValue("sell_objects").asString()); if (!valid_sell_objects) { @@ -335,11 +335,11 @@ void LLFloaterSellLandUI::refreshUI() if (valid_sell_to && valid_price && valid_sell_objects) { - getChildView("sell_btn")->setEnabled(TRUE); + childEnable("sell_btn"); } else { - getChildView("sell_btn")->setEnabled(FALSE); + childDisable("sell_btn"); } } @@ -348,7 +348,7 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) { LLFloaterSellLandUI *self = (LLFloaterSellLandUI *)userdata; - std::string sell_to = self->getChild("sell_to")->getValue().asString(); + std::string sell_to = self->childGetValue("sell_to").asString(); if (sell_to == "user") { @@ -365,9 +365,9 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) self->mSellToBuyer = false; } - self->mParcelPrice = self->getChild("price")->getValue(); + self->mParcelPrice = self->childGetValue("price"); - if ("yes" == self->getChild("sell_objects")->getValue().asString()) + if ("yes" == self->childGetValue("sell_objects").asString()) { self->mParcelSoldWithObjects = true; } @@ -396,7 +396,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector& nam mAuthorizedBuyer = ids[0]; - getChild("sell_to_agent")->setValue(names[0]); + childSetText("sell_to_agent", names[0]); refreshUI(); } @@ -439,13 +439,13 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) LLParcel* parcel = self->mParcelSelection->getParcel(); // Do a confirmation - S32 sale_price = self->getChild("price")->getValue(); + S32 sale_price = self->childGetValue("price"); S32 area = parcel->getArea(); std::string authorizedBuyerName = "Anyone"; bool sell_to_anyone = true; - if ("user" == self->getChild("sell_to")->getValue().asString()) + if ("user" == self->childGetValue("sell_to").asString()) { - authorizedBuyerName = self->getChild("sell_to_agent")->getValue().asString(); + authorizedBuyerName = self->childGetText("sell_to_agent"); sell_to_anyone = false; } @@ -492,7 +492,7 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re { return false; } - S32 sale_price = getChild("price")->getValue(); + S32 sale_price = childGetValue("price"); // Valid extracted data if (sale_price < 0) @@ -514,12 +514,12 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re parcel->setParcelFlag(PF_FOR_SALE, TRUE); parcel->setSalePrice(sale_price); bool sell_with_objects = false; - if ("yes" == getChild("sell_objects")->getValue().asString()) + if ("yes" == childGetValue("sell_objects").asString()) { sell_with_objects = true; } parcel->setSellWithObjects(sell_with_objects); - if ("user" == getChild("sell_to")->getValue().asString()) + if ("user" == childGetValue("sell_to").asString()) { parcel->setAuthorizedBuyerID(mAuthorizedBuyer); } diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 41a05055fe..3bd5e900b4 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -121,49 +121,49 @@ void LLFloaterSettingsDebug::onCommitSettings() switch(controlp->type()) { case TYPE_U32: - controlp->set(getChild("val_spinner_1")->getValue()); + controlp->set(childGetValue("val_spinner_1")); break; case TYPE_S32: - controlp->set(getChild("val_spinner_1")->getValue()); + controlp->set(childGetValue("val_spinner_1")); break; case TYPE_F32: - controlp->set(LLSD(getChild("val_spinner_1")->getValue().asReal())); + controlp->set(LLSD(childGetValue("val_spinner_1").asReal())); break; case TYPE_BOOLEAN: - controlp->set(getChild("boolean_combo")->getValue()); + controlp->set(childGetValue("boolean_combo")); break; case TYPE_STRING: - controlp->set(LLSD(getChild("val_text")->getValue().asString())); + controlp->set(LLSD(childGetValue("val_text").asString())); break; case TYPE_VEC3: - vector.mV[VX] = (F32)getChild("val_spinner_1")->getValue().asReal(); - vector.mV[VY] = (F32)getChild("val_spinner_2")->getValue().asReal(); - vector.mV[VZ] = (F32)getChild("val_spinner_3")->getValue().asReal(); + vector.mV[VX] = (F32)childGetValue("val_spinner_1").asReal(); + vector.mV[VY] = (F32)childGetValue("val_spinner_2").asReal(); + vector.mV[VZ] = (F32)childGetValue("val_spinner_3").asReal(); controlp->set(vector.getValue()); break; case TYPE_VEC3D: - vectord.mdV[VX] = getChild("val_spinner_1")->getValue().asReal(); - vectord.mdV[VY] = getChild("val_spinner_2")->getValue().asReal(); - vectord.mdV[VZ] = getChild("val_spinner_3")->getValue().asReal(); + vectord.mdV[VX] = childGetValue("val_spinner_1").asReal(); + vectord.mdV[VY] = childGetValue("val_spinner_2").asReal(); + vectord.mdV[VZ] = childGetValue("val_spinner_3").asReal(); controlp->set(vectord.getValue()); break; case TYPE_RECT: - rect.mLeft = getChild("val_spinner_1")->getValue().asInteger(); - rect.mRight = getChild("val_spinner_2")->getValue().asInteger(); - rect.mBottom = getChild("val_spinner_3")->getValue().asInteger(); - rect.mTop = getChild("val_spinner_4")->getValue().asInteger(); + rect.mLeft = childGetValue("val_spinner_1").asInteger(); + rect.mRight = childGetValue("val_spinner_2").asInteger(); + rect.mBottom = childGetValue("val_spinner_3").asInteger(); + rect.mTop = childGetValue("val_spinner_4").asInteger(); controlp->set(rect.getValue()); break; case TYPE_COL4: - col3.setValue(getChild("val_color_swatch")->getValue()); - col4 = LLColor4(col3, (F32)getChild("val_spinner_4")->getValue().asReal()); + col3.setValue(childGetValue("val_color_swatch")); + col4 = LLColor4(col3, (F32)childGetValue("val_spinner_4").asReal()); controlp->set(col4.getValue()); break; case TYPE_COL3: - controlp->set(getChild("val_color_swatch")->getValue()); - //col3.mV[VRED] = (F32)floaterp->getChild("val_spinner_1")->getValue().asC(); - //col3.mV[VGREEN] = (F32)floaterp->getChild("val_spinner_2")->getValue().asReal(); - //col3.mV[VBLUE] = (F32)floaterp->getChild("val_spinner_3")->getValue().asReal(); + controlp->set(childGetValue("val_color_swatch")); + //col3.mV[VRED] = (F32)floaterp->childGetValue("val_spinner_1").asC(); + //col3.mV[VGREEN] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); + //col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); //controlp->set(col3.getValue()); break; default: @@ -205,7 +205,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) spinner3->setVisible(FALSE); spinner4->setVisible(FALSE); color_swatch->setVisible(FALSE); - getChildView("val_text")->setVisible( FALSE); + childSetVisible("val_text", FALSE); mComment->setText(LLStringUtil::null); if (controlp) @@ -213,7 +213,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) eControlType type = controlp->type(); //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame - getChildView("boolean_combo")->setVisible( type == TYPE_BOOLEAN); + childSetVisible("boolean_combo", type == TYPE_BOOLEAN); mComment->setText(controlp->getComment()); @@ -279,23 +279,23 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) } break; case TYPE_BOOLEAN: - if (!getChild("boolean_combo")->hasFocus()) + if (!childHasFocus("boolean_combo")) { if (sd.asBoolean()) { - getChild("boolean_combo")->setValue(LLSD("true")); + childSetValue("boolean_combo", LLSD("true")); } else { - getChild("boolean_combo")->setValue(LLSD("")); + childSetValue("boolean_combo", LLSD("")); } } break; case TYPE_STRING: - getChildView("val_text")->setVisible( TRUE); - if (!getChild("val_text")->hasFocus()) + childSetVisible("val_text", TRUE); + if (!childHasFocus("val_text")) { - getChild("val_text")->setValue(sd); + childSetValue("val_text", sd); } break; case TYPE_VEC3: diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index f58f704ff2..a5da861fb0 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -40,7 +40,6 @@ #include "llbutton.h" #include "llcombobox.h" #include "lleconomy.h" -#include "lllandmarkactions.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llviewercontrol.h" @@ -54,7 +53,6 @@ #include "llradiogroup.h" #include "lltoolfocus.h" #include "lltoolmgr.h" -#include "llwebsharing.h" #include "llworld.h" #include "llagentui.h" @@ -82,8 +80,8 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -S32 LLFloaterSnapshot::sUIWinHeightLong = 530 ; -S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 240 ; +S32 LLFloaterSnapshot::sUIWinHeightLong = 526 ; +S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 230 ; S32 LLFloaterSnapshot::sUIWinWidth = 215 ; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; @@ -111,8 +109,7 @@ public: { SNAPSHOT_POSTCARD, SNAPSHOT_TEXTURE, - SNAPSHOT_LOCAL, - SNAPSHOT_WEB + SNAPSHOT_LOCAL }; @@ -158,7 +155,6 @@ public: void setSnapshotQuality(S32 quality); void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); - void saveWeb(); LLFloaterPostcard* savePostcard(); void saveTexture(); BOOL saveLocal(); @@ -171,9 +167,6 @@ public: // Returns TRUE when snapshot generated, FALSE otherwise. static BOOL onIdle( void* snapshot_preview ); - // callback for region name resolve - void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z); - private: LLColor4 mColor; LLPointer mViewerImage[2]; //used to represent the scene when the frame is frozen. @@ -827,19 +820,9 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // delete any existing image previewp->mFormattedImage = NULL; // now create the new one of the appropriate format. - // note: postcards and web hardcoded to use jpeg always. - LLFloaterSnapshot::ESnapshotFormat format; - - if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD || - previewp->getSnapshotType() == SNAPSHOT_WEB) - { - format = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; - } - else - { - format = previewp->getSnapshotFormat(); - } - + // note: postcards hardcoded to use jpeg always. + LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotType() == SNAPSHOT_POSTCARD + ? LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG : previewp->getSnapshotFormat(); switch(format) { case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: @@ -1032,33 +1015,6 @@ BOOL LLSnapshotLivePreview::saveLocal() return success; } -void LLSnapshotLivePreview::saveWeb() -{ - // *FIX: Will break if the window closes because of CloseSnapshotOnKeep! - // Needs to pass on ownership of the image. - LLImageJPEG* jpg = dynamic_cast(mFormattedImage.get()); - if(!jpg) - { - llwarns << "Formatted image not a JPEG" << llendl; - return; - } - - LLSD metadata; - metadata["description"] = getChild("description")->getText(); - - LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(), - boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4)); - - gViewerWindow->playSnapshotAnimAndSound(); -} - -void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z) -{ - metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString(); - - LLWebSharing::instance().shareSnapshot(snapshot, metadata); -} - ///---------------------------------------------------------------------------- /// Class LLFloaterSnapshot::Impl ///---------------------------------------------------------------------------- @@ -1109,7 +1065,6 @@ public: private: static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater); - static LLSD getTypeName(LLSnapshotLivePreview::ESnapshotType index); static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater); static LLViewerWindow::ESnapshotType getLayerType(LLFloaterSnapshot* floater); static void comboSetCustom(LLFloaterSnapshot *floater, const std::string& comboname); @@ -1135,51 +1090,17 @@ LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater) { LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - LLSD value = floater->getChild("snapshot_type_radio")->getValue(); - + LLSD value = floater->childGetValue("snapshot_type_radio"); const std::string id = value.asString(); if (id == "postcard") - { index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - } else if (id == "texture") - { index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; - } else if (id == "local") - { index = LLSnapshotLivePreview::SNAPSHOT_LOCAL; - } - else if (id == "share_to_web") - { - index = LLSnapshotLivePreview::SNAPSHOT_WEB; - } - return index; } -// static -LLSD LLFloaterSnapshot::Impl::getTypeName(LLSnapshotLivePreview::ESnapshotType index) -{ - std::string id; - switch (index) - { - case LLSnapshotLivePreview::SNAPSHOT_WEB: - id = "share_to_web"; - break; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: - id = "postcard"; - break; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: - id = "texture"; - break; - case LLSnapshotLivePreview::SNAPSHOT_LOCAL: - default: - id = "local"; - break; - } - return LLSD(id); -} // static LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater) @@ -1205,7 +1126,7 @@ LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFlo LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSnapshot* floater) { LLViewerWindow::ESnapshotType type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - LLSD value = floater->getChild("layer_types")->getValue(); + LLSD value = floater->childGetValue("layer_types"); const std::string id = value.asString(); if (id == "colors") type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; @@ -1248,7 +1169,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } - bool use_freeze_frame = floaterp->getChild("freeze_frame_check")->getValue().asBoolean(); + bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean(); if (use_freeze_frame) { @@ -1316,64 +1237,56 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { LLRadioGroup* snapshot_type_radio = floater->getChild("snapshot_type_radio"); - LLSnapshotLivePreview::ESnapshotType shot_type = (LLSnapshotLivePreview::ESnapshotType)gSavedSettings.getS32("LastSnapshotType"); - snapshot_type_radio->setSelectedByValue(getTypeName(shot_type), true); - - ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); + snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType")); + LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater); + ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); //getFormatIndex(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); - floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled")); - - floater->getChildView("postcard_size_combo")->setVisible( FALSE); - floater->getChildView("texture_size_combo")->setVisible( FALSE); - floater->getChildView("local_size_combo")->setVisible( FALSE); + floater->childSetVisible("postcard_size_combo", FALSE); + floater->childSetVisible("texture_size_combo", FALSE); + floater->childSetVisible("local_size_combo", FALSE); floater->getChild("postcard_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution")); floater->getChild("texture_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution")); floater->getChild("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution")); floater->getChild("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); - // *TODO: Separate settings for Web images from postcards - floater->getChildView("send_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB); - floater->getChildView("upload_btn")->setVisible(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); - floater->getChildView("save_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); - floater->getChildView("keep_aspect_check")->setEnabled(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); - floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); + floater->childSetVisible("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); + floater->childSetVisible("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD); + floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); + floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); + floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; - BOOL show_slider = (shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB || - (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG)); - - floater->getChildView("more_btn")->setVisible( !is_advance); // the only item hidden in advanced mode - floater->getChildView("less_btn")->setVisible( is_advance); - floater->getChildView("type_label2")->setVisible( is_advance); - floater->getChildView("format_label")->setVisible( is_advance && is_local); - floater->getChildView("local_format_combo")->setVisible( is_advance && is_local); - floater->getChildView("layer_types")->setVisible( is_advance); - floater->getChildView("layer_type_label")->setVisible( is_advance); - floater->getChildView("snapshot_width")->setVisible( is_advance); - floater->getChildView("snapshot_height")->setVisible( is_advance); - floater->getChildView("keep_aspect_check")->setVisible( is_advance); - floater->getChildView("ui_check")->setVisible( is_advance); - floater->getChildView("hud_check")->setVisible( is_advance); - floater->getChildView("keep_open_check")->setVisible( is_advance); - floater->getChildView("freeze_frame_check")->setVisible( is_advance); - floater->getChildView("auto_snapshot_check")->setVisible( is_advance); - floater->getChildView("image_quality_slider")->setVisible( is_advance && show_slider); + BOOL show_slider = + shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD + || (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + + floater->childSetVisible("more_btn", !is_advance); // the only item hidden in advanced mode + floater->childSetVisible("less_btn", is_advance); + floater->childSetVisible("type_label2", is_advance); + floater->childSetVisible("format_label", is_advance && is_local); + floater->childSetVisible("local_format_combo", is_advance && is_local); + floater->childSetVisible("layer_types", is_advance); + floater->childSetVisible("layer_type_label", is_advance); + floater->childSetVisible("snapshot_width", is_advance); + floater->childSetVisible("snapshot_height", is_advance); + floater->childSetVisible("keep_aspect_check", is_advance); + floater->childSetVisible("ui_check", is_advance); + floater->childSetVisible("hud_check", is_advance); + floater->childSetVisible("keep_open_check", is_advance); + floater->childSetVisible("freeze_frame_check", is_advance); + floater->childSetVisible("auto_snapshot_check", is_advance); + floater->childSetVisible("image_quality_slider", is_advance && show_slider); LLSnapshotLivePreview* previewp = getPreviewView(floater); BOOL got_bytes = previewp && previewp->getDataSize() > 0; BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - // *TODO: Separate maximum size for Web images from postcards - floater->getChildView("send_btn")->setEnabled((shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB) && - got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); - floater->getChildView("upload_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); - floater->getChildView("save_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap); + floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); + floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); + floater->childSetEnabled("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap); LLLocale locale(LLLocale::USER_LOCALE); std::string bytes_string; @@ -1382,21 +1295,19 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); } S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - floater->getChild("texture")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); - floater->getChild("upload_btn")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); - floater->getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); - floater->getChild("file_size_label")->setColor( + floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost)); + floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost)); + floater->childSetTextArg("file_size_label", "[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); + floater->childSetColor("file_size_label", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_bytes && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); switch(shot_type) { - // *TODO: Separate settings for Web images from postcards - case LLSnapshotLivePreview::SNAPSHOT_WEB: case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - floater->getChild("layer_types")->setValue("colors"); + floater->childSetValue("layer_types", "colors"); if(is_advance) { setResolution(floater, "postcard_size_combo"); @@ -1404,7 +1315,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) break; case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - floater->getChild("layer_types")->setValue("colors"); + floater->childSetValue("layer_types", "colors"); if(is_advance) { setResolution(floater, "texture_size_combo"); @@ -1485,39 +1396,28 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data) { LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; LLSnapshotLivePreview* previewp = getPreviewView(view); - + if (previewp) { - switch (previewp->getSnapshotType()) + if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { - case LLSnapshotLivePreview::SNAPSHOT_WEB: - previewp->saveWeb(); - break; - - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: + LLFloaterPostcard* floater = previewp->savePostcard(); + // if still in snapshot mode, put postcard floater in snapshot floaterview + // and link it to snapshot floater + if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep")) { - LLFloaterPostcard* floater = previewp->savePostcard(); - // if still in snapshot mode, put postcard floater in snapshot floaterview - // and link it to snapshot floater - if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - gFloaterView->removeChild(floater); - gSnapshotFloaterView->addChild(floater); - view->addDependentFloater(floater, FALSE); - } + gFloaterView->removeChild(floater); + gSnapshotFloaterView->addChild(floater); + view->addDependentFloater(floater, FALSE); } - break; - - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: + } + else if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) + { previewp->saveTexture(); - break; - - case LLSnapshotLivePreview::SNAPSHOT_LOCAL: + } + else + { previewp->saveLocal(); - break; - - default: - break; } if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) @@ -1704,7 +1604,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde if(0 == index) //current window size { view->impl.mAspectRatioCheckOff = true ; - view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; + view->childSetEnabled("keep_aspect_check", FALSE) ; if(previewp) { @@ -1716,7 +1616,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde view->impl.mAspectRatioCheckOff = false ; //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) { - view->getChildView("keep_aspect_check")->setEnabled(TRUE) ; + view->childSetEnabled("keep_aspect_check", TRUE) ; if(previewp) { @@ -1727,7 +1627,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde else { view->impl.mAspectRatioCheckOff = true ; - view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; + view->childSetEnabled("keep_aspect_check", FALSE) ; if(previewp) { @@ -1742,22 +1642,18 @@ static std::string lastSnapshotWidthName() { switch(gSavedSettings.getS32("LastSnapshotType")) { - // *TODO: Separate settings for Web snapshots and postcards - case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailWidth"; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryWidth"; - default: return "LastSnapshotToDiskWidth"; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth"; + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryWidth"; + default: return "LastSnapshotToDiskWidth"; } } static std::string lastSnapshotHeightName() { switch(gSavedSettings.getS32("LastSnapshotType")) { - // *TODO: Separate settings for Web snapshots and postcards - case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailHeight"; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryHeight"; - default: return "LastSnapshotToDiskHeight"; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight"; + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryHeight"; + default: return "LastSnapshotToDiskHeight"; } } @@ -1816,10 +1712,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL resetSnapshotSizeOnUI(view, width, height) ; } - if(view->getChild("snapshot_width")->getValue().asInteger() != width || view->getChild("snapshot_height")->getValue().asInteger() != height) + if(view->childGetValue("snapshot_width").asInteger() != width || view->childGetValue("snapshot_height").asInteger() != height) { - view->getChild("snapshot_width")->setValue(width); - view->getChild("snapshot_height")->setValue(height); + view->childSetValue("snapshot_width", width); + view->childSetValue("snapshot_height", height); } if(original_width != width || original_height != height) @@ -1871,7 +1767,7 @@ void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data) //static void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { gSavedSettings.setS32("SnapshotFormat", getFormatIndex(view)); @@ -2002,8 +1898,8 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { - S32 w = llfloor((F32)view->getChild("snapshot_width")->getValue().asReal()); - S32 h = llfloor((F32)view->getChild("snapshot_height")->getValue().asReal()); + S32 w = llfloor((F32)view->childGetValue("snapshot_width").asReal()); + S32 h = llfloor((F32)view->childGetValue("snapshot_height").asReal()); LLSnapshotLivePreview* previewp = getPreviewView(view); if (previewp) @@ -2092,12 +1988,6 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { - // Kick start Web Sharing, to fetch its config data if it needs to. - if (gSavedSettings.getBOOL("SnapshotSharingEnabled")) - { - LLWebSharing::instance().init(); - } - childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this); childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this); @@ -2112,34 +2002,34 @@ BOOL LLFloaterSnapshot::postBuild() childSetAction("discard_btn", Impl::onClickDiscard, this); childSetCommitCallback("image_quality_slider", Impl::onCommitQuality, this); - getChild("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); + childSetValue("image_quality_slider", gSavedSettings.getS32("SnapshotQuality")); childSetCommitCallback("snapshot_width", Impl::onCommitCustomResolution, this); childSetCommitCallback("snapshot_height", Impl::onCommitCustomResolution, this); childSetCommitCallback("ui_check", Impl::onClickUICheck, this); - getChild("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot")); + childSetValue("ui_check", gSavedSettings.getBOOL("RenderUIInSnapshot")); childSetCommitCallback("hud_check", Impl::onClickHUDCheck, this); - getChild("hud_check")->setValue(gSavedSettings.getBOOL("RenderHUDInSnapshot")); + childSetValue("hud_check", gSavedSettings.getBOOL("RenderHUDInSnapshot")); childSetCommitCallback("keep_open_check", Impl::onClickKeepOpenCheck, this); - getChild("keep_open_check")->setValue(!gSavedSettings.getBOOL("CloseSnapshotOnKeep")); + childSetValue("keep_open_check", !gSavedSettings.getBOOL("CloseSnapshotOnKeep")); childSetCommitCallback("keep_aspect_check", Impl::onClickKeepAspectCheck, this); - getChild("keep_aspect_check")->setValue(gSavedSettings.getBOOL("KeepAspectForSnapshot")); + childSetValue("keep_aspect_check", gSavedSettings.getBOOL("KeepAspectForSnapshot")); childSetCommitCallback("layer_types", Impl::onCommitLayerTypes, this); - getChild("layer_types")->setValue("colors"); - getChildView("layer_types")->setEnabled(FALSE); + childSetValue("layer_types", "colors"); + childSetEnabled("layer_types", FALSE); - getChild("snapshot_width")->setValue(gSavedSettings.getS32(lastSnapshotWidthName())); - getChild("snapshot_height")->setValue(gSavedSettings.getS32(lastSnapshotHeightName())); + childSetValue("snapshot_width", gSavedSettings.getS32(lastSnapshotWidthName())); + childSetValue("snapshot_height", gSavedSettings.getS32(lastSnapshotHeightName())); - getChild("freeze_frame_check")->setValue(gSavedSettings.getBOOL("UseFreezeFrame")); + childSetValue("freeze_frame_check", gSavedSettings.getBOOL("UseFreezeFrame")); childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this); - getChild("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot")); + childSetValue("auto_snapshot_check", gSavedSettings.getBOOL("AutoSnapshot")); childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this); childSetCommitCallback("postcard_size_combo", Impl::onCommitResolution, this); diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index d945f1a2de..d3d3b75a50 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -106,19 +106,19 @@ void LLFloaterTelehub::refresh() BOOL have_selection = (object != NULL); BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); - getChildView("connect_btn")->setEnabled(have_selection && all_volume); + childSetEnabled("connect_btn", have_selection && all_volume); BOOL have_telehub = mTelehubObjectID.notNull(); - getChildView("disconnect_btn")->setEnabled(have_telehub); + childSetEnabled("disconnect_btn", have_telehub); BOOL space_avail = (mNumSpawn < MAX_SPAWNPOINTS_PER_TELEHUB); - getChildView("add_spawn_point_btn")->setEnabled(have_selection && all_volume && space_avail); + childSetEnabled("add_spawn_point_btn", have_selection && all_volume && space_avail); LLScrollListCtrl* list = getChild("spawn_points_list"); if (list) { BOOL enable_remove = (list->getFirstSelected() != NULL); - getChildView("remove_spawn_point_btn")->setEnabled(enable_remove); + childSetEnabled("remove_spawn_point_btn", enable_remove); } } @@ -249,18 +249,18 @@ void LLFloaterTelehub::unpackTelehubInfo(LLMessageSystem* msg) if (mTelehubObjectID.isNull()) { - getChildView("status_text_connected")->setVisible( false); - getChildView("status_text_not_connected")->setVisible( true); - getChildView("help_text_connected")->setVisible( false); - getChildView("help_text_not_connected")->setVisible( true); + childSetVisible("status_text_connected", false); + childSetVisible("status_text_not_connected", true); + childSetVisible("help_text_connected", false); + childSetVisible("help_text_not_connected", true); } else { - getChild("status_text_connected")->setTextArg("[OBJECT]", mTelehubObjectName); - getChildView("status_text_connected")->setVisible( true); - getChildView("status_text_not_connected")->setVisible( false); - getChildView("help_text_connected")->setVisible( true); - getChildView("help_text_not_connected")->setVisible( false); + childSetTextArg("status_text_connected", "[OBJECT]", mTelehubObjectName); + childSetVisible("status_text_connected", true); + childSetVisible("status_text_not_connected", false); + childSetVisible("help_text_connected", true); + childSetVisible("help_text_not_connected", false); } LLScrollListCtrl* list = getChild("spawn_points_list"); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 58a0d08c7d..41ca5b78f8 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -222,13 +222,13 @@ BOOL LLFloaterTools::postBuild() mTitleMedia = getChild("title_media"); mCheckSelectIndividual = getChild("checkbox edit linked parts"); - getChild("checkbox edit linked parts")->setValue((BOOL)gSavedSettings.getBOOL("EditLinkedParts")); + childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); mCheckSnapToGrid = getChild("checkbox snap to grid"); - getChild("checkbox snap to grid")->setValue((BOOL)gSavedSettings.getBOOL("SnapEnabled")); + childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled")); mCheckStretchUniform = getChild("checkbox uniform"); - getChild("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform")); + childSetValue("checkbox uniform",(BOOL)gSavedSettings.getBOOL("ScaleUniform")); mCheckStretchTexture = getChild("checkbox stretch textures"); - getChild("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); + childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); mComboGridMode = getChild("combobox grid mode"); mCheckStretchUniformLabel = getChild("checkbox uniform label"); @@ -248,21 +248,21 @@ BOOL LLFloaterTools::postBuild() } } mCheckCopySelection = getChild("checkbox copy selection"); - getChild("checkbox copy selection")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); + childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); mCheckSticky = getChild("checkbox sticky"); - getChild("checkbox sticky")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); + childSetValue("checkbox sticky",(BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); mCheckCopyCenters = getChild("checkbox copy centers"); - getChild("checkbox copy centers")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); + childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); mCheckCopyRotates = getChild("checkbox copy rotates"); - getChild("checkbox copy rotates")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); + childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); mRadioGroupLand = getChild("land_radio_group"); mBtnApplyToSelection = getChild("button apply to selection"); mSliderDozerSize = getChild("slider brush size"); - getChild("slider brush size")->setValue(gSavedSettings.getF32("LandBrushSize")); + childSetValue( "slider brush size", gSavedSettings.getF32("LandBrushSize")); mSliderDozerForce = getChild("slider force"); // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here - getChild("slider force")->setValue(log10(gSavedSettings.getF32("LandBrushForce"))); + childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); mTab = getChild("Object Info Tabs"); if(mTab) @@ -415,25 +415,25 @@ void LLFloaterTools::refresh() LLLocale locale(LLLocale::USER_LOCALE); std::string obj_count_string; LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - getChild("obj_count")->setTextArg("[COUNT]", obj_count_string); + childSetTextArg("obj_count", "[COUNT]", obj_count_string); std::string prim_count_string; LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - getChild("prim_count")->setTextArg("[COUNT]", prim_count_string); + childSetTextArg("prim_count", "[COUNT]", prim_count_string); // calculate selection rendering cost if (sShowObjectCost) { std::string prim_cost_string; LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); - getChild("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); + childSetTextArg("RenderingCost", "[COUNT]", prim_cost_string); } // disable the object and prim counts if nothing selected bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); - getChildView("obj_count")->setEnabled(have_selection); - getChildView("prim_count")->setEnabled(have_selection); - getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); + childSetEnabled("obj_count", have_selection); + childSetEnabled("prim_count", have_selection); + childSetEnabled("RenderingCost", have_selection && sShowObjectCost); // Refresh child tabs mPanelPermissions->refresh(); @@ -501,8 +501,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnFocus ->setToggleState( focus_visible ); mRadioGroupFocus->setVisible( focus_visible ); - getChildView("slider zoom")->setVisible( focus_visible); - getChildView("slider zoom")->setEnabled(gCameraBtnZoom); + childSetVisible("slider zoom", focus_visible); + childSetEnabled("slider zoom", gCameraBtnZoom); if (!gCameraBtnOrbit && !gCameraBtnPan && @@ -527,7 +527,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) } // multiply by correction factor because volume sliders go [0, 0.5] - getChild("slider zoom")->setValue(gAgentCamera.getCameraZoomFraction() * 0.5f); + childSetValue( "slider zoom", gAgentCamera.getCameraZoomFraction() * 0.5f); // Move buttons BOOL move_visible = (tool == LLToolGrab::getInstance()); @@ -565,7 +565,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnEdit ->setToggleState( edit_visible ); mRadioGroupEdit->setVisible( edit_visible ); bool linked_parts = gSavedSettings.getBOOL("EditLinkedParts"); - getChildView("RenderingCost")->setVisible( !linked_parts && (edit_visible || focus_visible || move_visible) && sShowObjectCost); + childSetVisible("RenderingCost", !linked_parts && (edit_visible || focus_visible || move_visible) && sShowObjectCost); if (mCheckSelectIndividual) { @@ -708,17 +708,17 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mSliderDozerSize) { mSliderDozerSize ->setVisible( land_visible ); - getChildView("Bulldozer:")->setVisible( land_visible); - getChildView("Dozer Size:")->setVisible( land_visible); + childSetVisible("Bulldozer:", land_visible); + childSetVisible("Dozer Size:", land_visible); } if (mSliderDozerForce) { mSliderDozerForce ->setVisible( land_visible ); - getChildView("Strength:")->setVisible( land_visible); + childSetVisible("Strength:", land_visible); } - getChildView("obj_count")->setVisible( !land_visible); - getChildView("prim_count")->setVisible( !land_visible); + childSetVisible("obj_count", !land_visible); + childSetVisible("prim_count", !land_visible); mTab->setVisible(!land_visible); mPanelLandInfo->setVisible(land_visible); } @@ -1085,7 +1085,7 @@ void LLFloaterTools::getMediaState() &&first_object->permModify() )) { - getChildView("Add_Media")->setEnabled(FALSE); + childSetEnabled("Add_Media", FALSE); media_info->clear(); clearMediaSettings(); return; @@ -1096,7 +1096,7 @@ void LLFloaterTools::getMediaState() if(!has_media_capability) { - getChildView("Add_Media")->setEnabled(FALSE); + childSetEnabled("Add_Media", FALSE); LL_WARNS("LLFloaterTools: media") << "Media not enabled (no capability) in this region!" << LL_ENDL; clearMediaSettings(); return; @@ -1188,7 +1188,7 @@ void LLFloaterTools::getMediaState() // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. - getChildView("Add_Media")->setEnabled(editable); + childSetEnabled("Add_Media", editable); // IF all the faces have media (or all dont have media) if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) { @@ -1215,10 +1215,10 @@ void LLFloaterTools::getMediaState() mNeedMediaTitle = false; } - getChildView("media_tex")->setEnabled(bool_has_media && editable); - getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); - getChildView("delete_media")->setEnabled(bool_has_media && editable ); - getChildView("add_media")->setEnabled(( ! bool_has_media ) && editable ); + childSetEnabled("media_tex", bool_has_media && editable); + childSetEnabled( "edit_media", bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); + childSetEnabled( "delete_media", bool_has_media && editable ); + childSetEnabled( "add_media", ( ! bool_has_media ) && editable ); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1245,10 +1245,10 @@ void LLFloaterTools::getMediaState() } } - getChildView("media_tex")->setEnabled(TRUE); - getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); - getChildView("delete_media")->setEnabled(TRUE); - getChildView("add_media")->setEnabled(FALSE ); + childSetEnabled("media_tex", TRUE); + childSetEnabled( "edit_media", LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); + childSetEnabled( "delete_media", TRUE); + childSetEnabled( "add_media", FALSE ); } media_info->setText(media_title); diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index a984dd1d51..41869ac62b 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -92,7 +92,7 @@ LLFloaterTopObjects::~LLFloaterTopObjects() BOOL LLFloaterTopObjects::postBuild() { LLScrollListCtrl *objects_list = getChild("objects_list"); - getChild("objects_list")->setFocus(TRUE); + childSetFocus("objects_list"); objects_list->setDoubleClickCallback(onDoubleClickObjectsList, this); objects_list->setCommitOnSelectionChange(TRUE); @@ -247,7 +247,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) LLUIString format = getString("top_scripts_text"); format.setArg("[COUNT]", llformat("%d", total_count)); format.setArg("[TIME]", llformat("%0.1f", mtotalScore)); - getChild("title_text")->setValue(LLSD(format)); + childSetValue("title_text", LLSD(format)); } else { @@ -256,7 +256,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) list->setColumnLabel("mono_time", ""); LLUIString format = getString("top_colliders_text"); format.setArg("[COUNT]", llformat("%d", total_count)); - getChild("title_text")->setValue(LLSD(format)); + childSetValue("title_text", LLSD(format)); } } @@ -276,13 +276,13 @@ void LLFloaterTopObjects::updateSelectionInfo() std::string object_id_string = object_id.asString(); - getChild("id_editor")->setValue(LLSD(object_id_string)); + childSetValue("id_editor", LLSD(object_id_string)); LLScrollListItem* sli = list->getFirstSelected(); llassert(sli); if (sli) { - getChild("object_name_editor")->setValue(sli->getColumn(1)->getValue().asString()); - getChild("owner_name_editor")->setValue(sli->getColumn(2)->getValue().asString()); + childSetValue("object_name_editor", sli->getColumn(1)->getValue().asString()); + childSetValue("owner_name_editor", sli->getColumn(2)->getValue().asString()); } } @@ -306,7 +306,7 @@ void LLFloaterTopObjects::doToObjects(int action, bool all) LLViewerRegion* region = gAgent.getRegion(); if (!region) return; - LLCtrlListInterface *list = getChild("objects_list")->getListInterface(); + LLCtrlListInterface *list = childGetListInterface("objects_list"); if (!list || list->getItemCount() == 0) return; uuid_vec_t::iterator id_itor; @@ -451,14 +451,14 @@ void LLFloaterTopObjects::onRefresh() void LLFloaterTopObjects::onGetByObjectName() { mFlags = STAT_FILTER_BY_OBJECT; - mFilter = getChild("object_name_editor")->getValue().asString(); + mFilter = childGetText("object_name_editor"); onRefresh(); } void LLFloaterTopObjects::onGetByOwnerName() { mFlags = STAT_FILTER_BY_OWNER; - mFilter = getChild("owner_name_editor")->getValue().asString(); + mFilter = childGetText("owner_name_editor"); onRefresh(); } diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index c5df7e16e9..6e64291240 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -193,8 +193,8 @@ void LLFloaterTOS::draw() void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; - bool agree = self->getChild("agree_chk")->getValue().asBoolean(); - self->getChildView("Continue")->setEnabled(agree); + bool agree = self->childGetValue("agree_chk").asBoolean(); + self->childSetEnabled("Continue", agree); } // static diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 333e44e077..fadb250c48 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -469,7 +469,7 @@ BOOL LLFloaterUIPreview::postBuild() // Set up overlap panel mOverlapPanel = getChild("overlap_panel"); - getChildView("overlap_scroll")->setVisible( mHighlightingOverlaps); + childSetVisible("overlap_scroll", mHighlightingOverlaps); mDelim = gDirUtilp->getDirDelimiter(); // initialize delimiter to dir sep slash @@ -1693,7 +1693,7 @@ void LLFloaterUIPreview::onClickToggleOverlapping() setRect(LLRect(getRect().mLeft,getRect().mTop,getRect().mRight + mOverlapPanel->getRect().getWidth(),getRect().mBottom)); setResizeLimits(width + mOverlapPanel->getRect().getWidth(), height); } - getChildView("overlap_scroll")->setVisible( mHighlightingOverlaps); + childSetVisible("overlap_scroll", mHighlightingOverlaps); } void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp new file mode 100644 index 0000000000..fffc4fd20a --- /dev/null +++ b/indra/newview/llfloaterurldisplay.cpp @@ -0,0 +1,103 @@ +/** + * @file llfloaterurldisplay.h + * @brief Probably should be called LLFloaterTeleport, or LLFloaterLandmark + * as it gives you a preview of a potential teleport location. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llregionhandle.h" +#include "v3dmath.h" + +#include "llfloaterurldisplay.h" + +#include "llpanelplace.h" +#include "lluictrlfactory.h" + +//////////////////////////////////////////////////////////////////////////// +// LLFloaterURLDisplay + + +LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) + : LLFloater(sd) +{ + mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); + + // If positioned at 0,0 the teleport button is behind the toolbar. + LLRect r = getRect(); + if (r.mBottom == 0 && r.mLeft == 0) + { + // first use, center it + center(); + } + else + { + gFloaterView->adjustToFitScreen(this, FALSE); + } +} + +LLFloaterURLDisplay::~LLFloaterURLDisplay() +{ +} + +void LLFloaterURLDisplay::displayParcelInfo(U64 region_handle, const LLVector3& pos_local) +{ + mRegionHandle = region_handle; + mRegionPosition = pos_local; + LLVector3d pos_global = from_region_handle(region_handle); + pos_global += (LLVector3d)pos_local; + + LLUUID region_id; // don't know this + LLUUID landmark_asset_id; // don't know this either + mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, region_id, pos_global); + + this->setVisible(true); + this->setFrontmost(true); +} + +void LLFloaterURLDisplay::setSnapshotDisplay(const LLUUID& snapshot_id) +{ + mPlacePanel->setSnapshot(snapshot_id); +} + +void LLFloaterURLDisplay::setName(const std::string& name) +{ // Set the name and also clear description + mPlacePanel->resetName(name); +} + +void LLFloaterURLDisplay::setLocationString(const std::string& name) +{ + mPlacePanel->setLocationString(name); +} + +// static +void* LLFloaterURLDisplay::createPlaceDetail(void* userdata) +{ + LLFloaterURLDisplay *self = (LLFloaterURLDisplay*)userdata; + self->mPlacePanel = new LLPanelPlace(); + LLUICtrlFactory::getInstance()->buildPanel(self->mPlacePanel, "panel_place.xml"); + + return self->mPlacePanel; +} diff --git a/indra/newview/llfloaterurldisplay.h b/indra/newview/llfloaterurldisplay.h new file mode 100644 index 0000000000..1bea4c4aa8 --- /dev/null +++ b/indra/newview/llfloaterurldisplay.h @@ -0,0 +1,58 @@ +/** + * @file llfloaterurldisplay.h + * @brief LLFloaterURLDisplay class implementation + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERURLDISPLAY_H +#define LL_LLFLOATERURLDISPLAY_H + +#include "llfloater.h" +#include "v3math.h" + +class LLPanelPlace; +class LLSD; +class LLUUID; + +class LLFloaterURLDisplay : public LLFloater +{ + friend class LLFloaterReg; +public: + + void displayParcelInfo(U64 region_handle, const LLVector3& pos); + void setSnapshotDisplay(const LLUUID& snapshot_id); + void setName(const std::string& name); + void setLocationString(const std::string& name); + + static void* createPlaceDetail(void* userdata); + +private: + LLFloaterURLDisplay(const LLSD& sd); + virtual ~LLFloaterURLDisplay(); + + LLVector3 mRegionPosition; + U64 mRegionHandle; + LLPanelPlace* mPlacePanel; +}; + +#endif // LL_LLFLOATERURLDISPLAY_H diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 40f6d07286..3c906501c7 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -105,7 +105,7 @@ BOOL LLFloaterURLEntry::postBuild() // clear media list button LLSD parcel_history = LLURLHistory::getURLHistory("parcel"); bool enable_clear_button = parcel_history.size() > 0 ? true : false; - getChildView("clear_btn")->setEnabled(enable_clear_button ); + childSetEnabled( "clear_btn", enable_clear_button ); // OK button childSetAction("ok_btn", onBtnOK, this); @@ -157,7 +157,7 @@ void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_ } // Decrement the cursor getWindow()->decBusyCount(); - getChildView("loading_label")->setVisible( false); + childSetVisible("loading_label", false); closeFloater(); } @@ -230,13 +230,13 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) } // Grey the buttons until we get the header response - self->getChildView("ok_btn")->setEnabled(false); - self->getChildView("cancel_btn")->setEnabled(false); - self->getChildView("media_entry")->setEnabled(false); + self->childSetEnabled("ok_btn", false); + self->childSetEnabled("cancel_btn", false); + self->childSetEnabled("media_entry", false); // show progress bar here? getWindow()->incBusyCount(); - self->getChildView("loading_label")->setVisible( true); + self->childSetVisible("loading_label", true); } // static @@ -278,7 +278,7 @@ bool LLFloaterURLEntry::callback_clear_url_list(const LLSD& notification, const LLURLHistory::clear("parcel"); // cleared the list so disable Clear button - getChildView("clear_btn")->setEnabled(false ); + childSetEnabled( "clear_btn", false ); } return false; } diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 34277001ee..81a65f5469 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -97,7 +97,7 @@ void LLPanelVoiceDeviceSettings::draw() // let user know that volume indicator is not yet available bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode(); - getChildView("wait_text")->setVisible( !is_in_tuning_mode); + childSetVisible("wait_text", !is_in_tuning_mode); LLPanel::draw(); diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 2a3950f9b1..24d1707f64 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -60,7 +60,7 @@ BOOL LLFloaterVoiceEffect::postBuild() { setDefaultBtn("record_btn"); getChild("record_btn")->setFocus(true); - getChild("voice_morphing_link")->setTextArg("[URL]", LLTrans::getString("voice_morphing_url")); + childSetTextArg("voice_morphing_link", "[URL]", LLTrans::getString("voice_morphing_url")); mVoiceEffectList = getChild("voice_effect_list"); if (mVoiceEffectList) diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 9c3f943013..ebcd9d40f2 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -204,7 +204,7 @@ void LLFloaterWater::syncMenu() param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err); LLColor4 col = param_mgr->getFogColor(); - getChild("WaterGlow")->setValue(col.mV[3]); + childSetValue("WaterGlow", col.mV[3]); col.mV[3] = 1.0f; LLColorSwatchCtrl* colCtrl = getChild("WaterFogColor"); @@ -215,41 +215,41 @@ void LLFloaterWater::syncMenu() log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / log(param_mgr->mFogDensity.mBase); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); - getChild("WaterFogDensity")->setValue(param_mgr->mFogDensity.mExp); + childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp); param_mgr->mUnderWaterFogMod.mX = current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); - getChild("WaterUnderWaterFogMod")->setValue(param_mgr->mUnderWaterFogMod.mX); + childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX); param_mgr->mNormalScale = current_params.getVector3(param_mgr->mNormalScale.mName, err); - getChild("WaterNormalScaleX")->setValue(param_mgr->mNormalScale.mX); - getChild("WaterNormalScaleY")->setValue(param_mgr->mNormalScale.mY); - getChild("WaterNormalScaleZ")->setValue(param_mgr->mNormalScale.mZ); + childSetValue("WaterNormalScaleX", param_mgr->mNormalScale.mX); + childSetValue("WaterNormalScaleY", param_mgr->mNormalScale.mY); + childSetValue("WaterNormalScaleZ", param_mgr->mNormalScale.mZ); // Fresnel param_mgr->mFresnelScale.mX = current_params.getFloat(param_mgr->mFresnelScale.mName, err); - getChild("WaterFresnelScale")->setValue(param_mgr->mFresnelScale.mX); + childSetValue("WaterFresnelScale", param_mgr->mFresnelScale.mX); param_mgr->mFresnelOffset.mX = current_params.getFloat(param_mgr->mFresnelOffset.mName, err); - getChild("WaterFresnelOffset")->setValue(param_mgr->mFresnelOffset.mX); + childSetValue("WaterFresnelOffset", param_mgr->mFresnelOffset.mX); // Scale Above/Below param_mgr->mScaleAbove.mX = current_params.getFloat(param_mgr->mScaleAbove.mName, err); - getChild("WaterScaleAbove")->setValue(param_mgr->mScaleAbove.mX); + childSetValue("WaterScaleAbove", param_mgr->mScaleAbove.mX); param_mgr->mScaleBelow.mX = current_params.getFloat(param_mgr->mScaleBelow.mName, err); - getChild("WaterScaleBelow")->setValue(param_mgr->mScaleBelow.mX); + childSetValue("WaterScaleBelow", param_mgr->mScaleBelow.mX); // blur mult param_mgr->mBlurMultiplier.mX = current_params.getFloat(param_mgr->mBlurMultiplier.mName, err); - getChild("WaterBlurMult")->setValue(param_mgr->mBlurMultiplier.mX); + childSetValue("WaterBlurMult", param_mgr->mBlurMultiplier.mX); // wave directions param_mgr->mWave1Dir = current_params.getVector2(param_mgr->mWave1Dir.mName, err); - getChild("WaterWave1DirX")->setValue(param_mgr->mWave1Dir.mX); - getChild("WaterWave1DirY")->setValue(param_mgr->mWave1Dir.mY); + childSetValue("WaterWave1DirX", param_mgr->mWave1Dir.mX); + childSetValue("WaterWave1DirY", param_mgr->mWave1Dir.mY); param_mgr->mWave2Dir = current_params.getVector2(param_mgr->mWave2Dir.mName, err); - getChild("WaterWave2DirX")->setValue(param_mgr->mWave2Dir.mX); - getChild("WaterWave2DirY")->setValue(param_mgr->mWave2Dir.mY); + childSetValue("WaterWave2DirX", param_mgr->mWave2Dir.mX); + childSetValue("WaterWave2DirY", param_mgr->mWave2Dir.mY); LLTextureCtrl* textCtrl = getChild("WaterNormalMap"); textCtrl->setImageAssetID(param_mgr->getNormalMapID()); @@ -333,7 +333,7 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - getChild(name)->setValue(colorControl->mR); + childSetValue(name, colorControl->mR); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -356,7 +356,7 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - getChild(name)->setValue(colorControl->mG); + childSetValue(name, colorControl->mG); } @@ -380,7 +380,7 @@ void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - getChild(name)->setValue(colorControl->mB); + childSetValue(name, colorControl->mB); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -449,9 +449,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* col } // set the sliders to the new vals - getChild(rName)->setValue(colorControl->mR); - getChild(gName)->setValue(colorControl->mG); - getChild(bName)->setValue(colorControl->mB); + childSetValue(rName, colorControl->mR); + childSetValue(gName, colorControl->mG); + childSetValue(bName, colorControl->mB); } // now update the current parameters and send them to shaders diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 7131cb5de3..dae473c6f9 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -272,31 +272,31 @@ void LLFloaterWindLight::syncMenu() // blue horizon param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); - getChild("WLBlueHorizonR")->setValue(param_mgr->mBlueHorizon.r / 2.0); - getChild("WLBlueHorizonG")->setValue(param_mgr->mBlueHorizon.g / 2.0); - getChild("WLBlueHorizonB")->setValue(param_mgr->mBlueHorizon.b / 2.0); - getChild("WLBlueHorizonI")->setValue( + 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); - getChild("WLHazeDensity")->setValue(param_mgr->mHazeDensity.r); + childSetValue("WLHazeDensity", param_mgr->mHazeDensity.r); param_mgr->mHazeHorizon = currentParams.getVector(param_mgr->mHazeHorizon.mName, err); - getChild("WLHazeHorizon")->setValue(param_mgr->mHazeHorizon.r); + childSetValue("WLHazeHorizon", param_mgr->mHazeHorizon.r); param_mgr->mDensityMult = currentParams.getVector(param_mgr->mDensityMult.mName, err); - getChild("WLDensityMult")->setValue(param_mgr->mDensityMult.x * + childSetValue("WLDensityMult", param_mgr->mDensityMult.x * param_mgr->mDensityMult.mult); param_mgr->mMaxAlt = currentParams.getVector(param_mgr->mMaxAlt.mName, err); - getChild("WLMaxAltitude")->setValue(param_mgr->mMaxAlt.x); + childSetValue("WLMaxAltitude", param_mgr->mMaxAlt.x); // blue density param_mgr->mBlueDensity = currentParams.getVector(param_mgr->mBlueDensity.mName, err); - getChild("WLBlueDensityR")->setValue(param_mgr->mBlueDensity.r / 2.0); - getChild("WLBlueDensityG")->setValue(param_mgr->mBlueDensity.g / 2.0); - getChild("WLBlueDensityB")->setValue(param_mgr->mBlueDensity.b / 2.0); - getChild("WLBlueDensityI")->setValue( + 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))); @@ -304,93 +304,93 @@ void LLFloaterWindLight::syncMenu() // sunlight param_mgr->mSunlight = currentParams.getVector(param_mgr->mSunlight.mName, err); - getChild("WLSunlightR")->setValue(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLSunlightG")->setValue(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLSunlightB")->setValue(param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLSunlightI")->setValue( + 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); - getChild("WLGlowR")->setValue(2 - param_mgr->mGlow.r / 20.0f); - getChild("WLGlowB")->setValue(-param_mgr->mGlow.b / 5.0f); + 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); - getChild("WLAmbientR")->setValue(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLAmbientG")->setValue(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLAmbientB")->setValue(param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild("WLAmbientI")->setValue( + 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))); - getChild("WLSunAngle")->setValue(param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); - getChild("WLEastAngle")->setValue(param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); + 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); - getChild("WLCloudColorR")->setValue(param_mgr->mCloudColor.r); - getChild("WLCloudColorG")->setValue(param_mgr->mCloudColor.g); - getChild("WLCloudColorB")->setValue(param_mgr->mCloudColor.b); - getChild("WLCloudColorI")->setValue( + 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); - getChild("WLCloudX")->setValue(param_mgr->mCloudMain.r); - getChild("WLCloudY")->setValue(param_mgr->mCloudMain.g); - getChild("WLCloudDensity")->setValue(param_mgr->mCloudMain.b); + 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); - getChild("WLCloudDetailX")->setValue(param_mgr->mCloudDetail.r); - getChild("WLCloudDetailY")->setValue(param_mgr->mCloudDetail.g); - getChild("WLCloudDetailDensity")->setValue(param_mgr->mCloudDetail.b); + 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); - getChild("WLCloudCoverage")->setValue(param_mgr->mCloudCoverage.x); - getChild("WLCloudScale")->setValue(param_mgr->mCloudScale.x); + 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(); - getChild("WLCloudLockX")->setValue(lockX); - getChild("WLCloudLockY")->setValue(lockY); - getChild("DrawClassicClouds")->setValue(gSavedSettings.getBOOL("SkyUseClassicClouds")); + childSetValue("WLCloudLockX", lockX); + childSetValue("WLCloudLockY", lockY); + childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds")); // disable if locked, enable if not if(lockX) { - getChildView("WLCloudScrollX")->setEnabled(FALSE); + childDisable("WLCloudScrollX"); } else { - getChildView("WLCloudScrollX")->setEnabled(TRUE); + childEnable("WLCloudScrollX"); } if(lockY) { - getChildView("WLCloudScrollY")->setEnabled(FALSE); + childDisable("WLCloudScrollY"); } else { - getChildView("WLCloudScrollY")->setEnabled(TRUE); + childEnable("WLCloudScrollY"); } // *HACK cloud scrolling is off my an additive of 10 - getChild("WLCloudScrollX")->setValue(param_mgr->mCurParams.getCloudScrollX() - 10.0f); - getChild("WLCloudScrollY")->setValue(param_mgr->mCurParams.getCloudScrollY() - 10.0f); + 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); - getChild("WLDistanceMult")->setValue(param_mgr->mDistanceMult.x); + childSetValue("WLDistanceMult", param_mgr->mDistanceMult.x); // Tweak extras param_mgr->mWLGamma = currentParams.getVector(param_mgr->mWLGamma.mName, err); - getChild("WLGamma")->setValue(param_mgr->mWLGamma.x); + childSetValue("WLGamma", param_mgr->mWLGamma.x); - getChild("WLStarAlpha")->setValue(param_mgr->mCurParams.getStarBrightness()); + childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); LLTabContainer* tab = getChild("WindLight Tabs"); LLPanel* panel = getChild("Scattering"); @@ -422,11 +422,11 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - getChild(name)->setValue(colorControl->r / 3); + childSetValue(name, colorControl->r / 3); } else if(colorControl->isBlueHorizonOrDensity) { - getChild(name)->setValue(colorControl->r / 2); + childSetValue(name, colorControl->r / 2); } else { - getChild(name)->setValue(colorControl->r); + childSetValue(name, colorControl->r); } } @@ -457,11 +457,11 @@ void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - getChild(name)->setValue(colorControl->g / 3); + childSetValue(name, colorControl->g / 3); } else if(colorControl->isBlueHorizonOrDensity) { - getChild(name)->setValue(colorControl->g / 2); + childSetValue(name, colorControl->g / 2); } else { - getChild(name)->setValue(colorControl->g); + childSetValue(name, colorControl->g); } } @@ -492,11 +492,11 @@ void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - getChild(name)->setValue(colorControl->b / 3); + childSetValue(name, colorControl->b / 3); } else if(colorControl->isBlueHorizonOrDensity) { - getChild(name)->setValue(colorControl->b / 2); + childSetValue(name, colorControl->b / 2); } else { - getChild(name)->setValue(colorControl->b); + childSetValue(name, colorControl->b); } } @@ -566,24 +566,24 @@ void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* co // divide sun color vals by three if(colorControl->isSunOrAmbientColor) { - getChild(rName)->setValue(colorControl->r/3); - getChild(gName)->setValue(colorControl->g/3); - getChild(bName)->setValue(colorControl->b/3); + childSetValue(rName, colorControl->r/3); + childSetValue(gName, colorControl->g/3); + childSetValue(bName, colorControl->b/3); } else if(colorControl->isBlueHorizonOrDensity) { - getChild(rName)->setValue(colorControl->r/2); - getChild(gName)->setValue(colorControl->g/2); - getChild(bName)->setValue(colorControl->b/2); + childSetValue(rName, colorControl->r/2); + childSetValue(gName, colorControl->g/2); + childSetValue(bName, colorControl->b/2); } else { // set the sliders to the new vals - getChild(rName)->setValue(colorControl->r); - getChild(gName)->setValue(colorControl->g); - getChild(bName)->setValue(colorControl->b); + childSetValue(rName, colorControl->r); + childSetValue(gName, colorControl->g); + childSetValue(bName, colorControl->b); } } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 3afa31b873..942d246dc2 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -242,7 +242,7 @@ BOOL LLFloaterWorldMap::postBuild() landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); - getChild("zoom slider")->setValue(LLWorldMapView::sMapScale); + childSetValue("zoom slider", LLWorldMapView::sMapScale); setDefaultBtn(NULL); @@ -315,7 +315,7 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id); - getChild("location")->setFocus( TRUE); + childSetFocus("location", TRUE); gFocusMgr.triggerFocusFlash(); buildAvatarIDList(); @@ -351,9 +351,9 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { if(mPanel->pointInView(x, y)) { - F32 slider_value = (F32)getChild("zoom slider")->getValue().asReal(); + F32 slider_value = (F32)childGetValue("zoom slider").asReal(); slider_value += ((F32)clicks * -0.3333f); - getChild("zoom slider")->setValue(LLSD(slider_value)); + childSetValue("zoom slider", LLSD(slider_value)); return TRUE; } } @@ -381,32 +381,32 @@ void LLFloaterWorldMap::draw() LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; - getChildView("Go Home")->setEnabled(enable_go_home); + childSetEnabled("Go Home", enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { - getChild("avatar_icon")->setColor( map_track_color); + childSetColor("avatar_icon", map_track_color); } else { - getChild("avatar_icon")->setColor( map_track_disabled_color); + childSetColor("avatar_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { - getChild("landmark_icon")->setColor( map_track_color); + childSetColor("landmark_icon", map_track_color); } else { - getChild("landmark_icon")->setColor( map_track_disabled_color); + childSetColor("landmark_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LOCATION == tracking_status) { - getChild("location_icon")->setColor( map_track_color); + childSetColor("location_icon", map_track_color); } else { @@ -416,11 +416,11 @@ void LLFloaterWorldMap::draw() 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); - getChild("location_icon")->setColor( loading_color); + childSetColor("location_icon", loading_color); } else { - getChild("location_icon")->setColor( map_track_disabled_color); + childSetColor("location_icon", map_track_disabled_color); } } @@ -430,16 +430,16 @@ void LLFloaterWorldMap::draw() centerOnTarget(TRUE); } - getChildView("Teleport")->setEnabled((BOOL)tracking_status); -// getChildView("Clear")->setEnabled((BOOL)tracking_status); - getChildView("Show Destination")->setEnabled((BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); - getChildView("copy_slurl")->setEnabled((mSLURL.isValid()) ); + childSetEnabled("Teleport", (BOOL)tracking_status); +// childSetEnabled("Clear", (BOOL)tracking_status); + childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); + childSetEnabled("copy_slurl", (mSLURL.isValid()) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering - if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)getChild("zoom slider")->getValue().asReal()) + if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) { mZoomTimer.start(); } @@ -449,7 +449,7 @@ void LLFloaterWorldMap::draw() interp = 1.f; mZoomTimer.stop(); } - mCurZoomVal = lerp(mCurZoomVal, (F32)getChild("zoom slider")->getValue().asReal(), interp); + mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); @@ -457,13 +457,13 @@ void LLFloaterWorldMap::draw() // 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(); - getChildView("people_chk")->setEnabled(enable); - getChildView("infohub_chk")->setEnabled(enable); - getChildView("telehub_chk")->setEnabled(enable); - getChildView("land_for_sale_chk")->setEnabled(enable); - getChildView("event_chk")->setEnabled(enable); - getChildView("events_mature_chk")->setEnabled(enable); - getChildView("events_adult_chk")->setEnabled(enable); + childSetEnabled("people_chk", enable); + childSetEnabled("infohub_chk", enable); + childSetEnabled("telehub_chk", enable); + childSetEnabled("land_for_sale_chk", enable); + childSetEnabled("event_chk", enable); + childSetEnabled("events_mature_chk", enable); + childSetEnabled("events_adult_chk", enable); LLFloater::draw(); } @@ -487,7 +487,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& // convenience. if(gAgent.isGodlike()) { - getChild("spin z")->setValue(LLSD(200.f)); + childSetValue("spin z", LLSD(200.f)); } // Don't re-request info if we already have it or we won't have it in time to teleport if (mTrackedStatus != LLTracker::TRACKING_AVATAR || name != mTrackedAvatarName) @@ -668,7 +668,7 @@ void LLFloaterWorldMap::updateLocation() mSetToUserPosition = FALSE; // Fill out the location field - getChild("location")->setValue(agent_sim_name); + childSetValue("location", agent_sim_name); // update the coordinate display with location of avatar in region updateTeleportCoordsDisplay( agentPos ); @@ -701,7 +701,7 @@ void LLFloaterWorldMap::updateLocation() } } - getChild("location")->setValue(sim_name); + childSetValue("location", sim_name); // refresh coordinate display to reflect where user clicked. LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); @@ -736,7 +736,7 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 else { // fill in UI based on URL - gFloaterWorldMap->getChild("location")->setValue(region_name); + gFloaterWorldMap->childSetValue("location", region_name); // Save local coords to highlight position after region global // position is returned. @@ -1133,7 +1133,7 @@ void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus ) void LLFloaterWorldMap::updateSearchEnabled() { if (childHasKeyboardFocus("location") && - getChild("location")->getValue().asString().length() > 0) + childGetValue("location").asString().length() > 0) { setDefaultBtn("DoSearch"); } @@ -1154,14 +1154,14 @@ void LLFloaterWorldMap::onLocationCommit() mCompletingRegionName = ""; mLastRegionName = ""; - std::string str = getChild("location")->getValue().asString(); + std::string str = childGetValue("location").asString(); // Trim any leading and trailing spaces in the search target std::string saved_str = str; LLStringUtil::trim( str ); if ( str != saved_str ) { // Set the value in the UI if any spaces were removed - getChild("location")->setValue(str); + childSetValue("location", str); } LLStringUtil::toLower(str); @@ -1301,7 +1301,7 @@ void LLFloaterWorldMap::teleport() && av_tracker.haveTrackingInfo() ) { pos_global = av_tracker.getGlobalPos(); - pos_global.mdV[VZ] = getChild("spin z")->getValue(); + pos_global.mdV[VZ] = childGetValue("spin z"); } else if ( LLTracker::TRACKING_LANDMARK == tracking_status) { @@ -1470,7 +1470,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) if (!match.isUndefined()) { list->selectByValue(match); - getChild("search_results")->setFocus(TRUE); + childSetFocus("search_results"); onCommitSearchResult(); } @@ -1518,7 +1518,7 @@ void LLFloaterWorldMap::onCommitSearchResult() pos_global.mdV[VY] += (F64)pos_local.mV[VY]; pos_global.mdV[VZ] = (F64)pos_local.mV[VZ]; - getChild("location")->setValue(sim_name); + childSetValue("location", sim_name); trackLocation(pos_global); setDefaultBtn("Teleport"); break; @@ -1533,13 +1533,13 @@ void LLFloaterWorldMap::onChangeMaturity() bool can_access_mature = gAgent.canAccessMature(); bool can_access_adult = gAgent.canAccessAdult(); - getChildView("events_mature_icon")->setVisible( can_access_mature); - getChildView("events_mature_label")->setVisible( can_access_mature); - getChildView("events_mature_chk")->setVisible( can_access_mature); + childSetVisible("events_mature_icon", can_access_mature); + childSetVisible("events_mature_label", can_access_mature); + childSetVisible("events_mature_chk", can_access_mature); - getChildView("events_adult_icon")->setVisible( can_access_adult); - getChildView("events_adult_label")->setVisible( can_access_adult); - getChildView("events_adult_chk")->setVisible( can_access_adult); + childSetVisible("events_adult_icon", can_access_adult); + childSetVisible("events_adult_label", can_access_adult); + childSetVisible("events_adult_chk", can_access_adult); // disable mature / adult events. if (!can_access_mature) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5d8e3f9ab9..d71e288ffe 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -56,7 +56,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" -#include "llnotificationsutil.h" // Linden library includes #include "lldbstrings.h" @@ -99,6 +98,7 @@ void copy_selected_item(void* user_data); void open_selected_items(void* user_data); void properties_selected_items(void* user_data); void paste_items(void* user_data); +void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); //--------------------------------------------------------------------------- @@ -178,6 +178,7 @@ LLFolderView::LLFolderView(const Params& p) mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), + mEnableScroll( true ), mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), @@ -243,7 +244,7 @@ LLFolderView::LLFolderView(const Params& p) text_p.name(std::string(p.name)); text_p.font(font); text_p.visible(false); - text_p.parse_urls(true); + text_p.allow_html(true); text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 // set text padding the same as in People panel. EXT-7047, EXT-4837 text_p.h_pad(STATUS_TEXT_HPAD); @@ -268,8 +269,6 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { - closeRenamer(); - // The release focus call can potentially call the // scrollcontainer, which can potentially be called with a partly // destroyed scollcontainer. Just null it out here, and no worries @@ -285,6 +284,8 @@ LLFolderView::~LLFolderView( void ) LLView::deleteViewByHandle(mPopupMenuHandle); + gViewerWindow->removePopup(mRenamer); + mAutoOpenItems.removeAllNodes(); clearSelection(); mItems.clear(); @@ -991,7 +992,12 @@ void LLFolderView::finishRenamingItem( void ) mRenameItem->rename( mRenamer->getText() ); } - closeRenamer(); + gViewerWindow->removePopup(mRenamer); + + if( mRenameItem ) + { + setSelectionFromRoot( mRenameItem, TRUE ); + } // List is re-sorted alphabeticly, so scroll to make sure the selected item is visible. scrollToShowSelection(); @@ -999,26 +1005,20 @@ void LLFolderView::finishRenamingItem( void ) void LLFolderView::closeRenamer( void ) { - if (mRenamer && mRenamer->getVisible()) + // will commit current name (which could be same as original name) + mRenamer->setFocus( FALSE ); + mRenamer->setVisible( FALSE ); + gViewerWindow->removePopup(mRenamer); + + if( mRenameItem ) { - // Triggers onRenamerLost() that actually closes the renamer. - gViewerWindow->removePopup(mRenamer); + setSelectionFromRoot( mRenameItem, TRUE ); + mRenameItem = NULL; } } void LLFolderView::removeSelectedItems( void ) { - if (mSelectedItems.empty()) return; - LLSD args; - args["QUESTION"] = LLTrans::getString(mSelectedItems.size() > 1 ? "DeleteItems" : "DeleteItem"); - LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2)); -} - -void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) return; // canceled - if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. @@ -1438,7 +1438,8 @@ void LLFolderView::startRenamingSelectedItem( void ) mRenamer->setVisible( TRUE ); // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); - mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); + mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); + mRenamer->setFocusLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); gViewerWindow->addPopup(mRenamer); } } @@ -1959,7 +1960,10 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderView::deleteAllChildren() { - closeRenamer(); + if(mRenamer == gFocusMgr.getTopCtrl()) + { + gViewerWindow->removePopup(mRenamer); + } LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle(); mRenamer = NULL; @@ -1970,9 +1974,7 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - // If items are filtered while background fetch is in progress - // scrollbar resets to the first filtered item. See EXT-3981. - if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) + if (mEnableScroll && mSelectedItems.size()) { mNeedsScroll = TRUE; } @@ -2444,20 +2446,13 @@ S32 LLFolderView::notify(const LLSD& info) /// Local function definitions ///---------------------------------------------------------------------------- -void LLFolderView::onRenamerLost() +void LLFolderView::onRenamerLost( LLFocusableElement* renamer) { - if (mRenamer && mRenamer->getVisible()) - { - mRenamer->setVisible(FALSE); - - // will commit current name (which could be same as original name) - mRenamer->setFocus(FALSE); - } - - if( mRenameItem ) + mRenameItem = NULL; + LLUICtrl* uictrl = dynamic_cast(renamer); + if (uictrl) { - setSelectionFromRoot( mRenameItem, TRUE ); - mRenameItem = NULL; + uictrl->setVisible(FALSE); } } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 980f9a34a6..9be83ba852 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -268,6 +268,7 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; + void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; } bool useLabelSuffix() { return mUseLabelSuffix; } private: @@ -277,7 +278,7 @@ protected: LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container. void commitRename( const LLSD& data ); - void onRenamerLost(); + void onRenamerLost( LLFocusableElement* renamer); void finishRenamingItem( void ); void closeRenamer( void ); @@ -287,8 +288,6 @@ protected: BOOL addNoOptions(LLMenuGL* menu) const; - void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response); - protected: LLHandle mPopupMenuHandle; @@ -304,6 +303,7 @@ protected: LLLineEditor* mRenamer; BOOL mNeedsScroll; + bool mEnableScroll; BOOL mPinningSelectedItem; LLRect mScrollConstraintRect; BOOL mNeedsAutoSelect; diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 2f856abe8f..f672ffe20f 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -293,17 +293,6 @@ void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBud { folderBuddiesMap.clear(); - static bool syncronize_friends_folders = true; - if (syncronize_friends_folders) - { - // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, - // fetches their contents if needed and synchronizes it with buddies list. - // If the folders are not found they are created. - LLFriendCardsManager::instance().syncFriendCardsFolders(); - syncronize_friends_folders = false; - } - - LLInventoryModel::cat_array_t* listFolders; LLInventoryModel::item_array_t* items; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 4f9d51ce58..3751a33a48 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -206,8 +206,8 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->setName(name, mNameFilter); item->setGroupIconID(icon_id); - item->getChildView("info_btn")->setVisible( false); - item->getChildView("profile_btn")->setVisible( false); + item->childSetVisible("info_btn", false); + item->childSetVisible("profile_btn", false); item->setGroupIconVisible(mShowIcons); addItem(item, id, pos); @@ -317,16 +317,16 @@ void LLGroupListItem::setValue( const LLSD& value ) { if (!value.isMap()) return; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); } void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( true); + childSetVisible("hovered_icon", true); if (mGroupID.notNull()) // don't show the info button for the "none" group { mInfoBtn->setVisible(true); - getChildView("profile_btn")->setVisible( true); + childSetVisible("profile_btn", true); } LLPanel::onMouseEnter(x, y, mask); @@ -334,9 +334,9 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( false); + childSetVisible("hovered_icon", false); mInfoBtn->setVisible(false); - getChildView("profile_btn")->setVisible( false); + childSetVisible("profile_btn", false); LLPanel::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b00a663a9a..f748603bfa 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -231,25 +231,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& new LLSessionTimeoutTimer(mSessionID, SESSION_INITIALIZATION_TIMEOUT); } - // *WORKAROUND: for server hard-coded string in indra\newsim\llsimchatterbox.cpp - if (isAdHocSessionType() && IM_SESSION_INVITE == type) - { - // For an ad-hoc incoming chat name is received from the server and is in a form of " Conference" - // Lets update it to localize the "Conference" word. See EXT-8429. - S32 separator_index = mName.rfind(" "); - std::string name = mName.substr(0, separator_index); - ++separator_index; - std::string conference_word = mName.substr(separator_index, mName.length()); - - // additional check that session name is what we expected - if ("Conference" == conference_word) - { - LLStringUtil::format_map_t args; - args["[AGENT_NAME]"] = name; - LLTrans::findString(mName, "conference-title-incoming", args); - } - } - if (IM_NOTHING_SPECIAL == type) { mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID); @@ -1015,6 +996,19 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if (is_not_group_id) { + +#if 0 + //use this code to add only online members + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); + LLSpeakerMgr::speaker_list_t speaker_list; + speaker_mgr->getSpeakerList(&speaker_list, true); + for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) + { + const LLPointer& speakerp = *it; + + LLRecentPeople::instance().add(speakerp->mID); + } +#else LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id); if( session == 0)//??? shouldn't really happen { @@ -1029,20 +1023,16 @@ void LLIMModel::sendMessage(const std::string& utf8_text, // Concrete participants will be added into this list once they sent message in chat. if (IM_SESSION_INVITE == dialog) return; - // Add only online members to recent (EXT-8658) - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); - LLSpeakerMgr::speaker_list_t speaker_list; - if(speaker_mgr != NULL) - { - speaker_mgr->getSpeakerList(&speaker_list, true); - } - for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) + // implemented adding of all participants of an outgoing to Recent People List. See EXT-5694. + for(uuid_vec_t::iterator it = session->mInitialTargetIDs.begin(); + it!=session->mInitialTargetIDs.end();++it) { - const LLPointer& speakerp = *it; + const LLUUID id = *it; - LLRecentPeople::instance().add(speakerp->mID); + LLRecentPeople::instance().add(id); } } +#endif } @@ -1713,12 +1703,12 @@ void LLOutgoingCallDialog::show(const LLSD& key) old_caller_name = LLTextUtil::formatPhoneNumber(old_caller_name); } - getChild("leaving")->setTextArg("[CURRENT_CHAT]", old_caller_name); + childSetTextArg("leaving", "[CURRENT_CHAT]", old_caller_name); show_oldchannel = true; } else { - getChild("leaving")->setTextArg("[CURRENT_CHAT]", getString("localchat")); + childSetTextArg("leaving", "[CURRENT_CHAT]", getString("localchat")); } if (!mPayload["disconnected_channel_name"].asString().empty()) @@ -1728,16 +1718,16 @@ void LLOutgoingCallDialog::show(const LLSD& key) { channel_name = LLTextUtil::formatPhoneNumber(channel_name); } - getChild("nearby")->setTextArg("[VOICE_CHANNEL_NAME]", channel_name); + childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); // skipping "You will now be reconnected to nearby" in notification when call is ended by disabling voice, // so no reconnection to nearby chat happens (EXT-4397) bool voice_works = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); std::string reconnect_nearby = voice_works ? LLTrans::getString("reconnect_nearby") : std::string(); - getChild("nearby")->setTextArg("[RECONNECT_NEARBY]", reconnect_nearby); + childSetTextArg("nearby", "[RECONNECT_NEARBY]", reconnect_nearby); const std::string& nearby_str = mPayload["ended_by_agent"] ? NEARBY_P2P_BY_AGENT : NEARBY_P2P_BY_OTHER; - getChild(nearby_str)->setTextArg("[RECONNECT_NEARBY]", reconnect_nearby); + childSetTextArg(nearby_str, "[RECONNECT_NEARBY]", reconnect_nearby); } std::string callee_name = mPayload["session_name"].asString(); @@ -1757,8 +1747,8 @@ void LLOutgoingCallDialog::show(const LLSD& key) setTitle(callee_name); LLSD callee_id = mPayload["other_user_id"]; - getChild("calling")->setTextArg("[CALLEE_NAME]", callee_name); - getChild("connecting")->setTextArg("[CALLEE_NAME]", callee_name); + childSetTextArg("calling", "[CALLEE_NAME]", callee_name); + childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); // for outgoing group calls callee_id == group id == session id setIcon(callee_id, callee_id); @@ -1943,7 +1933,7 @@ BOOL LLIncomingCallDialog::postBuild() //it's not possible to connect to existing Ad-Hoc/Group chat through incoming ad-hoc call //and no IM for avaline - getChildView("Start IM")->setVisible( is_avatar && notify_box_type != "VoiceInviteAdHoc" && notify_box_type != "VoiceInviteGroup"); + childSetVisible("Start IM", is_avatar && notify_box_type != "VoiceInviteAdHoc" && notify_box_type != "VoiceInviteGroup"); setCanDrag(FALSE); @@ -1967,12 +1957,12 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) if (voice && !voice->getSessionName().empty()) { args["[CURRENT_CHAT]"] = voice->getSessionName(); - getChild("question")->setValue(getString(key["question_type"].asString(), args)); + childSetText("question", getString(key["question_type"].asString(), args)); } else { args["[CURRENT_CHAT]"] = getString("localchat"); - getChild("question")->setValue(getString(key["question_type"].asString(), args)); + childSetText("question", getString(key["question_type"].asString(), args)); } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 4ce94773bf..dfd39cc39c 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -227,8 +227,7 @@ public: * Get a session's name. * For a P2P chat - it's an avatar's name, * For a group chat - it's a group's name - * For an incoming ad-hoc chat - is received from the server and is in a from of " Conference" - * It is updated in LLIMModel::LLIMSession's constructor to localize the "Conference". + * For an ad-hoc chat - is received from the server and is in a from of " conference" */ const std::string& getName(const LLUUID& session_id) const; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index b367d68b02..d877d659c1 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -365,7 +365,7 @@ void LLInspectAvatar::requestUpdate() //remove avatar id from cache to get fresh info LLAvatarIconIDCache::getInstance()->remove(mAvatarID); - getChild("avatar_icon")->setValue(LLSD(mAvatarID) ); + childSetValue("avatar_icon", LLSD(mAvatarID) ); gCacheName->get(mAvatarID, FALSE, boost::bind(&LLInspectAvatar::nameUpdatedCallback, @@ -615,7 +615,7 @@ void LLInspectAvatar::nameUpdatedCallback( if (id == mAvatarID) { mAvatarName = first + " " + last; - getChild("user_name")->setValue(LLSD(mAvatarName) ); + childSetValue("user_name", LLSD(mAvatarName) ); } } diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 214b135bc1..1e9bbb7839 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -233,7 +233,7 @@ void LLInspectGroup::nameUpdatedCallback( if (id == mGroupID) { // group names are returned as a first name - getChild("group_name")->setValue(LLSD(first) ); + childSetValue("group_name", LLSD(first) ); } // Otherwise possibly a request for an older inspector, ignore it diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aff0bc4099..beeac86f94 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1264,12 +1264,6 @@ BOOL LLItemBridge::isItemRenameable() const { return FALSE; } - - if (!item->isFinished()) // EXT-8662 - { - return FALSE; - } - return (item->getPermissions().allowModifyBy(gAgent.getID())); } return FALSE; @@ -3936,7 +3930,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL, true); // Replace if "Wear"ing. + rez_attachment(item, NULL); } else if(item && item->isFinished()) { @@ -3952,16 +3946,23 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } - else if ("wear_add" == action) - { - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. - } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); if(item) { - LLVOAvatarSelf::detachAttachmentIntoInventory(item->getLinkedUUID()); + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); + gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); + + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID()); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + } } } else LLItemBridge::performAction(model, action); @@ -3978,11 +3979,6 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { - if (!isAgentAvatarValid()) - { - return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); - } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); // e.g. "(worn on ...)" / "(attached to ...)" @@ -3996,19 +3992,10 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) { - const LLUUID& item_id = item->getLinkedUUID(); - - // Check for duplicate request. - if (isAgentAvatarValid() && - (gAgentAvatarp->attachmentWasRequested(item_id) || - gAgentAvatarp->isWearingAttachment(item_id))) - { - llwarns << "duplicate attachment request, ignoring" << llendl; - return; - } - gAgentAvatarp->addAttachmentRequest(item_id); + LLSD payload; + payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. S32 attach_pt = 0; if (isAgentAvatarValid() && attachment) @@ -4024,16 +4011,9 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - - LLSD payload; - payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; - if (replace && + if (!gSavedSettings.getBOOL("MultipleAttachments") && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4057,13 +4037,13 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0/*YES*/) { - LLUUID item_id = notification["payload"]["item_id"].asUUID(); - LLViewerInventoryItem* itemp = gInventory.getItem(item_id); + LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); - + if (gSavedSettings.getBOOL("MultipleAttachments")) + attachment_pt |= ATTACHMENT_ADD; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4120,7 +4100,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); - items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4129,7 +4108,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); - disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } @@ -4332,7 +4310,19 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ LLViewerInventoryItem *obj_item = obj_item_array.get(i); if (get_is_item_worn(obj_item->getUUID())) { - LLVOAvatarSelf::detachAttachmentIntoInventory(obj_item->getLinkedUUID()); + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item->getLinkedUUID() ); + + gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); + + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject( obj_item->getLinkedUUID()); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + } } } } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 14abdd76b9..6ddd77284a 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -588,8 +588,7 @@ public: }; void rez_attachment(LLViewerInventoryItem* item, - LLViewerJointAttachment* attachment, - bool replace = false); + LLViewerJointAttachment* attachment); // Move items from an in-world object's "Contents" folder to a specified // folder in agent inventory. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f3d9639dee..e814cf012e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -215,13 +215,7 @@ BOOL get_is_item_worn(const LLUUID& id) const LLViewerInventoryItem* item = gInventory.getItem(id); if (!item) return FALSE; - - // Consider the item as worn if it has links in COF. - if (LLAppearanceMgr::instance().isLinkInCOF(id)) - { - return TRUE; - } - + switch(item->getType()) { case LLAssetType::AT_OBJECT: @@ -263,16 +257,6 @@ BOOL get_can_item_be_worn(const LLUUID& id) return FALSE; } - const LLUUID trash_id = gInventory.findCategoryUUIDForType( - LLFolderType::FT_TRASH); - - // item can't be worn if base obj in trash, see EXT-7015 - if (gInventory.isObjectDescendentOf(item->getLinkedUUID(), - trash_id)) - { - return false; - } - switch(item->getType()) { case LLAssetType::AT_OBJECT: diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index cfe1747fd4..853bf45c5e 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -295,7 +295,6 @@ public: virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) { - //converting an inventory type to a bitmap filter mask if(item && (mFilterMask & (1LL << item->getInventoryType())) ) { return true; diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 348d7ebcec..2b81ba8a12 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -80,37 +80,6 @@ boost::signals2::connection LLInventoryItemsList::setRefreshCompleteCallback(con return mRefreshCompleteSignal.connect(cb); } -bool LLInventoryItemsList::selectItemByValue(const LLSD& value, bool select) -{ - if (!LLFlatListView::selectItemByValue(value, select) && !value.isUndefined()) - { - mSelectTheseIDs.push_back(value); - return false; - } - return true; -} - -void LLInventoryItemsList::updateSelection() -{ - if(mSelectTheseIDs.empty()) return; - - std::vector cur; - getValues(cur); - - for(std::vector::const_iterator cur_id_it = cur.begin(); cur_id_it != cur.end() && !mSelectTheseIDs.empty(); ++cur_id_it) - { - uuid_vec_t::iterator select_ids_it = std::find(mSelectTheseIDs.begin(), mSelectTheseIDs.end(), *cur_id_it); - if(select_ids_it != mSelectTheseIDs.end()) - { - selectItemByUUID(*select_ids_it); - mSelectTheseIDs.erase(select_ids_it); - } - } - - scrollToShowFirstSelectedItem(); - mSelectTheseIDs.clear(); -} - void LLInventoryItemsList::doIdle() { if (!mNeedsRefresh) return; @@ -179,12 +148,6 @@ void LLInventoryItemsList::refresh() bool needs_refresh = add_limit_exceeded; setNeedsRefresh(needs_refresh); setForceRefresh(needs_refresh); - - // After list building completed, select items that had been requested to select before list was build - if(!needs_refresh) - { - updateSelection(); - } } void LLInventoryItemsList::computeDifference( diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 86e11dff17..ca90427659 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -64,10 +64,6 @@ public: */ void setForceRefresh(bool force_refresh){ mForceRefresh = force_refresh; } - virtual bool selectItemByValue(const LLSD& value, bool select = true); - - void updateSelection(); - /** * Idle routine used to refresh the list regardless of the current list * visibility, unlike draw() which is called only for the visible list. @@ -104,9 +100,6 @@ protected: private: uuid_vec_t mIDs; // IDs of items that were added in refreshList(). // Will be used in refresh() to determine added and removed ids - - uuid_vec_t mSelectTheseIDs; // IDs that will be selected if list is not loaded till now - bool mNeedsRefresh; bool mForceRefresh; diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 1ea91103f1..901fa483a9 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -232,17 +232,6 @@ const std::string& LLPanelInventoryListItemBase::getDescription() const return inv_item->getDescription(); } -time_t LLPanelInventoryListItemBase::getCreationDate() const -{ - LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) - { - return 0; - } - - return inv_item->getCreationDate(); -} - LLViewerInventoryItem* LLPanelInventoryListItemBase::getItem() const { return gInventory.getItem(mInventoryItemUUID); diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index b1ef6c74ee..40bb52ddda 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -146,9 +146,6 @@ public: /** Get the description of a corresponding inventory item */ const std::string& getDescription() const; - /** Get the creation date of a corresponding inventory item */ - time_t getCreationDate() const; - /** Get the associated inventory item */ LLViewerInventoryItem* getItem() const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 820520df9e..cb6a1fafe5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -169,9 +169,6 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); - - // Initialize base class params. - LLPanel::initFromParams(params); } LLInventoryPanel::~LLInventoryPanel() @@ -703,6 +700,21 @@ BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } +// virtual +void LLInventoryPanel::onMouseEnter(S32 x, S32 y, MASK mask) +{ + LLPanel::onMouseEnter(x, y, mask); + // don't auto-scroll a list when cursor is over Inventory. See EXT-3981. + mFolderRoot->setEnableScroll(false); +} + +// virtual +void LLInventoryPanel::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLPanel::onMouseLeave(x, y, mask); + mFolderRoot->setEnableScroll(true); +} + void LLInventoryPanel::onFocusLost() { // inventory no longer handles cut/copy/paste/delete diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 6545fc0d5e..f8aaae8fab 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -115,6 +115,10 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); + + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + // LLUICtrl methods /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index a6ff76cf84..5981441e27 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -61,8 +61,7 @@ LLMediaCtrl::Params::Params() decouple_texture_size("decouple_texture_size", false), texture_width("texture_width", 1024), texture_height("texture_height", 1024), - caret_color("caret_color"), - initial_mime_type("initial_mime_type") + caret_color("caret_color") { tab_stop(false); } @@ -87,8 +86,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mDecoupleTextureSize ( false ), mTextureWidth ( 1024 ), mTextureHeight ( 1024 ), - mClearCache(false), - mHomePageMimeType(p.initial_mime_type) + mClearCache(false) { { LLColor4 color = p.caret_color().get(); @@ -97,7 +95,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : setIgnoreUIScale(p.ignore_ui_scale); - setHomePageUrl(p.start_url, p.initial_mime_type); + setHomePageUrl(p.start_url); setBorderVisible(p.border_visible); @@ -563,12 +561,12 @@ void LLMediaCtrl::navigateHome() //////////////////////////////////////////////////////////////////////////////// // -void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& mime_type ) +void LLMediaCtrl::setHomePageUrl( const std::string urlIn ) { mHomePageUrl = urlIn; if (mMediaSource) { - mMediaSource->setHomeURL(mHomePageUrl, mime_type); + mMediaSource->setHomeURL(mHomePageUrl); } } @@ -612,7 +610,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() if ( mMediaSource ) { mMediaSource->setUsedInUI(true); - mMediaSource->setHomeURL(mHomePageUrl, mHomePageMimeType); + mMediaSource->setHomeURL(mHomePageUrl); mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 755d1e1b04..9fc066c07f 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -57,8 +57,6 @@ public: texture_height; Optional caret_color; - - Optional initial_mime_type; Params(); }; @@ -105,7 +103,7 @@ public: // because we control the page content. See DEV-9530. JC. void setTrusted( bool valIn ); - void setHomePageUrl( const std::string& urlIn, const std::string& mime_type = LLStringUtil::null ); + void setHomePageUrl( const std::string urlIn ); std::string getHomePageUrl(); // set/clear URL to visit when a 404 page is reached @@ -169,7 +167,6 @@ public: bool mForceUpdate; bool mTrusted; std::string mHomePageUrl; - std::string mHomePageMimeType; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 31038b4aac..da656d8b5e 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -52,32 +52,6 @@ // - Any request that gets a 503 still goes through the retry logic // -/*************************************************************************************************************** - What's up with this queueing code? - - First, a bit of background: - - Media on a prim was added into the system in the Viewer 2.0 timeframe. In order to avoid changing the - network format of objects, an unused field in the object (the "MediaURL" string) was repurposed to - indicate that the object had media data, and also hold a sequence number and the UUID of the agent - who last updated the data. The actual media data for objects is accessed via the "ObjectMedia" capability. - Due to concerns about sim performance, requests to this capability are rate-limited to 5 requests every - 5 seconds per agent. - - The initial implementation of LLMediaDataClient used a single queue to manage requests to the "ObjectMedia" cap. - Requests to the cap were queued so that objects closer to the avatar were loaded in first, since they were most - likely to be the ones the media performance manager would load. - - This worked in some cases, but we found that it was possible for a scripted object that constantly updated its - media data to starve other objects, since the same queue contained both requests to load previously unseen media - data and requests to fetch media data in response to object updates. - - The solution for this we came up with was to have two queues. The sorted queue contains requests to fetch media - data for objects that don't have it yet, and the round-robin queue contains requests to update media data for - objects that have already completed their initial load. When both queues are non-empty, the code ping-pongs - between them so that updates can't completely block initial load-in. -**************************************************************************************************************/ - // // Forward decls // @@ -91,54 +65,6 @@ const U32 LLMediaDataClient::MAX_ROUND_ROBIN_QUEUE_SIZE = 10000; std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue_t &q); std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); -template -static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) -{ - for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) - { - if(request->isMatch(*iter, match_type)) - { - return iter; - } - } - - return c.end(); -} - -template -static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) -{ - for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) - { - if(((*iter)->getID() == id) && ((match_type == LLMediaDataClient::Request::ANY) || (match_type == (*iter)->getType()))) - { - return iter; - } - } - - return c.end(); -} - -// NOTE: remove_matching_requests will not work correctly for containers where deleting an element may invalidate iterators -// to other elements in the container (such as std::vector). -// If the implementation is changed to use a container with this property, this will need to be revisited. -template -static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) -{ - for(typename T::iterator iter = c.begin(); iter != c.end();) - { - typename T::value_type i = *iter; - typename T::iterator next = iter; - next++; - if((i->getID() == id) && ((match_type == LLMediaDataClient::Request::ANY) || (match_type == i->getType()))) - { - i->markDead(); - c.erase(iter); - } - iter = next; - } -} - ////////////////////////////////////////////////////////////////////////////////////// // // LLMediaDataClient @@ -155,36 +81,117 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay, mMaxNumRetries(max_retries), mMaxSortedQueueSize(max_sorted_queue_size), mMaxRoundRobinQueueSize(max_round_robin_queue_size), - mQueueTimerIsRunning(false) + mQueueTimerIsRunning(false), + mCurrentQueueIsTheSortedQueue(true) { } LLMediaDataClient::~LLMediaDataClient() { stopQueueTimer(); + + // This should clear the queue, and hopefully call all the destructors. + LL_DEBUGS("LLMediaDataClient") << "~LLMediaDataClient destructor: queue: " << + (isEmpty() ? " " : " ") << LL_ENDL; + + mSortedQueue.clear(); + mRoundRobinQueue.clear(); } bool LLMediaDataClient::isEmpty() const { - return mQueue.empty(); + return mSortedQueue.empty() && mRoundRobinQueue.empty(); } bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) { - if(find_matching_request(mQueue, object->getID()) != mQueue.end()) - return true; - - if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end()) - return true; + return (LLMediaDataClient::findOrRemove(mSortedQueue, object, false/*remove*/, LLMediaDataClient::Request::ANY).notNull() + || (LLMediaDataClient::findOrRemove(mRoundRobinQueue, object, false/*remove*/, LLMediaDataClient::Request::ANY).notNull())); +} + +bool LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) +{ + bool removedFromSortedQueue = LLMediaDataClient::findOrRemove(mSortedQueue, object, true/*remove*/, LLMediaDataClient::Request::ANY).notNull(); + bool removedFromRoundRobinQueue = LLMediaDataClient::findOrRemove(mRoundRobinQueue, object, true/*remove*/, LLMediaDataClient::Request::ANY).notNull(); + return removedFromSortedQueue || removedFromRoundRobinQueue; +} + +//static +LLMediaDataClient::request_ptr_t LLMediaDataClient::findOrRemove(request_queue_t &queue, const LLMediaDataClientObject::ptr_t &obj, bool remove, LLMediaDataClient::Request::Type type) +{ + request_ptr_t result; + request_queue_t::iterator iter = queue.begin(); + request_queue_t::iterator end = queue.end(); + while (iter != end) + { + if (obj->getID() == (*iter)->getObject()->getID() && (type == LLMediaDataClient::Request::ANY || type == (*iter)->getType())) + { + result = *iter; + if (remove) queue.erase(iter); + break; + } + iter++; + } + return result; +} + +void LLMediaDataClient::request(const LLMediaDataClientObject::ptr_t &object, const LLSD &payload) +{ + if (object.isNull() || ! object->hasMedia()) return; - return false; + // Push the object on the queue + enqueue(new Request(getCapabilityName(), payload, object, this)); } -void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) +void LLMediaDataClient::enqueue(const Request *request) { - LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL; - remove_matching_requests(mQueue, object->getID()); - remove_matching_requests(mUnQueuedRequests, object->getID()); + if (request->isNew()) + { + // Add to sorted queue + if (LLMediaDataClient::findOrRemove(mSortedQueue, request->getObject(), true/*remove*/, request->getType()).notNull()) + { + LL_DEBUGS("LLMediaDataClient") << "REMOVING OLD request for " << *request << " ALREADY THERE!" << LL_ENDL; + } + + LL_DEBUGS("LLMediaDataClient") << "Queuing SORTED request for " << *request << LL_ENDL; + + // Sadly, we have to const-cast because items put into the queue are not const + mSortedQueue.push_back(const_cast(request)); + + LL_DEBUGS("LLMediaDataClientQueue") << "SORTED queue:" << mSortedQueue << LL_ENDL; + } + else { + if (mRoundRobinQueue.size() > mMaxRoundRobinQueueSize) + { + LL_INFOS_ONCE("LLMediaDataClient") << "RR QUEUE MAXED OUT!!!" << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "Not queuing " << *request << LL_ENDL; + return; + } + + // ROUND ROBIN: if it is there, and it is a GET request, leave it. If not, put at front! + request_ptr_t existing_request; + if (request->getType() == Request::GET) + { + existing_request = LLMediaDataClient::findOrRemove(mRoundRobinQueue, request->getObject(), false/*remove*/, request->getType()); + } + if (existing_request.isNull()) + { + LL_DEBUGS("LLMediaDataClient") << "Queuing RR request for " << *request << LL_ENDL; + // Push the request on the pending queue + // Sadly, we have to const-cast because items put into the queue are not const + mRoundRobinQueue.push_front(const_cast(request)); + + LL_DEBUGS("LLMediaDataClientQueue") << "RR queue:" << mRoundRobinQueue << LL_ENDL; + } + else + { + LL_DEBUGS("LLMediaDataClient") << "ALREADY THERE: NOT Queuing request for " << *request << LL_ENDL; + + existing_request->markSent(false); + } + } + // Start the timer if not already running + startQueueTimer(); } void LLMediaDataClient::startQueueTimer() @@ -196,7 +203,7 @@ void LLMediaDataClient::startQueueTimer() new QueueTimer(mQueueTimerDelay, this); } else { - LL_DEBUGS("LLMediaDataClient") << "queue timer is already running" << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "not starting queue timer (it's already running, right???)" << LL_ENDL; } } @@ -207,138 +214,179 @@ void LLMediaDataClient::stopQueueTimer() bool LLMediaDataClient::processQueueTimer() { - if(isEmpty()) - return true; - - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, queue size is: " << mQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, SORTED queue is: " << mQueue << LL_ENDL; - + sortQueue(); + + if(!isEmpty()) + { + LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue size is: " << mSortedQueue.size() + << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, SORTED queue is: " << mSortedQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, RR queue is: " << mRoundRobinQueue << LL_ENDL; + } + serviceQueue(); - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, queue size is: " << mQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, SORTED queue is: " << mQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, SORTED queue size is: " << mSortedQueue.size() + << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, SORTED queue is: " << mSortedQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, RR queue is: " << mRoundRobinQueue << LL_ENDL; return isEmpty(); } -LLMediaDataClient::request_ptr_t LLMediaDataClient::dequeue() +void LLMediaDataClient::sortQueue() { - request_ptr_t request; - request_queue_t *queue_p = getQueue(); - - if (queue_p->empty()) + if(!mSortedQueue.empty()) { - LL_DEBUGS("LLMediaDataClient") << "queue empty: " << (*queue_p) << LL_ENDL; - } - else - { - request = queue_p->front(); - - if(canServiceRequest(request)) + // Score all items first + request_queue_t::iterator iter = mSortedQueue.begin(); + request_queue_t::iterator end = mSortedQueue.end(); + while (iter != end) { - // We will be returning this request, so remove it from the queue. - queue_p->pop_front(); + (*iter)->updateScore(); + iter++; } - else + + // Re-sort the list... + // NOTE: should this be a stable_sort? If so we need to change to using a vector. + mSortedQueue.sort(LLMediaDataClient::compareRequests); + + // ...then cull items over the max + U32 size = mSortedQueue.size(); + if (size > mMaxSortedQueueSize) { - // Don't return this request -- it's not ready to be serviced. - request = NULL; + U32 num_to_cull = (size - mMaxSortedQueueSize); + LL_INFOS_ONCE("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " + << num_to_cull << " items" << LL_ENDL; + while (num_to_cull-- > 0) + { + mSortedQueue.pop_back(); + } } } - - return request; -} - -void LLMediaDataClient::pushBack(request_ptr_t request) -{ - request_queue_t *queue_p = getQueue(); - queue_p->push_front(request); } -void LLMediaDataClient::trackRequest(request_ptr_t request) -{ - request_set_t::iterator iter = mUnQueuedRequests.find(request); - - if(iter != mUnQueuedRequests.end()) - { - LL_WARNS("LLMediaDataClient") << "Tracking already tracked request: " << *request << LL_ENDL; - } - else - { - mUnQueuedRequests.insert(request); - } -} - -void LLMediaDataClient::stopTrackingRequest(request_ptr_t request) +// static +bool LLMediaDataClient::compareRequests(const request_ptr_t &o1, const request_ptr_t &o2) { - request_set_t::iterator iter = mUnQueuedRequests.find(request); - - if (iter != mUnQueuedRequests.end()) - { - mUnQueuedRequests.erase(iter); - } - else - { - LL_WARNS("LLMediaDataClient") << "Removing an untracked request: " << *request << LL_ENDL; - } + if (o2.isNull()) return true; + if (o1.isNull()) return false; + return ( o1->getScore() > o2->getScore() ); } void LLMediaDataClient::serviceQueue() { - // Peel one off of the items from the queue and execute it - request_ptr_t request; + request_queue_t *queue_p = getCurrentQueue(); - do + // quick retry loop for cases where we shouldn't wait for the next timer tick + while(true) { - request = dequeue(); - - if(request.isNull()) - { - // Queue is empty. - return; - } - - if(request->isDead()) + if (queue_p->empty()) { - LL_INFOS("LLMediaDataClient") << "Skipping dead request " << *request << LL_ENDL; - continue; + LL_DEBUGS("LLMediaDataClient") << "queue empty: " << (*queue_p) << LL_ENDL; + break; } - - } while(false); - // try to send the HTTP message to the cap url - std::string url = request->getCapability(); - if (!url.empty()) - { - const LLSD &sd_payload = request->getPayload(); - LL_INFOS("LLMediaDataClient") << "Sending request for " << *request << LL_ENDL; + // Peel one off of the items from the queue, and execute request + request_ptr_t request = queue_p->front(); + llassert(!request.isNull()); + const LLMediaDataClientObject *object = (request.isNull()) ? NULL : request->getObject(); + llassert(NULL != object); - // Add this request to the non-queued tracking list - trackRequest(request); + // Check for conditions that would make us just pop and rapidly loop through + // the queue. + if(request.isNull() || + request->isMarkedSent() || + NULL == object || + object->isDead() || + !object->hasMedia()) + { + if (request.isNull()) + { + LL_WARNS("LLMediaDataClient") << "Skipping NULL request" << LL_ENDL; + } + else { + LL_INFOS("LLMediaDataClient") << "Skipping : " << *request << " " + << ((request->isMarkedSent()) ? " request is marked sent" : + ((NULL == object) ? " object is NULL " : + ((object->isDead()) ? "object is dead" : + ((!object->hasMedia()) ? "object has no media!" : "BADNESS!")))) << LL_ENDL; + } + queue_p->pop_front(); + continue; // jump back to the start of the quick retry loop + } - // and make the post - LLHTTPClient::post(url, sd_payload, request->createResponder()); - } - else - { - // Cap url doesn't exist. + // Next, ask if this is "interesting enough" to fetch. If not, just stop + // and wait for the next timer go-round. Only do this for the sorted + // queue. + if (mCurrentQueueIsTheSortedQueue && !object->isInterestingEnough()) + { + LL_DEBUGS("LLMediaDataClient") << "Not fetching " << *request << ": not interesting enough" << LL_ENDL; + break; + } - if(request->getRetryCount() < mMaxNumRetries) + // Finally, try to send the HTTP message to the cap url + std::string url = request->getCapability(); + bool maybe_retry = false; + if (!url.empty()) { - LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " (empty cap url), will retry." << LL_ENDL; - // Put this request back at the head of its queue, and retry next time the queue timer fires. - request->incRetryCount(); - pushBack(request); + const LLSD &sd_payload = request->getPayload(); + LL_INFOS("LLMediaDataClient") << "Sending request for " << *request << LL_ENDL; + + // Call the subclass for creating the responder + LLHTTPClient::post(url, sd_payload, createResponder(request)); } - else + else { + LL_INFOS("LLMediaDataClient") << "NOT Sending request for " << *request << ": empty cap url!" << LL_ENDL; + maybe_retry = true; + } + + bool exceeded_retries = request->getRetryCount() > mMaxNumRetries; + if (maybe_retry && ! exceeded_retries) // Try N times before giving up { - // This request has exceeded its maxumim retry count. It will be dropped. - LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " for " << mMaxNumRetries << " tries, dropping request." << LL_ENDL; + // We got an empty cap, but in that case we will retry again next + // timer fire. + request->incRetryCount(); } + else { + if (exceeded_retries) + { + LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " for " + << mMaxNumRetries << " tries...popping object id " << object->getID() << LL_ENDL; + // XXX Should we bring up a warning dialog?? + } + + queue_p->pop_front(); + + if (! mCurrentQueueIsTheSortedQueue) { + // Round robin + request->markSent(true); + mRoundRobinQueue.push_back(request); + } + } + + // end of quick loop -- any cases where we want to loop will use 'continue' to jump back to the start. + break; + } + + swapCurrentQueue(); +} +void LLMediaDataClient::swapCurrentQueue() +{ + // Swap + mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; + // If its empty, swap back + if (getCurrentQueue()->empty()) + { + mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; } } +LLMediaDataClient::request_queue_t *LLMediaDataClient::getCurrentQueue() +{ + return (mCurrentQueueIsTheSortedQueue) ? &mSortedQueue : &mRoundRobinQueue; +} // dump the queue std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue_t &q) @@ -348,7 +396,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue LLMediaDataClient::request_queue_t::const_iterator end = q.end(); while (iter != end) { - s << "\t" << i << "]: " << (*iter)->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; + s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; iter++; i++; } @@ -368,24 +416,18 @@ LLMediaDataClient::QueueTimer::QueueTimer(F32 time, LLMediaDataClient *mdc) mMDC->setIsRunning(true); } +LLMediaDataClient::QueueTimer::~QueueTimer() +{ + LL_DEBUGS("LLMediaDataClient") << "~QueueTimer" << LL_ENDL; + mMDC->setIsRunning(false); + mMDC = NULL; +} + // virtual BOOL LLMediaDataClient::QueueTimer::tick() { - BOOL result = TRUE; - - if (!mMDC.isNull()) - { - result = mMDC->processQueueTimer(); - - if(result) - { - // This timer won't fire again. - mMDC->setIsRunning(false); - mMDC = NULL; - } - } - - return result; + if (mMDC.isNull()) return TRUE; + return mMDC->processQueueTimer(); } @@ -395,30 +437,29 @@ BOOL LLMediaDataClient::QueueTimer::tick() // ////////////////////////////////////////////////////////////////////////////////////// -LLMediaDataClient::RetryTimer::RetryTimer(F32 time, request_ptr_t request) -: LLEventTimer(time), mRequest(request) +LLMediaDataClient::Responder::RetryTimer::RetryTimer(F32 time, Responder *mdr) +: LLEventTimer(time), mResponder(mdr) { - mRequest->startTracking(); } -// virtual -BOOL LLMediaDataClient::RetryTimer::tick() +// virtual +LLMediaDataClient::Responder::RetryTimer::~RetryTimer() { - mRequest->stopTracking(); - - if(mRequest->isDead()) - { - LL_INFOS("LLMediaDataClient") << "RetryTimer fired for dead request: " << *mRequest << ", aborting." << LL_ENDL; - } - else - { - LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *mRequest << ", retrying." << LL_ENDL; - mRequest->reEnqueue(); - } + LL_DEBUGS("LLMediaDataClient") << "~RetryTimer" << *(mResponder->getRequest()) << LL_ENDL; - // Release the ref to the request. - mRequest = NULL; + // XXX This is weird: Instead of doing the work in tick() (which re-schedules + // a timer, which might be risky), do it here, in the destructor. Yes, it is very odd. + // Instead of retrying, we just put the request back onto the queue + LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << " retrying" << LL_ENDL; + mResponder->getRequest()->reEnqueue(); + + // Release the ref to the responder. + mResponder = NULL; +} +// virtual +BOOL LLMediaDataClient::Responder::RetryTimer::tick() +{ // Don't fire again return TRUE; } @@ -431,37 +472,56 @@ BOOL LLMediaDataClient::RetryTimer::tick() ////////////////////////////////////////////////////////////////////////////////////// /*static*/U32 LLMediaDataClient::Request::sNum = 0; -LLMediaDataClient::Request::Request(Type in_type, +LLMediaDataClient::Request::Request(const char *cap_name, + const LLSD& sd_payload, LLMediaDataClientObject *obj, - LLMediaDataClient *mdc, - S32 face) -: mType(in_type), + LLMediaDataClient *mdc) +: mCapName(cap_name), + mPayload(sd_payload), mObject(obj), mNum(++sNum), mRetryCount(0), mMDC(mdc), - mScore((F64)0.0), - mFace(face) + mMarkedSent(false), + mScore((F64)0.0) { - mObjectID = mObject->getID(); } -const char *LLMediaDataClient::Request::getCapName() const +LLMediaDataClient::Request::~Request() { - if(mMDC) - return mMDC->getCapabilityName(); - - return ""; + LL_DEBUGS("LLMediaDataClient") << "~Request" << (*this) << LL_ENDL; + mMDC = NULL; + mObject = NULL; } + std::string LLMediaDataClient::Request::getCapability() const { - if(mMDC) + return getObject()->getCapabilityUrl(getCapName()); +} + +// Helper function to get the "type" of request, which just pokes around to +// discover it. +LLMediaDataClient::Request::Type LLMediaDataClient::Request::getType() const +{ + if (0 == strcmp(mCapName, "ObjectMediaNavigate")) { - return getObject()->getCapabilityUrl(getCapName()); + return NAVIGATE; } - - return ""; + else if (0 == strcmp(mCapName, "ObjectMedia")) + { + const std::string &verb = mPayload["verb"]; + if (verb == "GET") + { + return GET; + } + else if (verb == "UPDATE") + { + return UPDATE; + } + } + llassert(false); + return GET; } const char *LLMediaDataClient::Request::getTypeAsString() const @@ -486,30 +546,35 @@ const char *LLMediaDataClient::Request::getTypeAsString() const } -void LLMediaDataClient::Request::reEnqueue() +void LLMediaDataClient::Request::reEnqueue() const { - if(mMDC) - { - mMDC->enqueue(this); - } + // I sure hope this doesn't deref a bad pointer: + mMDC->enqueue(this); } F32 LLMediaDataClient::Request::getRetryTimerDelay() const { - if(mMDC) - return mMDC->mRetryTimerDelay; - - return 0.0f; + return (mMDC == NULL) ? LLMediaDataClient::UNAVAILABLE_RETRY_TIMER_DELAY : + mMDC->mRetryTimerDelay; } U32 LLMediaDataClient::Request::getMaxNumRetries() const { - if(mMDC) - return mMDC->mMaxNumRetries; - - return 0; + return (mMDC == NULL) ? LLMediaDataClient::MAX_RETRIES : mMDC->mMaxNumRetries; } +void LLMediaDataClient::Request::markSent(bool flag) +{ + if (mMarkedSent != flag) + { + mMarkedSent = flag; + if (!mMarkedSent) + { + mNum = ++sNum; + } + } +} + void LLMediaDataClient::Request::updateScore() { F64 tmp = mObject->getMediaInterest(); @@ -520,37 +585,15 @@ void LLMediaDataClient::Request::updateScore() } } -void LLMediaDataClient::Request::markDead() -{ - mMDC = NULL; -} - -bool LLMediaDataClient::Request::isDead() -{ - return ((mMDC == NULL) || mObject->isDead()); -} - -void LLMediaDataClient::Request::startTracking() -{ - if(mMDC) - mMDC->trackRequest(this); -} - -void LLMediaDataClient::Request::stopTracking() -{ - if(mMDC) - mMDC->stopTrackingRequest(this); -} - std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &r) { s << "request: num=" << r.getNum() << " type=" << r.getTypeAsString() - << " ID=" << r.getID() - << " face=" << r.getFace() + << " ID=" << r.getObject()->getID() << " #retries=" << r.getRetryCount(); return s; } + ////////////////////////////////////////////////////////////////////////////////////// // @@ -563,17 +606,15 @@ LLMediaDataClient::Responder::Responder(const request_ptr_t &request) { } +LLMediaDataClient::Responder::~Responder() +{ + LL_DEBUGS("LLMediaDataClient") << "~Responder" << *(getRequest()) << LL_ENDL; + mRequest = NULL; +} + /*virtual*/ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) { - mRequest->stopTracking(); - - if(mRequest->isDead()) - { - LL_WARNS("LLMediaDataClient") << "dead request " << *mRequest << LL_ENDL; - return; - } - if (status == HTTP_SERVICE_UNAVAILABLE) { F32 retry_timeout = mRequest->getRetryTimerDelay(); @@ -586,16 +627,14 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) // Start timer (instances are automagically tracked by // InstanceTracker<> and LLEventTimer) - new RetryTimer(F32(retry_timeout/*secs*/), mRequest); + new RetryTimer(F32(retry_timeout/*secs*/), this); } - else - { + else { LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retry count " << mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL; } } - else - { + else { std::string msg = boost::lexical_cast(status) + ": " + reason; LL_WARNS("LLMediaDataClient") << *mRequest << " http error(" << msg << ")" << LL_ENDL; } @@ -604,14 +643,6 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) /*virtual*/ void LLMediaDataClient::Responder::result(const LLSD& content) { - mRequest->stopTracking(); - - if(mRequest->isDead()) - { - LL_WARNS("LLMediaDataClient") << "dead request " << *mRequest << LL_ENDL; - return; - } - LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL; } @@ -622,10 +653,9 @@ void LLMediaDataClient::Responder::result(const LLSD& content) // ////////////////////////////////////////////////////////////////////////////////////// -void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) +LLMediaDataClient::Responder *LLObjectMediaDataClient::createResponder(const request_ptr_t &request) const { - // Create a get request and put it in the queue. - enqueue(new RequestGet(object, this)); + return new LLObjectMediaDataClient::Responder(request); } const char *LLObjectMediaDataClient::getCapabilityName() const @@ -633,286 +663,70 @@ const char *LLObjectMediaDataClient::getCapabilityName() const return "ObjectMedia"; } -LLObjectMediaDataClient::request_queue_t *LLObjectMediaDataClient::getQueue() -{ - return (mCurrentQueueIsTheSortedQueue) ? &mQueue : &mRoundRobinQueue; -} - -void LLObjectMediaDataClient::sortQueue() -{ - if(!mQueue.empty()) - { - // score all elements in the sorted queue. - for(request_queue_t::iterator iter = mQueue.begin(); iter != mQueue.end(); iter++) - { - (*iter)->updateScore(); - } - - // Re-sort the list... - mQueue.sort(compareRequestScores); - - // ...then cull items over the max - U32 size = mQueue.size(); - if (size > mMaxSortedQueueSize) - { - U32 num_to_cull = (size - mMaxSortedQueueSize); - LL_INFOS_ONCE("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " - << num_to_cull << " items" << LL_ENDL; - while (num_to_cull-- > 0) - { - mQueue.back()->markDead(); - mQueue.pop_back(); - } - } - } - -} - -// static -bool LLObjectMediaDataClient::compareRequestScores(const request_ptr_t &o1, const request_ptr_t &o2) -{ - if (o2.isNull()) return true; - if (o1.isNull()) return false; - return ( o1->getScore() > o2->getScore() ); -} - -void LLObjectMediaDataClient::enqueue(Request *request) -{ - if(request->isDead()) - { - LL_DEBUGS("LLMediaDataClient") << "not queueing dead request " << *request << LL_ENDL; - return; - } - - // Invariants: - // new requests always go into the sorted queue. - // - - bool is_new = request->isNew(); - - if(!is_new && (request->getType() == Request::GET)) - { - // For GET requests that are not new, if a matching request is already in the round robin queue, - // in flight, or being retried, leave it at its current position. - request_queue_t::iterator iter = find_matching_request(mRoundRobinQueue, request->getID(), Request::GET); - request_set_t::iterator iter2 = find_matching_request(mUnQueuedRequests, request->getID(), Request::GET); - - if( (iter != mRoundRobinQueue.end()) || (iter2 != mUnQueuedRequests.end()) ) - { - LL_DEBUGS("LLMediaDataClient") << "ALREADY THERE: NOT Queuing request for " << *request << LL_ENDL; - - return; - } - } - - // TODO: should an UPDATE cause pending GET requests for the same object to be removed from the queue? - // IF the update will cause an object update message to be sent out at some point in the future, it probably should. - - // Remove any existing requests of this type for this object - remove_matching_requests(mQueue, request->getID(), request->getType()); - remove_matching_requests(mRoundRobinQueue, request->getID(), request->getType()); - remove_matching_requests(mUnQueuedRequests, request->getID(), request->getType()); - - if (is_new) - { - LL_DEBUGS("LLMediaDataClient") << "Queuing SORTED request for " << *request << LL_ENDL; - - mQueue.push_back(request); - - LL_DEBUGS("LLMediaDataClientQueue") << "SORTED queue:" << mQueue << LL_ENDL; - } - else - { - if (mRoundRobinQueue.size() > mMaxRoundRobinQueueSize) - { - LL_INFOS_ONCE("LLMediaDataClient") << "RR QUEUE MAXED OUT!!!" << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "Not queuing " << *request << LL_ENDL; - return; - } - - LL_DEBUGS("LLMediaDataClient") << "Queuing RR request for " << *request << LL_ENDL; - // Push the request on the pending queue - mRoundRobinQueue.push_back(request); - - LL_DEBUGS("LLMediaDataClientQueue") << "RR queue:" << mRoundRobinQueue << LL_ENDL; - } - // Start the timer if not already running - startQueueTimer(); -} - -bool LLObjectMediaDataClient::canServiceRequest(request_ptr_t request) -{ - if(mCurrentQueueIsTheSortedQueue) - { - if(!request->getObject()->isInterestingEnough()) - { - LL_DEBUGS("LLMediaDataClient") << "Not fetching " << *request << ": not interesting enough" << LL_ENDL; - return false; - } - } - - return true; -}; - -void LLObjectMediaDataClient::swapCurrentQueue() -{ - // Swap - mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; - // If its empty, swap back - if (getQueue()->empty()) - { - mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; - } -} - -bool LLObjectMediaDataClient::isEmpty() const -{ - return mQueue.empty() && mRoundRobinQueue.empty(); -} - -bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) -{ - // First, call parent impl. - if(LLMediaDataClient::isInQueue(object)) - return true; - - if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end()) - return true; - - return false; -} - -void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) -{ - // First, call parent impl. - LLMediaDataClient::removeFromQueue(object); - - remove_matching_requests(mRoundRobinQueue, object->getID()); -} - -bool LLObjectMediaDataClient::processQueueTimer() -{ - if(isEmpty()) - return true; - - LL_DEBUGS("LLMediaDataClient") << "started, SORTED queue size is: " << mQueue.size() - << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << " SORTED queue is: " << mQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << " RR queue is: " << mRoundRobinQueue << LL_ENDL; - -// purgeDeadRequests(); - - sortQueue(); - - LL_DEBUGS("LLMediaDataClientQueue") << "after sort, SORTED queue is: " << mQueue << LL_ENDL; - - serviceQueue(); - - swapCurrentQueue(); - - LL_DEBUGS("LLMediaDataClient") << "finished, SORTED queue size is: " << mQueue.size() - << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << " SORTED queue is: " << mQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << " RR queue is: " << mRoundRobinQueue << LL_ENDL; - - return isEmpty(); -} - -LLObjectMediaDataClient::RequestGet::RequestGet(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): - LLMediaDataClient::Request(LLMediaDataClient::Request::GET, obj, mdc) -{ -} - -LLSD LLObjectMediaDataClient::RequestGet::getPayload() const -{ - LLSD result; - result["verb"] = "GET"; - result[LLTextureEntry::OBJECT_ID_KEY] = mObject->getID(); - - return result; -} - -LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestGet::createResponder() +void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) { - return new LLObjectMediaDataClient::Responder(this); + LLSD sd_payload; + sd_payload["verb"] = "GET"; + sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); + request(object, sd_payload); } - void LLObjectMediaDataClient::updateMedia(LLMediaDataClientObject *object) { - // Create an update request and put it in the queue. - enqueue(new RequestUpdate(object, this)); -} - -LLObjectMediaDataClient::RequestUpdate::RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): - LLMediaDataClient::Request(LLMediaDataClient::Request::UPDATE, obj, mdc) -{ -} - -LLSD LLObjectMediaDataClient::RequestUpdate::getPayload() const -{ - LLSD result; - result["verb"] = "UPDATE"; - result[LLTextureEntry::OBJECT_ID_KEY] = mObject->getID(); - + LLSD sd_payload; + sd_payload["verb"] = "UPDATE"; + sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); LLSD object_media_data; int i = 0; - int end = mObject->getMediaDataCount(); + int end = object->getMediaDataCount(); for ( ; i < end ; ++i) { - object_media_data.append(mObject->getMediaDataLLSD(i)); + object_media_data.append(object->getMediaDataLLSD(i)); } + sd_payload[LLTextureEntry::OBJECT_MEDIA_DATA_KEY] = object_media_data; + + LL_DEBUGS("LLMediaDataClient") << "update media data: " << object->getID() << " " << ll_print_sd(sd_payload) << LL_ENDL; - result[LLTextureEntry::OBJECT_MEDIA_DATA_KEY] = object_media_data; - - return result; + request(object, sd_payload); } -LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestUpdate::createResponder() -{ - // This just uses the base class's responder. - return new LLMediaDataClient::Responder(this); -} - - /*virtual*/ void LLObjectMediaDataClient::Responder::result(const LLSD& content) { - getRequest()->stopTracking(); - - if(getRequest()->isDead()) + const LLMediaDataClient::Request::Type type = getRequest()->getType(); + llassert(type == LLMediaDataClient::Request::GET || type == LLMediaDataClient::Request::UPDATE) + if (type == LLMediaDataClient::Request::GET) { - LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; - return; - } - - // This responder is only used for GET requests, not UPDATE. - - LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; - - // Look for an error - if (content.has("error")) - { - const LLSD &error = content["error"]; - LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error getting media data for object: code=" << - error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; - // XXX Warn user? - } - else - { - // Check the data - const LLUUID &object_id = content[LLTextureEntry::OBJECT_ID_KEY]; - if (object_id != getRequest()->getObject()->getID()) + // Look for an error + if (content.has("error")) { - // NOT good, wrong object id!! - LL_WARNS("LLMediaDataClient") << *(getRequest()) << " DROPPING response with wrong object id (" << object_id << ")" << LL_ENDL; - return; + const LLSD &error = content["error"]; + LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error getting media data for object: code=" << + error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; + + // XXX Warn user? } - - // Otherwise, update with object media data - getRequest()->getObject()->updateObjectMediaData(content[LLTextureEntry::OBJECT_MEDIA_DATA_KEY], - content[LLTextureEntry::MEDIA_VERSION_KEY]); + else { + // Check the data + const LLUUID &object_id = content[LLTextureEntry::OBJECT_ID_KEY]; + if (object_id != getRequest()->getObject()->getID()) + { + // NOT good, wrong object id!! + LL_WARNS("LLMediaDataClient") << *(getRequest()) << " DROPPING response with wrong object id (" << object_id << ")" << LL_ENDL; + return; + } + + // Otherwise, update with object media data + getRequest()->getObject()->updateObjectMediaData(content[LLTextureEntry::OBJECT_MEDIA_DATA_KEY], + content[LLTextureEntry::MEDIA_VERSION_KEY]); + } + } + else if (type == LLMediaDataClient::Request::UPDATE) + { + // just do what our superclass does + LLMediaDataClient::Responder::result(content); } } @@ -922,105 +736,38 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content) // Subclass of LLMediaDataClient for the ObjectMediaNavigate cap // ////////////////////////////////////////////////////////////////////////////////////// - -const char *LLObjectMediaNavigateClient::getCapabilityName() const +LLMediaDataClient::Responder *LLObjectMediaNavigateClient::createResponder(const request_ptr_t &request) const { - return "ObjectMediaNavigate"; + return new LLObjectMediaNavigateClient::Responder(request); } -void LLObjectMediaNavigateClient::enqueue(Request *request) +const char *LLObjectMediaNavigateClient::getCapabilityName() const { - if(request->isDead()) - { - LL_DEBUGS("LLMediaDataClient") << "not queueing dead request " << *request << LL_ENDL; - return; - } - - // If there's already a matching request in the queue, remove it. - request_queue_t::iterator iter = find_matching_request(mQueue, request); - if(iter != mQueue.end()) - { - LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL; - mQueue.erase(iter); - } - else - { - request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request); - if(set_iter != mUnQueuedRequests.end()) - { - LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL; - mUnQueuedRequests.erase(set_iter); - } - } - -#if 0 - // Sadly, this doesn't work. It ends up creating a race condition when the user navigates and then hits the "back" button - // where the navigate-back appears to be spurious and doesn't get broadcast. - if(request->getObject()->isCurrentMediaUrl(request->getFace(), request->getURL())) - { - // This navigate request is trying to send the face to the current URL. Drop it. - LL_DEBUGS("LLMediaDataClient") << "dropping spurious request " << (*request) << LL_ENDL; - } - else -#endif - { - LL_DEBUGS("LLMediaDataClient") << "queueing new request " << (*request) << LL_ENDL; - mQueue.push_back(request); - - // Start the timer if not already running - startQueueTimer(); - } + return "ObjectMediaNavigate"; } void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 texture_index, const std::string &url) { - -// LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; + LLSD sd_payload; + sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); + sd_payload[LLMediaEntry::CURRENT_URL_KEY] = url; + sd_payload[LLTextureEntry::TEXTURE_INDEX_KEY] = (LLSD::Integer)texture_index; - // Create a get request and put it in the queue. - enqueue(new RequestNavigate(object, this, texture_index, url)); -} - -LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): - LLMediaDataClient::Request(LLMediaDataClient::Request::NAVIGATE, obj, mdc, (S32)texture_index), - mURL(url) -{ -} - -LLSD LLObjectMediaNavigateClient::RequestNavigate::getPayload() const -{ - LLSD result; - result[LLTextureEntry::OBJECT_ID_KEY] = getID(); - result[LLMediaEntry::CURRENT_URL_KEY] = mURL; - result[LLTextureEntry::TEXTURE_INDEX_KEY] = (LLSD::Integer)getFace(); + LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; - return result; -} - -LLMediaDataClient::Responder *LLObjectMediaNavigateClient::RequestNavigate::createResponder() -{ - return new LLObjectMediaNavigateClient::Responder(this); + request(object, sd_payload); } /*virtual*/ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string& reason) { - getRequest()->stopTracking(); - - if(getRequest()->isDead()) - { - LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; - return; - } - // Bounce back (unless HTTP_SERVICE_UNAVAILABLE, in which case call base // class if (status == HTTP_SERVICE_UNAVAILABLE) { LLMediaDataClient::Responder::error(status, reason); } - else - { + else { // bounce the face back LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << status << LL_ENDL; const LLSD &payload = getRequest()->getPayload(); @@ -1032,14 +779,6 @@ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string /*virtual*/ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) { - getRequest()->stopTracking(); - - if(getRequest()->isDead()) - { - LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; - return; - } - LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(content) << LL_ENDL; if (content.has("error")) @@ -1054,17 +793,14 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) // bounce the face back getRequest()->getObject()->mediaNavigateBounceBack((LLSD::Integer)payload[LLTextureEntry::TEXTURE_INDEX_KEY]); } - else - { + else { LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: code=" << error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; } - // XXX Warn user? } - else - { - // No action required. - LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(content) << LL_ENDL; + else { + // just do what our superclass does + LLMediaDataClient::Responder::result(content); } } diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index ab90915c55..69579c57fd 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -28,7 +28,7 @@ #define LL_LLMEDIADATACLIENT_H #include "llhttpclient.h" -#include +#include #include "llrefcount.h" #include "llpointer.h" #include "lleventtimer.h" @@ -42,8 +42,6 @@ public: virtual U8 getMediaDataCount() const = 0; // Get the media data at index, as an LLSD virtual LLSD getMediaDataLLSD(U8 index) const = 0; - // Return true if the current URL for the face in the media data matches the specified URL. - virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const = 0; // Get this object's UUID virtual LLUUID getID() const = 0; // Navigate back to previous URL @@ -69,7 +67,6 @@ public: typedef LLPointer ptr_t; }; - // This object creates a priority queue for requests. // Abstracts the Cap URL, the request, and the responder class LLMediaDataClient : public LLRefCount @@ -90,37 +87,31 @@ public: U32 max_sorted_queue_size = MAX_SORTED_QUEUE_SIZE, U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE); + // Make the request + void request(const LLMediaDataClientObject::ptr_t &object, const LLSD &payload); + F32 getRetryTimerDelay() const { return mRetryTimerDelay; } // Returns true iff the queue is empty - virtual bool isEmpty() const; + bool isEmpty() const; // Returns true iff the given object is in the queue - virtual bool isInQueue(const LLMediaDataClientObject::ptr_t &object); + bool isInQueue(const LLMediaDataClientObject::ptr_t &object); // Remove the given object from the queue. Returns true iff the given object is removed. - virtual void removeFromQueue(const LLMediaDataClientObject::ptr_t &object); + bool removeFromQueue(const LLMediaDataClientObject::ptr_t &object); // Called only by the Queue timer and tests (potentially) - virtual bool processQueueTimer(); + bool processQueueTimer(); protected: // Destructor virtual ~LLMediaDataClient(); // use unref - class Responder; - - // Request (pure virtual base class for requests in the queue) + // Request class Request : public LLRefCount { public: - // Subclasses must implement this to build a payload for their request type. - virtual LLSD getPayload() const = 0; - // and must create the correct type of responder. - virtual Responder *createResponder() = 0; - - virtual std::string getURL() { return ""; } - enum Type { GET, UPDATE, @@ -128,61 +119,50 @@ protected: ANY }; - protected: - // The only way to create one of these is through a subclass. - Request(Type in_type, LLMediaDataClientObject *obj, LLMediaDataClient *mdc, S32 face = -1); - public: + Request(const char *cap_name, const LLSD& sd_payload, LLMediaDataClientObject *obj, LLMediaDataClient *mdc); + const char *getCapName() const { return mCapName; } + const LLSD &getPayload() const { return mPayload; } LLMediaDataClientObject *getObject() const { return mObject; } U32 getNum() const { return mNum; } + U32 getRetryCount() const { return mRetryCount; } void incRetryCount() { mRetryCount++; } - Type getType() const { return mType; } - F64 getScore() const { return mScore; } // Note: may return empty string! std::string getCapability() const; - const char *getCapName() const; + + Type getType() const; const char *getTypeAsString() const; // Re-enqueue thyself - void reEnqueue(); + void reEnqueue() const; F32 getRetryTimerDelay() const; U32 getMaxNumRetries() const; - bool isObjectValid() const { return mObject.notNull() && (!mObject->isDead()); } - bool isNew() const { return isObjectValid() && mObject->isNew(); } + bool isNew() const { return mObject.notNull() ? mObject->isNew() : false; } + void markSent(bool flag); + bool isMarkedSent() const { return mMarkedSent; } void updateScore(); + F64 getScore() const { return mScore; } - void markDead(); - bool isDead(); - void startTracking(); - void stopTracking(); - + public: friend std::ostream& operator<<(std::ostream &s, const Request &q); - const LLUUID &getID() const { return mObjectID; } - S32 getFace() const { return mFace; } - - bool isMatch (const Request* other, Type match_type = ANY) const - { - return ((match_type == ANY) || (mType == other->mType)) && - (mFace == other->mFace) && - (mObjectID == other->mObjectID); - } - protected: - LLMediaDataClientObject::ptr_t mObject; + protected: + virtual ~Request(); // use unref(); + private: - Type mType; + const char *mCapName; + LLSD mPayload; + LLMediaDataClientObject::ptr_t mObject; // Simple tracking U32 mNum; static U32 sNum; U32 mRetryCount; F64 mScore; - - LLUUID mObjectID; - S32 mFace; + bool mMarkedSent; // Back pointer to the MDC...not a ref! LLMediaDataClient *mMDC; @@ -199,66 +179,48 @@ protected: //If we get back a normal response, handle it here. Default just logs it. virtual void result(const LLSD& content); - request_ptr_t &getRequest() { return mRequest; } + const request_ptr_t &getRequest() const { return mRequest; } + protected: + virtual ~Responder(); + private: - request_ptr_t mRequest; - }; - class RetryTimer : public LLEventTimer - { - public: - RetryTimer(F32 time, request_ptr_t); - virtual BOOL tick(); - private: - // back-pointer + class RetryTimer : public LLEventTimer + { + public: + RetryTimer(F32 time, Responder *); + virtual ~RetryTimer(); + virtual BOOL tick(); + private: + // back-pointer + boost::intrusive_ptr mResponder; + }; + request_ptr_t mRequest; }; - protected: - typedef std::list request_queue_t; - typedef std::set request_set_t; + // Subclasses must override this factory method to return a new responder + virtual Responder *createResponder(const request_ptr_t &request) const = 0; + // Subclasses must override to return a cap name virtual const char *getCapabilityName() const = 0; - - // Puts the request into a queue, appropriately handling duplicates, etc. - virtual void enqueue(Request*) = 0; + virtual void sortQueue(); virtual void serviceQueue(); - - virtual request_queue_t *getQueue() { return &mQueue; }; - - // Gets the next request, removing it from the queue - virtual request_ptr_t dequeue(); - - virtual bool canServiceRequest(request_ptr_t request) { return true; }; - - // Returns a request to the head of the queue (should only be used for requests that came from dequeue - virtual void pushBack(request_ptr_t request); - - void trackRequest(request_ptr_t request); - void stopTrackingRequest(request_ptr_t request); - - request_queue_t mQueue; - - const F32 mQueueTimerDelay; - const F32 mRetryTimerDelay; - const U32 mMaxNumRetries; - const U32 mMaxSortedQueueSize; - const U32 mMaxRoundRobinQueueSize; - // Set for keeping track of requests that aren't in either queue. This includes: - // Requests that have been sent and are awaiting a response (pointer held by the Responder) - // Requests that are waiting for their retry timers to fire (pointer held by the retry timer) - request_set_t mUnQueuedRequests; - - void startQueueTimer(); - void stopQueueTimer(); - private: + typedef std::list request_queue_t; + + void enqueue(const Request*); + + // Return whether the given object is/was in the queue + static LLMediaDataClient::request_ptr_t findOrRemove(request_queue_t &queue, const LLMediaDataClientObject::ptr_t &obj, bool remove, Request::Type type); + // Comparator for sorting + static bool compareRequests(const request_ptr_t &o1, const request_ptr_t &o2); static F64 getObjectScore(const LLMediaDataClientObject::ptr_t &obj); friend std::ostream& operator<<(std::ostream &s, const Request &q); @@ -269,76 +231,57 @@ private: public: QueueTimer(F32 time, LLMediaDataClient *mdc); virtual BOOL tick(); + protected: + virtual ~QueueTimer(); private: // back-pointer LLPointer mMDC; }; + void startQueueTimer(); + void stopQueueTimer(); void setIsRunning(bool val) { mQueueTimerIsRunning = val; } - + + void swapCurrentQueue(); + request_queue_t *getCurrentQueue(); + + const F32 mQueueTimerDelay; + const F32 mRetryTimerDelay; + const U32 mMaxNumRetries; + const U32 mMaxSortedQueueSize; + const U32 mMaxRoundRobinQueueSize; + bool mQueueTimerIsRunning; - - template friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - + + request_queue_t mSortedQueue; + request_queue_t mRoundRobinQueue; + bool mCurrentQueueIsTheSortedQueue; }; + // MediaDataClient specific for the ObjectMedia cap class LLObjectMediaDataClient : public LLMediaDataClient { public: - LOG_CLASS(LLObjectMediaDataClient); LLObjectMediaDataClient(F32 queue_timer_delay = QUEUE_TIMER_DELAY, F32 retry_timer_delay = UNAVAILABLE_RETRY_TIMER_DELAY, U32 max_retries = MAX_RETRIES, U32 max_sorted_queue_size = MAX_SORTED_QUEUE_SIZE, U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE) - : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries), - mCurrentQueueIsTheSortedQueue(true) + : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries) {} + virtual ~LLObjectMediaDataClient() {} void fetchMedia(LLMediaDataClientObject *object); void updateMedia(LLMediaDataClientObject *object); - - class RequestGet: public Request - { - public: - RequestGet(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ Responder *createResponder(); - }; - - class RequestUpdate: public Request - { - public: - RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ Responder *createResponder(); - }; - - // Returns true iff the queue is empty - virtual bool isEmpty() const; - - // Returns true iff the given object is in the queue - virtual bool isInQueue(const LLMediaDataClientObject::ptr_t &object); - - // Remove the given object from the queue. Returns true iff the given object is removed. - virtual void removeFromQueue(const LLMediaDataClientObject::ptr_t &object); - - virtual bool processQueueTimer(); - - virtual bool canServiceRequest(request_ptr_t request); - + protected: + // Subclasses must override this factory method to return a new responder + virtual Responder *createResponder(const request_ptr_t &request) const; + // Subclasses must override to return a cap name virtual const char *getCapabilityName() const; - - virtual request_queue_t *getQueue(); - - // Puts the request into the appropriate queue - virtual void enqueue(Request*); - + class Responder : public LLMediaDataClient::Responder { public: @@ -346,16 +289,6 @@ protected: : LLMediaDataClient::Responder(request) {} virtual void result(const LLSD &content); }; -private: - // The Get/Update data client needs a second queue to avoid object updates starving load-ins. - void swapCurrentQueue(); - - request_queue_t mRoundRobinQueue; - bool mCurrentQueueIsTheSortedQueue; - - // Comparator for sorting - static bool compareRequestScores(const request_ptr_t &o1, const request_ptr_t &o2); - void sortQueue(); }; @@ -363,7 +296,6 @@ private: class LLObjectMediaNavigateClient : public LLMediaDataClient { public: - LOG_CLASS(LLObjectMediaNavigateClient); // NOTE: from llmediaservice.h static const int ERROR_PERMISSION_DENIED_CODE = 8002; @@ -374,24 +306,14 @@ public: U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE) : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries) {} + virtual ~LLObjectMediaNavigateClient() {} void navigate(LLMediaDataClientObject *object, U8 texture_index, const std::string &url); - - // Puts the request into the appropriate queue - virtual void enqueue(Request*); - - class RequestNavigate: public Request - { - public: - RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ Responder *createResponder(); - /*virtual*/ std::string getURL() { return mURL; } - private: - std::string mURL; - }; protected: + // Subclasses must override this factory method to return a new responder + virtual Responder *createResponder(const request_ptr_t &request) const; + // Subclasses must override to return a cap name virtual const char *getCapabilityName() const; diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 18bba6e358..e4d6a45ee8 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -810,9 +810,9 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) } } - getChildView("bg_icon")->setVisible( visible && fpVisible); - getChildView("bg_icon_no_fav_bevel")->setVisible( visible && !fpVisible); - getChildView("bg_icon_no_nav_bevel")->setVisible( !visible && fpVisible); + childSetVisible("bg_icon", visible && fpVisible); + childSetVisible("bg_icon_no_fav_bevel", visible && !fpVisible); + childSetVisible("bg_icon_no_nav_bevel", !visible && fpVisible); } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -877,9 +877,9 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } - getChildView("bg_icon")->setVisible( npVisible && visible); - getChildView("bg_icon_no_fav_bevel")->setVisible( npVisible && !visible); - getChildView("bg_icon_no_nav_bevel")->setVisible( !npVisible && visible); + childSetVisible("bg_icon", npVisible && visible); + childSetVisible("bg_icon_no_fav_bevel", npVisible && !visible); + childSetVisible("bg_icon_no_nav_bevel", !npVisible && visible); fb->setVisible(visible); } diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4f9845d704..9bef0a6192 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -388,7 +388,7 @@ LLGestureComboList::~LLGestureComboList() LLCtrlListInterface* LLGestureComboList::getListInterface() { return mList; -} +}; LLNearbyChatBar::LLNearbyChatBar() : LLPanel() diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 51f9a03a9c..3eda077b87 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -398,12 +398,6 @@ void LLOutfitsList::onOpen(const LLSD& /*info*/) mIsInitialized = true; } - - LLAccordionCtrlTab* selected_tab = mAccordion->getSelectedTab(); - if (!selected_tab) return; - - // Pass focus to the selected outfit tab. - selected_tab->showAndFocusHeader(); } void LLOutfitsList::refreshList(const LLUUID& category_id) @@ -1056,37 +1050,25 @@ void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) void LLOutfitsList::onCOFChanged() { - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - - // Collect current COF items - gInventory.collectDescendents( - LLAppearanceMgr::instance().getCOF(), - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH); - - uuid_vec_t vnew; - uuid_vec_t vadded; - uuid_vec_t vremoved; + LLInventoryModel::changed_items_t changed_linked_items; - // From gInventory we get the UUIDs of links that are currently in COF. - // These links UUIDs are not the same UUIDs that we have in each wearable items list. - // So we collect base items' UUIDs to find them or links that point to them in wearable - // items lists and update their worn state there. - for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); - iter != item_array.end(); - ++iter) + const LLInventoryModel::changed_items_t& changed_items = gInventory.getChangedIDs(); + for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items.begin(); + iter != changed_items.end(); + ++iter) { - vnew.push_back((*iter)->getLinkedUUID()); + LLViewerInventoryItem* item = gInventory.getItem(*iter); + if (item) + { + // From gInventory we get the UUIDs of new links added to COF + // or removed from COF. These links UUIDs are not the same UUIDs + // that we have in each wearable items list. So we collect base items + // UUIDs to find all items or links that point to same base items in wearable + // items lists and update their worn state there. + changed_linked_items.insert(item->getLinkedUUID()); + } } - // We need to update only items that were added or removed from COF. - LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved); - - // Store the ids of items currently linked from COF. - mCOFLinkedItems = vnew; - for (outfits_map_t::iterator iter = mOutfitsMap.begin(); iter != mOutfitsMap.end(); ++iter) @@ -1097,13 +1079,9 @@ void LLOutfitsList::onCOFChanged() LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); if (!list) continue; - // Append removed ids to added ids because we should update all of them. - vadded.reserve(vadded.size() + vremoved.size()); - vadded.insert(vadded.end(), vremoved.begin(), vremoved.end()); - // Every list updates the labels of changed items or // the links that point to these items. - list->updateChangedItems(vadded); + list->updateChangedItems(changed_linked_items); } } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 37b909c93e..25aeab2cb7 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -209,10 +209,6 @@ private: typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; - // IDs of original items which are worn and linked in COF. - // Used to monitor COF changes for updating items worn state. See EXT-8636. - uuid_vec_t mCOFLinkedItems; - LLOutfitListGearMenu* mGearMenu; LLListContextMenu* mOutfitMenu; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 68ca65420a..38a8e17827 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -170,14 +170,14 @@ void LLPanelAvatarNotes::onOpen(const LLSD& key) fillRightsData(); //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); + childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId())); } void LLPanelAvatarNotes::fillRightsData() { - getChild("status_check")->setValue(FALSE); - getChild("map_check")->setValue(FALSE); - getChild("objects_check")->setValue(FALSE); + childSetValue("status_check", FALSE); + childSetValue("map_check", FALSE); + childSetValue("objects_check", FALSE); const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); // If true - we are viewing friend's profile, enable check boxes and set values. @@ -185,9 +185,9 @@ void LLPanelAvatarNotes::fillRightsData() { S32 rights = relation->getRightsGrantedTo(); - getChild("status_check")->setValue(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); - getChild("map_check")->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); - getChild("objects_check")->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); + childSetValue("status_check",LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); + childSetValue("map_check",LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); + childSetValue("objects_check",LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); } @@ -196,7 +196,7 @@ void LLPanelAvatarNotes::fillRightsData() void LLPanelAvatarNotes::onCommitNotes() { - std::string notes = getChild("notes_edit")->getValue().asString(); + std::string notes = childGetValue("notes_edit").asString(); LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); } @@ -211,8 +211,8 @@ void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification, } else { - getChild("objects_check")->setValue( - getChild("objects_check")->getValue().asBoolean() ? FALSE : TRUE); + childSetValue("objects_check", + childGetValue("objects_check").asBoolean() ? FALSE : TRUE); } } @@ -255,14 +255,14 @@ void LLPanelAvatarNotes::onCommitRights() S32 rights = 0; - if(getChild("status_check")->getValue().asBoolean()) + if(childGetValue("status_check").asBoolean()) rights |= LLRelationship::GRANT_ONLINE_STATUS; - if(getChild("map_check")->getValue().asBoolean()) + if(childGetValue("map_check").asBoolean()) rights |= LLRelationship::GRANT_MAP_LOCATION; - if(getChild("objects_check")->getValue().asBoolean()) + if(childGetValue("objects_check").asBoolean()) rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - bool allow_modify_objects = getChild("objects_check")->getValue().asBoolean(); + bool allow_modify_objects = childGetValue("objects_check").asBoolean(); // if modify objects checkbox clicked if (buddy_relationship->isRightGrantedTo( @@ -285,8 +285,8 @@ void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type LLAvatarNotes* avatar_notes = static_cast(data); if(avatar_notes && getAvatarId() == avatar_notes->target_id) { - getChild("notes_edit")->setValue(avatar_notes->notes); - getChildView("notes edit")->setEnabled(true); + childSetValue("notes_edit",avatar_notes->notes); + childSetEnabled("notes edit", true); LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } @@ -295,15 +295,15 @@ void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type void LLPanelAvatarNotes::resetData() { - getChild("notes_edit")->setValue(LLStringUtil::null); + childSetValue("notes_edit",LLStringUtil::null); // Default value is TRUE - getChild("status_check")->setValue(TRUE); + childSetValue("status_check", TRUE); } void LLPanelAvatarNotes::resetControls() { //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(TRUE); + childSetEnabled("add_friend", TRUE); enableCheckboxes(false); } @@ -335,9 +335,9 @@ void LLPanelAvatarNotes::onShareButtonClick() void LLPanelAvatarNotes::enableCheckboxes(bool enable) { - getChildView("status_check")->setEnabled(enable); - getChildView("map_check")->setEnabled(enable); - getChildView("objects_check")->setEnabled(enable); + childSetEnabled("status_check", enable); + childSetEnabled("map_check", enable); + childSetEnabled("objects_check", enable); } LLPanelAvatarNotes::~LLPanelAvatarNotes() @@ -355,7 +355,7 @@ LLPanelAvatarNotes::~LLPanelAvatarNotes() // virtual, called by LLAvatarTracker void LLPanelAvatarNotes::changed(U32 mask) { - getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); + childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); // update rights to avoid have checkboxes enabled when friendship is terminated. EXT-4947. fillRightsData(); @@ -369,7 +369,7 @@ void LLPanelAvatarNotes::onChange(EStatusType status, const std::string &channel return; } - getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); + childSetEnabled("call", LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); } void LLPanelAvatarNotes::setAvatarId(const LLUUID& id) @@ -451,17 +451,17 @@ void LLPanelProfileTab::updateButtons() if(LLAvatarActions::isFriend(getAvatarId())) { - getChildView("teleport")->setEnabled(is_buddy_online); + childSetEnabled("teleport", is_buddy_online); } else { - getChildView("teleport")->setEnabled(true); + childSetEnabled("teleport", true); } bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId())) || gAgent.isGodlike(); - getChildView("show_on_map_btn")->setEnabled(enable_map_btn); + childSetEnabled("show_on_map_btn", enable_map_btn); } ////////////////////////////////////////////////////////////////////////// @@ -522,7 +522,7 @@ void LLPanelAvatarProfile::onOpen(const LLSD& key) mGroups.clear(); //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); + childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId())); } void LLPanelAvatarProfile::updateData() @@ -538,32 +538,32 @@ void LLPanelAvatarProfile::updateData() void LLPanelAvatarProfile::resetControls() { - getChildView("status_panel")->setVisible( true); - getChildView("profile_buttons_panel")->setVisible( true); - getChildView("title_groups_text")->setVisible( true); - getChildView("sl_groups")->setVisible( true); - getChildView("add_friend")->setEnabled(true); + childSetVisible("status_panel", true); + childSetVisible("profile_buttons_panel", true); + childSetVisible("title_groups_text", true); + childSetVisible("sl_groups", true); + childSetEnabled("add_friend", true); - getChildView("status_me_panel")->setVisible( false); - getChildView("profile_me_buttons_panel")->setVisible( false); - getChildView("account_actions_panel")->setVisible( false); + childSetVisible("status_me_panel", false); + childSetVisible("profile_me_buttons_panel", false); + childSetVisible("account_actions_panel", false); } void LLPanelAvatarProfile::resetData() { mGroups.clear(); - getChild("2nd_life_pic")->setValue(LLUUID::null); - getChild("real_world_pic")->setValue(LLUUID::null); - getChild("online_status")->setValue(LLStringUtil::null); - getChild("status_message")->setValue(LLStringUtil::null); - getChild("sl_description_edit")->setValue(LLStringUtil::null); - getChild("fl_description_edit")->setValue(LLStringUtil::null); - getChild("sl_groups")->setValue(LLStringUtil::null); - getChild("homepage_edit")->setValue(LLStringUtil::null); - getChild("register_date")->setValue(LLStringUtil::null); - getChild("acc_status_text")->setValue(LLStringUtil::null); - getChild("partner_text")->setTextArg("[FIRST]", LLStringUtil::null); - getChild("partner_text")->setTextArg("[LAST]", LLStringUtil::null); + childSetValue("2nd_life_pic",LLUUID::null); + childSetValue("real_world_pic",LLUUID::null); + childSetValue("online_status",LLStringUtil::null); + childSetValue("status_message",LLStringUtil::null); + childSetValue("sl_description_edit",LLStringUtil::null); + childSetValue("fl_description_edit",LLStringUtil::null); + childSetValue("sl_groups",LLStringUtil::null); + childSetValue("homepage_edit",LLStringUtil::null); + childSetValue("register_date",LLStringUtil::null); + childSetValue("acc_status_text",LLStringUtil::null); + childSetTextArg("partner_text", "[FIRST]", LLStringUtil::null); + childSetTextArg("partner_text", "[LAST]", LLStringUtil::null); } void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType type) @@ -625,7 +625,7 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g groups += group_url; } - getChild("sl_groups")->setValue(groups); + childSetValue("sl_groups", groups); } void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) @@ -641,15 +641,15 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) } args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); std::string register_date = getString("RegisterDateFormat", args); - getChild("register_date")->setValue(register_date ); - getChild("sl_description_edit")->setValue(avatar_data->about_text); - getChild("fl_description_edit")->setValue(avatar_data->fl_about_text); - getChild("2nd_life_pic")->setValue(avatar_data->image_id); - getChild("real_world_pic")->setValue(avatar_data->fl_image_id); - getChild("homepage_edit")->setValue(avatar_data->profile_url); + childSetValue("register_date", register_date ); + childSetValue("sl_description_edit", avatar_data->about_text); + childSetValue("fl_description_edit",avatar_data->fl_about_text); + childSetValue("2nd_life_pic", avatar_data->image_id); + childSetValue("real_world_pic", avatar_data->fl_image_id); + childSetValue("homepage_edit", avatar_data->profile_url); // Hide home page textbox if no page was set to fix "homepage URL appears clickable without URL - EXT-4734" - getChildView("homepage_edit")->setVisible( !avatar_data->profile_url.empty()); + childSetVisible("homepage_edit", !avatar_data->profile_url.empty()); } void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) @@ -675,7 +675,7 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) // dataserver/lldataavatar.cpp for privacy considerations args["[AGEVERIFICATION]"] = ""; std::string caption_text = getString("CaptionTextAcctInfo", args); - getChild("acc_status_text")->setValue(caption_text); + childSetValue("acc_status_text", caption_text); } void LLPanelAvatarProfile::pay() @@ -791,7 +791,7 @@ LLPanelAvatarProfile::~LLPanelAvatarProfile() // virtual, called by LLAvatarTracker void LLPanelAvatarProfile::changed(U32 mask) { - getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); + childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); } // virtual @@ -802,7 +802,7 @@ void LLPanelAvatarProfile::onChange(EStatusType status, const std::string &chann return; } - getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); + childSetEnabled("call", LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); } void LLPanelAvatarProfile::setAvatarId(const LLUUID& id) @@ -855,12 +855,12 @@ void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data) void LLPanelMyProfile::resetControls() { - getChildView("status_panel")->setVisible( false); - getChildView("profile_buttons_panel")->setVisible( false); - getChildView("title_groups_text")->setVisible( false); - getChildView("sl_groups")->setVisible( false); - getChildView("status_me_panel")->setVisible( true); - getChildView("profile_me_buttons_panel")->setVisible( true); + childSetVisible("status_panel", false); + childSetVisible("profile_buttons_panel", false); + childSetVisible("title_groups_text", false); + childSetVisible("sl_groups", false); + childSetVisible("status_me_panel", true); + childSetVisible("profile_me_buttons_panel", true); } diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index fd2e961cb7..6fe29ed6bb 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -126,7 +126,7 @@ void LLPanelBlockedList::refreshBlockedList() void LLPanelBlockedList::updateButtons() { bool hasSelected = NULL != mBlockedList->getFirstSelected(); - getChildView("Unblock")->setEnabled(hasSelected); + childSetEnabled("Unblock", hasSelected); } @@ -263,7 +263,7 @@ void LLFloaterGetBlockedObjectName::applyBlocking() { if (mGetObjectNameCallback) { - const std::string& text = getChild("object_name")->getValue().asString(); + const std::string& text = childGetValue("object_name").asString(); mGetObjectNameCallback(text); } closeFloater(); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index bf7214eb3b..f61fd1f39e 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -32,34 +32,53 @@ #include "llpanelclassified.h" +#include "lldir.h" #include "lldispatcher.h" #include "llfloaterreg.h" #include "llhttpclient.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llparcel.h" +#include "lltabcontainer.h" +#include "message.h" #include "llagent.h" +#include "llavataractions.h" +#include "llbutton.h" +#include "llcheckboxctrl.h" #include "llclassifiedflags.h" #include "llclassifiedstatsresponder.h" #include "llcommandhandler.h" // for classified HTML detail page click tracking -#include "lliconctrl.h" +#include "llviewercontrol.h" #include "lllineeditor.h" +#include "lltextbox.h" #include "llcombobox.h" #include "lltexturectrl.h" #include "lltexteditor.h" +#include "lluiconstants.h" +#include "llurldispatcher.h" // for classified HTML detail click teleports +#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" +#include "llviewerwindow.h" +#include "llworldmap.h" #include "llfloaterworldmap.h" #include "llviewergenericmessage.h" // send_generic_message #include "llviewerregion.h" +#include "llviewerwindow.h" // for window width, height +#include "llappviewer.h" // abortQuit() #include "lltrans.h" #include "llscrollcontainer.h" #include "llstatusbar.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ +const S32 MATURE_UNDEFINED = -1; +const S32 MATURE_CONTENT = 1; +const S32 PG_CONTENT = 2; +const S32 DECLINE_TO_STATE = 0; //static -LLPanelClassifiedInfo::panel_list_t LLPanelClassifiedInfo::sAllPanels; +std::list LLPanelClassified::sAllPanels; +std::list LLPanelClassifiedInfo::sAllPanels; // "classifiedclickthrough" // strings[0] = classified_id @@ -106,6 +125,1040 @@ public: } }; + +/* Re-expose this if we need to have classified ad HTML detail + pages. JC + +// We need to count classified teleport clicks from the search HTML detail pages, +// so we need have a teleport that also sends a click count message. +class LLClassifiedTeleportHandler : public LLCommandHandler +{ +public: + // don't allow from external browsers because it moves you immediately + LLClassifiedTeleportHandler() : LLCommandHandler("classifiedteleport", UNTRUSTED_BLOCK) { } + + bool handle(const LLSD& tokens, const LLSD& queryMap) + { + // Need at least classified id and region name, so 2 params + if (tokens.size() < 2) return false; + LLUUID classified_id = tokens[0].asUUID(); + if (classified_id.isNull()) return false; + // *HACK: construct a SLURL to do the teleport + std::string url("secondlife:///app/teleport/"); + // skip the uuid we took off above, rebuild URL + // separated by slashes. + for (S32 i = 1; i < tokens.size(); ++i) + { + url += tokens[i].asString(); + url += "/"; + } + llinfos << "classified teleport to " << url << llendl; + // *TODO: separately track old search, sidebar, and new search + // Right now detail HTML pages count as new search. + const bool from_search = true; + LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search); + // Invoke teleport + LLMediaCtrl* web = NULL; + const bool trusted_browser = true; + return LLURLDispatcher::dispatch(url, web, trusted_browser); + } +}; +// Creating the object registers with the dispatcher. +LLClassifiedTeleportHandler gClassifiedTeleportHandler; +*/ + +LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) +: LLPanel(), + mInFinder(in_finder), + mFromSearch(from_search), + mDirty(false), + mForceClose(false), + mLocationChanged(false), + mClassifiedID(), + mCreatorID(), + mPriceForListing(0), + mDataRequested(FALSE), + mPaidFor(FALSE), + mPosGlobal(), + mSnapshotCtrl(NULL), + mNameEditor(NULL), + mDescEditor(NULL), + mLocationEditor(NULL), + mCategoryCombo(NULL), + mMatureCombo(NULL), + mAutoRenewCheck(NULL), + mUpdateBtn(NULL), + mTeleportBtn(NULL), + mMapBtn(NULL), + mProfileBtn(NULL), + mInfoText(NULL), + mSetBtn(NULL), + mClickThroughText(NULL), + mTeleportClicksOld(0), + mMapClicksOld(0), + mProfileClicksOld(0), + mTeleportClicksNew(0), + mMapClicksNew(0), + mProfileClicksNew(0) + +{ + sAllPanels.push_back(this); + + std::string classified_def_file; + if (mInFinder) + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_classified.xml"); + } + else + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_classified.xml"); + } + + // Register dispatcher + gGenericDispatcher.addHandler("classifiedclickthrough", + &sClassifiedClickThrough); +} + + +LLPanelClassified::~LLPanelClassified() +{ + sAllPanels.remove(this); +} + + +void LLPanelClassified::reset() +{ + mClassifiedID.setNull(); + mCreatorID.setNull(); + mParcelID.setNull(); + + // Don't request data, this isn't valid + mDataRequested = TRUE; + + mDirty = false; + mPaidFor = FALSE; + + mPosGlobal.clearVec(); + + clearCtrls(); + resetDirty(); +} + + +BOOL LLPanelClassified::postBuild() +{ + mSnapshotCtrl = getChild("snapshot_ctrl"); + mSnapshotCtrl->setCommitCallback(onCommitAny, this); + mSnapshotSize = mSnapshotCtrl->getRect(); + + mNameEditor = getChild("given_name_editor"); + mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); + mNameEditor->setCommitOnFocusLost(TRUE); + mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); + mNameEditor->setCommitCallback(onCommitAny, this); + mNameEditor->setPrevalidate( LLTextValidate::validateASCII ); + + mDescEditor = getChild("desc_editor"); + mDescEditor->setCommitOnFocusLost(TRUE); + mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); + mDescEditor->setCommitCallback(onCommitAny, this); + + mLocationEditor = getChild("location_editor"); + + mSetBtn = getChild( "set_location_btn"); + mSetBtn->setClickedCallback(onClickSet, this); + + mTeleportBtn = getChild( "classified_teleport_btn"); + mTeleportBtn->setClickedCallback(onClickTeleport, this); + + mMapBtn = getChild( "classified_map_btn"); + mMapBtn->setClickedCallback(onClickMap, this); + + if(mInFinder) + { + mProfileBtn = getChild( "classified_profile_btn"); + mProfileBtn->setClickedCallback(onClickProfile, this); + } + + mCategoryCombo = getChild( "classified_category_combo"); + LLClassifiedInfo::cat_map::iterator iter; + for (iter = LLClassifiedInfo::sCategories.begin(); + iter != LLClassifiedInfo::sCategories.end(); + iter++) + { + mCategoryCombo->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); + } + mCategoryCombo->setCurrentByIndex(0); + mCategoryCombo->setCommitCallback(onCommitAny, this); + + mMatureCombo = getChild( "classified_mature_check"); + mMatureCombo->setCurrentByIndex(0); + mMatureCombo->setCommitCallback(onCommitAny, this); + if (gAgent.wantsPGOnly()) + { + // Teens don't get to set mature flag. JC + mMatureCombo->setVisible(FALSE); + mMatureCombo->setCurrentByIndex(PG_CONTENT); + } + + if (!mInFinder) + { + mAutoRenewCheck = getChild( "auto_renew_check"); + mAutoRenewCheck->setCommitCallback(onCommitAny, this); + } + + mUpdateBtn = getChild("classified_update_btn"); + mUpdateBtn->setClickedCallback(onClickUpdate, this); + + if (!mInFinder) + { + mClickThroughText = getChild("click_through_text"); + } + + resetDirty(); + return TRUE; +} + +BOOL LLPanelClassified::titleIsValid() +{ + // Disallow leading spaces, punctuation, etc. that screw up + // sort order. + const std::string& name = mNameEditor->getText(); + if (name.empty()) + { + LLNotificationsUtil::add("BlankClassifiedName"); + return FALSE; + } + if (!isalnum(name[0])) + { + LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); + return FALSE; + } + + return TRUE; +} + +void LLPanelClassified::apply() +{ + // Apply is used for automatically saving results, so only + // do that if there is a difference, and this is a save not create. + if (checkDirty() && mPaidFor) + { + sendClassifiedInfoUpdate(); + } +} + +bool LLPanelClassified::saveCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + switch(option) + { + case 0: // Save + sendClassifiedInfoUpdate(); + // fall through to close + + case 1: // Don't Save + { + mForceClose = true; + // Close containing floater + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + if (parent_floater) + { + parent_floater->closeFloater(); + } + } + break; + + case 2: // Cancel + default: + LLAppViewer::instance()->abortQuit(); + break; + } + return false; +} + + +BOOL LLPanelClassified::canClose() +{ + if (mForceClose || !checkDirty()) + return TRUE; + + LLSD args; + args["NAME"] = mNameEditor->getText(); + LLNotificationsUtil::add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2)); + return FALSE; +} + +// Fill in some reasonable defaults for a new classified. +void LLPanelClassified::initNewClassified() +{ + // TODO: Don't generate this on the client. + mClassifiedID.generate(); + + mCreatorID = gAgent.getID(); + + mPosGlobal = gAgent.getPositionGlobal(); + + mPaidFor = FALSE; + + // Try to fill in the current parcel + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + mNameEditor->setText(parcel->getName()); + //mDescEditor->setText(parcel->getDesc()); + mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); + //mPriceEditor->setText("0"); + mCategoryCombo->setCurrentByIndex(0); + } + + mUpdateBtn->setLabel(getString("publish_txt")); + + // simulate clicking the "location" button + LLPanelClassified::onClickSet(this); +} + + +void LLPanelClassified::setClassifiedID(const LLUUID& id) +{ + mClassifiedID = id; +} + +//static +void LLPanelClassified::setClickThrough(const LLUUID& classified_id, + S32 teleport, + S32 map, + S32 profile, + bool from_new_table) +{ + for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) + { + LLPanelClassified* self = *iter; + // For top picks, must match pick id + if (self->mClassifiedID != classified_id) + { + continue; + } + + // We need to check to see if the data came from the new stat_table + // or the old classified table. We also need to cache the data from + // the two separate sources so as to display the aggregate totals. + + if (from_new_table) + { + self->mTeleportClicksNew = teleport; + self->mMapClicksNew = map; + self->mProfileClicksNew = profile; + } + else + { + self->mTeleportClicksOld = teleport; + self->mMapClicksOld = map; + self->mProfileClicksOld = profile; + } + + if (self->mClickThroughText) + { + LLStringUtil::format_map_t args; + args["[TELEPORT]"] = llformat ("%d", self->mTeleportClicksNew + self->mTeleportClicksOld); + args["[MAP]"] = llformat ("%d", self->mMapClicksNew + self->mMapClicksOld); + args["[PROFILE]"] = llformat ("%d", self->mProfileClicksNew + self->mProfileClicksOld); + std::string msg = LLTrans::getString ("ClassifiedClicksTxt", args); + self->mClickThroughText->setText(msg); + } + } +} + +// Schedules the panel to request data +// from the server next time it is drawn. +void LLPanelClassified::markForServerRequest() +{ + mDataRequested = FALSE; +} + + +std::string LLPanelClassified::getClassifiedName() +{ + return mNameEditor->getText(); +} + + +void LLPanelClassified::sendClassifiedInfoRequest() +{ + LLMessageSystem *msg = gMessageSystem; + + if (mClassifiedID != mRequestedID) + { + msg->newMessageFast(_PREHASH_ClassifiedInfoRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->nextBlockFast(_PREHASH_Data); + msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); + gAgent.sendReliableMessage(); + + mDataRequested = TRUE; + mRequestedID = mClassifiedID; + + // While we're at it let's get the stats from the new table if that + // capability exists. + std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); + LLSD body; + body["classified_id"] = mClassifiedID; + + if (!url.empty()) + { + llinfos << "Classified stat request via capability" << llendl; + LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(mClassifiedID)); + } + } +} + + +void LLPanelClassified::sendClassifiedInfoUpdate() +{ + // If we don't have a classified id yet, we'll need to generate one, + // otherwise we'll keep overwriting classified_id 00000 in the database. + if (mClassifiedID.isNull()) + { + // TODO: Don't do this on the client. + mClassifiedID.generate(); + } + + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_ClassifiedInfoUpdate); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_Data); + msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); + // TODO: fix this + U32 category = mCategoryCombo->getCurrentIndex() + 1; + msg->addU32Fast(_PREHASH_Category, category); + msg->addStringFast(_PREHASH_Name, mNameEditor->getText()); + msg->addStringFast(_PREHASH_Desc, mDescEditor->getText()); + + // fills in on simulator if null + msg->addUUIDFast(_PREHASH_ParcelID, mParcelID); + // fills in on simulator if null + msg->addU32Fast(_PREHASH_ParentEstate, 0); + msg->addUUIDFast(_PREHASH_SnapshotID, mSnapshotCtrl->getImageAssetID()); + msg->addVector3dFast(_PREHASH_PosGlobal, mPosGlobal); + BOOL mature = mMatureCombo->getCurrentIndex() == MATURE_CONTENT; + BOOL auto_renew = FALSE; + if (mAutoRenewCheck) + { + auto_renew = mAutoRenewCheck->get(); + } + // These flags doesn't matter here. + const bool adult_enabled = false; + const bool is_pg = false; + U8 flags = pack_classified_flags_request(auto_renew, is_pg, mature, adult_enabled); + msg->addU8Fast(_PREHASH_ClassifiedFlags, flags); + msg->addS32("PriceForListing", mPriceForListing); + gAgent.sendReliableMessage(); + + mDirty = false; +} + + +//static +void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **) +{ + lldebugs << "processClassifiedInfoReply()" << llendl; + // Extract the agent id and verify the message is for this + // client. + LLUUID agent_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); + if (agent_id != gAgent.getID()) + { + llwarns << "Agent ID mismatch in processClassifiedInfoReply" + << llendl; + return; + } + + LLUUID classified_id; + msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id); + + LLUUID creator_id; + msg->getUUIDFast(_PREHASH_Data, _PREHASH_CreatorID, creator_id); + + LLUUID parcel_id; + msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); + + std::string name; + msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name); + + std::string desc; + msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, desc); + + LLUUID snapshot_id; + msg->getUUIDFast(_PREHASH_Data, _PREHASH_SnapshotID, snapshot_id); + + // "Location text" is actually the original + // name that owner gave the parcel, and the location. + std::string location_text; + + msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, location_text); + if (!location_text.empty()) + { + location_text.append(", "); + } + + std::string sim_name; + msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, sim_name); + + LLVector3d pos_global; + msg->getVector3dFast(_PREHASH_Data, _PREHASH_PosGlobal, pos_global); + + S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)pos_global.mdV[VZ]); + + std::string buffer = llformat("%s (%d, %d, %d)", sim_name.c_str(), region_x, region_y, region_z); + location_text.append(buffer); + + U8 flags; + msg->getU8Fast(_PREHASH_Data, _PREHASH_ClassifiedFlags, flags); + //BOOL enabled = is_cf_enabled(flags); + bool mature = is_cf_mature(flags); + bool auto_renew = is_cf_auto_renew(flags); + + U32 date = 0; + msg->getU32Fast(_PREHASH_Data, _PREHASH_CreationDate, date); + time_t tim = date; + + // future use + U32 expiration_date = 0; + msg->getU32("Data", "ExpirationDate", expiration_date); + + U32 category = 0; + msg->getU32Fast(_PREHASH_Data, _PREHASH_Category, category); + + S32 price_for_listing = 0; + msg->getS32("Data", "PriceForListing", price_for_listing); + + // Look up the panel to fill in + for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) + { + LLPanelClassified* self = *iter; + // For top picks, must match pick id + if (self->mClassifiedID != classified_id) + { + continue; + } + + // Found the panel, now fill in the information + self->mClassifiedID = classified_id; + self->mCreatorID = creator_id; + self->mParcelID = parcel_id; + self->mPriceForListing = price_for_listing; + self->mSimName.assign(sim_name); + self->mPosGlobal = pos_global; + + // Update UI controls + self->mNameEditor->setText(name); + self->mDescEditor->setText(desc); + self->mSnapshotCtrl->setImageAssetID(snapshot_id); + self->mLocationEditor->setText(location_text); + self->mLocationChanged = false; + + self->mCategoryCombo->setCurrentByIndex(category - 1); + if(mature) + { + self->mMatureCombo->setCurrentByIndex(MATURE_CONTENT); + } + else + { + self->mMatureCombo->setCurrentByIndex(PG_CONTENT); + } + if (self->mAutoRenewCheck) + { + self->mAutoRenewCheck->set(auto_renew); + } + + std::string dateStr = self->getString("dateStr"); + LLSD substitution; + substitution["datetime"] = (S32) tim; + LLStringUtil::format (dateStr, substitution); + + LLStringUtil::format_map_t string_args; + string_args["[DATE]"] = dateStr; + string_args["[AMT]"] = llformat("%d", price_for_listing); + self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); + + // If we got data from the database, we know the listing is paid for. + self->mPaidFor = TRUE; + + self->mUpdateBtn->setLabel(self->getString("update_txt")); + + self->resetDirty(); + + // I don't know if a second call is deliberate or a bad merge, so I'm leaving it here. + self->resetDirty(); + } +} + +void LLPanelClassified::draw() +{ + refresh(); + + LLPanel::draw(); +} + + +void LLPanelClassified::refresh() +{ + if (!mDataRequested) + { + sendClassifiedInfoRequest(); + } + + // Check for god mode + BOOL godlike = gAgent.isGodlike(); + BOOL is_self = (gAgent.getID() == mCreatorID); + + // Set button visibility/enablement appropriately + if (mInFinder) + { + + // End user doesn't ned to see price twice, or date posted. + + mSnapshotCtrl->setEnabled(godlike); + if(godlike) + { + //make it smaller, so text is more legible + mSnapshotCtrl->setOrigin(20, 175); + mSnapshotCtrl->reshape(300, 200); + } + else + { + mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom); + mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight()); + //normal + } + mNameEditor->setEnabled(godlike); + mDescEditor->setEnabled(godlike); + mCategoryCombo->setEnabled(godlike); + mCategoryCombo->setVisible(godlike); + + mMatureCombo->setEnabled(godlike); + mMatureCombo->setVisible(godlike); + + // Jesse (who is the only one who uses this, as far as we can tell + // Says that he does not want a set location button - he has used it + // accidently in the past. + mSetBtn->setVisible(FALSE); + mSetBtn->setEnabled(FALSE); + + mUpdateBtn->setEnabled(godlike); + mUpdateBtn->setVisible(godlike); + } + else + { + mSnapshotCtrl->setEnabled(is_self); + mNameEditor->setEnabled(is_self); + mDescEditor->setEnabled(is_self); + //mPriceEditor->setEnabled(is_self); + mCategoryCombo->setEnabled(is_self); + mMatureCombo->setEnabled(is_self); + + if( is_self ) + { + if( mMatureCombo->getCurrentIndex() == 0 ) + { + // It's a new panel. + // PG regions should have PG classifieds. AO should have mature. + + setDefaultAccessCombo(); + } + } + + if (mAutoRenewCheck) + { + mAutoRenewCheck->setEnabled(is_self); + mAutoRenewCheck->setVisible(is_self); + } + + mClickThroughText->setEnabled(is_self); + mClickThroughText->setVisible(is_self); + + mSetBtn->setVisible(is_self); + mSetBtn->setEnabled(is_self); + + mUpdateBtn->setEnabled(is_self && checkDirty()); + mUpdateBtn->setVisible(is_self); + } +} + +// static +void LLPanelClassified::onClickUpdate(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + + if(self == NULL) return; + + // Disallow leading spaces, punctuation, etc. that screw up + // sort order. + if ( ! self->titleIsValid() ) + { + return; + }; + + // If user has not set mature, do not allow publish + if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) + { + // Tell user about it + LLNotificationsUtil::add("SetClassifiedMature", + LLSD(), + LLSD(), + boost::bind(&LLPanelClassified::confirmMature, self, _1, _2)); + return; + } + + // Mature content flag is set, proceed + self->gotMature(); +} + +// Callback from a dialog indicating response to mature notification +bool LLPanelClassified::confirmMature(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // 0 == Yes + // 1 == No + // 2 == Cancel + switch(option) + { + case 0: + mMatureCombo->setCurrentByIndex(MATURE_CONTENT); + break; + case 1: + mMatureCombo->setCurrentByIndex(PG_CONTENT); + break; + default: + return false; + } + + // If we got here it means they set a valid value + gotMature(); + return false; +} + +// Called after we have determined whether this classified has +// mature content or not. +void LLPanelClassified::gotMature() +{ + // if already paid for, just do the update + if (mPaidFor) + { + LLNotification::Params params("PublishClassified"); + params.functor.function(boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); + LLNotifications::instance().forceResponse(params, 0); + } + else + { + // Ask the user how much they want to pay + LLFloaterPriceForListing::show( callbackGotPriceForListing, this ); + } +} + +// static +void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + + // Only do something if user hits publish + if (option != 0) return; + + S32 price_for_listing = strtol(text.c_str(), NULL, 10); + if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) + { + LLSD args; + std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); + args["MIN_PRICE"] = price_text; + + LLNotificationsUtil::add("MinClassifiedPrice", args); + return; + } + + // price is acceptable, put it in the dialog for later read by + // update send + self->mPriceForListing = price_for_listing; + + LLSD args; + args["AMOUNT"] = llformat("%d", price_for_listing); + LLNotificationsUtil::add("PublishClassified", args, LLSD(), + boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); +} + +void LLPanelClassified::resetDirty() +{ + // Tell all the widgets to reset their dirty state since the ad was just saved + if (mSnapshotCtrl) + mSnapshotCtrl->resetDirty(); + if (mNameEditor) + mNameEditor->resetDirty(); + if (mDescEditor) + mDescEditor->resetDirty(); + if (mLocationEditor) + mLocationEditor->resetDirty(); + mLocationChanged = false; + if (mCategoryCombo) + mCategoryCombo->resetDirty(); + if (mMatureCombo) + mMatureCombo->resetDirty(); + if (mAutoRenewCheck) + mAutoRenewCheck->resetDirty(); +} + +// invoked from callbackConfirmPublish +bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // Option 0 = publish + if (option != 0) return false; + + sendClassifiedInfoUpdate(); + + // Big hack - assume that top picks are always in a browser, + // and non-finder-classifieds are always in a tab container. + if (! mInFinder) + { + LLTabContainer* tab = (LLTabContainer*)getParent(); + tab->setCurrentTabName(mNameEditor->getText()); + } + + resetDirty(); + return false; +} + + +// static +void LLPanelClassified::onClickTeleport(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + + if (!self->mPosGlobal.isExactlyZero()&&worldmap_instance) + { + gAgent.teleportViaLocation(self->mPosGlobal); + worldmap_instance->trackLocation(self->mPosGlobal); + self->sendClassifiedClickMessage("teleport"); + } +} + + +// static +void LLPanelClassified::onClickMap(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if(worldmap_instance) + { + worldmap_instance->trackLocation(self->mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } + self->sendClassifiedClickMessage("map"); +} + +// static +void LLPanelClassified::onClickProfile(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + LLAvatarActions::showProfile(self->mCreatorID); + self->sendClassifiedClickMessage("profile"); +} + +// static +/* +void LLPanelClassified::onClickLandmark(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); +} +*/ + +// static +void LLPanelClassified::onClickSet(void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + + // Save location for later. + self->mPosGlobal = gAgent.getPositionGlobal(); + + std::string location_text; + std::string regionName = LLTrans::getString("ClassifiedUpdateAfterPublish"); + LLViewerRegion* pRegion = gAgent.getRegion(); + if (pRegion) + { + regionName = pRegion->getName(); + } + location_text.assign(regionName); + location_text.append(", "); + + S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); + + location_text.append(self->mSimName); + location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); + + self->mLocationEditor->setText(location_text); + self->mLocationChanged = true; + + self->setDefaultAccessCombo(); + + // Set this to null so it updates on the next save. + self->mParcelID.setNull(); + + onCommitAny(NULL, data); +} + + +BOOL LLPanelClassified::checkDirty() +{ + mDirty = FALSE; + if ( mSnapshotCtrl ) mDirty |= mSnapshotCtrl->isDirty(); + if ( mNameEditor ) mDirty |= mNameEditor->isDirty(); + if ( mDescEditor ) mDirty |= mDescEditor->isDirty(); + if ( mLocationEditor ) mDirty |= mLocationEditor->isDirty(); + if ( mLocationChanged ) mDirty |= TRUE; + if ( mCategoryCombo ) mDirty |= mCategoryCombo->isDirty(); + if ( mMatureCombo ) mDirty |= mMatureCombo->isDirty(); + if ( mAutoRenewCheck ) mDirty |= mAutoRenewCheck->isDirty(); + + return mDirty; +} + +// static +void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data) +{ + LLPanelClassified* self = (LLPanelClassified*)data; + if (self) + { + self->checkDirty(); + } +} + +// static +void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data) +{ + // allow the data to be saved + onCommitAny((LLUICtrl*)ctrl, data); +} + + +void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) +{ + // You're allowed to click on your own ads to reassure yourself + // that the system is working. + LLSD body; + body["type"] = type; + body["from_search"] = mFromSearch; + body["classified_id"] = mClassifiedID; + body["parcel_id"] = mParcelID; + body["dest_pos_global"] = mPosGlobal.getValue(); + body["region_name"] = mSimName; + + std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); + llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; + LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); +} + +//////////////////////////////////////////////////////////////////////////////////////////// + +LLFloaterPriceForListing::LLFloaterPriceForListing() +: LLFloater(LLSD()), + mCallback(NULL), + mUserData(NULL) +{ } + +//virtual +LLFloaterPriceForListing::~LLFloaterPriceForListing() +{ } + +//virtual +BOOL LLFloaterPriceForListing::postBuild() +{ + LLLineEditor* edit = getChild("price_edit"); + if (edit) + { + edit->setPrevalidate(LLTextValidate::validateNonNegativeS32); + std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); + edit->setText(min_price); + edit->selectAll(); + edit->setFocus(TRUE); + } + + childSetAction("set_price_btn", onClickSetPrice, this); + + childSetAction("cancel_btn", onClickCancel, this); + + setDefaultBtn("set_price_btn"); + return TRUE; +} + +//static +void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata) +{ + LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); + + // Builds and adds to gFloaterView + LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml", NULL); + self->center(); + + self->mCallback = callback; + self->mUserData = userdata; +} + +//static +void LLFloaterPriceForListing::onClickSetPrice(void* data) +{ + buttonCore(0, data); +} + +//static +void LLFloaterPriceForListing::onClickCancel(void* data) +{ + buttonCore(1, data); +} + +//static +void LLFloaterPriceForListing::buttonCore(S32 button, void* data) +{ + LLFloaterPriceForListing* self = (LLFloaterPriceForListing*)data; + + if (self->mCallback) + { + std::string text = self->childGetText("price_edit"); + self->mCallback(button, text, self->mUserData); + self->closeFloater(); + } +} + +void LLPanelClassified::setDefaultAccessCombo() +{ + // PG regions should have PG classifieds. AO should have mature. + + LLViewerRegion *regionp = gAgent.getRegion(); + + switch( regionp->getSimAccess() ) + { + case SIM_ACCESS_PG: + mMatureCombo->setCurrentByIndex(PG_CONTENT); + break; + case SIM_ACCESS_ADULT: + mMatureCombo->setCurrentByIndex(MATURE_CONTENT); + break; + default: + // You are free to move about the cabin. + break; + } +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -257,7 +1310,7 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t setSimName(c_info->sim_name); setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); - getChild("category")->setValue(LLClassifiedInfo::sCategories[c_info->category]); + childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); static std::string mature_str = getString("type_mature"); static std::string pg_str = getString("type_pg"); @@ -265,20 +1318,20 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t static std::string date_fmt = getString("date_fmt"); bool mature = is_cf_mature(c_info->flags); - getChild("content_type")->setValue(mature ? mature_str : pg_str); + childSetValue("content_type", mature ? mature_str : pg_str); getChild("content_type_moderate")->setVisible(mature); getChild("content_type_general")->setVisible(!mature); std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ? getString("auto_renew_on") : getString("auto_renew_off"); - getChild("auto_renew")->setValue(auto_renew_str); + childSetValue("auto_renew", auto_renew_str); price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing)); - getChild("price_for_listing")->setValue(LLSD(price_str)); + childSetValue("price_for_listing", LLSD(price_str)); std::string date_str = date_fmt; LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date)); - getChild("creation_date")->setValue(date_str); + childSetText("creation_date", date_str); setInfoLoaded(true); } @@ -305,13 +1358,13 @@ void LLPanelClassifiedInfo::resetData() mMapClicksNew = 0; mProfileClicksNew = 0; - getChild("category")->setValue(LLStringUtil::null); - getChild("content_type")->setValue(LLStringUtil::null); - getChild("click_through_text")->setValue(LLStringUtil::null); - getChild("price_for_listing")->setValue(LLStringUtil::null); - getChild("auto_renew")->setValue(LLStringUtil::null); - getChild("creation_date")->setValue(LLStringUtil::null); - getChild("click_through_text")->setValue(LLStringUtil::null); + childSetText("category", LLStringUtil::null); + childSetText("content_type", LLStringUtil::null); + childSetText("click_through_text", LLStringUtil::null); + childSetText("price_for_listing", LLStringUtil::null); + childSetText("auto_renew", LLStringUtil::null); + childSetText("creation_date", LLStringUtil::null); + childSetText("click_through_text", LLStringUtil::null); getChild("content_type_moderate")->setVisible(FALSE); getChild("content_type_general")->setVisible(FALSE); } @@ -320,40 +1373,40 @@ void LLPanelClassifiedInfo::resetControls() { bool is_self = getAvatarId() == gAgent.getID(); - getChildView("edit_btn")->setEnabled(is_self); - getChildView("edit_btn")->setVisible( is_self); - getChildView("price_layout_panel")->setVisible( is_self); - getChildView("clickthrough_layout_panel")->setVisible( is_self); + childSetEnabled("edit_btn", is_self); + childSetVisible("edit_btn", is_self); + childSetVisible("price_layout_panel", is_self); + childSetVisible("clickthrough_layout_panel", is_self); } void LLPanelClassifiedInfo::setClassifiedName(const std::string& name) { - getChild("classified_name")->setValue(name); + childSetValue("classified_name", name); } std::string LLPanelClassifiedInfo::getClassifiedName() { - return getChild("classified_name")->getValue().asString(); + return childGetValue("classified_name").asString(); } void LLPanelClassifiedInfo::setDescription(const std::string& desc) { - getChild("classified_desc")->setValue(desc); + childSetValue("classified_desc", desc); } std::string LLPanelClassifiedInfo::getDescription() { - return getChild("classified_desc")->getValue().asString(); + return childGetValue("classified_desc").asString(); } void LLPanelClassifiedInfo::setClassifiedLocation(const std::string& location) { - getChild("classified_location")->setValue(location); + childSetValue("classified_location", location); } std::string LLPanelClassifiedInfo::getClassifiedLocation() { - return getChild("classified_location")->getValue().asString(); + return childGetValue("classified_location").asString(); } void LLPanelClassifiedInfo::setSnapshotId(const LLUUID& id) @@ -376,7 +1429,7 @@ void LLPanelClassifiedInfo::draw() LLUUID LLPanelClassifiedInfo::getSnapshotId() { - return getChild("classified_snapshot")->getValue().asUUID(); + return childGetValue("classified_snapshot").asUUID(); } // static @@ -431,9 +1484,9 @@ void LLPanelClassifiedInfo::setClickThrough( ct_str.setArg("[MAP]", llformat("%d", self->mMapClicksNew + self->mMapClicksOld)); ct_str.setArg("[PROFILE]", llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)); - self->getChild("click_through_text")->setValue(ct_str.getString()); + self->childSetText("click_through_text", ct_str.getString()); // *HACK: remove this when there is enough room for click stats in the info panel - self->getChildView("click_through_text")->setToolTip(ct_str.getString()); + self->childSetToolTip("click_through_text", ct_str.getString()); llinfos << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld) << ", map: " << llformat("%d", self->mMapClicksNew + self->mMapClicksOld) @@ -681,8 +1734,8 @@ void LLPanelClassifiedEdit::fillIn(const LLSD& key) region_name = region->getName(); } - getChild("classified_name")->setValue(makeClassifiedName()); - getChild("classified_desc")->setValue(desc); + childSetValue("classified_name", makeClassifiedName()); + childSetValue("classified_desc", desc); setSnapshotId(snapshot_id); setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); // server will set valid parcel id @@ -697,8 +1750,8 @@ void LLPanelClassifiedEdit::fillIn(const LLSD& key) setCategory((U32)key["category"].asInteger()); setContentType((U32)key["content_type"].asInteger()); setClassifiedLocation(key["location_text"]); - getChild("auto_renew")->setValue(key["auto_renew"]); - getChild("price_for_listing")->setValue(key["price_for_listing"].asInteger()); + childSetValue("auto_renew", key["auto_renew"]); + childSetValue("price_for_listing", key["price_for_listing"].asInteger()); } } @@ -729,7 +1782,7 @@ void LLPanelClassifiedEdit::onOpen(const LLSD& key) } std::string save_btn_label = is_new ? getString("publish_label") : getString("save_label"); - getChild("save_changes_btn")->setLabelArg("[LABEL]", save_btn_label); + childSetLabelArg("save_changes_btn", "[LABEL]", save_btn_label); enableVerbs(is_new); enableEditing(is_new); @@ -768,16 +1821,16 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t bool auto_renew = is_cf_auto_renew(c_info->flags); setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG); - getChild("auto_renew")->setValue(auto_renew); - getChild("price_for_listing")->setValue(c_info->price_for_listing); - getChildView("price_for_listing")->setEnabled(isNew()); + childSetValue("auto_renew", auto_renew); + childSetValue("price_for_listing", c_info->price_for_listing); + childSetEnabled("price_for_listing", isNew()); resetDirty(); setInfoLoaded(true); enableVerbs(false); // for just created classified - in case user opened edit panel before processProperties() callback - getChild("save_changes_btn")->setLabelArg("[LABEL]", getString("save_label")); + childSetLabelArg("save_changes_btn", "[LABEL]", getString("save_label")); } } } @@ -836,9 +1889,9 @@ void LLPanelClassifiedEdit::resetControls() getChild("category")->setCurrentByIndex(0); getChild("content_type")->setCurrentByIndex(0); - getChild("auto_renew")->setValue(false); - getChild("price_for_listing")->setValue(MINIMUM_PRICE_FOR_LISTING); - getChildView("price_for_listing")->setEnabled(TRUE); + childSetValue("auto_renew", false); + childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); + childSetEnabled("price_for_listing", TRUE); } bool LLPanelClassifiedEdit::canClose() @@ -877,7 +1930,7 @@ void LLPanelClassifiedEdit::setContentType(U32 content_type) bool LLPanelClassifiedEdit::getAutoRenew() { - return getChild("auto_renew")->getValue().asBoolean(); + return childGetValue("auto_renew").asBoolean(); } void LLPanelClassifiedEdit::sendUpdate() @@ -928,7 +1981,7 @@ void LLPanelClassifiedEdit::setCategory(U32 category) U8 LLPanelClassifiedEdit::getFlags() { - bool auto_renew = getChild("auto_renew")->getValue().asBoolean(); + bool auto_renew = childGetValue("auto_renew").asBoolean(); LLComboBox* content_cb = getChild("content_type"); bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; @@ -938,25 +1991,25 @@ U8 LLPanelClassifiedEdit::getFlags() void LLPanelClassifiedEdit::enableVerbs(bool enable) { - getChildView("save_changes_btn")->setEnabled(enable); + childSetEnabled("save_changes_btn", enable); } void LLPanelClassifiedEdit::enableEditing(bool enable) { - getChildView("classified_snapshot")->setEnabled(enable); - getChildView("classified_name")->setEnabled(enable); - getChildView("classified_desc")->setEnabled(enable); - getChildView("set_to_curr_location_btn")->setEnabled(enable); - getChildView("category")->setEnabled(enable); - getChildView("content_type")->setEnabled(enable); - getChildView("price_for_listing")->setEnabled(enable); - getChildView("auto_renew")->setEnabled(enable); + childSetEnabled("classified_snapshot", enable); + childSetEnabled("classified_name", enable); + childSetEnabled("classified_desc", enable); + childSetEnabled("set_to_curr_location_btn", enable); + childSetEnabled("category", enable); + childSetEnabled("content_type", enable); + childSetEnabled("price_for_listing", enable); + childSetEnabled("auto_renew", enable); } void LLPanelClassifiedEdit::showEditing(bool show) { - getChildView("price_for_listing_label")->setVisible( show); - getChildView("price_for_listing")->setVisible( show); + childSetVisible("price_for_listing_label", show); + childSetVisible("price_for_listing", show); } std::string LLPanelClassifiedEdit::makeClassifiedName() @@ -985,12 +2038,12 @@ std::string LLPanelClassifiedEdit::makeClassifiedName() S32 LLPanelClassifiedEdit::getPriceForListing() { - return getChild("price_for_listing")->getValue().asInteger(); + return childGetValue("price_for_listing").asInteger(); } void LLPanelClassifiedEdit::setPriceForListing(S32 price) { - getChild("price_for_listing")->setValue(price); + childSetValue("price_for_listing", price); } void LLPanelClassifiedEdit::onSetLocationClick() @@ -1148,12 +2201,12 @@ BOOL LLPublishClassifiedFloater::postBuild() void LLPublishClassifiedFloater::setPrice(S32 price) { - getChild("price_for_listing")->setValue(price); + childSetValue("price_for_listing", price); } S32 LLPublishClassifiedFloater::getPrice() { - return getChild("price_for_listing")->getValue().asInteger(); + return childGetValue("price_for_listing").asInteger(); } void LLPublishClassifiedFloater::setPublishClickedCallback(const commit_signal_t::slot_type& cb) diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index cedd65c405..b3aeaae3e5 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -27,20 +27,174 @@ // Display of a classified used both for the global view in the // Find directory, and also for each individual user's classified in their // profile. + #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H #include "llavatarpropertiesprocessor.h" -#include "llclassifiedinfo.h" -#include "llfloater.h" #include "llpanel.h" -#include "llrect.h" -#include "lluuid.h" +#include "llclassifiedinfo.h" #include "v3dmath.h" - -class LLScrollContainer; +#include "lluuid.h" +#include "llfloater.h" +//#include "llrect.h" + +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLIconCtrl; +class LLLineEditor; +class LLTextBox; +class LLTextEditor; class LLTextureCtrl; class LLUICtrl; +class LLMessageSystem; +class LLScrollContainer; + +// *TODO deprecated, should be removed. +// New class implemented in ticket EXT-2095 +class LLPanelClassified : public LLPanel +{ +public: + LLPanelClassified(bool in_finder, bool from_search); + /*virtual*/ ~LLPanelClassified(); + + void reset(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void draw(); + + /*virtual*/ void refresh(); + + void apply(); + + // If can close, return TRUE. If cannot close, pop save/discard dialog + // and return FALSE. + BOOL canClose(); + + // Setup a new classified, including creating an id, giving a sane + // initial position, etc. + void initNewClassified(); + + void setClassifiedID(const LLUUID& id); + void setClickThroughText(const std::string& text); + static void setClickThrough(const LLUUID& classified_id, + S32 teleport, S32 map, S32 profile, bool from_new_table); + + // check that the title is valid (E.G. starts with a number or letter) + BOOL titleIsValid(); + + // Schedules the panel to request data + // from the server next time it is drawn. + void markForServerRequest(); + + std::string getClassifiedName(); + const LLUUID& getClassifiedID() const { return mClassifiedID; } + + void sendClassifiedInfoRequest(); + void sendClassifiedInfoUpdate(); + void resetDirty(); + + static void processClassifiedInfoReply(LLMessageSystem* msg, void**); + + // Confirmation dialogs flow in this order + bool confirmMature(const LLSD& notification, const LLSD& response); + void gotMature(); + static void callbackGotPriceForListing(S32 option, std::string text, void* data); + bool confirmPublish(const LLSD& notification, const LLSD& response); + + void sendClassifiedClickMessage(const std::string& type); + +protected: + bool saveCallback(const LLSD& notification, const LLSD& response); + + static void onClickUpdate(void* data); + static void onClickTeleport(void* data); + static void onClickMap(void* data); + static void onClickProfile(void* data); + static void onClickSet(void* data); + + static void focusReceived(LLFocusableElement* ctrl, void* data); + static void onCommitAny(LLUICtrl* ctrl, void* data); + + void setDefaultAccessCombo(); // Default AO and PG regions to proper classified access + + BOOL checkDirty(); // Update and return mDirty + +protected: + bool mInFinder; + bool mFromSearch; // from web-based "All" search sidebar + BOOL mDirty; + bool mForceClose; + bool mLocationChanged; + LLUUID mClassifiedID; + LLUUID mRequestedID; + LLUUID mCreatorID; + LLUUID mParcelID; + S32 mPriceForListing; + + // Needed for stat tracking + S32 mTeleportClicksOld; + S32 mMapClicksOld; + S32 mProfileClicksOld; + S32 mTeleportClicksNew; + S32 mMapClicksNew; + S32 mProfileClicksNew; + + // Data will be requested on first draw + BOOL mDataRequested; + + // For avatar panel classifieds only, has the user been charged + // yet for this classified? That is, have they saved once? + BOOL mPaidFor; + + std::string mSimName; + LLVector3d mPosGlobal; + + // Values the user may change + LLTextureCtrl* mSnapshotCtrl; + LLLineEditor* mNameEditor; + LLTextEditor* mDescEditor; + LLLineEditor* mLocationEditor; + LLComboBox* mCategoryCombo; + LLComboBox* mMatureCombo; + LLCheckBoxCtrl* mAutoRenewCheck; + + LLButton* mUpdateBtn; + LLButton* mTeleportBtn; + LLButton* mMapBtn; + LLButton* mProfileBtn; + + LLTextBox* mInfoText; + LLButton* mSetBtn; + LLTextBox* mClickThroughText; + + LLRect mSnapshotSize; + typedef std::list panel_list_t; + static panel_list_t sAllPanels; +}; + + +class LLFloaterPriceForListing +: public LLFloater +{ +public: + LLFloaterPriceForListing(); + virtual ~LLFloaterPriceForListing(); + virtual BOOL postBuild(); + + static void show( void (*callback)(S32 option, std::string value, void* userdata), void* userdata ); + +private: + static void onClickSetPrice(void*); + static void onClickCancel(void*); + static void buttonCore(S32 button, void* data); + +private: + void (*mCallback)(S32 option, std::string, void*); + void* mUserData; +}; class LLPublishClassifiedFloater : public LLFloater { diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index bf3bf38863..3952e80962 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -107,7 +107,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) { if( !objectp ) { - getChildView("button new script")->setEnabled(FALSE); + childSetEnabled("button new script",FALSE); return; } @@ -121,7 +121,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); // Edit script button - ok if object is editable and there's an unambiguous destination for the object. - getChildView("button new script")->setEnabled( + childSetEnabled("button new script", editable && all_volume && ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1) diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 90ed8b9e58..85bddab02c 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -838,15 +838,6 @@ void LLPanelEditWearable::draw() LLPanel::draw(); } -void LLPanelEditWearable::setVisible(BOOL visible) -{ - if (!visible) - { - showWearable(mWearablePtr, FALSE); - } - LLPanel::setVisible(visible); -} - void LLPanelEditWearable::setWearable(LLWearable *wearable) { showWearable(mWearablePtr, FALSE); @@ -1218,9 +1209,9 @@ void LLPanelEditWearable::toggleTypeSpecificControls(LLWearableType::EType type) // Toggle controls specific to shape editing panel. { bool is_shape = (type == LLWearableType::WT_SHAPE); - getChildView("sex_radio")->setVisible( is_shape); - getChildView("female_icon")->setVisible( is_shape); - getChildView("male_icon")->setVisible( is_shape); + childSetVisible("sex_radio", is_shape); + childSetVisible("female_icon", is_shape); + childSetVisible("male_icon", is_shape); } } @@ -1420,7 +1411,7 @@ void LLPanelEditWearable::updateVerbs() BOOL is_dirty = isDirty(); mBtnRevert->setEnabled(is_dirty); - getChildView("save_as_button")->setEnabled(is_dirty && can_copy); + childSetEnabled("save_as_button", is_dirty && can_copy); if(isAgentAvatarValid()) { diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 43513d8ab3..2d586276a6 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -71,8 +71,6 @@ public: void onSaveAsButtonClicked(); void saveAsCallback(const LLSD& notification, const LLSD& response); - virtual void setVisible(BOOL visible); - private: typedef std::map value_map_t; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 572e7a6212..c4bbdb37f8 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -388,8 +388,8 @@ void LLPanelFace::getState() BOOL editable = objectp->permModify(); // only turn on auto-adjust button if there is a media renderer and the media is loaded - getChildView("textbox autofix")->setEnabled(editable); - getChildView("button align")->setEnabled(editable); + childSetEnabled("textbox autofix", editable); + childSetEnabled("button align", editable); //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) @@ -399,7 +399,7 @@ void LLPanelFace::getState() // // //mBtnAutoFix->setEnabled ( editable ); // } - getChildView("button apply")->setEnabled(editable); + childSetEnabled("button apply",editable); bool identical; LLTextureCtrl* texture_ctrl = getChild("texture control"); @@ -439,8 +439,8 @@ void LLPanelFace::getState() if(LLViewerMedia::textureHasMedia(id)) { - getChildView("textbox autofix")->setEnabled(editable); - getChildView("button align")->setEnabled(editable); + childSetEnabled("textbox autofix",editable); + childSetEnabled("button align",editable); } if (identical) @@ -499,6 +499,8 @@ void LLPanelFace::getState() // Texture scale { + childSetEnabled("tex scale",editable); + //mLabelTexScale->setEnabled( editable ); F32 scale_s = 1.f; struct f2 : public LLSelectedTEGetFunctor { @@ -508,12 +510,12 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s ); - getChild("TexScaleU")->setValue(editable ? llabs(scale_s) : 0); - getChild("TexScaleU")->setTentative(LLSD((BOOL)(!identical))); - getChildView("TexScaleU")->setEnabled(editable); - getChild("checkbox flip s")->setValue(LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE ))); - getChild("checkbox flip s")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); - getChildView("checkbox flip s")->setEnabled(editable); + childSetValue("TexScaleU",editable ? llabs(scale_s) : 0); + childSetTentative("TexScaleU",LLSD((BOOL)(!identical))); + childSetEnabled("TexScaleU",editable); + childSetValue("checkbox flip s",LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE ))); + childSetTentative("checkbox flip s",LLSD((BOOL)((!identical) ? TRUE : FALSE ))); + childSetEnabled("checkbox flip s",editable); } { @@ -527,17 +529,17 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t ); - getChild("TexScaleV")->setValue(llabs(editable ? llabs(scale_t) : 0)); - getChild("TexScaleV")->setTentative(LLSD((BOOL)(!identical))); - getChildView("TexScaleV")->setEnabled(editable); - getChild("checkbox flip t")->setValue(LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE ))); - getChild("checkbox flip t")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); - getChildView("checkbox flip t")->setEnabled(editable); + childSetValue("TexScaleV",llabs(editable ? llabs(scale_t) : 0)); + childSetTentative("TexScaleV",LLSD((BOOL)(!identical))); + childSetEnabled("TexScaleV",editable); + childSetValue("checkbox flip t",LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE ))); + childSetTentative("checkbox flip t",LLSD((BOOL)((!identical) ? TRUE : FALSE ))); + childSetEnabled("checkbox flip t",editable); } // Texture offset { - getChildView("tex offset")->setEnabled(editable); + childSetEnabled("tex offset",editable); F32 offset_s = 0.f; struct f4 : public LLSelectedTEGetFunctor { @@ -547,9 +549,9 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s ); - getChild("TexOffsetU")->setValue(editable ? offset_s : 0); - getChild("TexOffsetU")->setTentative(!identical); - getChildView("TexOffsetU")->setEnabled(editable); + childSetValue("TexOffsetU", editable ? offset_s : 0); + childSetTentative("TexOffsetU",!identical); + childSetEnabled("TexOffsetU",editable); } { @@ -562,13 +564,14 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t ); - getChild("TexOffsetV")->setValue(editable ? offset_t : 0); - getChild("TexOffsetV")->setTentative(!identical); - getChildView("TexOffsetV")->setEnabled(editable); + childSetValue("TexOffsetV", editable ? offset_t : 0); + childSetTentative("TexOffsetV",!identical); + childSetEnabled("TexOffsetV",editable); } // Texture rotation { + childSetEnabled("tex rotate",editable); F32 rotation = 0.f; struct f6 : public LLSelectedTEGetFunctor { @@ -578,9 +581,9 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation ); - getChild("TexRot")->setValue(editable ? rotation * RAD_TO_DEG : 0); - getChild("TexRot")->setTentative(!identical); - getChildView("TexRot")->setEnabled(editable); + childSetValue("TexRot", editable ? rotation * RAD_TO_DEG : 0); + childSetTentative("TexRot",!identical); + childSetEnabled("TexRot",editable); } // Color swatch @@ -606,13 +609,13 @@ void LLPanelFace::getState() } // Color transparency { - getChildView("color trans")->setEnabled(editable); + childSetEnabled("color trans",editable); } F32 transparency = (1.f - color.mV[VALPHA]) * 100.f; { - getChild("ColorTrans")->setValue(editable ? transparency : 0); - getChildView("ColorTrans")->setEnabled(editable); + childSetValue("ColorTrans", editable ? transparency : 0); + childSetEnabled("ColorTrans",editable); } { @@ -626,10 +629,10 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, glow ); - getChild("glow")->setValue(glow); - getChildView("glow")->setEnabled(editable); - getChild("glow")->setTentative(!identical); - getChildView("glow label")->setEnabled(editable); + childSetValue("glow",glow); + childSetEnabled("glow",editable); + childSetTentative("glow",!identical); + childSetEnabled("glow label",editable); } @@ -654,9 +657,9 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; } - getChildView("combobox shininess")->setEnabled(editable); - getChild("combobox shininess")->setTentative(!identical); - getChildView("label shininess")->setEnabled(editable); + childSetEnabled("combobox shininess",editable); + childSetTentative("combobox shininess",!identical); + childSetEnabled("label shininess",editable); } { @@ -679,9 +682,9 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; } - getChildView("combobox bumpiness")->setEnabled(editable); - getChild("combobox bumpiness")->setTentative(!identical); - getChildView("label bumpiness")->setEnabled(editable); + childSetEnabled("combobox bumpiness",editable); + childSetTentative("combobox bumpiness",!identical); + childSetEnabled("label bumpiness",editable); } { @@ -705,14 +708,19 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl; } - getChildView("combobox texgen")->setEnabled(editable); - getChild("combobox texgen")->setTentative(!identical); - getChildView("tex gen")->setEnabled(editable); + childSetEnabled("combobox texgen",editable); + childSetTentative("combobox texgen",!identical); + childSetEnabled("tex gen",editable); if (selected_texgen == 1) { - getChild("TexScaleU")->setValue(2.0f * getChild("TexScaleU")->getValue().asReal() ); - getChild("TexScaleV")->setValue(2.0f * getChild("TexScaleV")->getValue().asReal() ); + childSetText("tex scale",getString("string repeats per meter")); + childSetValue("TexScaleU", 2.0f * childGetValue("TexScaleU").asReal() ); + childSetValue("TexScaleV", 2.0f * childGetValue("TexScaleV").asReal() ); + } + else + { + childSetText("tex scale",getString("string repeats per face")); } } @@ -728,14 +736,14 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf ); - getChild("checkbox fullbright")->setValue((S32)fullbrightf); - getChildView("checkbox fullbright")->setEnabled(editable); - getChild("checkbox fullbright")->setTentative(!identical); + childSetValue("checkbox fullbright",(S32)fullbrightf); + childSetEnabled("checkbox fullbright",editable); + childSetTentative("checkbox fullbright",!identical); } // Repeats per meter label { - getChildView("rpt")->setEnabled(editable); + childSetEnabled("rpt",editable); } // Repeats per meter @@ -755,14 +763,14 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats ); - getChild("rptctrl")->setValue(editable ? repeats : 0); - getChild("rptctrl")->setTentative(!identical); + childSetValue("rptctrl", editable ? repeats : 0); + childSetTentative("rptctrl",!identical); LLComboBox* mComboTexGen = getChild("combobox texgen"); if (mComboTexGen) { BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1); - getChildView("rptctrl")->setEnabled(enabled); - getChildView("button apply")->setEnabled(enabled); + childSetEnabled("rptctrl",enabled); + childSetEnabled("button apply",enabled); } } } @@ -786,19 +794,21 @@ void LLPanelFace::getState() mColorSwatch->setFallbackImageName("locked_image.j2c" ); mColorSwatch->setValid(FALSE); } - getChildView("color trans")->setEnabled(FALSE); - getChildView("rpt")->setEnabled(FALSE); - getChildView("tex offset")->setEnabled(FALSE); - getChildView("tex gen")->setEnabled(FALSE); - getChildView("label shininess")->setEnabled(FALSE); - getChildView("label bumpiness")->setEnabled(FALSE); - - getChildView("textbox autofix")->setEnabled(FALSE); - - getChildView("button align")->setEnabled(FALSE); - getChildView("button apply")->setEnabled(FALSE); - //getChildView("has media")->setEnabled(FALSE); - //getChildView("media info set")->setEnabled(FALSE); + childSetEnabled("color trans",FALSE); + childSetEnabled("rpt",FALSE); + childSetEnabled("tex scale",FALSE); + childSetEnabled("tex offset",FALSE); + childSetEnabled("tex rotate",FALSE); + childSetEnabled("tex gen",FALSE); + childSetEnabled("label shininess",FALSE); + childSetEnabled("label bumpiness",FALSE); + + childSetEnabled("textbox autofix",FALSE); + + childSetEnabled("button align",FALSE); + childSetEnabled("button apply",FALSE); + //childSetEnabled("has media", FALSE); + //childSetEnabled("media info set", FALSE); } } @@ -928,7 +938,7 @@ void LLPanelFace::onClickApply(void* userdata) gFocusMgr.setKeyboardFocus( NULL ); //F32 repeats_per_meter = self->mCtrlRepeatsPerMeter->get(); - F32 repeats_per_meter = (F32)self->getChild("rptctrl")->getValue().asReal();//self->mCtrlRepeatsPerMeter->get(); + F32 repeats_per_meter = (F32)self->childGetValue( "rptctrl" ).asReal();//self->mCtrlRepeatsPerMeter->get(); LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter ); } diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index 2660814afc..e71e57130f 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -38,7 +38,7 @@ LLPanelGenericTip::LLPanelGenericTip( { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_generic_tip.xml"); - getChild("message")->setValue(notification->getMessage()); + childSetValue("message", notification->getMessage()); S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index e42057e93a..347937af01 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -419,14 +419,19 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild("prepend_founded_by")->setVisible(!is_null_group_id); - LLAccordionCtrl* tab_ctrl = getChild("groups_accordion"); - tab_ctrl->reset(); + LLAccordionCtrl* tab_ctrl = findChild("group_accordion"); + if(tab_ctrl) + tab_ctrl->reset(); - LLAccordionCtrlTab* tab_general = getChild("group_general_tab"); - LLAccordionCtrlTab* tab_roles = getChild("group_roles_tab"); - LLAccordionCtrlTab* tab_notices = getChild("group_notices_tab"); - LLAccordionCtrlTab* tab_land = getChild("group_land_tab"); + LLAccordionCtrlTab* tab_general = findChild("group_general_tab"); + LLAccordionCtrlTab* tab_roles = findChild("group_roles_tab"); + LLAccordionCtrlTab* tab_notices = findChild("group_notices_tab"); + LLAccordionCtrlTab* tab_land = findChild("group_land_tab"); + + if(!tab_general || !tab_roles || !tab_notices || !tab_land) + return; + if(mButtonJoin) mButtonJoin->setVisible(false); @@ -487,8 +492,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) button_chat->setVisible(is_member); } - tab_ctrl->arrange(); - reposButtons(); update(GC_ALL);//show/hide "join" button if data is already ready } @@ -539,7 +542,6 @@ void LLPanelGroup::draw() { mRefreshTimer.stop(); childEnable("btn_refresh"); - childEnable("groups_accordion"); } LLButton* button_apply = findChild("btn_apply"); @@ -568,8 +570,6 @@ void LLPanelGroup::refreshData() // 5 second timeout childDisable("btn_refresh"); - childDisable("groups_accordion"); - mRefreshTimer.start(); mRefreshTimer.setTimerExpirySec(5); } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 840b98213d..3c752f7606 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -178,7 +178,8 @@ BOOL LLPanelGroupGeneral::postBuild() mComboActiveTitle = getChild("active_title", recurse); if (mComboActiveTitle) { - mComboActiveTitle->setCommitCallback(onCommitAny, this); + mComboActiveTitle->setCommitCallback(onCommitTitle, this); + mComboActiveTitle->resetDirty(); } mIncompleteMemberDataStr = getString("incomplete_member_data_str"); @@ -270,6 +271,16 @@ void LLPanelGroupGeneral::onCommitEnrollment(LLUICtrl* ctrl, void* data) } } +// static +void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data) +{ + LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; + if (self->mGroupID.isNull() || !self->mAllowEdit) return; + LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID()); + self->update(GC_TITLES); + self->mComboActiveTitle->resetDirty(); +} + // static void LLPanelGroupGeneral::onClickInfo(void *userdata) { @@ -339,13 +350,6 @@ void LLPanelGroupGeneral::draw() bool LLPanelGroupGeneral::apply(std::string& mesg) { - if (!mGroupID.isNull() && mAllowEdit && mComboActiveTitle && mComboActiveTitle->isDirty()) - { - LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID()); - update(GC_TITLES); - mComboActiveTitle->resetDirty(); - } - BOOL has_power_in_group = gAgent.hasPowerInGroup(mGroupID,GP_GROUP_CHANGE_IDENTITY); if (has_power_in_group || mGroupID.isNull()) diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index cbf173f845..3a2079d228 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -71,6 +71,7 @@ private: static void onFocusEdit(LLFocusableElement* ctrl, void* data); static void onCommitAny(LLUICtrl* ctrl, void* data); static void onCommitUserOnly(LLUICtrl* ctrl, void* data); + static void onCommitTitle(LLUICtrl* ctrl, void* data); static void onCommitEnrollment(LLUICtrl* ctrl, void* data); static void onClickInfo(void* userdata); static void onReceiveNotices(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index d4736d22ae..3514664f01 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -365,7 +365,7 @@ void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max) { - mPanel.getChild("your_contribution_max_value")->setTextArg("[AMOUNT]", llformat("%d", max)); + mPanel.childSetTextArg("your_contribution_max_value", "[AMOUNT]", llformat("%d", max)); } //static @@ -427,14 +427,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) S32 total_contribution; msg->getS32("QueryData", "ActualArea", total_contribution, 0); - mPanel.getChild("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution)); + mPanel.childSetTextArg("total_contributed_land_value", "[AREA]", llformat("%d", total_contribution)); S32 committed; msg->getS32("QueryData", "BillableArea", committed, 0); - mPanel.getChild("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed)); + mPanel.childSetTextArg("total_land_in_use_value", "[AREA]", llformat("%d", committed)); S32 available = total_contribution - committed; - mPanel.getChild("land_available_value")->setTextArg("[AREA]", llformat("%d", available)); + mPanel.childSetTextArg("land_available_value", "[AREA]", llformat("%d", available)); if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) { diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 7489c02d8d..9dc31f770f 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -83,7 +83,7 @@ void LLPanelChatControlPanel::updateCallButton() if (!session) { - getChildView("call_btn")->setEnabled(false); + childSetEnabled("call_btn", false); return; } @@ -93,14 +93,14 @@ void LLPanelChatControlPanel::updateCallButton() BOOL enable_connect = session_initialized && voice_enabled && callback_enabled; - getChildView("call_btn")->setEnabled(enable_connect); + childSetEnabled("call_btn", enable_connect); } void LLPanelChatControlPanel::updateButtons(bool is_call_started) { - getChildView("end_call_btn_panel")->setVisible( is_call_started); - getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); - getChildView("call_btn_panel")->setVisible( ! is_call_started); + childSetVisible("end_call_btn_panel", is_call_started); + childSetVisible("voice_ctrls_btn_panel", is_call_started); + childSetVisible("call_btn_panel", ! is_call_started); updateCallButton(); } @@ -156,7 +156,7 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); - getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); @@ -209,12 +209,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. - getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mAvatarID)) { - getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); } getChild("avatar_icon")->setValue(mAvatarID); @@ -225,24 +225,24 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) im_model.findIMSession(session_id); if( im_session && !im_session->mOtherParticipantIsAvatar ) { - getChildView("view_profile_btn")->setEnabled(FALSE); - getChildView("add_friend_btn")->setEnabled(FALSE); + childSetEnabled("view_profile_btn", FALSE); + childSetEnabled("add_friend_btn", FALSE); - getChildView("share_btn")->setEnabled(FALSE); - getChildView("teleport_btn")->setEnabled(FALSE); - getChildView("pay_btn")->setEnabled(FALSE); + childSetEnabled("share_btn", FALSE); + childSetEnabled("teleport_btn", FALSE); + childSetEnabled("pay_btn", FALSE); } } //virtual void LLPanelIMControlPanel::changed(U32 mask) { - getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mAvatarID)) { - getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); } } diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 04c1a86f69..e5c598d019 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -58,14 +58,15 @@ public: BOOL LLPanelLandInfo::postBuild() { - childSetAction("button buy land",boost::bind(onClickClaim)); - childSetAction("button abandon land", boost::bind(onClickRelease)); - childSetAction("button subdivide land", boost::bind(onClickDivide)); - childSetAction("button join land", boost::bind(onClickJoin)); - childSetAction("button about land", boost::bind(onClickAbout)); + + childSetAction("button buy land",onClickClaim,this); + childSetAction("button abandon land",onClickRelease,this); + childSetAction("button subdivide land",onClickDivide,this); + childSetAction("button join land",onClickJoin,this); + childSetAction("button about land",onClickAbout,this); mCheckShowOwners = getChild("checkbox show owners"); - getChild("checkbox show owners")->setValue(gSavedSettings.getBOOL("ShowParcelOwners")); + childSetValue("checkbox show owners", gSavedSettings.getBOOL("ShowParcelOwners")); return TRUE; } @@ -119,17 +120,17 @@ void LLPanelLandInfo::refresh() if (!parcel || !regionp) { // nothing selected, disable panel - getChildView("label_area_price")->setVisible(false); - getChildView("label_area")->setVisible(false); + childSetVisible("label_area_price",false); + childSetVisible("label_area",false); //mTextPrice->setText(LLStringUtil::null); - getChild("textbox price")->setValue(LLStringUtil::null); + childSetText("textbox price",LLStringUtil::null); - getChildView("button buy land")->setEnabled(FALSE); - getChildView("button abandon land")->setEnabled(FALSE); - getChildView("button subdivide land")->setEnabled(FALSE); - getChildView("button join land")->setEnabled(FALSE); - getChildView("button about land")->setEnabled(FALSE); + childSetEnabled("button buy land",FALSE); + childSetEnabled("button abandon land",FALSE); + childSetEnabled("button subdivide land",FALSE); + childSetEnabled("button join land",FALSE); + childSetEnabled("button about land",FALSE); } else { @@ -147,11 +148,11 @@ void LLPanelLandInfo::refresh() if (is_public) { - getChildView("button buy land")->setEnabled(TRUE); + childSetEnabled("button buy land",TRUE); } else { - getChildView("button buy land")->setEnabled(can_buy); + childSetEnabled("button buy land",can_buy); } BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE); @@ -163,16 +164,16 @@ void LLPanelLandInfo::refresh() BOOL manager_divideable = ( gAgent.canManageEstate() && ((parcel->getOwnerID() == regionp->getOwner()) || owner_divide) ); - getChildView("button abandon land")->setEnabled(owner_release || manager_releaseable || gAgent.isGodlike()); + childSetEnabled("button abandon land",owner_release || manager_releaseable || gAgent.isGodlike()); // only mainland sims are subdividable by owner if (regionp->getRegionFlags() && REGION_FLAGS_ALLOW_PARCEL_CHANGES) { - getChildView("button subdivide land")->setEnabled(owner_divide || manager_divideable || gAgent.isGodlike()); + childSetEnabled("button subdivide land",owner_divide || manager_divideable || gAgent.isGodlike()); } else { - getChildView("button subdivide land")->setEnabled(manager_divideable || gAgent.isGodlike()); + childSetEnabled("button subdivide land",manager_divideable || gAgent.isGodlike()); } // To join land, must have something selected, @@ -183,15 +184,15 @@ void LLPanelLandInfo::refresh() //&& LLViewerParcelMgr::getInstance()->getSelfCount() > 1 && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) { - getChildView("button join land")->setEnabled(TRUE); + childSetEnabled("button join land",TRUE); } else { lldebugs << "Invalid selection for joining land" << llendl; - getChildView("button join land")->setEnabled(FALSE); + childSetEnabled("button join land",FALSE); } - getChildView("button about land")->setEnabled(TRUE); + childSetEnabled("button about land",TRUE); // show pricing information S32 area; @@ -206,48 +207,48 @@ void LLPanelLandInfo::refresh() &dwell); if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())) { - getChild("label_area_price")->setTextArg("[PRICE]", llformat("%d",claim_price)); - getChild("label_area_price")->setTextArg("[AREA]", llformat("%d",area)); - getChildView("label_area_price")->setVisible(true); - getChildView("label_area")->setVisible(false); + childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price)); + childSetTextArg("label_area_price","[AREA]", llformat("%d",area)); + childSetVisible("label_area_price",true); + childSetVisible("label_area",false); } else { - getChildView("label_area_price")->setVisible(false); - getChild("label_area")->setTextArg("[AREA]", llformat("%d",area)); - getChildView("label_area")->setVisible(true); + childSetVisible("label_area_price",false); + childSetTextArg("label_area","[AREA]", llformat("%d",area)); + childSetVisible("label_area",true); } } } //static -void LLPanelLandInfo::onClickClaim() +void LLPanelLandInfo::onClickClaim(void*) { LLViewerParcelMgr::getInstance()->startBuyLand(); } //static -void LLPanelLandInfo::onClickRelease() +void LLPanelLandInfo::onClickRelease(void*) { LLViewerParcelMgr::getInstance()->startReleaseLand(); } // static -void LLPanelLandInfo::onClickDivide() +void LLPanelLandInfo::onClickDivide(void*) { LLViewerParcelMgr::getInstance()->startDivideLand(); } // static -void LLPanelLandInfo::onClickJoin() +void LLPanelLandInfo::onClickJoin(void*) { LLViewerParcelMgr::getInstance()->startJoinLand(); } //static -void LLPanelLandInfo::onClickAbout() +void LLPanelLandInfo::onClickAbout(void*) { // Promote the rectangle selection to a parcel selection if (!LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) diff --git a/indra/newview/llpanelland.h b/indra/newview/llpanelland.h index 2ab1618d47..7051289393 100644 --- a/indra/newview/llpanelland.h +++ b/indra/newview/llpanelland.h @@ -49,13 +49,22 @@ public: LLCheckBoxCtrl *mCheckShowOwners; protected: - static void onClickClaim(); - static void onClickRelease(); - static void onClickDivide(); - static void onClickJoin(); - static void onClickAbout(); + static void onClickClaim(void*); + static void onClickRelease(void*); + static void onClickDivide(void*); + static void onClickJoin(void*); + static void onClickAbout(void*); protected: + //LLTextBox* mTextPriceLabel; + //LLTextBox* mTextPrice; + + //LLButton* mBtnClaimLand; + //LLButton* mBtnReleaseLand; + //LLButton* mBtnDivideLand; + //LLButton* mBtnJoinLand; + //LLButton* mBtnAbout; + virtual BOOL postBuild(); static LLPanelLandSelectObserver* sObserver; diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index b69cee9586..e6281f4605 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -117,54 +117,11 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) switch(type) { case CREATE_LANDMARK: - { mCurrentTitle = getString("title_create_landmark"); mLandmarkTitle->setVisible(FALSE); mLandmarkTitleEditor->setVisible(TRUE); mNotesEditor->setEnabled(TRUE); - - LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); - std::string name = parcel_mgr->getAgentParcelName(); - LLVector3 agent_pos = gAgent.getPositionAgent(); - - if (name.empty()) - { - S32 region_x = llround(agent_pos.mV[VX]); - S32 region_y = llround(agent_pos.mV[VY]); - S32 region_z = llround(agent_pos.mV[VZ]); - - std::string region_name; - LLViewerRegion* region = parcel_mgr->getSelectionRegion(); - if (region) - { - region_name = region->getName(); - } - else - { - region_name = getString("unknown"); - } - - mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)", - region_name.c_str(), region_x, region_y, region_z)); - } - else - { - mLandmarkTitleEditor->setText(name); - } - - std::string desc; - LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); - mNotesEditor->setText(desc); - - // Moved landmark creation here from LLPanelLandmarkInfo::processParcelInfo() - // because we use only agent's current coordinates instead of waiting for - // remote parcel request to complete. - if (!LLLandmarkActions::landmarkAlreadyExists()) - { - createLandmark(LLUUID()); - } - } break; case LANDMARK: @@ -229,6 +186,28 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) info["global_y"] = parcel_data.global_y; info["global_z"] = parcel_data.global_z; notifyParent(info); + + if (mInfoType == CREATE_LANDMARK) + { + if (parcel_data.name.empty()) + { + mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z)); + } + else + { + mLandmarkTitleEditor->setText(parcel_data.name); + } + + std::string desc; + LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent()); + mNotesEditor->setText(desc); + + if (!LLLandmarkActions::landmarkAlreadyExists()) + { + createLandmark(mFolderCombo->getValue().asUUID()); + } + } } void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 43814ac652..d825071825 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -716,8 +716,8 @@ void LLLandmarksPanel::updateListCommands() bool trash_enabled = isActionEnabled("delete"); // keep Options & Add Landmark buttons always enabled - mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled); - mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled); + mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); + mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled); } void LLLandmarksPanel::onActionsButtonClick() diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index f17defda55..ef15f971c9 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -139,7 +139,7 @@ void LLPanelLandMedia::refresh() mMediaURLEdit->setText(parcel->getMediaURL()); mMediaURLEdit->setEnabled( FALSE ); - getChild("current_url")->setValue(parcel->getMediaCurrentURL()); + childSetText("current_url", parcel->getMediaCurrentURL()); mMediaDescEdit->setText(parcel->getMediaDesc()); mMediaDescEdit->setEnabled( can_change_media ); @@ -151,7 +151,7 @@ void LLPanelLandMedia::refresh() } setMediaType(mime_type); mMediaTypeCombo->setEnabled( can_change_media ); - getChild("mime_type")->setValue(mime_type); + childSetText("mime_type", mime_type); mMediaUrlCheck->set( parcel->getObscureMedia() ); mMediaUrlCheck->setEnabled( can_change_media ); @@ -249,7 +249,7 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type) // localizable - "none" for example (see EXT-6542) mime_str = LLMIMETypes::getDefaultMimeTypeTranslation(); } - getChild("mime_type")->setValue(mime_str); + childSetText("mime_type", mime_str); } void LLPanelLandMedia::setMediaURL(const std::string& media_url) @@ -263,7 +263,7 @@ void LLPanelLandMedia::setMediaURL(const std::string& media_url) mMediaURLEdit->onCommit(); // LLViewerParcelMedia::sendMediaNavigateMessage(media_url); - getChild("current_url")->setValue(media_url); + childSetText("current_url", media_url); } std::string LLPanelLandMedia::getMediaURL() { @@ -274,11 +274,11 @@ std::string LLPanelLandMedia::getMediaURL() void LLPanelLandMedia::onCommitType(LLUICtrl *ctrl, void *userdata) { LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; - std::string current_type = LLMIMETypes::widgetType(self->getChild("mime_type")->getValue().asString()); + std::string current_type = LLMIMETypes::widgetType(self->childGetText("mime_type")); std::string new_type = self->mMediaTypeCombo->getValue(); if(current_type != new_type) { - self->getChild("mime_type")->setValue(LLMIMETypes::findDefaultMimeType(new_type)); + self->childSetText("mime_type", LLMIMETypes::findDefaultMimeType(new_type)); } onCommitAny(ctrl, userdata); @@ -298,7 +298,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) // Extract data from UI std::string media_url = self->mMediaURLEdit->getText(); std::string media_desc = self->mMediaDescEdit->getText(); - std::string mime_type = self->getChild("mime_type")->getValue().asString(); + std::string mime_type = self->childGetText("mime_type"); U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); U8 media_loop = self->mMediaLoopCheck->get(); U8 obscure_media = self->mMediaUrlCheck->get(); @@ -307,7 +307,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); - self->getChild("mime_type")->setValue(mime_type); + self->childSetText("mime_type", mime_type); // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(media_url); @@ -348,7 +348,7 @@ void LLPanelLandMedia::onResetBtn(void *userdata) LLParcel* parcel = self->mParcel->getParcel(); // LLViewerMedia::navigateHome(); self->refresh(); - self->getChild("current_url")->setValue(parcel->getMediaURL()); + self->childSetText("current_url", parcel->getMediaURL()); // LLViewerParcelMedia::sendMediaNavigateMessage(parcel->getMediaURL()); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index be1afbd8d7..3af38f35ef 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -205,7 +205,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - getChild("username_edit")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("username_edit", LLTextValidate::validateASCIIPrintableNoPipe); getChild("password_edit")->setKeystrokeCallback(onPassKey, this); // change z sort of clickable text to be behind buttons @@ -435,8 +435,8 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string username = sInstance->getChild("username_edit")->getValue().asString(); - std::string pass = sInstance->getChild("password_edit")->getValue().asString(); + std::string username = sInstance->childGetText("username_edit"); + std::string pass = sInstance->childGetText("password_edit"); BOOL have_username = !username.empty(); BOOL have_pass = !pass.empty(); @@ -466,7 +466,7 @@ void LLPanelLogin::giveFocus() // static void LLPanelLogin::showLoginWidgets() { - sInstance->getChildView("login_widgets")->setVisible( true); + sInstance->childSetVisible("login_widgets", true); LLMediaCtrl* web_browser = sInstance->getChild("login_html"); sInstance->reshapeBrowser(); // *TODO: Append all the usual login parameters, like first_login=Y etc. @@ -508,16 +508,16 @@ void LLPanelLogin::setFields(LLPointer credential, LLSD identifier = credential->getIdentifier(); if((std::string)identifier["type"] == "agent") { - sInstance->getChild("username_edit")->setValue((std::string)identifier["first_name"] + " " + + sInstance->childSetText("username_edit", (std::string)identifier["first_name"] + " " + (std::string)identifier["last_name"]); } else if((std::string)identifier["type"] == "account") { - sInstance->getChild("username_edit")->setValue((std::string)identifier["account_name"]); + sInstance->childSetText("username_edit", (std::string)identifier["account_name"]); } else { - sInstance->getChild("username_edit")->setValue(std::string()); + sInstance->childSetText("username_edit", std::string()); } // if the password exists in the credential, set the password field with // a filler to get some stars @@ -533,13 +533,13 @@ void LLPanelLogin::setFields(LLPointer credential, // fill it with MAX_PASSWORD characters so we get a // nice row of asterixes. const std::string filler("123456789!123456"); - sInstance->getChild("password_edit")->setValue(std::string("123456789!123456")); + sInstance->childSetText("password_edit", std::string("123456789!123456")); } else { - sInstance->getChild("password_edit")->setValue(std::string()); + sInstance->childSetText("password_edit", std::string()); } - sInstance->getChild("remember_check")->setValue(remember); + sInstance->childSetValue("remember_check", remember); } @@ -566,9 +566,9 @@ void LLPanelLogin::getFields(LLPointer& credential, authenticator = credential->getAuthenticator(); } - std::string username = sInstance->getChild("username_edit")->getValue().asString(); + std::string username = sInstance->childGetText("username_edit"); LLStringUtil::trim(username); - std::string password = sInstance->getChild("password_edit")->getValue().asString(); + std::string password = sInstance->childGetText("password_edit"); LL_INFOS2("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL; // determine if the username is a first/last form or not. @@ -615,7 +615,7 @@ void LLPanelLogin::getFields(LLPointer& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - remember = sInstance->getChild("remember_check")->getValue(); + remember = sInstance->childGetValue("remember_check"); } // static @@ -643,9 +643,9 @@ BOOL LLPanelLogin::areCredentialFieldsDirty() } else { - std::string username = sInstance->getChild("username_edit")->getValue().asString(); + std::string username = sInstance->childGetText("username_edit"); LLStringUtil::trim(username); - std::string password = sInstance->getChild("password_edit")->getValue().asString(); + std::string password = sInstance->childGetText("password_edit"); LLLineEditor* ctrl = sInstance->getChild("username_edit"); if(ctrl && ctrl->isDirty()) { @@ -693,12 +693,12 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) if ( ! force_visible ) show_start = gSavedSettings.getBOOL("ShowStartLocation"); - sInstance->getChildView("start_location_combo")->setVisible( show_start); - sInstance->getChildView("start_location_text")->setVisible( show_start); + sInstance->childSetVisible("start_location_combo", show_start); + sInstance->childSetVisible("start_location_text", show_start); BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); - sInstance->getChildView("server_combo_text")->setVisible( show_server); - sInstance->getChildView("server_combo")->setVisible( show_server); + sInstance->childSetVisible("server_combo_text", show_server); + sInstance->childSetVisible("server_combo", show_server); } // static @@ -958,7 +958,7 @@ void LLPanelLogin::onClickConnect(void *) return; } updateStartSLURL(); - std::string username = sInstance->getChild("username_edit")->getValue().asString(); + std::string username = sInstance->childGetText("username_edit"); if(username.empty()) @@ -1073,7 +1073,7 @@ void LLPanelLogin::updateServer() if(sInstance && !sInstance->areCredentialFieldsDirty()) { LLPointer credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid()); - bool remember = sInstance->getChild("remember_check")->getValue(); + bool remember = sInstance->childGetValue("remember_check"); sInstance->setFields(credential, remember); } // grid changed so show new splash screen (possibly) @@ -1167,6 +1167,6 @@ void LLPanelLogin::updateLoginPanelLinks() // need to call through sInstance, as it's called from onSelectServer, which // is static. - sInstance->getChildView("create_new_account_text")->setVisible( system_grid); - sInstance->getChildView("forgot_password_text")->setVisible( system_grid); + sInstance->childSetVisible("create_new_account_text", system_grid); + sInstance->childSetVisible("forgot_password_text", system_grid); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 27e054af34..f5e33034a3 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -39,7 +39,6 @@ #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" -#include "lloutfitobserver.h" #include "llpreviewtexture.h" #include "llresmgr.h" #include "llscrollcontainer.h" @@ -485,7 +484,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) void LLPanelMainInventory::onFilterSelected() { // Find my index - mActivePanel = (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + mActivePanel = (LLInventoryPanel*)childGetVisibleTab("inventory filter tabs"); if (!mActivePanel) { @@ -493,7 +492,7 @@ void LLPanelMainInventory::onFilterSelected() } BOOL recent_active = ("Recent Items" == mActivePanel->getName()); - getChildView("add_btn_panel")->setVisible( !recent_active); + childSetVisible("add_btn_panel", !recent_active); setFilterSubString(mFilterSubString); LLInventoryFilter* filter = mActivePanel->getFilter(); @@ -585,7 +584,7 @@ void LLPanelMainInventory::updateItemcountText() { text = getString("ItemcountUnknown"); } - getChild("ItemcountText")->setValue(text); + childSetText("ItemcountText",text); } void LLPanelMainInventory::setFilterTextFromFilter() @@ -652,7 +651,7 @@ void LLFloaterInventoryFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_dat LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data; if (!self) return; - bool since_logoff= self->getChild("check_since_logoff")->getValue(); + bool since_logoff= self->childGetValue("check_since_logoff"); if (!since_logoff && !( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) ) @@ -692,7 +691,7 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) { since_logoff = false; } - self->getChild("check_since_logoff")->setValue(since_logoff); + self->childSetValue("check_since_logoff", since_logoff); } void LLFloaterInventoryFinder::changeFilter(LLInventoryFilter* filter) @@ -715,20 +714,20 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() // update the ui elements setTitle(mFilter->getName()); - getChild("check_animation")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); - - getChild("check_calling_card")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); - getChild("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); - getChild("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); - getChild("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); - getChild("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); - getChild("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); - getChild("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); - getChild("check_sound")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); - getChild("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); - getChild("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); - getChild("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); - getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); + childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); + + childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); + childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); + childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); + childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); + childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); + childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); + childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); + childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); + childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); + childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); + childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + childSetValue("check_since_logoff", mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); } @@ -739,32 +738,32 @@ void LLFloaterInventoryFinder::draw() U32 filter = 0xffffffff; BOOL filtered_by_all_types = TRUE; - if (!getChild("check_animation")->getValue()) + if (!childGetValue("check_animation")) { filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); filtered_by_all_types = FALSE; } - if (!getChild("check_calling_card")->getValue()) + if (!childGetValue("check_calling_card")) { filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); filtered_by_all_types = FALSE; } - if (!getChild("check_clothing")->getValue()) + if (!childGetValue("check_clothing")) { filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); filtered_by_all_types = FALSE; } - if (!getChild("check_gesture")->getValue()) + if (!childGetValue("check_gesture")) { filter &= ~(0x1 << LLInventoryType::IT_GESTURE); filtered_by_all_types = FALSE; } - if (!getChild("check_landmark")->getValue()) + if (!childGetValue("check_landmark")) { @@ -772,38 +771,38 @@ void LLFloaterInventoryFinder::draw() filtered_by_all_types = FALSE; } - if (!getChild("check_notecard")->getValue()) + if (!childGetValue("check_notecard")) { filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); filtered_by_all_types = FALSE; } - if (!getChild("check_object")->getValue()) + if (!childGetValue("check_object")) { filter &= ~(0x1 << LLInventoryType::IT_OBJECT); filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); filtered_by_all_types = FALSE; } - if (!getChild("check_script")->getValue()) + if (!childGetValue("check_script")) { filter &= ~(0x1 << LLInventoryType::IT_LSL); filtered_by_all_types = FALSE; } - if (!getChild("check_sound")->getValue()) + if (!childGetValue("check_sound")) { filter &= ~(0x1 << LLInventoryType::IT_SOUND); filtered_by_all_types = FALSE; } - if (!getChild("check_texture")->getValue()) + if (!childGetValue("check_texture")) { filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); filtered_by_all_types = FALSE; } - if (!getChild("check_snapshot")->getValue()) + if (!childGetValue("check_snapshot")) { filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); filtered_by_all_types = FALSE; @@ -843,12 +842,12 @@ void LLFloaterInventoryFinder::draw() BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { - return getChild("check_show_empty")->getValue(); + return childGetValue("check_show_empty"); } BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() { - return getChild("check_since_logoff")->getValue(); + return childGetValue("check_since_logoff"); } void LLFloaterInventoryFinder::onCloseBtn(void* user_data) @@ -863,17 +862,17 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->getChild("check_animation")->setValue(TRUE); - self->getChild("check_calling_card")->setValue(TRUE); - self->getChild("check_clothing")->setValue(TRUE); - self->getChild("check_gesture")->setValue(TRUE); - self->getChild("check_landmark")->setValue(TRUE); - self->getChild("check_notecard")->setValue(TRUE); - self->getChild("check_object")->setValue(TRUE); - self->getChild("check_script")->setValue(TRUE); - self->getChild("check_sound")->setValue(TRUE); - self->getChild("check_texture")->setValue(TRUE); - self->getChild("check_snapshot")->setValue(TRUE); + self->childSetValue("check_animation", TRUE); + self->childSetValue("check_calling_card", TRUE); + self->childSetValue("check_clothing", TRUE); + self->childSetValue("check_gesture", TRUE); + self->childSetValue("check_landmark", TRUE); + self->childSetValue("check_notecard", TRUE); + self->childSetValue("check_object", TRUE); + self->childSetValue("check_script", TRUE); + self->childSetValue("check_sound", TRUE); + self->childSetValue("check_texture", TRUE); + self->childSetValue("check_snapshot", TRUE); } //static @@ -882,17 +881,17 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->getChild("check_animation")->setValue(FALSE); - self->getChild("check_calling_card")->setValue(FALSE); - self->getChild("check_clothing")->setValue(FALSE); - self->getChild("check_gesture")->setValue(FALSE); - self->getChild("check_landmark")->setValue(FALSE); - self->getChild("check_notecard")->setValue(FALSE); - self->getChild("check_object")->setValue(FALSE); - self->getChild("check_script")->setValue(FALSE); - self->getChild("check_sound")->setValue(FALSE); - self->getChild("check_texture")->setValue(FALSE); - self->getChild("check_snapshot")->setValue(FALSE); + self->childSetValue("check_animation", FALSE); + self->childSetValue("check_calling_card", FALSE); + self->childSetValue("check_clothing", FALSE); + self->childSetValue("check_gesture", FALSE); + self->childSetValue("check_landmark", FALSE); + self->childSetValue("check_notecard", FALSE); + self->childSetValue("check_object", FALSE); + self->childSetValue("check_script", FALSE); + self->childSetValue("check_sound", FALSE); + self->childSetValue("check_texture", FALSE); + self->childSetValue("check_snapshot", FALSE); } ////////////////////////////////////////////////////////////////////////////////// @@ -915,9 +914,6 @@ void LLPanelMainInventory::initListCommandsHandlers() mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - - // Update the trash button when selected item(s) get worn or taken off. - LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); } void LLPanelMainInventory::updateListCommands() diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 5cd4cea96d..50f0a14995 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -140,10 +140,10 @@ void LLPanelMe::onSaveChangesClicked() data.avatar_id = gAgent.getID(); data.image_id = mEditPanel->getChild(PICKER_SECOND_LIFE)->getImageAssetID(); data.fl_image_id = mEditPanel->getChild(PICKER_FIRST_LIFE)->getImageAssetID(); - data.about_text = mEditPanel->getChild("sl_description_edit")->getValue().asString(); - data.fl_about_text = mEditPanel->getChild("fl_description_edit")->getValue().asString(); - data.profile_url = mEditPanel->getChild("homepage_edit")->getValue().asString(); - data.allow_publish = mEditPanel->getChild("show_in_search_checkbox")->getValue(); + data.about_text = mEditPanel->childGetValue("sl_description_edit").asString(); + data.fl_about_text = mEditPanel->childGetValue("fl_description_edit").asString(); + data.profile_url = mEditPanel->childGetValue("homepage_edit").asString(); + data.allow_publish = mEditPanel->childGetValue("show_in_search_checkbox"); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data); togglePanel(mEditPanel); // close @@ -199,20 +199,20 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d // 'Home page' was hidden in LLPanelAvatarProfile::fillCommonData() to fix EXT-4734 // Show 'Home page' in Edit My Profile (EXT-4873) - getChildView("homepage_edit")->setVisible( true); + childSetVisible("homepage_edit", true); fillPartnerData(avatar_data); fillAccountStatus(avatar_data); - getChild("show_in_search_checkbox")->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); + childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); std::string first, last; BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last); if (found) { - getChild("name_text")->setTextArg("[FIRST]", first); - getChild("name_text")->setTextArg("[LAST]", last); + childSetTextArg("name_text", "[FIRST]", first); + childSetTextArg("name_text", "[LAST]", last); } } @@ -220,8 +220,8 @@ BOOL LLPanelMyProfileEdit::postBuild() { initTexturePickerMouseEvents(); - getChild("partner_edit_link")->setTextArg("[URL]", getString("partner_edit_link_url")); - getChild("my_account_link")->setTextArg("[URL]", getString("my_account_link_url")); + childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url")); + childSetTextArg("my_account_link", "[URL]", getString("my_account_link_url")); return LLPanelAvatarProfile::postBuild(); } @@ -250,8 +250,8 @@ void LLPanelMyProfileEdit::resetData() { LLPanelMyProfile::resetData(); - getChild("name_text")->setTextArg("[FIRST]", LLStringUtil::null); - getChild("name_text")->setTextArg("[LAST]", LLStringUtil::null); + childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); + childSetTextArg("name_text", "[LAST]", LLStringUtil::null); } void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) @@ -265,10 +265,10 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) void LLPanelMyProfileEdit::enableEditing(bool enable) { - getChildView("2nd_life_pic")->setEnabled(enable); - getChildView("real_world_pic")->setEnabled(enable); - getChildView("sl_description_edit")->setEnabled(enable); - getChildView("fl_description_edit")->setEnabled(enable); - getChildView("homepage_edit")->setEnabled(enable); - getChildView("show_in_search_checkbox")->setEnabled(enable); + childSetEnabled("2nd_life_pic", enable); + childSetEnabled("real_world_pic", enable); + childSetEnabled("sl_description_edit", enable); + childSetEnabled("fl_description_edit", enable); + childSetEnabled("homepage_edit", enable); + childSetEnabled("show_in_search_checkbox", enable); } diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 92c8365a70..3d79e104af 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -125,13 +125,13 @@ void LLPanelMediaSettingsGeneral::draw() // enable/disable pixel values image entry based on auto scale checkbox if ( mAutoScale->getValue().asBoolean() == false ) { - getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( true ); - getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( true ); + childSetEnabled( LLMediaEntry::WIDTH_PIXELS_KEY, true ); + childSetEnabled( LLMediaEntry::HEIGHT_PIXELS_KEY, true ); } else { - getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( false ); - getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( false ); + childSetEnabled( LLMediaEntry::WIDTH_PIXELS_KEY, false ); + childSetEnabled( LLMediaEntry::HEIGHT_PIXELS_KEY, false ); }; // enable/disable UI based on type of media @@ -152,17 +152,17 @@ void LLPanelMediaSettingsGeneral::draw() bool show_time_controls = media_plugin->pluginSupportsMediaTime(); if ( show_time_controls ) { - getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( false ); + childSetEnabled( LLMediaEntry::CURRENT_URL_KEY, false ); reset_button_is_active = false; - getChildView("current_url_label")->setEnabled(false ); - getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( true ); + childSetEnabled( "current_url_label", false ); + childSetEnabled( LLMediaEntry::AUTO_LOOP_KEY, true ); } else { - getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( true ); + childSetEnabled( LLMediaEntry::CURRENT_URL_KEY, true ); reset_button_is_active = true; - getChildView("current_url_label")->setEnabled(true ); - getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( false ); + childSetEnabled( "current_url_label", true ); + childSetEnabled( LLMediaEntry::AUTO_LOOP_KEY, false ); }; }; }; @@ -179,18 +179,18 @@ void LLPanelMediaSettingsGeneral::draw() // user has perms to press reset button and it is active if ( user_can_press_reset ) { - getChildView("current_url_reset_btn")->setEnabled(true ); + childSetEnabled( "current_url_reset_btn", true ); } // user does not has perms to press reset button and it is active else { - getChildView("current_url_reset_btn")->setEnabled(false ); + childSetEnabled( "current_url_reset_btn", false ); }; } else // reset button is inactive so we just slam it to off - other states don't matter { - getChildView("current_url_reset_btn")->setEnabled(false ); + childSetEnabled( "current_url_reset_btn", false ); }; } diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index 339376cbf6..9a0d2569d5 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -93,7 +93,7 @@ void LLPanelMediaSettingsPermissions::draw() // housekeeping LLPanel::draw(); - getChild("perms_group_name")->setValue(LLStringUtil::null); + childSetText("perms_group_name",LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -101,6 +101,7 @@ void LLPanelMediaSettingsPermissions::draw() if(mPermsGroupName) { mPermsGroupName->setNameID(group_id, true); + mPermsGroupName->setEnabled(true); }; } else @@ -109,6 +110,7 @@ void LLPanelMediaSettingsPermissions::draw() { mPermsGroupName->setNameID(LLUUID::null, TRUE); mPermsGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, true); + mPermsGroupName->setEnabled(false); }; }; } @@ -134,12 +136,6 @@ void LLPanelMediaSettingsPermissions::clearValues( void* userdata, bool editable self->mPermsGroupControl->setEnabled(editable); self->mPermsWorldInteract->setEnabled(editable); self->mPermsWorldControl->setEnabled(editable); - - self->getChild< LLTextBox >("controls_label")->setEnabled(editable); - self->getChild< LLTextBox >("owner_label")->setEnabled(editable); - self->getChild< LLTextBox >("group_label")->setEnabled(editable); - self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable); - self->getChild< LLTextBox >("anyone_label")->setEnabled(editable); } //////////////////////////////////////////////////////////////////////////////// @@ -214,11 +210,13 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me self->mPermsWorldControl->setEnabled(false); } - self->getChild< LLTextBox >("controls_label")->setEnabled(editable); - self->getChild< LLTextBox >("owner_label")->setEnabled(editable); - self->getChild< LLTextBox >("group_label")->setEnabled(editable); - self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable); - self->getChild< LLTextBox >("anyone_label")->setEnabled(editable); + + self->childSetEnabled("media_perms_label_owner", editable ); + self->childSetText("media_perms_label_owner", LLTrans::getString("Media Perms Owner") ); + self->childSetEnabled("media_perms_label_group", editable ); + self->childSetText("media_perms_label_group", LLTrans::getString("Media Perms Group") ); + self->childSetEnabled("media_perms_label_anyone", editable ); + self->childSetText("media_perms_label_anyone", LLTrans::getString("Media Perms Anyone") ); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index d756a1b931..bc00d75533 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -458,17 +458,17 @@ void LLPanelObject::getState( ) BOOL editable = root_objectp->permModify(); // Select Single Message - getChildView("select_single")->setVisible( FALSE); - getChildView("edit_object")->setVisible( FALSE); + childSetVisible("select_single", FALSE); + childSetVisible("edit_object", FALSE); if (!editable || single_volume || selected_count <= 1) { - getChildView("edit_object")->setVisible( TRUE); - getChildView("edit_object")->setEnabled(TRUE); + childSetVisible("edit_object", TRUE); + childSetEnabled("edit_object", TRUE); } else { - getChildView("select_single")->setVisible( TRUE); - getChildView("select_single")->setEnabled(TRUE); + childSetVisible("select_single", TRUE); + childSetEnabled("select_single", TRUE); } // Lock checkbox - only modifiable if you own the object. BOOL self_owned = (gAgent.getID() == owner_id); @@ -987,19 +987,19 @@ void LLPanelObject::getState( ) mLabelSkew ->setEnabled( enabled ); mSpinSkew ->setEnabled( enabled ); - getChildView("scale_hole")->setVisible( FALSE); - getChildView("scale_taper")->setVisible( FALSE); + childSetVisible("scale_hole", FALSE); + childSetVisible("scale_taper", FALSE); if (top_size_x_visible || top_size_y_visible) { if (size_is_hole) { - getChildView("scale_hole")->setVisible( TRUE); - getChildView("scale_hole")->setEnabled(enabled); + childSetVisible("scale_hole", TRUE); + childSetEnabled("scale_hole", enabled); } else { - getChildView("scale_taper")->setVisible( TRUE); - getChildView("scale_taper")->setEnabled(enabled); + childSetVisible("scale_taper", TRUE); + childSetEnabled("scale_taper", enabled); } } @@ -1010,27 +1010,27 @@ void LLPanelObject::getState( ) mSpinShearX ->setEnabled( enabled ); mSpinShearY ->setEnabled( enabled ); - getChildView("advanced_cut")->setVisible( FALSE); - getChildView("advanced_dimple")->setVisible( FALSE); - getChildView("advanced_slice")->setVisible( FALSE); + childSetVisible("advanced_cut", FALSE); + childSetVisible("advanced_dimple", FALSE); + childSetVisible("advanced_slice", FALSE); if (advanced_cut_visible) { if (advanced_is_dimple) { - getChildView("advanced_dimple")->setVisible( TRUE); - getChildView("advanced_dimple")->setEnabled(enabled); + childSetVisible("advanced_dimple", TRUE); + childSetEnabled("advanced_dimple", enabled); } else if (advanced_is_slice) { - getChildView("advanced_slice")->setVisible( TRUE); - getChildView("advanced_slice")->setEnabled(enabled); + childSetVisible("advanced_slice", TRUE); + childSetEnabled("advanced_slice", enabled); } else { - getChildView("advanced_cut")->setVisible( TRUE); - getChildView("advanced_cut")->setEnabled(enabled); + childSetVisible("advanced_cut", TRUE); + childSetEnabled("advanced_cut", enabled); } } @@ -1913,15 +1913,15 @@ void LLPanelObject::clearCtrls() mLabelRadiusOffset->setEnabled( FALSE ); mLabelRevolutions->setEnabled( FALSE ); - getChildView("select_single")->setVisible( FALSE); - getChildView("edit_object")->setVisible( TRUE); - getChildView("edit_object")->setEnabled(FALSE); + childSetVisible("select_single", FALSE); + childSetVisible("edit_object", TRUE); + childSetEnabled("edit_object", FALSE); - getChildView("scale_hole")->setEnabled(FALSE); - getChildView("scale_taper")->setEnabled(FALSE); - getChildView("advanced_cut")->setEnabled(FALSE); - getChildView("advanced_dimple")->setEnabled(FALSE); - getChildView("advanced_slice")->setVisible( FALSE); + childSetEnabled("scale_hole", FALSE); + childSetEnabled("scale_taper", FALSE); + childSetEnabled("advanced_cut", FALSE); + childSetEnabled("advanced_dimple", FALSE); + childSetVisible("advanced_slice", FALSE); } // diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp index 2f1300e0f2..08204e7e4d 100644 --- a/indra/newview/llpanelonlinestatus.cpp +++ b/indra/newview/llpanelonlinestatus.cpp @@ -39,8 +39,8 @@ LLPanelOnlineStatus::LLPanelOnlineStatus( "panel_online_status_toast.xml"); - getChild("avatar_icon")->setValue(notification->getPayload()["FROM_ID"]); - getChild("message")->setValue(notification->getMessage()); + childSetValue("avatar_icon", notification->getPayload()["FROM_ID"]); + childSetValue("message", notification->getMessage()); if (notification->getPayload().has("respond_on_mousedown") && notification->getPayload()["respond_on_mousedown"]) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c9380bf6e6..d67b95a70e 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -36,7 +36,6 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" -#include "llfolderviewitem.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" @@ -80,11 +79,6 @@ const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK; static const std::string REVERT_BTN("revert_btn"); - -/////////////////////////////////////////////////////////////////////////////// -// LLShopURLDispatcher -/////////////////////////////////////////////////////////////////////////////// - class LLShopURLDispatcher { public: @@ -144,10 +138,6 @@ std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex return gSavedSettings.getString(setting_name); } -/////////////////////////////////////////////////////////////////////////////// -// LLPanelOutfitEditGearMenu -/////////////////////////////////////////////////////////////////////////////// - class LLPanelOutfitEditGearMenu { public: @@ -163,6 +153,7 @@ public: if (menu) { populateCreateWearableSubmenus(menu); + menu->buildDrawLabels(); } return menu; @@ -211,147 +202,6 @@ private: } }; -/////////////////////////////////////////////////////////////////////////////// -// LLAddWearablesGearMenu -/////////////////////////////////////////////////////////////////////////////// - -class LLAddWearablesGearMenu : public LLInitClass -{ -public: - static LLMenuGL* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) - { - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; - - llassert(flat_list); - llassert(inventory_panel); - - LLHandle flat_list_handle = flat_list->getHandle(); - LLHandle inventory_panel_handle = inventory_panel->getHandle(); - - registrar.add("AddWearable.Gear.Sort", boost::bind(onSort, flat_list_handle, inventory_panel_handle, _2)); - enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); - enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); - - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile( - "menu_add_wearable_gear.xml", - LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); - - return menu; - } - -private: - static void onSort(LLHandle flat_list_handle, - LLHandle inventory_panel_handle, - LLSD::String sort_order_str) - { - if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return; - - LLWearableItemsList* flat_list = dynamic_cast(flat_list_handle.get()); - LLInventoryPanel* inventory_panel = dynamic_cast(inventory_panel_handle.get()); - - if (!flat_list || !inventory_panel) return; - - LLWearableItemsList::ESortOrder sort_order; - - if ("by_most_recent" == sort_order_str) - { - sort_order = LLWearableItemsList::E_SORT_BY_MOST_RECENT; - } - else if ("by_name" == sort_order_str) - { - sort_order = LLWearableItemsList::E_SORT_BY_NAME; - } - else if ("by_type" == sort_order_str) - { - sort_order = LLWearableItemsList::E_SORT_BY_TYPE_NAME; - } - else - { - llwarns << "Unrecognized sort order action" << llendl; - return; - } - - if (inventory_panel->getVisible()) - { - inventory_panel->setSortOrder(sort_order); - } - else - { - flat_list->setSortOrder(sort_order); - } - } - - static bool onCheck(LLHandle flat_list_handle, - LLHandle inventory_panel_handle, - LLSD::String sort_order_str) - { - if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return false; - - LLWearableItemsList* flat_list = dynamic_cast(flat_list_handle.get()); - LLInventoryPanel* inventory_panel = dynamic_cast(inventory_panel_handle.get()); - - if (!inventory_panel || !flat_list) return false; - - // Inventory panel uses its own sort order independent from - // flat list view so this flag is used to distinguish between - // currently visible "tree" or "flat" representation of inventory. - bool inventory_tree_visible = inventory_panel->getVisible(); - - if (inventory_tree_visible) - { - U32 sort_order = inventory_panel->getSortOrder(); - - if ("by_most_recent" == sort_order_str) - { - return LLWearableItemsList::E_SORT_BY_MOST_RECENT & sort_order; - } - else if ("by_name" == sort_order_str) - { - // If inventory panel is not sorted by date then it is sorted by name. - return LLWearableItemsList::E_SORT_BY_MOST_RECENT & ~sort_order; - } - llwarns << "Unrecognized inventory panel sort order" << llendl; - } - else - { - LLWearableItemsList::ESortOrder sort_order = flat_list->getSortOrder(); - - if ("by_most_recent" == sort_order_str) - { - return LLWearableItemsList::E_SORT_BY_MOST_RECENT == sort_order; - } - else if ("by_name" == sort_order_str) - { - return LLWearableItemsList::E_SORT_BY_NAME == sort_order; - } - else if ("by_type" == sort_order_str) - { - return LLWearableItemsList::E_SORT_BY_TYPE_NAME == sort_order; - } - llwarns << "Unrecognized wearable list sort order" << llendl; - } - return false; - } - - static bool onVisible(LLHandle inventory_panel_handle, - LLSD::String sort_order_str) - { - if (inventory_panel_handle.isDead()) return false; - - LLInventoryPanel* inventory_panel = dynamic_cast(inventory_panel_handle.get()); - - // Enable sorting by type only for the flat list of items - // because inventory panel doesn't support this kind of sorting. - return ( "by_type" == sort_order_str ) - && ( !inventory_panel || !inventory_panel->getVisible() ); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// LLCOFDragAndDropObserver -/////////////////////////////////////////////////////////////////////////////// - class LLCOFDragAndDropObserver : public LLInventoryAddItemByAssetObserver { public: @@ -387,17 +237,12 @@ void LLCOFDragAndDropObserver::done() LLAppearanceMgr::instance().updateAppearanceFromCOF(); } -/////////////////////////////////////////////////////////////////////////////// -// LLPanelOutfitEdit -/////////////////////////////////////////////////////////////////////////////// - LLPanelOutfitEdit::LLPanelOutfitEdit() : LLPanel(), mSearchFilter(NULL), mCOFWearables(NULL), mInventoryItemsPanel(NULL), mGearMenu(NULL), - mAddWearablesGearMenu(NULL), mCOFDragAndDropObserver(NULL), mInitialized(false), mAddWearablesPanel(NULL), @@ -450,7 +295,7 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindNonLinksByMask(ALL_ITEMS_MASK))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsTypeActual(LLAssetType::AT_CLOTHING))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsTypeActual(LLAssetType::AT_BODYPART))); - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindNonLinksByMask(ATTACHMENT_MASK)));; + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindByMask(ATTACHMENT_MASK)));; mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("shape"), new LLFindActualWearablesOfType(LLWearableType::WT_SHAPE))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("skin"), new LLFindActualWearablesOfType(LLWearableType::WT_SKIN))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("hair"), new LLFindActualWearablesOfType(LLWearableType::WT_HAIR))); @@ -475,9 +320,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); - childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); - childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); @@ -537,26 +380,12 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); - /* - * By default AT_CLOTHING are sorted by (in in MY OUTFITS): - * - by type (types order determined in LLWearableType::EType) - * - each LLWearableType::EType by outer layer on top - * - * In Add More panel AT_CLOTHING should be sorted in a such way: - * - by type (types order determined in LLWearableType::EType) - * - each LLWearableType::EType by name (EXT-8205) - */ - mWearableListViewItemsComparator = new LLWearableItemTypeNameComparator(); - mWearableListViewItemsComparator->setOrder(LLAssetType::AT_CLOTHING, LLWearableItemTypeNameComparator::ORDER_RANK_1, false, true); - mWearablesListViewPanel = getChild("filtered_wearables_panel"); - mWearableItemsList = getChild("list_view"); + mWearableItemsList = getChild("list_view"); mWearableItemsList->setCommitOnSelectionChange(true); mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); mWearableItemsList->setDoubleClickCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); - mWearableItemsList->setComparator(mWearableListViewItemsComparator); - mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; } @@ -594,46 +423,35 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) { mAddWearablesPanel->setVisible(show_add_wearables); - getChild("show_add_wearables_btn")->setValue(show_add_wearables); + childSetValue("show_add_wearables_btn", show_add_wearables); updateFiltersVisibility(); - getChildView("filter_button")->setVisible( show_add_wearables); + childSetVisible("filter_button", show_add_wearables); //search filter should be disabled if (!show_add_wearables) { - getChild("filter_button")->setValue(false); + childSetValue("filter_button", false); mFolderViewFilterCmbBox->setVisible(false); mListViewFilterCmbBox->setVisible(false); showWearablesFilter(); - /* - * By default AT_CLOTHING are sorted by (in in MY OUTFITS): - * - by type (types order determined in LLWearableType::EType) - * - each LLWearableType::EType by outer layer on top - * - * In Add More panel AT_CLOTHING should be sorted in a such way: - * - by type (types order determined in LLWearableType::EType) - * - each LLWearableType::EType by name (EXT-8205) - */ - mWearableItemsList->setSortOrder(LLWearableItemsList::E_SORT_BY_TYPE_NAME); - // Reset mWearableItemsList position to top. See EXT-8180. mWearableItemsList->goToTop(); } //switching button bars - getChildView("no_add_wearables_button_bar")->setVisible( !show_add_wearables); - getChildView("add_wearables_button_bar")->setVisible( show_add_wearables); + childSetVisible("no_add_wearables_button_bar", !show_add_wearables); + childSetVisible("add_wearables_button_bar", show_add_wearables); } void LLPanelOutfitEdit::showWearablesFilter() { - bool filter_visible = getChild("filter_button")->getValue(); + bool filter_visible = childGetValue("filter_button"); - getChildView("filter_panel")->setVisible( filter_visible); + childSetVisible("filter_panel", filter_visible); if(!filter_visible) { @@ -650,7 +468,9 @@ void LLPanelOutfitEdit::showWearablesListView() { if(switchPanels(mInventoryItemsPanel, mWearablesListViewPanel)) { - updateWearablesPanelVerbButtons(); + mFolderViewBtn->setToggleState(FALSE); + mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); + mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); updateFiltersVisibility(); } mListViewBtn->setToggleState(TRUE); @@ -660,7 +480,9 @@ void LLPanelOutfitEdit::showWearablesFolderView() { if(switchPanels(mWearablesListViewPanel, mInventoryItemsPanel)) { - updateWearablesPanelVerbButtons(); + mListViewBtn->setToggleState(FALSE); + mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); + mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); updateFiltersVisibility(); } mFolderViewBtn->setToggleState(TRUE); @@ -801,17 +623,8 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (isAgentAvatarValid()) { // try to get wearable type from 'Add More' panel first (EXT-7639) - selection_info_t selection_info = getAddMorePanelSelectionType(); - - LLWearableType::EType type = selection_info.first; + LLWearableType::EType type = getAddMorePanelSelectionType(); - if (selection_info.second > 1) - { - // the second argument is not important in this case: generic market place will be opened - url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); - } - else - { if (type == LLWearableType::WT_NONE) { type = getCOFWearablesSelectionType(); @@ -827,9 +640,7 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (url.empty()) { - url = url_resolver.resolveURL( - mCOFWearables->getExpandedAccordionAssetType(), sex); - } + url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); } } else @@ -868,9 +679,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const return type; } -LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionType() const +LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const { - selection_info_t result = std::make_pair(LLWearableType::WT_NONE, 0); + LLWearableType::EType type = LLWearableType::WT_NONE; if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) { @@ -878,11 +689,9 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT { std::set selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); - result.second = selected_uuids.size(); - - if (result.second == 1) + if (selected_uuids.size() == 1) { - result.first = getWearableTypeByItemUUID(*(selected_uuids.begin())); + type = getWearableTypeByItemUUID(*(selected_uuids.begin())); } } else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) @@ -890,16 +699,14 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT std::vector selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); - result.second = selected_uuids.size(); - - if (result.second == 1) + if (selected_uuids.size() == 1) { - result.first = getWearableTypeByItemUUID(selected_uuids.front()); + type = getWearableTypeByItemUUID(selected_uuids.front()); } } } - return result; + return type; } LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const @@ -936,7 +743,7 @@ void LLPanelOutfitEdit::updatePlusButton() } // If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button. - uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(&get_can_item_be_worn, _1)); + uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1)); bool can_add = ( unwearable_item == selected_items.end() ); mPlusBtn->setEnabled(can_add); @@ -1184,7 +991,7 @@ void LLPanelOutfitEdit::updateVerbs() bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty); - getChildView(REVERT_BTN)->setEnabled(outfit_is_dirty && has_baseoutfit); + childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit); mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty); @@ -1221,33 +1028,13 @@ void LLPanelOutfitEdit::resetAccordionState() void LLPanelOutfitEdit::onGearButtonClick(LLUICtrl* clicked_button) { - LLMenuGL* menu = NULL; - - if (mAddWearablesPanel->getVisible()) + if(!mGearMenu) { - if (!mAddWearablesGearMenu) - { - mAddWearablesGearMenu = LLAddWearablesGearMenu::create(mWearableItemsList, mInventoryItemsPanel); - } - - menu = mAddWearablesGearMenu; - } - else - { - if (!mGearMenu) - { - mGearMenu = LLPanelOutfitEditGearMenu::create(); - } - - menu = mGearMenu; + mGearMenu = LLPanelOutfitEditGearMenu::create(); } - if (!menu) return; - - menu->arrangeAndClear(); // update menu height - S32 menu_y = menu->getRect().getHeight() + clicked_button->getRect().getHeight(); - menu->buildDrawLabels(); - LLMenuGL::showPopup(clicked_button, menu, 0, menu_y); + S32 menu_y = mGearMenu->getRect().getHeight() + clicked_button->getRect().getHeight(); + LLMenuGL::showPopup(clicked_button, mGearMenu, 0, menu_y); } void LLPanelOutfitEdit::onAddMoreButtonClicked() @@ -1339,62 +1126,5 @@ void LLPanelOutfitEdit::onCOFChanged() update(); } -void LLPanelOutfitEdit::updateWearablesPanelVerbButtons() -{ - if(mWearablesListViewPanel->getVisible()) - { - mFolderViewBtn->setToggleState(FALSE); - mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); - mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); - } - else if(mInventoryItemsPanel->getVisible()) - { - mListViewBtn->setToggleState(FALSE); - mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); - mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); - } -} - -void LLPanelOutfitEdit::saveListSelection() -{ - if(mWearablesListViewPanel->getVisible()) - { - std::set selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); - - if(!selected_ids.size()) return; - - for (std::set::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) - { - mWearableItemsList->selectItemByUUID(*item_id, true); - } - mWearableItemsList->scrollToShowFirstSelectedItem(); - } - else if(mInventoryItemsPanel->getVisible()) - { - std::vector selected_ids; - mWearableItemsList->getSelectedUUIDs(selected_ids); - - if(!selected_ids.size()) return; - - mInventoryItemsPanel->clearSelection(); - LLFolderView* root = mInventoryItemsPanel->getRootFolder(); - - if(!root) return; - - for(std::vector::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) - { - LLFolderViewItem* item = root->getItemByID(*item_id); - if (!item) continue; - - LLFolderViewFolder* parent = item->getParentFolder(); - if(parent) - { - parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); - } - mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE); - } - mInventoryItemsPanel->getRootFolder()->scrollToShowSelection(); - } -} // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 2dca986e33..836bba8c44 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -37,8 +37,8 @@ #include "llremoteparcelrequest.h" #include "llinventory.h" #include "llinventoryfunctions.h" +#include "llinventoryitemslist.h" #include "llinventorymodel.h" -#include "llwearableitemslist.h" class LLButton; class LLCOFWearables; @@ -58,7 +58,6 @@ class LLMenuGL; class LLFindNonLinksByMask; class LLFindWearablesOfType; class LLSaveOutfitComboBtn; -class LLWearableItemTypeNameComparator; class LLPanelOutfitEdit : public LLPanel { @@ -195,17 +194,8 @@ private: void getCurrentItemUUID(LLUUID& selected_id); void onCOFChanged(); - /** - * Method preserves selection while switching between folder/list view modes - */ - void saveListSelection(); - - void updateWearablesPanelVerbButtons(); - - typedef std::pair selection_info_t; - LLWearableType::EType getCOFWearablesSelectionType() const; - selection_info_t getAddMorePanelSelectionType() const; + LLWearableType::EType getAddMorePanelSelectionType() const; LLWearableType::EType getWearableTypeByItemUUID(const LLUUID& item_uuid) const; LLTextBox* mCurrentOutfitName; @@ -224,9 +214,8 @@ private: LLComboBox* mListViewFilterCmbBox; LLFilteredWearableListManager* mWearableListManager; - LLWearableItemsList* mWearableItemsList; + LLInventoryItemsList* mWearableItemsList; LLPanel* mWearablesListViewPanel; - LLWearableItemTypeNameComparator* mWearableListViewItemsComparator; LLCOFDragAndDropObserver* mCOFDragAndDropObserver; @@ -235,7 +224,6 @@ private: LLCOFWearables* mCOFWearables; LLMenuGL* mGearMenu; - LLMenuGL* mAddWearablesGearMenu; bool mInitialized; std::auto_ptr mSaveComboBtn; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8627274e80..1c4476ca49 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -266,7 +266,6 @@ public: friend class LLInventoryFriendCardObserver; LLFriendListUpdater(callback_t cb) : LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT) - , mIsActive(false) { LLAvatarTracker::instance().addObserver(this); @@ -285,12 +284,9 @@ public: /*virtual*/ void changed(U32 mask) { - if (mIsActive) - { - // events can arrive quickly in bulk - we need not process EVERY one of them - - // so we wait a short while to let others pile-in, and process them in aggregate. - mEventTimer.start(); - } + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); // save-up all the mask-bits which have come-in mMask |= mask; @@ -299,12 +295,8 @@ public: /*virtual*/ BOOL tick() { - if (!mIsActive) return FALSE; - if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) - { updateList(); - } // Stop updates. mEventTimer.stop(); @@ -313,20 +305,9 @@ public: return FALSE; } - // virtual - void setActive(bool active) - { - mIsActive = active; - if (active) - { - tick(); - } - } - private: U32 mMask; LLInventoryFriendCardObserver* mInvObserver; - bool mIsActive; /** * This class is intended for updating Friend List when Inventory Friend Card is added/removed. @@ -509,25 +490,22 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL BOOL LLPanelPeople::postBuild() { + setVisibleCallback(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2)); + mFilterEditor = getChild("filter_input"); mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); mTabContainer = getChild("tabs"); mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); - LLPanel* friends_tab = getChild(FRIENDS_TAB_NAME); - // updater is active only if panel is visible to user. - friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); - mOnlineFriendList = friends_tab->getChild("avatars_online"); - mAllFriendList = friends_tab->getChild("avatars_all"); + mOnlineFriendList = getChild(FRIENDS_TAB_NAME)->getChild("avatars_online"); + mAllFriendList = getChild(FRIENDS_TAB_NAME)->getChild("avatars_all"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mAllFriendList->setNoItemsCommentText(getString("no_friends")); mAllFriendList->setShowIcons("FriendsListShowIcons"); - LLPanel* nearby_tab = getChild(NEARBY_TAB_NAME); - nearby_tab->setVisibleCallback(boost::bind(&Updater::setActive, mNearbyListUpdater, _2)); - mNearbyList = nearby_tab->getChild("avatar_list"); + mNearbyList = getChild(NEARBY_TAB_NAME)->getChild("avatar_list"); mNearbyList->setNoItemsCommentText(getString("no_one_near")); mNearbyList->setNoItemsMsg(getString("no_one_near")); mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near")); @@ -816,8 +794,8 @@ void LLPanelPeople::updateButtons() } LLPanel* groups_panel = mTabContainer->getCurrentPanel(); - groups_panel->getChildView("activate_btn")->setEnabled(item_selected && !cur_group_active); // "none" or a non-active group selected - groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); + groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected + groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull()); } else { @@ -833,10 +811,10 @@ void LLPanelPeople::updateButtons() LLPanel* cur_panel = mTabContainer->getCurrentPanel(); if (cur_panel) { - cur_panel->getChildView("add_friend_btn")->setEnabled(!is_friend); + cur_panel->childSetEnabled("add_friend_btn", !is_friend); if (friends_tab_active) { - cur_panel->getChildView("del_btn")->setEnabled(multiple_selected); + cur_panel->childSetEnabled("del_btn", multiple_selected); } } } @@ -971,6 +949,28 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save } } +void LLPanelPeople::onVisibilityChange(const LLSD& new_visibility) +{ + if (new_visibility.asBoolean() == FALSE) + { + // Don't update anything while we're invisible. + mNearbyListUpdater->setActive(FALSE); + } + else + { + reSelectedCurrentTab(); + } +} + +// Make the tab-container re-select current tab +// for onTabSelected() callback to get called. +// (currently this is needed to reactivate nearby list updates +// when we get visible) +void LLPanelPeople::reSelectedCurrentTab() +{ + mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); +} + bool LLPanelPeople::isRealGroup() { return getCurrentItemID() != LLUUID::null; @@ -1018,6 +1018,7 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) void LLPanelPeople::onTabSelected(const LLSD& param) { std::string tab_name = getChild(param.asString())->getName(); + mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME); updateButtons(); showFriendsAccordionsIfNeeded(); @@ -1381,6 +1382,8 @@ void LLPanelPeople::onOpen(const LLSD& key) if (!tab_name.empty()) mTabContainer->selectTabByName(tab_name); + else + reSelectedCurrentTab(); } bool LLPanelPeople::notifyChildren(const LLSD& info) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 3b8b736be1..e931537042 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -85,6 +85,10 @@ private: void showGroupMenu(LLMenuGL* menu); void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true); + void onVisibilityChange( const LLSD& new_visibility); + + void reSelectedCurrentTab(); + // UI callbacks void onFilterEdit(const std::string& search_string); void onTabSelected(const LLSD& param); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index e35574be6c..0317d1050c 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -136,9 +136,9 @@ LLPanelPermissions::LLPanelPermissions() : BOOL LLPanelPermissions::postBuild() { childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this); - getChild("Object Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("Object Name",LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this); - getChild("Object Description")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("Object Description",LLTextValidate::validateASCIIPrintableNoPipe); getChild("button set group")->setCommitCallback(boost::bind(&LLPanelPermissions::onClickGroup,this)); @@ -177,81 +177,81 @@ LLPanelPermissions::~LLPanelPermissions() void LLPanelPermissions::disableAll() { - getChildView("perm_modify")->setEnabled(FALSE); - getChild("perm_modify")->setValue(LLStringUtil::null); - - getChildView("Creator:")->setEnabled(FALSE); - getChild("Creator Name")->setValue(LLStringUtil::null); - getChildView("Creator Name")->setEnabled(FALSE); - - getChildView("Owner:")->setEnabled(FALSE); - getChild("Owner Name")->setValue(LLStringUtil::null); - getChildView("Owner Name")->setEnabled(FALSE); - - getChildView("Group:")->setEnabled(FALSE); - getChild("Group Name Proxy")->setValue(LLStringUtil::null); - getChildView("Group Name Proxy")->setEnabled(FALSE); - getChildView("button set group")->setEnabled(FALSE); - - getChild("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Name:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("Description:")->setEnabled(FALSE); - getChild("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); - - getChildView("Permissions:")->setEnabled(FALSE); + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name Proxy", LLStringUtil::null); + childSetEnabled("Group Name Proxy", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); - getChild("checkbox share with group")->setValue(FALSE); - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("button deed")->setEnabled(FALSE); + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); - getChild("checkbox allow everyone move")->setValue(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); //Next owner can: - getChildView("Next owner can:")->setEnabled(FALSE); - getChild("checkbox next owner can modify")->setValue(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChild("checkbox next owner can copy")->setValue(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); //checkbox for sale - getChild("checkbox for sale")->setValue(FALSE); - getChildView("checkbox for sale")->setEnabled(FALSE); + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); //checkbox include in search - getChild("search_check")->setValue(FALSE); - getChildView("search_check")->setEnabled(FALSE); + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); LLComboBox* combo_sale_type = getChild("sale type"); combo_sale_type->setValue(LLSaleInfo::FS_COPY); combo_sale_type->setEnabled(FALSE); - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); - getChildView("label click action")->setEnabled(FALSE); + childSetEnabled("label click action", FALSE); LLComboBox* combo_click_action = getChild("clickaction"); if (combo_click_action) { combo_click_action->setEnabled(FALSE); combo_click_action->clear(); } - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } void LLPanelPermissions::refresh() @@ -317,23 +317,23 @@ void LLPanelPermissions::refresh() { ++string_index; } - getChildView("perm_modify")->setEnabled(TRUE); - getChild("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - getChildView("Permissions:")->setEnabled(TRUE); + childSetEnabled("Permissions:", TRUE); // Update creator text field - getChildView("Creator:")->setEnabled(TRUE); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - getChild("Creator Name")->setValue(creator_name); - getChildView("Creator Name")->setEnabled(TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - getChildView("Owner:")->setEnabled(TRUE); + childSetEnabled("Owner:", TRUE); std::string owner_name; const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); @@ -358,12 +358,12 @@ void LLPanelPermissions::refresh() } } } - getChild("Owner Name")->setValue(owner_name); - getChildView("Owner Name")->setEnabled(TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - getChildView("Group:")->setEnabled(TRUE); - getChild("Group Name")->setValue(LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -384,18 +384,18 @@ void LLPanelPermissions::refresh() } } - getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - getChildView("Name:")->setEnabled(TRUE); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - getChildView("Description:")->setEnabled(TRUE); + childSetEnabled("Description:", TRUE); LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); if (is_one_object) { if (keyboard_focus_view != LineEditorObjectName) { - getChild("Object Name")->setValue(nodep->mName); + childSetText("Object Name",nodep->mName); } if (LineEditorObjectDesc) @@ -408,7 +408,7 @@ void LLPanelPermissions::refresh() } else { - getChild("Object Name")->setValue(LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } @@ -420,13 +420,13 @@ void LLPanelPermissions::refresh() } if (edit_name_desc) { - getChildView("Object Name")->setEnabled(TRUE); - getChildView("Object Description")->setEnabled(TRUE); + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Object Description")->setEnabled(FALSE); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -448,9 +448,9 @@ void LLPanelPermissions::refresh() if (!owners_identical) { - getChildView("Cost")->setEnabled(FALSE); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) @@ -458,11 +458,11 @@ void LLPanelPermissions::refresh() // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - getChild("Cost")->setValue(getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - getChild("Cost")->setValue(getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); @@ -486,35 +486,35 @@ void LLPanelPermissions::refresh() // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; - getChildView("Cost")->setEnabled(enable_edit); - getChildView("Edit Cost")->setEnabled(enable_edit); + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. else if (!public_owned) { - getChildView("Cost")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - getChild("Edit Cost")->setValue(llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - getChild("Edit Cost")->setValue(LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - getChild("Cost")->setValue(getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - getChild("Cost")->setValue(getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes @@ -556,20 +556,20 @@ void LLPanelPermissions::refresh() { if (valid_base_perms) { - getChild("B:")->setValue("B: " + mask_to_string(base_mask_on)); - getChildView("B:")->setVisible( TRUE); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - getChild("O:")->setValue("O: " + mask_to_string(owner_mask_on)); - getChildView("O:")->setVisible( TRUE); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - getChild("G:")->setValue("G: " + mask_to_string(group_mask_on)); - getChildView("G:")->setVisible( TRUE); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - getChild("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); - getChildView("E:")->setVisible( TRUE); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - getChild("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); - getChildView("N:")->setVisible( TRUE); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } U32 flag_mask = 0x0; @@ -578,17 +578,17 @@ void LLPanelPermissions::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - getChild("F:")->setValue("F:" + mask_to_string(flag_mask)); - getChildView("F:")->setVisible( TRUE); + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } BOOL has_change_perm_ability = FALSE; @@ -608,65 +608,65 @@ void LLPanelPermissions::refresh() if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - getChild("perm_modify")->setValue(getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - getChildView("checkbox share with group")->setEnabled(TRUE); - getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE); - getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - getChild("checkbox for sale")->setTentative( is_for_sale_mixed); - getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - getChildView("Next owner can:")->setEnabled(TRUE); - getChildView("checkbox next owner can modify")->setEnabled(base_mask_on & PERM_MODIFY); - getChildView("checkbox next owner can copy")->setEnabled(base_mask_on & PERM_COPY); - getChildView("checkbox next owner can transfer")->setEnabled(next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - getChildView("checkbox for sale")->setEnabled(FALSE); - getChildView("sale type")->setEnabled(FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - getChildView("Next owner can:")->setEnabled(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } if (valid_group_perms) { if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - getChild("checkbox share with group")->setValue(TRUE); - getChild("checkbox share with group")->setTentative( FALSE); - getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - getChild("checkbox share with group")->setValue(FALSE); - getChild("checkbox share with group")->setTentative( FALSE); - getChildView("button deed")->setEnabled(FALSE); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - getChild("checkbox share with group")->setValue(TRUE); - getChild("checkbox share with group")->setTentative( TRUE); - getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } @@ -675,35 +675,35 @@ void LLPanelPermissions::refresh() // Move if (everyone_mask_on & PERM_MOVE) { - getChild("checkbox allow everyone move")->setValue(TRUE); - getChild("checkbox allow everyone move")->setTentative( FALSE); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } else if (everyone_mask_off & PERM_MOVE) { - getChild("checkbox allow everyone move")->setValue(FALSE); - getChild("checkbox allow everyone move")->setTentative( FALSE); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - getChild("checkbox allow everyone move")->setValue(TRUE); - getChild("checkbox allow everyone move")->setTentative( TRUE); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy if (everyone_mask_on & PERM_COPY) { - getChild("checkbox allow everyone copy")->setValue(TRUE); - getChild("checkbox allow everyone copy")->setTentative( !can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } else if (everyone_mask_off & PERM_COPY) { - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChild("checkbox allow everyone copy")->setTentative( FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - getChild("checkbox allow everyone copy")->setValue(TRUE); - getChild("checkbox allow everyone copy")->setTentative( TRUE); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } @@ -712,52 +712,52 @@ void LLPanelPermissions::refresh() // Modify == next owner canot modify if (next_owner_mask_on & PERM_MODIFY) { - getChild("checkbox next owner can modify")->setValue(TRUE); - getChild("checkbox next owner can modify")->setTentative( FALSE); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } else if (next_owner_mask_off & PERM_MODIFY) { - getChild("checkbox next owner can modify")->setValue(FALSE); - getChild("checkbox next owner can modify")->setTentative( FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - getChild("checkbox next owner can modify")->setValue(TRUE); - getChild("checkbox next owner can modify")->setTentative( TRUE); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy if (next_owner_mask_on & PERM_COPY) { - getChild("checkbox next owner can copy")->setValue(TRUE); - getChild("checkbox next owner can copy")->setTentative( !can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } else if (next_owner_mask_off & PERM_COPY) { - getChild("checkbox next owner can copy")->setValue(FALSE); - getChild("checkbox next owner can copy")->setTentative( FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - getChild("checkbox next owner can copy")->setValue(TRUE); - getChild("checkbox next owner can copy")->setTentative( TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer if (next_owner_mask_on & PERM_TRANSFER) { - getChild("checkbox next owner can transfer")->setValue(TRUE); - getChild("checkbox next owner can transfer")->setTentative( !can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } else if (next_owner_mask_off & PERM_TRANSFER) { - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChild("checkbox next owner can transfer")->setTentative( FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - getChild("checkbox next owner can transfer")->setValue(TRUE); - getChild("checkbox next owner can transfer")->setTentative( TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -779,7 +779,7 @@ void LLPanelPermissions::refresh() combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - getChild("checkbox for sale")->setValue((num_for_sale != 0)); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only @@ -789,7 +789,7 @@ void LLPanelPermissions::refresh() { if (num_for_sale && has_change_sale_ability) { - getChildView("checkbox for sale")->setEnabled(true); + childSetEnabled("checkbox for sale", true); } } @@ -797,9 +797,9 @@ void LLPanelPermissions::refresh() const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - getChildView("search_check")->setEnabled(has_change_sale_ability && all_volume); - getChild("search_check")->setValue(include_in_search); - getChild("search_check")->setTentative( !all_include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; @@ -812,8 +812,8 @@ void LLPanelPermissions::refresh() combo_click_action->setValue(LLSD(combo_value)); } } - getChildView("label click action")->setEnabled(is_perm_modify && all_volume); - getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); } diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 7615a93a49..baff995d5c 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -244,13 +244,13 @@ void LLPanelPickInfo::resetControls() { if(getAvatarId() == gAgent.getID()) { - getChildView("edit_btn")->setEnabled(TRUE); - getChildView("edit_btn")->setVisible( TRUE); + childSetEnabled("edit_btn", TRUE); + childSetVisible("edit_btn", TRUE); } else { - getChildView("edit_btn")->setEnabled(FALSE); - getChildView("edit_btn")->setVisible( FALSE); + childSetEnabled("edit_btn", FALSE); + childSetVisible("edit_btn", FALSE); } } @@ -303,17 +303,17 @@ void LLPanelPickInfo::setSnapshotId(const LLUUID& id) void LLPanelPickInfo::setPickName(const std::string& name) { - getChild(XML_NAME)->setValue(name); + childSetValue(XML_NAME, name); } void LLPanelPickInfo::setPickDesc(const std::string& desc) { - getChild(XML_DESC)->setValue(desc); + childSetValue(XML_DESC, desc); } void LLPanelPickInfo::setPickLocation(const std::string& location) { - getChild(XML_LOCATION)->setValue(location); + childSetValue(XML_LOCATION, location); } void LLPanelPickInfo::onClickMap() @@ -396,8 +396,8 @@ void LLPanelPickEdit::onOpen(const LLSD& key) } setParcelID(parcel_id); - getChild("pick_name")->setValue(pick_name.empty() ? region_name : pick_name); - getChild("pick_desc")->setValue(pick_desc); + childSetValue("pick_name", pick_name.empty() ? region_name : pick_name); + childSetValue("pick_desc", pick_desc); setSnapshotId(snapshot_id); setPickLocation(createLocationText(getLocationNotice(), pick_name, region_name, getPosGlobal())); @@ -425,8 +425,8 @@ void LLPanelPickEdit::setPickData(const LLPickData* pick_data) mNeedData = false; setParcelID(pick_data->parcel_id); - getChild("pick_name")->setValue(pick_data->name); - getChild("pick_desc")->setValue(pick_data->desc); + childSetValue("pick_name", pick_data->name); + childSetValue("pick_desc", pick_data->desc); setSnapshotId(pick_data->snapshot_id); setPosGlobal(pick_data->pos_global); setPickLocation(createLocationText(LLStringUtil::null, pick_data->name, @@ -508,8 +508,8 @@ void LLPanelPickEdit::sendUpdate() //legacy var need to be deleted pick_data.top_pick = FALSE; pick_data.parcel_id = mParcelId; - pick_data.name = getChild(XML_NAME)->getValue().asString(); - pick_data.desc = getChild(XML_DESC)->getValue().asString(); + pick_data.name = childGetValue(XML_NAME).asString(); + pick_data.desc = childGetValue(XML_DESC).asString(); pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); pick_data.pos_global = getPosGlobal(); pick_data.sort_order = 0; @@ -544,7 +544,7 @@ void LLPanelPickEdit::resetData() void LLPanelPickEdit::enableSaveButton(bool enable) { - getChildView(XML_BTN_SAVE)->setEnabled(enable); + childSetEnabled(XML_BTN_SAVE, enable); } void LLPanelPickEdit::onClickSetLocation() diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index a5c3c9faef..ff069e34b7 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -212,7 +212,7 @@ void LLPanelPicks::updateData() mNoPicks = false; mNoClassifieds = false; - getChild("picks_panel_text")->setValue(LLTrans::getString("PicksClassifiedsLoadingText")); + childSetValue("picks_panel_text", LLTrans::getString("PicksClassifiedsLoadingText")); mPicksList->clear(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); @@ -231,7 +231,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) { std::string name, second_name; gCacheName->getName(getAvatarId(),name,second_name); - getChild("pick_title")->setTextArg("[NAME]", name); + childSetTextArg("pick_title", "[NAME]",name); // Save selection, to be able to edit same item after saving changes. See EXT-3023. LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID]; @@ -318,11 +318,11 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) { if(getAvatarId() == gAgentID) { - getChild("picks_panel_text")->setValue(LLTrans::getString("NoPicksClassifiedsText")); + childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText")); } else { - getChild("picks_panel_text")->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); + childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText")); } } } @@ -454,22 +454,22 @@ void LLPanelPicks::onOpen(const LLSD& key) BOOL self = (gAgent.getID() == id); // only agent can edit her picks - getChildView("edit_panel")->setEnabled(self); - getChildView("edit_panel")->setVisible( self); + childSetEnabled("edit_panel", self); + childSetVisible("edit_panel", self); // Disable buttons when viewing profile for first time if(getAvatarId() != id) { - getChildView(XML_BTN_INFO)->setEnabled(FALSE); - getChildView(XML_BTN_TELEPORT)->setEnabled(FALSE); - getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(FALSE); + childSetEnabled(XML_BTN_INFO,FALSE); + childSetEnabled(XML_BTN_TELEPORT,FALSE); + childSetEnabled(XML_BTN_SHOW_ON_MAP,FALSE); } // and see a special title - set as invisible by default in xml file if (self) { - getChildView("pick_title")->setVisible( !self); - getChildView("pick_title_agent")->setVisible( self); + childSetVisible("pick_title", !self); + childSetVisible("pick_title_agent", self); mPopupMenu->setItemVisible("pick_delete", TRUE); mPopupMenu->setItemVisible("pick_edit", TRUE); @@ -664,17 +664,17 @@ void LLPanelPicks::updateButtons() if (getAvatarId() == gAgentID) { - getChildView(XML_BTN_DELETE)->setEnabled(has_selected); + childSetEnabled(XML_BTN_DELETE, has_selected); } - getChildView(XML_BTN_INFO)->setEnabled(has_selected); - getChildView(XML_BTN_TELEPORT)->setEnabled(has_selected); - getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(has_selected); + childSetEnabled(XML_BTN_INFO, has_selected); + childSetEnabled(XML_BTN_TELEPORT, has_selected); + childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); LLClassifiedItem* c_item = dynamic_cast(mClassifiedsList->getSelectedItem()); if(c_item) { - getChildView(XML_BTN_INFO)->setEnabled(isClassifiedPublished(c_item)); + childSetEnabled(XML_BTN_INFO, isClassifiedPublished(c_item)); } } @@ -695,7 +695,8 @@ void LLPanelPicks::buildPickPanel() void LLPanelPicks::onClickPlusBtn() { - LLRect rect(getChildView(XML_BTN_NEW)->getRect()); + LLRect rect; + childGetRect(XML_BTN_NEW, rect); mPlusMenu->updateParent(LLMenuGL::sMenuContainer); mPlusMenu->setButtonRect(rect, this); @@ -1073,7 +1074,7 @@ void LLPickItem::init(LLPickData* pick_data) void LLPickItem::setPickName(const std::string& name) { mPickName = name; - getChild("picture_name")->setValue(name); + childSetValue("picture_name",name); } @@ -1094,7 +1095,7 @@ const LLUUID& LLPickItem::getSnapshotId() void LLPickItem::setPickDesc(const std::string& descr) { - getChild("picture_descr")->setValue(descr); + childSetValue("picture_descr",descr); } void LLPickItem::setPickId(const LLUUID& id) @@ -1114,7 +1115,7 @@ const LLVector3d& LLPickItem::getPosGlobal() const std::string LLPickItem::getDescription() { - return getChild("picture_descr")->getValue().asString(); + return childGetValue("picture_descr").asString(); } void LLPickItem::update() @@ -1141,15 +1142,10 @@ void LLPickItem::processProperties(void *data, EAvatarProcessorType type) LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); } -void set_child_visible(LLView* parent, const std::string& child_name, bool visible) -{ - parent->getChildView(child_name)->setVisible(visible); -} - BOOL LLPickItem::postBuild() { - setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); return TRUE; } @@ -1157,7 +1153,7 @@ void LLPickItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); } ////////////////////////////////////////////////////////////////////////// @@ -1203,8 +1199,8 @@ void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) BOOL LLClassifiedItem::postBuild() { - setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); return TRUE; } @@ -1212,7 +1208,7 @@ void LLClassifiedItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); } void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) @@ -1235,22 +1231,22 @@ void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) void LLClassifiedItem::setClassifiedName(const std::string& name) { - getChild("name")->setValue(name); + childSetValue("name", name); } void LLClassifiedItem::setDescription(const std::string& desc) { - getChild("description")->setValue(desc); + childSetValue("description", desc); } void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) { - getChild("picture")->setValue(snapshot_id); + childSetValue("picture", snapshot_id); } LLUUID LLClassifiedItem::getSnapshotId() { - return getChild("picture")->getValue(); + return childGetValue("picture"); } //EOF diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 526ba48dcb..79a291a622 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -269,11 +269,11 @@ public: void setClassifiedName (const std::string& name); - std::string getClassifiedName() { return getChild("name")->getValue().asString(); } + std::string getClassifiedName() { return childGetValue("name").asString(); } void setDescription(const std::string& desc); - std::string getDescription() { return getChild("description")->getValue().asString(); } + std::string getDescription() { return childGetValue("description").asString(); } void setSnapshotId(const LLUUID& snapshot_id); diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp new file mode 100644 index 0000000000..a06c00b705 --- /dev/null +++ b/indra/newview/llpanelplace.cpp @@ -0,0 +1,421 @@ +/** + * @file llpanelplace.cpp + * @brief Display of a place in the Find directory. + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelplace.h" + +#include "llviewercontrol.h" +#include "llqueryflags.h" +#include "llui.h" +#include "llsecondlifeurls.h" +#include "llfloater.h" +#include "llfloaterreg.h" +#include "llregionhandle.h" + +#include "llagent.h" +#include "llviewerwindow.h" +#include "llbutton.h" +#include "llfloaterworldmap.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" +#include "lluiconstants.h" +#include "lltextbox.h" +#include "lltexteditor.h" +#include "lltexturectrl.h" +#include "lltrans.h" +#include "llworldmap.h" +#include "llviewerregion.h" +#include "llvoavatarself.h" +#include "lluictrlfactory.h" +//#include "llviewermenu.h" // create_landmark() +#include "llweb.h" +#include "llsdutil.h" +#include "llsdutil_math.h" + +LLPanelPlace::LLPanelPlace() +: LLPanel(), + mParcelID(), + mRequestedID(), + mRegionID(), + mPosGlobal(), + mPosRegion(), + mAuctionID(0), + mLandmarkAssetID() +{} + +LLPanelPlace::~LLPanelPlace() +{ + if (mParcelID.notNull()) + { + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); + } +} + +BOOL LLPanelPlace::postBuild() +{ + // Since this is only used in the directory browser, always + // disable the snapshot control. Otherwise clicking on it will + // open a texture picker. + mSnapshotCtrl = getChild("snapshot_ctrl"); + mSnapshotCtrl->setEnabled(FALSE); + + mNameEditor = getChild("name_editor"); + // Text boxes appear to have a " " in them by default. This breaks the + // emptiness test for filling in data from the network. Slam to empty. + mNameEditor->setText( LLStringUtil::null ); + + mDescEditor = getChild("desc_editor"); + + mInfoEditor = getChild("info_editor"); + mLandTypeEditor = getChild("land_type_display"); + + mLocationDisplay = getChild("location_editor"); + + mTeleportBtn = getChild( "teleport_btn"); + mTeleportBtn->setClickedCallback(onClickTeleport, this); + + mMapBtn = getChild( "map_btn"); + mMapBtn->setClickedCallback(onClickMap, this); + + //mLandmarkBtn = getChild( "landmark_btn"); + //mLandmarkBtn->setClickedCallback(onClickLandmark, this); + + mAuctionBtn = getChild( "auction_btn"); + mAuctionBtn->setClickedCallback(onClickAuction, this); + + // Default to no auction button. We'll show it if we get an auction id + mAuctionBtn->setVisible(FALSE); + + // Temporary text to explain why the description panel is blank. + // mDescEditor->setText("Parcel information not available without server update"); + + return TRUE; +} + +void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem) +{ + if (pItem) + { + mNameEditor->setText(pItem->getName()); + mDescEditor->setText(pItem->getDescription()); + } +} + +// Use this for search directory clicks, because we are totally +// recycling the panel and don't need to use what's there. +// +// For SLURL clicks, don't call this, because we need to cache +// the location info from the user. +void LLPanelPlace::resetLocation() +{ + mParcelID.setNull(); + mRequestedID.setNull(); + mRegionID.setNull(); + mLandmarkAssetID.setNull(); + mPosGlobal.clearVec(); + mPosRegion.clearVec(); + mAuctionID = 0; + mNameEditor->setText( LLStringUtil::null ); + mDescEditor->setText( LLStringUtil::null ); + mInfoEditor->setText( LLStringUtil::null ); + mLandTypeEditor->setText( LLStringUtil::null ); + mLocationDisplay->setText( LLStringUtil::null ); +} + + +// Set the name and clear other bits of info. Used for SLURL clicks +void LLPanelPlace::resetName(const std::string& name) +{ + setName(name); + if(mDescEditor) + { + mDescEditor->setText( LLStringUtil::null ); + } + if(mNameEditor) + { + llinfos << "Clearing place name" << llendl; + mNameEditor->setText( LLStringUtil::null ); + } + if(mInfoEditor) + { + mInfoEditor->setText( LLStringUtil::null ); + } + if(mLandTypeEditor) + { + mLandTypeEditor->setText( LLStringUtil::null ); + } +} + +//virtual +void LLPanelPlace::setParcelID(const LLUUID& parcel_id) +{ + mParcelID = parcel_id; + sendParcelInfoRequest(); +} + +void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) +{ + mSnapshotCtrl->setImageAssetID(snapshot_id); +} + +void LLPanelPlace::setLocationString(const std::string& location) +{ + mLocationDisplay->setText(location); +} + +void LLPanelPlace::setLandTypeString(const std::string& land_type) +{ + mLandTypeEditor->setText(land_type); +} + +void LLPanelPlace::sendParcelInfoRequest() +{ + if (mParcelID != mRequestedID) + { + //ext-4655, remove now incase this gets called twice without a remove + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mRequestedID, this); + + LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); + + mRequestedID = mParcelID; + } +} + +//virtual +void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) +{ + // We only really handle 404 and 499 errors + std::string error_text; + if(status == 404) + { + error_text = getString("server_error_text"); + } + else if(status == 499) + { + error_text = getString("server_forbidden_text"); + } + mDescEditor->setText(error_text); +} + +//virtual +void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data) +{ + mAuctionID = parcel_data.auction_id; + + if(parcel_data.snapshot_id.notNull()) + { + mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); + } + + if( !parcel_data.name.empty() + && mNameEditor && mNameEditor->getText().empty()) + { + mNameEditor->setText(parcel_data.name); + } + + if( !parcel_data.desc.empty() + && mDescEditor && mDescEditor->getText().empty()) + { + mDescEditor->setText(parcel_data.desc); + } + + std::string info_text; + LLUIString traffic = getString("traffic_text"); + traffic.setArg("[TRAFFIC]", llformat("%d ", (int)parcel_data.dwell)); + info_text = traffic; + LLUIString area = getString("area_text"); + area.setArg("[AREA]", llformat("%d", parcel_data.actual_area)); + info_text += area; + if (parcel_data.flags & DFQ_FOR_SALE) + { + LLUIString forsale = getString("forsale_text"); + forsale.setArg("[PRICE]", llformat("%d", parcel_data.sale_price)); + info_text += forsale; + } + if (parcel_data.auction_id != 0) + { + LLUIString auction = getString("auction_text"); + auction.setArg("[ID]", llformat("%010d ", parcel_data.auction_id)); + info_text += auction; + } + if (mInfoEditor) + { + mInfoEditor->setText(info_text); + } + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); + if (parcel_data.flags & 0x2) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); + } + else if (parcel_data.flags & 0x1) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); + } + + // Just use given region position for display + S32 region_x = llround(mPosRegion.mV[0]); + S32 region_y = llround(mPosRegion.mV[1]); + S32 region_z = llround(mPosRegion.mV[2]); + + // If the region position is zero, grab position from the global + if(mPosRegion.isExactlyZero()) + { + region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = llround(parcel_data.global_z); + } + + if(mPosGlobal.isExactlyZero()) + { + mPosGlobal.setVec(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z); + } + + std::string location = llformat("%s %d, %d, %d (%s)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z, rating.c_str()); + if (mLocationDisplay) + { + mLocationDisplay->setText(location); + } + + BOOL show_auction = (parcel_data.auction_id > 0); + mAuctionBtn->setVisible(show_auction); +} + + +void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, + const LLUUID& landmark_asset_id, + const LLUUID& region_id, + const LLVector3d& pos_global) +{ + LLSD body; + mPosRegion = pos_region; + mPosGlobal = pos_global; + mLandmarkAssetID = landmark_asset_id; + std::string url = gAgent.getRegion()->getCapability("RemoteParcelRequest"); + if (!url.empty()) + { + body["location"] = ll_sd_from_vector3(pos_region); + if (!region_id.isNull()) + { + body["region_id"] = region_id; + } + if (!pos_global.isExactlyZero()) + { + U64 region_handle = to_region_handle(pos_global); + body["region_handle"] = ll_sd_from_U64(region_handle); + } + LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle())); + } + else + { + mDescEditor->setText(getString("server_update_text")); + } + mSnapshotCtrl->setImageAssetID(LLUUID::null); +} + +// static +void LLPanelPlace::onClickTeleport(void* data) +{ + LLPanelPlace* self = (LLPanelPlace*)data; + + LLView* parent_viewp = self->getParent(); + LLFloater* parent_floaterp = dynamic_cast(parent_viewp); + if (parent_floaterp) + { + parent_floaterp->closeFloater(); + } + // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); + parent_viewp->setVisible(false); + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if(self->mLandmarkAssetID.notNull() && worldmap_instance) + { + gAgent.teleportViaLandmark(self->mLandmarkAssetID); + worldmap_instance->trackLandmark(self->mLandmarkAssetID); + + } + else if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) + { + gAgent.teleportViaLocation(self->mPosGlobal); + worldmap_instance->trackLocation(self->mPosGlobal); + } +} + +// static +void LLPanelPlace::onClickMap(void* data) +{ + LLPanelPlace* self = (LLPanelPlace*)data; + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + + if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(self->mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } +} + +// static +/* +void LLPanelPlace::onClickLandmark(void* data) +{ + LLPanelPlace* self = (LLPanelPlace*)data; + + create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); +} +*/ + + +// static +void LLPanelPlace::onClickAuction(void* data) +{ + LLPanelPlace* self = (LLPanelPlace*)data; + LLSD args; + args["AUCTION_ID"] = self->mAuctionID; + + LLNotificationsUtil::add("GoToAuctionPage", args); +} +/* +// static +bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::string url; + url = LLNotifications::instance().getGlobalString("AUCTION_URL") + llformat("%010d", response["auction_id"].asInteger()); + + llinfos << "Loading auction page " << url << llendl; + + LLWeb::loadURL(url); + } + return false; +} +*/ + diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h new file mode 100644 index 0000000000..5afe1aa485 --- /dev/null +++ b/indra/newview/llpanelplace.h @@ -0,0 +1,114 @@ +/** + * @file llpanelplace.h + * @brief Display of a place in the Find directory. + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPLACE_H +#define LL_LLPANELPLACE_H + +#include "llpanel.h" + +#include "v3dmath.h" +#include "lluuid.h" + +#include "llremoteparcelrequest.h" + +class LLButton; +class LLTextBox; +class LLLineEditor; +class LLTextEditor; +class LLTextureCtrl; +class LLMessageSystem; +class LLInventoryItem; + +class LLPanelPlace : public LLPanel, LLRemoteParcelInfoObserver +{ +public: + LLPanelPlace(); + /*virtual*/ ~LLPanelPlace(); + + /*virtual*/ BOOL postBuild(); + + void resetLocation(); + // Ignore all old location information, useful if you are + // recycling an existing dialog and need to clear it. + + /*virtual*/ void setParcelID(const LLUUID& parcel_id); + // Sends a request for data about the given parcel, which will + // only update the location if there is none already available. + + void displayItemInfo(const LLInventoryItem* pItem); + void setRegionID(const LLUUID& region_id) { mRegionID = region_id; } + void setSnapshot(const LLUUID& snapshot_id); + void setLocationString(const std::string& location); + void setLandTypeString(const std::string& land_type); + /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); + void resetName(const std::string& name); + + void sendParcelInfoRequest(); + void displayParcelInfo(const LLVector3& pos_region, + const LLUUID& landmark_asset_id, + const LLUUID& region_id, + const LLVector3d& pos_global); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + + LLTextureCtrl *getSnapshotCtrl() const { return mSnapshotCtrl; } + +protected: + static void onClickTeleport(void* data); + static void onClickMap(void* data); + //static void onClickLandmark(void* data); + static void onClickAuction(void* data); + + // Go to auction web page if user clicked OK + static bool callbackAuctionWebPage(const LLSD& notification, const LLSD& response); + +protected: + LLUUID mParcelID; + LLUUID mRequestedID; + LLUUID mRegionID; + LLUUID mLandmarkAssetID; + // Absolute position of the location for teleport, may not + // be available (hence zero) + LLVector3d mPosGlobal; + // Region-local position for teleport, always available. + LLVector3 mPosRegion; + // Zero if this is not an auction + S32 mAuctionID; + + LLTextureCtrl* mSnapshotCtrl; + + LLTextBox* mNameEditor; + LLTextEditor* mDescEditor; + LLTextBox* mInfoEditor; + LLTextBox* mLandTypeEditor; + LLTextBox* mLocationDisplay; //not calling it "editor" because it isn't + + LLButton* mTeleportBtn; + LLButton* mMapBtn; + //LLButton* mLandmarkBtn; + LLButton* mAuctionBtn; +}; + +#endif // LL_LLPANELPLACE_H diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index bbaffda2f2..1076e17e1d 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -98,11 +98,11 @@ void LLPanelPlaceInfo::resetLocation() mPosRegion.clearVec(); std::string loading = LLTrans::getString("LoadingData"); + mMaturityRatingIcon->setValue(loading); mMaturityRatingText->setValue(loading); mRegionName->setText(loading); mParcelName->setText(loading); mDescEditor->setText(loading); - mMaturityRatingIcon->setValue(LLUUID::null); mSnapshotCtrl->setImageAssetID(LLUUID::null); } @@ -184,21 +184,7 @@ void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason) { error_text = getString("server_forbidden_text"); } - else - { - error_text = getString("server_error_text"); - } - mDescEditor->setText(error_text); - - std::string not_available = getString("not_available"); - mMaturityRatingText->setValue(not_available); - mRegionName->setText(not_available); - mParcelName->setText(not_available); - mMaturityRatingIcon->setValue(LLUUID::null); - - // Enable "Back" button that was disabled when parcel request was sent. - getChild("back_btn")->setEnabled(TRUE); } // virtual diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 5aed1e55e3..e244a6255e 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -49,7 +49,6 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarpropertiesprocessor.h" -#include "llcommandhandler.h" #include "llfloaterworldmap.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" @@ -62,7 +61,6 @@ #include "llpanelplaceprofile.h" #include "llpanelteleporthistory.h" #include "llremoteparcelrequest.h" -#include "llsidetray.h" #include "llteleporthistorystorage.h" #include "lltoggleablemenu.h" #include "llviewerinventory.h" @@ -72,7 +70,6 @@ #include "llviewerregion.h" #include "llviewerwindow.h" -// Constants static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; @@ -81,40 +78,6 @@ static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; -// Support for secondlife:///app/parcel/{UUID}/about SLapps -class LLParcelHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) - { - if (params.size() < 2) - { - return false; - } - LLUUID parcel_id; - if (!parcel_id.set(params[0], FALSE)) - { - return false; - } - if (params[1].asString() == "about") - { - if (parcel_id.notNull()) - { - LLSD key; - key["type"] = "remote_place"; - key["id"] = parcel_id; - LLSideTray::getInstance()->showPanel("panel_places", key); - return true; - } - } - return false; - } -}; -LLParcelHandler gParcelHandler; - // Helper functions static bool is_agent_in_selected_parcel(LLParcel* parcel); static void onSLURLBuilt(std::string& slurl); diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index c0f504fef6..55cf58c2d0 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -117,8 +117,8 @@ BOOL LLPanelProfileView::postBuild() getTabContainer()[PANEL_NOTES] = getChild(PANEL_NOTES); //*TODO remove this, according to style guide we don't use status combobox - getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE); - getTabContainer()[PANEL_PROFILE]->getChildView("status_combo")->setVisible( FALSE); + getTabContainer()[PANEL_PROFILE]->childSetVisible("online_me_status_text", FALSE); + getTabContainer()[PANEL_PROFILE]->childSetVisible("status_combo", FALSE); mStatusText = getChild("status"); mStatusText->setVisible(false); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index a7cbf52290..ba6d942838 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -164,7 +164,7 @@ void LLTeleportHistoryFlatItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); + childSetVisible("selected_icon", value["selected"]); } void LLTeleportHistoryFlatItem::setHighlightedText(const std::string& text) @@ -188,7 +188,7 @@ void LLTeleportHistoryFlatItem::updateTitle() void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( true); + childSetVisible("hovered_icon", true); mProfileBtn->setVisible(true); LLPanel::onMouseEnter(x, y, mask); @@ -196,7 +196,7 @@ void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLTeleportHistoryFlatItem::onMouseLeave(S32 x, S32 y, MASK mask) { - getChildView("hovered_icon")->setVisible( false); + childSetVisible("hovered_icon", false); mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 0d17fb3e82..15f7195b1a 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -155,8 +155,6 @@ BOOL LLPanelTopInfoBar::postBuild() mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback( boost::bind(&LLPanelTopInfoBar::onAgentParcelChange, this)); - setVisibleCallback(boost::bind(&LLPanelTopInfoBar::onVisibilityChange, this, _2)); - return TRUE; } @@ -170,27 +168,6 @@ void LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged() setParcelInfoText(new_text); } -// when panel is shown, all minimized floaters should be shifted downwards to prevent overlapping of -// PanelTopInfoBar. See EXT-7951. -void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show) -{ - // this height is used as a vertical offset for ALREADY MINIMIZED floaters - // when PanelTopInfoBar visibility changes - S32 height = getRect().getHeight(); - - // this vertical offset is used for a start minimize position of floaters that - // are NOT MIMIMIZED YET - S32 minimize_pos_offset = 0; - - if (show.asBoolean()) - { - height = minimize_pos_offset = -height; - } - - gFloaterView->shiftFloaters(0, height); - gFloaterView->setMinimizePositionVerticalOffset(minimize_pos_offset); -} - void LLPanelTopInfoBar::draw() { updateParcelInfoText(); diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index db922ef424..cf608b88e1 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -52,11 +52,6 @@ public: */ void handleLoginComplete(); - /** - * Called when the top info bar gets shown or hidden - */ - void onVisibilityChange(const LLSD& show); - private: class LLParcelChangeObserver; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 065c4d0b92..faf260881e 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -79,21 +79,21 @@ BOOL LLPanelVolume::postBuild() { childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - getChild("FlexNumSections")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexNumSections",precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); - getChild("FlexGravity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexGravity",precommitValidate); childSetCommitCallback("FlexFriction",onCommitFlexible,this); - getChild("FlexFriction")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexFriction",precommitValidate); childSetCommitCallback("FlexWind",onCommitFlexible,this); - getChild("FlexWind")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexWind",precommitValidate); childSetCommitCallback("FlexTension",onCommitFlexible,this); - getChild("FlexTension")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexTension",precommitValidate); childSetCommitCallback("FlexForceX",onCommitFlexible,this); - getChild("FlexForceX")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceX",precommitValidate); childSetCommitCallback("FlexForceY",onCommitFlexible,this); - getChild("FlexForceY")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceY",precommitValidate); childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - getChild("FlexForceZ")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceZ",precommitValidate); } // LIGHT Parameters @@ -115,18 +115,18 @@ BOOL LLPanelVolume::postBuild() } childSetCommitCallback("Light Intensity",onCommitLight,this); - getChild("Light Intensity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Intensity",precommitValidate); childSetCommitCallback("Light Radius",onCommitLight,this); - getChild("Light Radius")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Radius",precommitValidate); childSetCommitCallback("Light Falloff",onCommitLight,this); - getChild("Light Falloff")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Falloff",precommitValidate); childSetCommitCallback("Light FOV", onCommitLight, this); - getChild("Light FOV")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light FOV", precommitValidate); childSetCommitCallback("Light Focus", onCommitLight, this); - getChild("Light Focus")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Focus", precommitValidate); childSetCommitCallback("Light Ambiance", onCommitLight, this); - getChild("Light Ambiance")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Ambiance", precommitValidate); } // Start with everyone disabled @@ -204,25 +204,25 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - getChildView("edit_object")->setVisible(true); - getChildView("edit_object")->setEnabled(true); - getChildView("select_single")->setVisible(false); + childSetVisible("edit_object",true); + childSetEnabled("edit_object",true); + childSetVisible("select_single",false); } else { - getChildView("edit_object")->setVisible(false); - getChildView("select_single")->setVisible(true); - getChildView("select_single")->setEnabled(true); + childSetVisible("edit_object",false); + childSetVisible("select_single",true); + childSetEnabled("select_single",true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - getChild("Light Checkbox Ctrl")->setValue(is_light); - getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetValue("Light Checkbox Ctrl",is_light); + childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp); if (is_light && editable && single_volume) { - getChildView("label color")->setEnabled(true); + childSetEnabled("label color",true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) @@ -240,22 +240,22 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } - getChildView("Light Intensity")->setEnabled(true); - getChildView("Light Radius")->setEnabled(true); - getChildView("Light Falloff")->setEnabled(true); + childSetEnabled("Light Intensity",true); + childSetEnabled("Light Radius",true); + childSetEnabled("Light Falloff",true); - getChildView("Light FOV")->setEnabled(true); - getChildView("Light Focus")->setEnabled(true); - getChildView("Light Ambiance")->setEnabled(true); + childSetEnabled("Light FOV", true); + childSetEnabled("Light Focus", true); + childSetEnabled("Light Ambiance", true); - getChild("Light Intensity")->setValue(volobjp->getLightIntensity()); - getChild("Light Radius")->setValue(volobjp->getLightRadius()); - getChild("Light Falloff")->setValue(volobjp->getLightFalloff()); + childSetValue("Light Intensity",volobjp->getLightIntensity()); + childSetValue("Light Radius",volobjp->getLightRadius()); + childSetValue("Light Falloff",volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - getChild("Light FOV")->setValue(params.mV[0]); - getChild("Light Focus")->setValue(params.mV[1]); - getChild("Light Ambiance")->setValue(params.mV[2]); + childSetValue("Light FOV", params.mV[0]); + childSetValue("Light Focus", params.mV[1]); + childSetValue("Light Ambiance", params.mV[2]); mLightSavedColor = volobjp->getLightColor(); } @@ -265,7 +265,7 @@ void LLPanelVolume::getState( ) getChild("Light Radius", true)->clear(); getChild("Light Falloff", true)->clear(); - getChildView("label color")->setEnabled(false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -279,56 +279,56 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setValid(FALSE); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); - getChildView("Light FOV")->setEnabled(false); - getChildView("Light Focus")->setEnabled(false); - getChildView("Light Ambiance")->setEnabled(false); + childSetEnabled("Light FOV",false); + childSetEnabled("Light Focus",false); + childSetEnabled("Light Ambiance",false); } // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - getChild("Flexible1D Checkbox Ctrl")->setValue(is_flexible); + childSetValue("Flexible1D Checkbox Ctrl",is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetEnabled("Flexible1D Checkbox Ctrl", editable && single_volume && volobjp); } else { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + childSetEnabled("Flexible1D Checkbox Ctrl", false); } if (is_flexible && editable && single_volume) { - getChildView("FlexNumSections")->setVisible(true); - getChildView("FlexGravity")->setVisible(true); - getChildView("FlexTension")->setVisible(true); - getChildView("FlexFriction")->setVisible(true); - getChildView("FlexWind")->setVisible(true); - getChildView("FlexForceX")->setVisible(true); - getChildView("FlexForceY")->setVisible(true); - getChildView("FlexForceZ")->setVisible(true); - - getChildView("FlexNumSections")->setEnabled(true); - getChildView("FlexGravity")->setEnabled(true); - getChildView("FlexTension")->setEnabled(true); - getChildView("FlexFriction")->setEnabled(true); - getChildView("FlexWind")->setEnabled(true); - getChildView("FlexForceX")->setEnabled(true); - getChildView("FlexForceY")->setEnabled(true); - getChildView("FlexForceZ")->setEnabled(true); + childSetVisible("FlexNumSections",true); + childSetVisible("FlexGravity",true); + childSetVisible("FlexTension",true); + childSetVisible("FlexFriction",true); + childSetVisible("FlexWind",true); + childSetVisible("FlexForceX",true); + childSetVisible("FlexForceY",true); + childSetVisible("FlexForceZ",true); + + childSetEnabled("FlexNumSections",true); + childSetEnabled("FlexGravity",true); + childSetEnabled("FlexTension",true); + childSetEnabled("FlexFriction",true); + childSetEnabled("FlexWind",true); + childSetEnabled("FlexForceX",true); + childSetEnabled("FlexForceY",true); + childSetEnabled("FlexForceZ",true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - getChild("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); - getChild("FlexGravity")->setValue(attributes->getGravity()); - getChild("FlexTension")->setValue(attributes->getTension()); - getChild("FlexFriction")->setValue(attributes->getAirFriction()); - getChild("FlexWind")->setValue(attributes->getWindSensitivity()); - getChild("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); - getChild("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); - getChild("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); + childSetValue("FlexNumSections",(F32)attributes->getSimulateLOD()); + childSetValue("FlexGravity",attributes->getGravity()); + childSetValue("FlexTension",attributes->getTension()); + childSetValue("FlexFriction",attributes->getAirFriction()); + childSetValue("FlexWind",attributes->getWindSensitivity()); + childSetValue("FlexForceX",attributes->getUserForce().mV[VX]); + childSetValue("FlexForceY",attributes->getUserForce().mV[VY]); + childSetValue("FlexForceZ",attributes->getUserForce().mV[VZ]); } else { @@ -341,14 +341,14 @@ void LLPanelVolume::getState( ) getChild("FlexForceY", true)->clear(); getChild("FlexForceZ", true)->clear(); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } mObject = objectp; @@ -378,11 +378,11 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - getChildView("label texture")->setVisible( visible); - getChildView("Light FOV")->setVisible( visible); - getChildView("Light Focus")->setVisible( visible); - getChildView("Light Ambiance")->setVisible( visible); - getChildView("light texture control")->setVisible( visible); + childSetVisible("label texture", visible); + childSetVisible("Light FOV", visible); + childSetVisible("Light Focus", visible); + childSetVisible("Light Ambiance", visible); + childSetVisible("light texture control", visible); } @@ -397,13 +397,13 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - getChildView("select_single")->setEnabled(false); - getChildView("select_single")->setVisible(true); - getChildView("edit_object")->setEnabled(false); - getChildView("edit_object")->setVisible(false); - getChildView("Light Checkbox Ctrl")->setEnabled(false); - getChildView("label color")->setEnabled(false); - getChildView("label color")->setEnabled(false); + childSetEnabled("select_single",false); + childSetVisible("select_single",true); + childSetEnabled("edit_object",false); + childSetVisible("edit_object",false); + childSetEnabled("Light Checkbox Ctrl",false); + childSetEnabled("label color",false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -417,19 +417,19 @@ void LLPanelVolume::clearCtrls() LightTextureCtrl->setValid( FALSE ); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); - - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); + + childSetEnabled("Flexible1D Checkbox Ctrl",false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } // @@ -445,7 +445,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = getChild("Light Checkbox Ctrl")->getValue(); + BOOL value = childGetValue("Light Checkbox Ctrl"); volobjp->setIsLight(value); llinfos << "update light sent" << llendl; } @@ -459,7 +459,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = getChild("Flexible1D Checkbox Ctrl")->getValue(); + BOOL is_flexible = childGetValue("Flexible1D Checkbox Ctrl"); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -551,9 +551,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->getChild("Light Intensity")->getValue().asReal()); - volobjp->setLightRadius((F32)self->getChild("Light Radius")->getValue().asReal()); - volobjp->setLightFalloff((F32)self->getChild("Light Falloff")->getValue().asReal()); + volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal()); + volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal()); + volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal()); LLColorSwatchCtrl* LightColorSwatch = self->getChild("colorswatch"); if(LightColorSwatch) @@ -568,29 +568,29 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (!volobjp->isLightSpotlight()) + if (volobjp->getLightTextureID().isNull()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->getChild("Light FOV")->setValue(spot_params.mV[0]); - self->getChild("Light Focus")->setValue(spot_params.mV[1]); - self->getChild("Light Ambiance")->setValue(spot_params.mV[2]); + self->childSetValue("Light FOV", spot_params.mV[0]); + self->childSetValue("Light Focus", spot_params.mV[1]); + self->childSetValue("Light Ambiance", spot_params.mV[2]); } else { //modifying existing params LLVector3 spot_params; - spot_params.mV[0] = (F32) self->getChild("Light FOV")->getValue().asReal(); - spot_params.mV[1] = (F32) self->getChild("Light Focus")->getValue().asReal(); - spot_params.mV[2] = (F32) self->getChild("Light Ambiance")->getValue().asReal(); + spot_params.mV[0] = (F32) self->childGetValue("Light FOV").asReal(); + spot_params.mV[1] = (F32) self->childGetValue("Light Focus").asReal(); + spot_params.mV[2] = (F32) self->childGetValue("Light Ambiance").asReal(); volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->isLightSpotlight()) + else if (volobjp->getLightTextureID().notNull()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->getChildView("Light FOV")->setEnabled(FALSE); - //self->getChildView("Light Focus")->setEnabled(FALSE); - //self->getChildView("Light Ambiance")->setEnabled(FALSE); + //self->childDisable("Light FOV"); + //self->childDisable("Light Focus"); + //self->childDisable("Light Ambiance"); } } @@ -623,14 +623,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->getChild("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->getChild("FlexGravity")->getValue().asReal()); - new_attributes.setTension((F32)self->getChild("FlexTension")->getValue().asReal()); - new_attributes.setAirFriction((F32)self->getChild("FlexFriction")->getValue().asReal()); - new_attributes.setWindSensitivity((F32)self->getChild("FlexWind")->getValue().asReal()); - F32 fx = (F32)self->getChild("FlexForceX")->getValue().asReal(); - F32 fy = (F32)self->getChild("FlexForceY")->getValue().asReal(); - F32 fz = (F32)self->getChild("FlexForceZ")->getValue().asReal(); + new_attributes.setSimulateLOD(self->childGetValue("FlexNumSections").asInteger());//(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->childGetValue("FlexGravity").asReal()); + new_attributes.setTension((F32)self->childGetValue("FlexTension").asReal()); + new_attributes.setAirFriction((F32)self->childGetValue("FlexFriction").asReal()); + new_attributes.setWindSensitivity((F32)self->childGetValue("FlexWind").asReal()); + F32 fx = (F32)self->childGetValue("FlexForceX").asReal(); + F32 fy = (F32)self->childGetValue("FlexForceY").asReal(); + F32 fz = (F32)self->childGetValue("FlexForceZ").asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index a6bc34c62e..8b1682b901 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -82,58 +82,9 @@ protected: { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1); - registrar.add("Wearing.Edit", boost::bind(&edit_outfit)); - registrar.add("Wearing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs)); - registrar.add("Wearing.Detach", boost::bind(handleMultiple, take_off, mUUIDs)); - - LLContextMenu* menu = createFromFile("menu_wearing_tab.xml"); - - updateMenuItemsVisibility(menu); - return menu; - } - - void updateMenuItemsVisibility(LLContextMenu* menu) - { - bool bp_selected = false; // true if body parts selected - bool clothes_selected = false; - bool attachments_selected = false; - - // See what types of wearables are selected. - for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - - if (!item) - { - llwarns << "Invalid item" << llendl; - continue; - } - - LLAssetType::EType type = item->getType(); - if (type == LLAssetType::AT_CLOTHING) - { - clothes_selected = true; - } - else if (type == LLAssetType::AT_BODYPART) - { - bp_selected = true; - } - else if (type == LLAssetType::AT_OBJECT) - { - attachments_selected = true; - } - } - - // Enable/disable some menu items depending on the selection. - bool allow_detach = !bp_selected && !clothes_selected && attachments_selected; - bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected; - - menu->setItemVisible("take_off", allow_take_off); - menu->setItemVisible("detach", allow_detach); - menu->setItemVisible("edit_outfit_separator", allow_take_off || allow_detach); + return createFromFile("menu_wearing_tab.xml"); } }; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c8aa9ac91e..49850748ee 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -689,11 +689,11 @@ void LLParticipantList::LLParticipantListMenu::show(LLView* spawning_view, const if (is_muted) { - LLMenuGL::sMenuContainer->getChildView("ModerateVoiceMuteSelected")->setVisible( false); + LLMenuGL::sMenuContainer->childSetVisible("ModerateVoiceMuteSelected", false); } else { - LLMenuGL::sMenuContainer->getChildView("ModerateVoiceUnMuteSelected")->setVisible( false); + LLMenuGL::sMenuContainer->childSetVisible("ModerateVoiceUnMuteSelected", false); } } diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 69542764d2..4f3a2a4044 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -143,12 +143,12 @@ void LLPreview::onCommit() } LLPointer new_item = new LLViewerInventoryItem(item); - new_item->setDescription(getChild("desc")->getValue().asString()); + new_item->setDescription(childGetText("desc")); - std::string new_name = getChild("name")->getValue().asString(); + std::string new_name = childGetText("name"); if ( (new_item->getName() != new_name) && !new_name.empty()) { - new_item->rename(getChild("name")->getValue().asString()); + new_item->rename(childGetText("name")); } if(mObjectUUID.notNull()) @@ -180,7 +180,7 @@ void LLPreview::onCommit() { LLSelectMgr::getInstance()->deselectAll(); LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); - LLSelectMgr::getInstance()->selectionSetObjectDescription( getChild("desc")->getValue().asString() ); + LLSelectMgr::getInstance()->selectionSetObjectDescription( childGetText("desc") ); LLSelectMgr::getInstance()->deselectAll(); } @@ -226,10 +226,10 @@ void LLPreview::refreshFromItem() LLUIString title = getString("Title", args); setTitle(title.getString()); } - getChild("desc")->setValue(item->getDescription()); + childSetText("desc",item->getDescription()); BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID()); - getChildView("desc")->setEnabled(can_agent_manipulate); + childSetEnabled("desc",can_agent_manipulate); } // static diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index b328f65349..a998452888 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -54,8 +54,8 @@ void LLPreviewAnim::endAnimCallback( void *userdata ) delete handlep; // done with the handle if (self) { - self->getChild("Anim play btn")->setValue(FALSE); - self->getChild("Anim audition btn")->setValue(FALSE); + self->childSetValue("Anim play btn", FALSE); + self->childSetValue("Anim audition btn", FALSE); } } @@ -66,14 +66,14 @@ BOOL LLPreviewAnim::postBuild() if(item) { gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation - getChild("desc")->setValue(item->getDescription()); + childSetText("desc", item->getDescription()); } childSetAction("Anim play btn",playAnim, this); childSetAction("Anim audition btn",auditionAnim, this); childSetCommitCallback("desc", LLPreview::onText, this); - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -115,7 +115,7 @@ void LLPreviewAnim::playAnim( void *userdata ) btn->toggleState(); } - if (self->getChild("Anim play btn")->getValue().asBoolean() ) + if (self->childGetValue("Anim play btn").asBoolean() ) { self->mPauseRequest = NULL; gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START); @@ -149,7 +149,7 @@ void LLPreviewAnim::auditionAnim( void *userdata ) btn->toggleState(); } - if (self->getChild("Anim audition btn")->getValue().asBoolean() ) + if (self->childGetValue("Anim audition btn").asBoolean() ) { self->mPauseRequest = NULL; gAgentAvatarp->startMotion(item->getAssetUUID()); diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 3f4edbaf97..a8da9e5129 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -476,11 +476,11 @@ BOOL LLPreviewGesture::postBuild() if (item) { - getChild("desc")->setValue(item->getDescription()); - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetText("desc", item->getDescription()); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); - getChild("name")->setValue(item->getName()); - getChild("name")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetText("name", item->getName()); + childSetPrevalidate("name", &LLTextValidate::validateASCIIPrintableNoPipe); } return LLPreview::postBuild(); @@ -622,7 +622,7 @@ void LLPreviewGesture::refresh() if (mPreviewGesture || !is_complete) { - getChildView("desc")->setEnabled(FALSE); + childSetEnabled("desc", FALSE); //mDescEditor->setEnabled(FALSE); mTriggerEditor->setEnabled(FALSE); mReplaceText->setEnabled(FALSE); @@ -653,7 +653,7 @@ void LLPreviewGesture::refresh() BOOL modifiable = item->getPermissions().allowModifyBy(gAgent.getID()); - getChildView("desc")->setEnabled(modifiable); + childSetEnabled("desc", modifiable); mTriggerEditor->setEnabled(TRUE); mLibraryList->setEnabled(modifiable); mStepList->setEnabled(modifiable); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index e85a6a7094..2089beba26 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -85,20 +85,20 @@ BOOL LLPreviewNotecard::postBuild() ed->makePristine(); childSetAction("Save", onClickSave, this); - getChildView("lock")->setVisible( FALSE); + childSetVisible("lock", FALSE); childSetAction("Delete", onClickDelete, this); - getChildView("Delete")->setEnabled(false); + childSetEnabled("Delete", false); const LLInventoryItem* item = getItem(); childSetCommitCallback("desc", LLPreview::onText, this); if (item) { - getChild("desc")->setValue(item->getDescription()); - getChildView("Delete")->setEnabled(true); + childSetText("desc", item->getDescription()); + childSetEnabled("Delete", true); } - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -114,10 +114,10 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) LLViewerTextEditor* editor = getChild("Notecard Editor"); - getChildView("Notecard Editor")->setEnabled(enabled); - getChildView("lock")->setVisible( !enabled); - getChildView("desc")->setEnabled(enabled); - getChildView("Save")->setEnabled(enabled && editor && (!editor->isPristine())); + childSetEnabled("Notecard Editor", enabled); + childSetVisible("lock", !enabled); + childSetEnabled("desc", enabled); + childSetEnabled("Save", enabled && editor && (!editor->isPristine())); } @@ -126,7 +126,7 @@ void LLPreviewNotecard::draw() LLViewerTextEditor* editor = getChild("Notecard Editor"); BOOL changed = !editor->isPristine(); - getChildView("Save")->setEnabled(changed && getEnabled()); + childSetEnabled("Save", changed && getEnabled()); LLPreview::draw(); } @@ -277,7 +277,7 @@ void LLPreviewNotecard::loadAsset() GP_OBJECT_MANIPULATE)) { editor->setEnabled(FALSE); - getChildView("lock")->setVisible( TRUE); + childSetVisible("lock", TRUE); } } else diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index d280cf1625..5cb93e823d 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -213,7 +213,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata) void LLFloaterScriptSearch::handleBtnSearch() { LLCheckBoxCtrl* caseChk = getChild("case_text"); - mEditorCore->mEditor->selectNext(getChild("search_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->selectNext(childGetText("search_text"), caseChk->get()); } // static @@ -226,7 +226,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata) void LLFloaterScriptSearch::handleBtnReplace() { LLCheckBoxCtrl* caseChk = getChild("case_text"); - mEditorCore->mEditor->replaceText(getChild("search_text")->getValue().asString(), getChild("replace_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->replaceText(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); } // static @@ -239,7 +239,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata) void LLFloaterScriptSearch::handleBtnReplaceAll() { LLCheckBoxCtrl* caseChk = getChild("case_text"); - mEditorCore->mEditor->replaceTextAll(getChild("search_text")->getValue().asString(), getChild("replace_text")->getValue().asString(), caseChk->get()); + mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); } @@ -451,7 +451,7 @@ bool LLScriptEdCore::hasChanged() void LLScriptEdCore::draw() { BOOL script_changed = hasChanged(); - getChildView("Save_btn")->setEnabled(script_changed); + childSetEnabled("Save_btn", script_changed); if( mEditor->hasFocus() ) { @@ -463,11 +463,11 @@ void LLScriptEdCore::draw() args["[LINE]"] = llformat ("%d", line); args["[COLUMN]"] = llformat ("%d", column); cursor_pos = LLTrans::getString("CursorPos", args); - getChild("line_col")->setValue(cursor_pos); + childSetText("line_col", cursor_pos); } else { - getChild("line_col")->setValue(LLStringUtil::null); + childSetText("line_col", LLStringUtil::null); } updateDynamicHelp(); @@ -660,7 +660,7 @@ void LLScriptEdCore::onBtnDynamicHelp() if (parent) parent->addDependentFloater(live_help_floater, TRUE); live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); - live_help_floater->getChild("lock_check")->setValue(gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); + live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, this); live_help_floater->childSetAction("back_btn", onClickBack, this); live_help_floater->childSetAction("fwd_btn", onClickForward, this); @@ -953,10 +953,10 @@ BOOL LLPreviewLSL::postBuild() llassert(item); if (item) { - getChild("desc")->setValue(item->getDescription()); + childSetText("desc", item->getDescription()); } childSetCommitCallback("desc", LLPreview::onText, this); - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -1034,8 +1034,8 @@ void LLPreviewLSL::loadAsset() mScriptEd->mFunctions->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } - getChildView("lock")->setVisible( !is_modifiable); - mScriptEd->getChildView("Insert...")->setEnabled(is_modifiable); + childSetVisible("lock", !is_modifiable); + mScriptEd->childSetEnabled("Insert...", is_modifiable); } else { @@ -1423,14 +1423,14 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : BOOL LLLiveLSLEditor::postBuild() { childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); - getChildView("running")->setEnabled(FALSE); + childSetEnabled("running", FALSE); childSetAction("Reset",&LLLiveLSLEditor::onReset,this); - getChildView("Reset")->setEnabled(TRUE); + childSetEnabled("Reset", TRUE); mMonoCheckbox = getChild("mono"); childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); - getChildView("mono")->setEnabled(FALSE); + childSetEnabled("mono", FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mEditor->setFocus(TRUE); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 6b53b45990..bacdf20cae 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -54,7 +54,7 @@ BOOL LLPreviewSound::postBuild() const LLInventoryItem* item = getItem(); if (item) { - getChild("desc")->setValue(item->getDescription()); + childSetText("desc", item->getDescription()); if (gAudiop) gAudiop->preloadSound(item->getAssetUUID()); // preload the sound } @@ -69,7 +69,7 @@ BOOL LLPreviewSound::postBuild() button->setSoundFlags(LLView::SILENT); childSetCommitCallback("desc", LLPreview::onText, this); - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1155f35de8..2eb362cd7e 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -99,7 +99,7 @@ BOOL LLPreviewTexture::postBuild() { getChild("Keep")->setLabel(getString("Copy")); childSetAction("Keep",LLPreview::onBtnCopyToInv,this); - getChildView("Discard")->setVisible( false); + childSetVisible("Discard", false); } else if (mShowKeepDiscard) { @@ -108,13 +108,13 @@ BOOL LLPreviewTexture::postBuild() } else { - getChildView("Keep")->setVisible( false); - getChildView("Discard")->setVisible( false); + childSetVisible("Keep", false); + childSetVisible("Discard", false); } childSetAction("save_tex_btn", LLPreviewTexture::onSaveAsBtn, this); - getChildView("save_tex_btn")->setVisible( true); - getChildView("save_tex_btn")->setEnabled(canSaveAs()); + childSetVisible("save_tex_btn", true); + childSetEnabled("save_tex_btn", canSaveAs()); if (!mCopyToInv) { @@ -123,8 +123,8 @@ BOOL LLPreviewTexture::postBuild() if (item) { childSetCommitCallback("desc", LLPreview::onText, this); - getChild("desc")->setValue(item->getDescription()); - getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetText("desc", item->getDescription()); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); } } @@ -283,7 +283,8 @@ void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPreview::reshape(width, height, called_from_parent); - LLRect dim_rect(getChildView("dimensions")->getRect()); + LLRect dim_rect; + childGetRect("dimensions", dim_rect); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -405,11 +406,12 @@ void LLPreviewTexture::updateDimensions() mUpdateDimensions = FALSE; - getChild("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); - getChild("dimensions")->setTextArg("[HEIGHT]", llformat("%d", mImage->getFullHeight())); + childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth())); + childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight())); - LLRect dim_rect(getChildView("dimensions")->getRect()); + LLRect dim_rect; + childGetRect("dimensions", dim_rect); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -483,8 +485,9 @@ void LLPreviewTexture::updateDimensions() // Hide the aspect ratio label if the window is too narrow // Assumes the label should be to the right of the dimensions - LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); - getChildView("aspect_ratio")->setVisible( dim_rect.mRight < aspect_label_rect.mLeft); + LLRect aspect_label_rect; + childGetRect("aspect_ratio", aspect_label_rect); + childSetVisible("aspect_ratio", dim_rect.mRight < aspect_label_rect.mLeft); } @@ -541,7 +544,7 @@ void LLPreviewTexture::loadAsset() mAssetStatus = PREVIEW_ASSET_LOADING; mUpdateDimensions = TRUE; updateDimensions(); - getChildView("save_tex_btn")->setEnabled(canSaveAs()); + childSetEnabled("save_tex_btn", canSaveAs()); } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index d63a48647d..27f871c017 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -30,6 +30,7 @@ #include "message.h" +#include "llpanelplace.h" #include "llpanel.h" #include "llhttpclient.h" #include "llsdserialize.h" diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index cbad85cfd3..bb084dc94d 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -88,5 +88,5 @@ void LLSaveOutfitComboBtn::setMenuItemEnabled(const std::string& item, bool enab void LLSaveOutfitComboBtn::setSaveBtnEnabled(bool enabled) { - mParent->getChildView(SAVE_BTN)->setEnabled(enabled); + mParent->childSetEnabled(SAVE_BTN, enabled); } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 2334f0cde5..00afb00ddc 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -26,7 +26,6 @@ #include "llviewerprecompiledheaders.h" #include "llscriptfloater.h" -#include "llagentcamera.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -66,7 +65,6 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) { setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this)); setOverlapsScreenChannel(true); - mIsDockedStateForcedCallback = boost::bind(&LLAgentCamera::cameraMouselook, &gAgentCamera); } bool LLScriptFloater::toggle(const LLUUID& notification_id) diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 2d8c9b0fec..504115896a 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -73,17 +73,17 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param mHintMin->setAllowsUpdates( FALSE ); mHintMax->setAllowsUpdates( FALSE ); - getChild("param slider")->setValue(weightToPercent(param->getWeight())); + childSetValue("param slider", weightToPercent(param->getWeight())); std::string display_name = LLTrans::getString(param->getDisplayName()); - getChild("param slider")->setLabelArg("[DESC]", display_name); - getChildView("param slider")->setEnabled(mAllowModify); + childSetLabelArg("param slider", "[DESC]", display_name); + childSetEnabled("param slider", mAllowModify); childSetCommitCallback("param slider", LLScrollingPanelParam::onSliderMoved, this); std::string min_name = LLTrans::getString(param->getMinDisplayName()); std::string max_name = LLTrans::getString(param->getMaxDisplayName()); - getChild("min param text")->setValue(min_name); - getChild("max param text")->setValue(max_name); + childSetValue("min param text", min_name); + childSetValue("max param text", max_name); LLButton* less = getChild("less"); if (less) @@ -120,14 +120,14 @@ void LLScrollingPanelParam::updatePanel(BOOL allow_modify) return; } F32 current_weight = mWearable->getVisualParamWeight( param->getID() ); - getChild("param slider")->setValue(weightToPercent( current_weight ) ); + childSetValue("param slider", weightToPercent( current_weight ) ); mHintMin->requestUpdate( sUpdateDelayFrames++ ); mHintMax->requestUpdate( sUpdateDelayFrames++ ); mAllowModify = allow_modify; - getChildView("param slider")->setEnabled(mAllowModify); - getChildView("less")->setEnabled(mAllowModify); - getChildView("more")->setEnabled(mAllowModify); + childSetEnabled("param slider", mAllowModify); + childSetEnabled("less", mAllowModify); + childSetEnabled("more", mAllowModify); } void LLScrollingPanelParam::setVisible( BOOL visible ) @@ -153,16 +153,16 @@ void LLScrollingPanelParam::draw() return; } - getChildView("less")->setVisible( mHintMin->getVisible()); - getChildView("more")->setVisible( mHintMax->getVisible()); + childSetVisible("less", mHintMin->getVisible()); + childSetVisible("more", mHintMax->getVisible()); // hide borders if texture has been loaded - getChildView("left_border")->setVisible( !mHintMin->getVisible()); - getChildView("right_border")->setVisible( !mHintMax->getVisible()); + childSetVisible("left_border", !mHintMin->getVisible()); + childSetVisible("right_border", !mHintMax->getVisible()); // Draw all the children except for the labels - getChildView("min param text")->setVisible( FALSE ); - getChildView("max param text")->setVisible( FALSE ); + childSetVisible( "min param text", FALSE ); + childSetVisible( "max param text", FALSE ); LLPanel::draw(); // Draw the hints over the "less" and "more" buttons. @@ -184,10 +184,10 @@ void LLScrollingPanelParam::draw() // Draw labels on top of the buttons - getChildView("min param text")->setVisible( TRUE ); + childSetVisible( "min param text", TRUE ); drawChild(getChild("min param text")); - getChildView("max param text")->setVisible( TRUE ); + childSetVisible( "max param text", TRUE ); drawChild(getChild("max param text")); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index c9b60bf7f5..85ae37f9a8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3609,7 +3609,7 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) // Attachments //---------------------------------------------------------------------- -void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) +void LLSelectMgr::sendAttach(U8 attachment_point) { LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject(); @@ -3623,12 +3623,9 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) if (0 == attachment_point || get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) { - if (!replace || attachment_point != 0) - { - // If we know the attachment point then we got here by clicking an - // "Attach to..." context menu item, so we should add, not replace. + + if (gSavedSettings.getBOOL("MultipleAttachments")) attachment_point |= ATTACHMENT_ADD; - } sendListToRegions( "ObjectAttach", diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index e6db264377..fc9879b75a 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -606,7 +606,7 @@ public: // verification only, if it doesn't match region info then sale is // canceled void sendBuy(const LLUUID& buyer_id, const LLUUID& category_id, const LLSaleInfo sale_info); - void sendAttach(U8 attachment_point, bool replace); + void sendAttach(U8 attachment_point); void sendDetach(); void sendDropAttachment(); void sendLink(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 7206e4fcaf..fe7950c058 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -468,7 +468,7 @@ void LLSidepanelAppearance::fetchInventory() { LLViewerObject* attached_object = (*attachment_iter); if (!attached_object) continue; - const LLUUID& item_id = attached_object->getAttachmentItemID(); + const LLUUID& item_id = attached_object->getItemID(); if (item_id.isNull()) continue; ids.push_back(item_id); } @@ -496,8 +496,8 @@ void LLSidepanelAppearance::inventoryFetched() void LLSidepanelAppearance::setWearablesLoading(bool val) { - getChildView("wearables_loading_indicator")->setVisible( val); - getChildView("edit_outfit_btn")->setVisible( !val); + childSetVisible("wearables_loading_indicator", val); + childSetVisible("edit_outfit_btn", !val); if (!val) { diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 731079fb5d..d98398c484 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -104,9 +104,9 @@ BOOL LLSidepanelItemInfo::postBuild() { LLSidepanelInventorySubpanel::postBuild(); - getChild("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); getChild("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); - getChild("LabelItemDesc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); getChild("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); // Creator information getChild("BtnCreator")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickCreator,this)); @@ -187,7 +187,7 @@ void LLSidepanelItemInfo::refresh() for(size_t t=0; tsetEnabled(false); + childSetEnabled(no_item_names[t],false); } const std::string hide_names[]={ @@ -199,7 +199,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; tsetVisible(false); + childSetVisible(hide_names[t],false); } } @@ -211,7 +211,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; tsetEnabled(false); + childSetEnabled(no_edit_mode_names[t],false); } } @@ -259,13 +259,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete && not_in_trash; - getChildView("LabelItemNameTitle")->setEnabled(TRUE); - getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards - getChild("LabelItemName")->setValue(item->getName()); - getChildView("LabelItemDescTitle")->setEnabled(TRUE); - getChildView("LabelItemDesc")->setEnabled(is_modifiable); - getChildView("IconLocked")->setVisible(!is_modifiable); - getChild("LabelItemDesc")->setValue(item->getDescription()); + childSetEnabled("LabelItemNameTitle",TRUE); + childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards + childSetText("LabelItemName",item->getName()); + childSetEnabled("LabelItemDescTitle",TRUE); + childSetEnabled("LabelItemDesc",is_modifiable); + childSetVisible("IconLocked",!is_modifiable); + childSetText("LabelItemDesc",item->getDescription()); ////////////////// // CREATOR NAME // @@ -277,17 +277,17 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { std::string name; gCacheName->getFullName(item->getCreatorUUID(), name); - getChildView("BtnCreator")->setEnabled(TRUE); - getChildView("LabelCreatorTitle")->setEnabled(TRUE); - getChildView("LabelCreatorName")->setEnabled(TRUE); - getChild("LabelCreatorName")->setValue(name); + childSetEnabled("BtnCreator",TRUE); + childSetEnabled("LabelCreatorTitle",TRUE); + childSetEnabled("LabelCreatorName",TRUE); + childSetText("LabelCreatorName",name); } else { - getChildView("BtnCreator")->setEnabled(FALSE); - getChildView("LabelCreatorTitle")->setEnabled(FALSE); - getChildView("LabelCreatorName")->setEnabled(FALSE); - getChild("LabelCreatorName")->setValue(getString("unknown")); + childSetEnabled("BtnCreator",FALSE); + childSetEnabled("LabelCreatorTitle",FALSE); + childSetEnabled("LabelCreatorName",FALSE); + childSetText("LabelCreatorName",getString("unknown")); } //////////////// @@ -304,17 +304,17 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { gCacheName->getFullName(perm.getOwner(), name); } - getChildView("BtnOwner")->setEnabled(TRUE); - getChildView("LabelOwnerTitle")->setEnabled(TRUE); - getChildView("LabelOwnerName")->setEnabled(TRUE); - getChild("LabelOwnerName")->setValue(name); + childSetEnabled("BtnOwner",TRUE); + childSetEnabled("LabelOwnerTitle",TRUE); + childSetEnabled("LabelOwnerName",TRUE); + childSetText("LabelOwnerName",name); } else { - getChildView("BtnOwner")->setEnabled(FALSE); - getChildView("LabelOwnerTitle")->setEnabled(FALSE); - getChildView("LabelOwnerName")->setEnabled(FALSE); - getChild("LabelOwnerName")->setValue(getString("public")); + childSetEnabled("BtnOwner",FALSE); + childSetEnabled("LabelOwnerTitle",FALSE); + childSetEnabled("LabelOwnerName",FALSE); + childSetText("LabelOwnerName",getString("public")); } //////////// @@ -323,11 +323,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (object) { - getChild("origin")->setValue(getString("origin_inworld")); + childSetText("origin",getString("origin_inworld")); } else { - getChild("origin")->setValue(getString("origin_inventory")); + childSetText("origin",getString("origin_inventory")); } ////////////////// @@ -337,7 +337,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) time_t time_utc = item->getCreationDate(); if (0 == time_utc) { - getChild("LabelAcquiredDate")->setValue(getString("unknown")); + childSetText("LabelAcquiredDate",getString("unknown")); } else { @@ -345,7 +345,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); - getChild("LabelAcquiredDate")->setValue(timeStr); + childSetText ("LabelAcquiredDate", timeStr); } ////////////////////////////////////// @@ -388,12 +388,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; tsetVisible(false); + childSetVisible(perm_and_sale_items[t],false); } for(size_t t=0; tsetVisible(false); + childSetVisible(debug_items[t],false); } return; } @@ -401,7 +401,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; tsetVisible(true); + childSetVisible(perm_and_sale_items[t],true); } } @@ -410,11 +410,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) /////////////////////// if(can_agent_manipulate) { - getChild("OwnerLabel")->setValue(getString("you_can")); + childSetText("OwnerLabel",getString("you_can")); } else { - getChild("OwnerLabel")->setValue(getString("owner_can")); + childSetText("OwnerLabel",getString("owner_can")); } U32 base_mask = perm.getMaskBase(); @@ -423,13 +423,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - getChildView("OwnerLabel")->setEnabled(TRUE); - getChildView("CheckOwnerModify")->setEnabled(FALSE); - getChild("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); - getChildView("CheckOwnerCopy")->setEnabled(FALSE); - getChild("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY))); - getChildView("CheckOwnerTransfer")->setEnabled(FALSE); - getChild("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + childSetEnabled("OwnerLabel",TRUE); + childSetEnabled("CheckOwnerModify",FALSE); + childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY))); + childSetEnabled("CheckOwnerCopy",FALSE); + childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY))); + childSetEnabled("CheckOwnerTransfer",FALSE); + childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); /////////////////////// // DEBUG PERMISSIONS // @@ -453,39 +453,39 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); - getChild("BaseMaskDebug")->setValue(perm_string); - getChildView("BaseMaskDebug")->setVisible(TRUE); + childSetText("BaseMaskDebug",perm_string); + childSetVisible("BaseMaskDebug",TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); - getChild("OwnerMaskDebug")->setValue(perm_string); - getChildView("OwnerMaskDebug")->setVisible(TRUE); + childSetText("OwnerMaskDebug",perm_string); + childSetVisible("OwnerMaskDebug",TRUE); perm_string = "G"; perm_string += overwrite_group ? "*: " : ": "; perm_string += mask_to_string(group_mask); - getChild("GroupMaskDebug")->setValue(perm_string); - getChildView("GroupMaskDebug")->setVisible(TRUE); + childSetText("GroupMaskDebug",perm_string); + childSetVisible("GroupMaskDebug",TRUE); perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); - getChild("EveryoneMaskDebug")->setValue(perm_string); - getChildView("EveryoneMaskDebug")->setVisible(TRUE); + childSetText("EveryoneMaskDebug",perm_string); + childSetVisible("EveryoneMaskDebug",TRUE); perm_string = "N"; perm_string += slam_perm ? "*: " : ": "; perm_string += mask_to_string(next_owner_mask); - getChild("NextMaskDebug")->setValue(perm_string); - getChildView("NextMaskDebug")->setVisible(TRUE); + childSetText("NextMaskDebug",perm_string); + childSetVisible("NextMaskDebug",TRUE); } else { - getChildView("BaseMaskDebug")->setVisible(FALSE); - getChildView("OwnerMaskDebug")->setVisible(FALSE); - getChildView("GroupMaskDebug")->setVisible(FALSE); - getChildView("EveryoneMaskDebug")->setVisible(FALSE); - getChildView("NextMaskDebug")->setVisible(FALSE); + childSetVisible("BaseMaskDebug",FALSE); + childSetVisible("OwnerMaskDebug",FALSE); + childSetVisible("GroupMaskDebug",FALSE); + childSetVisible("EveryoneMaskDebug",FALSE); + childSetVisible("NextMaskDebug",FALSE); } ///////////// @@ -495,18 +495,18 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // Check for ability to change values. if (is_link || cannot_restrict_permissions) { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } else if (is_obj_modify && can_agent_manipulate) { - getChildView("CheckShareWithGroup")->setEnabled(TRUE); - getChildView("CheckEveryoneCopy")->setEnabled((owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); + childSetEnabled("CheckShareWithGroup",TRUE); + childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); } else { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } // Set values. @@ -516,7 +516,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_group_copy && is_group_modify && is_group_move) { - getChild("CheckShareWithGroup")->setValue(LLSD((BOOL)TRUE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); LLCheckBoxCtrl* ctl = getChild("CheckShareWithGroup"); if(ctl) @@ -526,7 +526,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } else if (!is_group_copy && !is_group_modify && !is_group_move) { - getChild("CheckShareWithGroup")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); LLCheckBoxCtrl* ctl = getChild("CheckShareWithGroup"); if(ctl) { @@ -543,7 +543,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } } - getChild("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY))); + childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); /////////////// // SALE INFO // @@ -555,48 +555,48 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - getChildView("SaleLabel")->setEnabled(is_complete); - getChildView("CheckPurchase")->setEnabled(is_complete); + childSetEnabled("SaleLabel",is_complete); + childSetEnabled("CheckPurchase",is_complete); - getChildView("NextOwnerLabel")->setEnabled(TRUE); - getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("NextOwnerLabel",TRUE); + childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); - getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); + childSetEnabled("TextPrice",is_complete && is_for_sale); + childSetEnabled("Edit Cost",is_complete && is_for_sale); } else { - getChildView("SaleLabel")->setEnabled(FALSE); - getChildView("CheckPurchase")->setEnabled(FALSE); + childSetEnabled("SaleLabel",FALSE); + childSetEnabled("CheckPurchase",FALSE); - getChildView("NextOwnerLabel")->setEnabled(FALSE); - getChildView("CheckNextOwnerModify")->setEnabled(FALSE); - getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); - getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); + childSetEnabled("NextOwnerLabel",FALSE); + childSetEnabled("CheckNextOwnerModify",FALSE); + childSetEnabled("CheckNextOwnerCopy",FALSE); + childSetEnabled("CheckNextOwnerTransfer",FALSE); - getChildView("TextPrice")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("TextPrice",FALSE); + childSetEnabled("Edit Cost",FALSE); } // Set values. - getChild("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); - getChild("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); - getChild("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); - getChild("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); + childSetValue("CheckPurchase", is_for_sale); + childSetEnabled("combobox sale copy", is_for_sale); + childSetEnabled("Edit Cost", is_for_sale); + childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY))); + childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); + childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); if (is_for_sale) { S32 numerical_price; numerical_price = sale_info.getSalePrice(); - getChild("Edit Cost")->setValue(llformat("%d",numerical_price)); + childSetText("Edit Cost",llformat("%d",numerical_price)); } else { - getChild("Edit Cost")->setValue(llformat("%d",0)); + childSetText("Edit Cost",llformat("%d",0)); } } @@ -817,10 +817,10 @@ void LLSidepanelItemInfo::updateSaleInfo() LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) { - getChild("CheckPurchase")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckPurchase",LLSD((BOOL)FALSE)); } - if((BOOL)getChild("CheckPurchase")->getValue()) + if((BOOL)childGetValue("CheckPurchase")) { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 4552088cad..c55cc12401 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -101,9 +101,9 @@ BOOL LLSidepanelTaskInfo::postBuild() mLabelGroupName = getChild("Group Name Proxy"); childSetCommitCallback("Object Name", LLSidepanelTaskInfo::onCommitName,this); - getChild("Object Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("Object Name", LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description", LLSidepanelTaskInfo::onCommitDesc,this); - getChild("Object Description")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("Object Description", LLTextValidate::validateASCIIPrintableNoPipe); getChild("button set group")->setCommitCallback(boost::bind(&LLSidepanelTaskInfo::onClickGroup,this)); childSetCommitCallback("checkbox share with group", &LLSidepanelTaskInfo::onCommitGroupShare,this); childSetAction("button deed", &LLSidepanelTaskInfo::onClickDeedToGroup,this); @@ -138,81 +138,81 @@ BOOL LLSidepanelTaskInfo::postBuild() void LLSidepanelTaskInfo::disableAll() { - getChildView("perm_modify")->setEnabled(FALSE); - getChild("perm_modify")->setValue(LLStringUtil::null); - - getChildView("Creator:")->setEnabled(FALSE); - getChild("Creator Name")->setValue(LLStringUtil::null); - getChildView("Creator Name")->setEnabled(FALSE); - - getChildView("Owner:")->setEnabled(FALSE); - getChild("Owner Name")->setValue(LLStringUtil::null); - getChildView("Owner Name")->setEnabled(FALSE); - - getChildView("Group:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("button set group")->setEnabled(FALSE); - - getChild("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Name:")->setEnabled(FALSE); - getChild("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("Description:")->setEnabled(FALSE); - getChild("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); - - getChildView("Permissions:")->setEnabled(FALSE); + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); - getChild("checkbox share with group")->setValue(FALSE); - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("button deed")->setEnabled(FALSE); + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); - getChild("checkbox allow everyone move")->setValue(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); //Next owner can: - getChildView("Next owner can:")->setEnabled(FALSE); - getChild("checkbox next owner can modify")->setValue(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChild("checkbox next owner can copy")->setValue(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); //checkbox for sale - getChild("checkbox for sale")->setValue(FALSE); - getChildView("checkbox for sale")->setEnabled(FALSE); + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); //checkbox include in search - getChild("search_check")->setValue(FALSE); - getChildView("search_check")->setEnabled(FALSE); + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); LLComboBox* combo_sale_type = getChild("sale type"); combo_sale_type->setValue(LLSaleInfo::FS_COPY); combo_sale_type->setEnabled(FALSE); - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); - getChildView("label click action")->setEnabled(FALSE); + childSetEnabled("label click action", FALSE); LLComboBox* combo_click_action = getChild("clickaction"); if (combo_click_action) { combo_click_action->setEnabled(FALSE); combo_click_action->clear(); } - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); @@ -283,23 +283,23 @@ void LLSidepanelTaskInfo::refresh() { ++string_index; } - getChildView("perm_modify")->setEnabled(TRUE); - getChild("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - getChildView("Permissions:")->setEnabled(TRUE); + childSetEnabled("Permissions:", TRUE); // Update creator text field - getChildView("Creator:")->setEnabled(TRUE); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - getChild("Creator Name")->setValue(creator_name); - getChildView("Creator Name")->setEnabled(TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - getChildView("Owner:")->setEnabled(TRUE); + childSetEnabled("Owner:", TRUE); std::string owner_name; const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); @@ -324,12 +324,12 @@ void LLSidepanelTaskInfo::refresh() } } } - getChild("Owner Name")->setValue(owner_name); - getChildView("Owner Name")->setEnabled(TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - getChildView("Group:")->setEnabled(TRUE); - getChild("Group Name")->setValue(LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -350,18 +350,18 @@ void LLSidepanelTaskInfo::refresh() } } - getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - getChildView("Name:")->setEnabled(TRUE); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - getChildView("Description:")->setEnabled(TRUE); + childSetEnabled("Description:", TRUE); LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); if (is_one_object) { if (!LineEditorObjectName->hasFocus()) { - getChild("Object Name")->setValue(nodep->mName); + childSetText("Object Name",nodep->mName); } if (LineEditorObjectDesc) @@ -374,7 +374,7 @@ void LLSidepanelTaskInfo::refresh() } else { - getChild("Object Name")->setValue(LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } @@ -386,13 +386,13 @@ void LLSidepanelTaskInfo::refresh() } if (edit_name_desc) { - getChildView("Object Name")->setEnabled(TRUE); - getChildView("Object Description")->setEnabled(TRUE); + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Object Description")->setEnabled(FALSE); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -414,9 +414,9 @@ void LLSidepanelTaskInfo::refresh() if (!owners_identical) { - getChildView("Cost")->setEnabled(FALSE); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) @@ -424,11 +424,11 @@ void LLSidepanelTaskInfo::refresh() // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - getChild("Cost")->setValue(getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - getChild("Cost")->setValue(getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); @@ -452,35 +452,35 @@ void LLSidepanelTaskInfo::refresh() // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; - getChildView("Cost")->setEnabled(enable_edit); - getChildView("Edit Cost")->setEnabled(enable_edit); + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. else if (!public_owned) { - getChildView("Cost")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - getChild("Edit Cost")->setValue(llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - getChild("Edit Cost")->setValue(LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - getChild("Cost")->setValue(getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - getChild("Cost")->setValue(getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - getChildView("Cost")->setEnabled(FALSE); - getChild("Cost")->setValue(getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - getChild("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes @@ -522,20 +522,20 @@ void LLSidepanelTaskInfo::refresh() { if (valid_base_perms) { - getChild("B:")->setValue("B: " + mask_to_string(base_mask_on)); - getChildView("B:")->setVisible( TRUE); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - getChild("O:")->setValue("O: " + mask_to_string(owner_mask_on)); - getChildView("O:")->setVisible( TRUE); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - getChild("G:")->setValue("G: " + mask_to_string(group_mask_on)); - getChildView("G:")->setVisible( TRUE); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - getChild("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); - getChildView("E:")->setVisible( TRUE); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - getChild("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); - getChildView("N:")->setVisible( TRUE); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } U32 flag_mask = 0x0; @@ -544,17 +544,17 @@ void LLSidepanelTaskInfo::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - getChild("F:")->setValue("F:" + mask_to_string(flag_mask)); - getChildView("F:")->setVisible( TRUE); + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } BOOL has_change_perm_ability = FALSE; @@ -574,65 +574,65 @@ void LLSidepanelTaskInfo::refresh() if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - getChild("perm_modify")->setValue(getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - getChildView("checkbox share with group")->setEnabled(TRUE); - getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE); - getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - getChild("checkbox for sale")->setTentative( is_for_sale_mixed); - getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - getChildView("Next owner can:")->setEnabled(TRUE); - getChildView("checkbox next owner can modify")->setEnabled(base_mask_on & PERM_MODIFY); - getChildView("checkbox next owner can copy")->setEnabled(base_mask_on & PERM_COPY); - getChildView("checkbox next owner can transfer")->setEnabled(next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - getChildView("checkbox for sale")->setEnabled(FALSE); - getChildView("sale type")->setEnabled(FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - getChildView("Next owner can:")->setEnabled(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } if (valid_group_perms) { if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - getChild("checkbox share with group")->setValue(TRUE); - getChild("checkbox share with group")->setTentative( FALSE); - getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - getChild("checkbox share with group")->setValue(FALSE); - getChild("checkbox share with group")->setTentative( FALSE); - getChildView("button deed")->setEnabled(FALSE); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - getChild("checkbox share with group")->setValue(TRUE); - getChild("checkbox share with group")->setTentative( TRUE); - getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } @@ -641,35 +641,35 @@ void LLSidepanelTaskInfo::refresh() // Move if (everyone_mask_on & PERM_MOVE) { - getChild("checkbox allow everyone move")->setValue(TRUE); - getChild("checkbox allow everyone move")->setTentative( FALSE); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } else if (everyone_mask_off & PERM_MOVE) { - getChild("checkbox allow everyone move")->setValue(FALSE); - getChild("checkbox allow everyone move")->setTentative( FALSE); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - getChild("checkbox allow everyone move")->setValue(TRUE); - getChild("checkbox allow everyone move")->setTentative( TRUE); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy if (everyone_mask_on & PERM_COPY) { - getChild("checkbox allow everyone copy")->setValue(TRUE); - getChild("checkbox allow everyone copy")->setTentative( !can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } else if (everyone_mask_off & PERM_COPY) { - getChild("checkbox allow everyone copy")->setValue(FALSE); - getChild("checkbox allow everyone copy")->setTentative( FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - getChild("checkbox allow everyone copy")->setValue(TRUE); - getChild("checkbox allow everyone copy")->setTentative( TRUE); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } @@ -678,52 +678,52 @@ void LLSidepanelTaskInfo::refresh() // Modify == next owner canot modify if (next_owner_mask_on & PERM_MODIFY) { - getChild("checkbox next owner can modify")->setValue(TRUE); - getChild("checkbox next owner can modify")->setTentative( FALSE); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } else if (next_owner_mask_off & PERM_MODIFY) { - getChild("checkbox next owner can modify")->setValue(FALSE); - getChild("checkbox next owner can modify")->setTentative( FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - getChild("checkbox next owner can modify")->setValue(TRUE); - getChild("checkbox next owner can modify")->setTentative( TRUE); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy if (next_owner_mask_on & PERM_COPY) { - getChild("checkbox next owner can copy")->setValue(TRUE); - getChild("checkbox next owner can copy")->setTentative( !can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } else if (next_owner_mask_off & PERM_COPY) { - getChild("checkbox next owner can copy")->setValue(FALSE); - getChild("checkbox next owner can copy")->setTentative( FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - getChild("checkbox next owner can copy")->setValue(TRUE); - getChild("checkbox next owner can copy")->setTentative( TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer if (next_owner_mask_on & PERM_TRANSFER) { - getChild("checkbox next owner can transfer")->setValue(TRUE); - getChild("checkbox next owner can transfer")->setTentative( !can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } else if (next_owner_mask_off & PERM_TRANSFER) { - getChild("checkbox next owner can transfer")->setValue(FALSE); - getChild("checkbox next owner can transfer")->setTentative( FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - getChild("checkbox next owner can transfer")->setValue(TRUE); - getChild("checkbox next owner can transfer")->setTentative( TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -745,7 +745,7 @@ void LLSidepanelTaskInfo::refresh() combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - getChild("checkbox for sale")->setValue((num_for_sale != 0)); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only @@ -755,7 +755,7 @@ void LLSidepanelTaskInfo::refresh() { if (num_for_sale && has_change_sale_ability) { - getChildView("checkbox for sale")->setEnabled(true); + childSetEnabled("checkbox for sale", true); } } @@ -763,9 +763,9 @@ void LLSidepanelTaskInfo::refresh() const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - getChildView("search_check")->setEnabled(has_change_sale_ability && all_volume); - getChild("search_check")->setValue(include_in_search); - getChild("search_check")->setTentative( !all_include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; @@ -777,8 +777,8 @@ void LLSidepanelTaskInfo::refresh() ComboClickAction->setCurrentByIndex((S32)click_action); } } - getChildView("label click action")->setEnabled(is_perm_modify && all_volume); - getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); if (!getIsEditing()) { @@ -804,7 +804,7 @@ void LLSidepanelTaskInfo::refresh() }; for (size_t t=0; tsetEnabled( FALSE); + childSetEnabled(no_item_names[t], FALSE); } } updateVerbs(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index fb984a7c62..317b597a11 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1508,7 +1508,6 @@ void LLSpatialGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) { - LLFastTimer t(FTM_OCCLUSION_READBACK); LLSpatialGroup* parent = getParent(); if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED)) { //if the parent has been marked as occluded, the child is implicitly occluded @@ -1516,6 +1515,7 @@ void LLSpatialGroup::checkOcclusion() } else if (isOcclusionState(QUERY_PENDING)) { //otherwise, if a query is pending, read it back + LLFastTimer t(FTM_OCCLUSION_READBACK); GLuint res = 1; if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { @@ -1919,8 +1919,11 @@ public: return; } - if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) || - mRes == 2) + if (mRes == 2) + { + //fully in, don't traverse further (won't effect extents + } + else if (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) { //don't need to do frustum check LLSpatialGroup::OctreeTraveler::traverse(n); } @@ -3415,23 +3418,11 @@ LLCullResult::LLCullResult() void LLCullResult::clear() { mVisibleGroupsSize = 0; - mVisibleGroupsEnd = mVisibleGroups.begin(); - mAlphaGroupsSize = 0; - mAlphaGroupsEnd = mAlphaGroups.begin(); - mOcclusionGroupsSize = 0; - mOcclusionGroupsEnd = mOcclusionGroups.begin(); - mDrawableGroupsSize = 0; - mDrawableGroupsEnd = mDrawableGroups.begin(); - mVisibleListSize = 0; - mVisibleListEnd = mVisibleList.begin(); - mVisibleBridgeSize = 0; - mVisibleBridgeEnd = mVisibleBridge.begin(); - for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) { @@ -3440,7 +3431,6 @@ void LLCullResult::clear() mRenderMap[i][j] = 0; } mRenderMapSize[i] = 0; - mRenderMapEnd[i] = mRenderMap[i].begin(); } } @@ -3451,7 +3441,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups() LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups() { - return mVisibleGroupsEnd; + return mVisibleGroups.begin() + mVisibleGroupsSize; } LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() @@ -3461,7 +3451,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups() { - return mAlphaGroupsEnd; + return mAlphaGroups.begin() + mAlphaGroupsSize; } LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() @@ -3471,7 +3461,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups() { - return mOcclusionGroupsEnd; + return mOcclusionGroups.begin() + mOcclusionGroupsSize; } LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() @@ -3481,7 +3471,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups() { - return mDrawableGroupsEnd; + return mDrawableGroups.begin() + mDrawableGroupsSize; } LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() @@ -3491,7 +3481,7 @@ LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList() { - return mVisibleListEnd; + return mVisibleList.begin() + mVisibleListSize; } LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() @@ -3501,7 +3491,7 @@ LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge() { - return mVisibleBridgeEnd; + return mVisibleBridge.begin() + mVisibleBridgeSize; } LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) @@ -3511,7 +3501,7 @@ LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type) { - return mRenderMapEnd[type]; + return mRenderMap[type].begin() + mRenderMapSize[type]; } void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) @@ -3525,7 +3515,6 @@ void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) mVisibleGroups.push_back(group); } ++mVisibleGroupsSize; - mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize; } void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) @@ -3539,7 +3528,6 @@ void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) mAlphaGroups.push_back(group); } ++mAlphaGroupsSize; - mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize; } void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) @@ -3553,7 +3541,6 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) mOcclusionGroups.push_back(group); } ++mOcclusionGroupsSize; - mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize; } void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) @@ -3567,7 +3554,6 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) mDrawableGroups.push_back(group); } ++mDrawableGroupsSize; - mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize; } void LLCullResult::pushDrawable(LLDrawable* drawable) @@ -3581,7 +3567,6 @@ void LLCullResult::pushDrawable(LLDrawable* drawable) mVisibleList.push_back(drawable); } ++mVisibleListSize; - mVisibleListEnd = mVisibleList.begin()+mVisibleListSize; } void LLCullResult::pushBridge(LLSpatialBridge* bridge) @@ -3595,7 +3580,6 @@ void LLCullResult::pushBridge(LLSpatialBridge* bridge) mVisibleBridge.push_back(bridge); } ++mVisibleBridgeSize; - mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize; } void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) @@ -3609,7 +3593,6 @@ void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) mRenderMap[type].push_back(draw_info); } ++mRenderMapSize[type]; - mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type]; } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 1a25f3f85d..cc634b784c 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -338,11 +338,11 @@ public: F32 mBuilt; OctreeNode* mOctreeNode; LLSpatialPartition* mSpatialPartition; - LLVector3 mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) - LLVector3 mExtents[2]; // extents (min, max) of this node and all its children + LLVector3 mBounds[2]; + LLVector3 mExtents[2]; - LLVector3 mObjectExtents[2]; // extents (min, max) of objects in this node - LLVector3 mObjectBounds[2]; // bounding box (center, size) of objects in this node + LLVector3 mObjectExtents[2]; + LLVector3 mObjectBounds[2]; LLPointer mVertexBuffer; F32* mOcclusionVerts; @@ -526,19 +526,12 @@ private: U32 mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES]; sg_list_t mVisibleGroups; - sg_list_t::iterator mVisibleGroupsEnd; sg_list_t mAlphaGroups; - sg_list_t::iterator mAlphaGroupsEnd; sg_list_t mOcclusionGroups; - sg_list_t::iterator mOcclusionGroupsEnd; sg_list_t mDrawableGroups; - sg_list_t::iterator mDrawableGroupsEnd; drawable_list_t mVisibleList; - drawable_list_t::iterator mVisibleListEnd; bridge_list_t mVisibleBridge; - bridge_list_t::iterator mVisibleBridgeEnd; drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; - drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES]; }; @@ -605,13 +598,14 @@ public: //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { - public: +public: virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); + }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 196ed5e0bb..1c418feabd 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -68,10 +68,7 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy void LLSpeaker::lookupName() { - if (mDisplayName.empty()) - { - gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4)); - } + gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4)); } void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 975d1f9f32..e6f93d34ac 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -112,6 +112,7 @@ #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" +#include "llfriendcard.h" #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "lllogininstance.h" // Host the login module. @@ -121,6 +122,7 @@ #include "llfloaterevent.h" #include "llpanelclassified.h" #include "llpanelpick.h" +#include "llpanelplace.h" #include "llpanelgrouplandmoney.h" #include "llpanelgroupnotices.h" #include "llpreview.h" @@ -1638,6 +1640,12 @@ bool idle_startup() //all categories loaded. lets create "My Favorites" category gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); + // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, + // fetches their contents if needed and synchronizes it with buddies list. + // If the folders are not found they are created. + LLFriendCardsManager::instance().syncFriendCardsFolders(); + + // set up callbacks llinfos << "Registering Callbacks" << llendl; LLMessageSystem* msg = gMessageSystem; @@ -2919,8 +2927,9 @@ bool process_login_success_response() text = response["agent_region_access"].asString(); if (!text.empty()) { - U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]); - + U32 preferredMaturity = + llmin((U32)LLAgent::convertTextToMaturity(text[0]), + gSavedSettings.getU32("PreferredMaturity")); gSavedSettings.setU32("PreferredMaturity", preferredMaturity); } // During the AO transition, this flag will be true. Then the flag will @@ -3133,13 +3142,6 @@ bool process_login_success_response() } } - // Set the location of the snapshot sharing config endpoint - std::string snapshot_config_url = response["snapshot_config_url"]; - if(!snapshot_config_url.empty()) - { - gSavedSettings.setString("SnapshotConfigURL", snapshot_config_url); - } - // Start the process of fetching the OpenID session cookie for this user login std::string openid_url = response["openid_url"]; if(!openid_url.empty()) diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b622e98971..af011d8599 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -105,6 +105,8 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; +static void onClickHealth(void*); +static void onClickScriptDebug(void*); static void onClickVolume(void*); std::vector LLStatusBar::sDays; @@ -187,6 +189,9 @@ BOOL LLStatusBar::postBuild() gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); + childSetAction("scriptout", onClickScriptDebug, this); + childSetAction("health", onClickHealth, this); + // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; @@ -224,7 +229,7 @@ BOOL LLStatusBar::postBuild() mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); - getChild("stat_btn")->setClickedCallback(onClickStatGraph); + childSetActionTextbox("stat_btn", onClickStatGraph); mPanelVolumePulldown = new LLPanelVolumePulldown(); addChild(mPanelVolumePulldown); @@ -236,17 +241,14 @@ BOOL LLStatusBar::postBuild() mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelNearByMedia->setVisible(FALSE); - mScriptOut = getChildView("scriptout"); - return TRUE; } // Per-frame updates of visibility void LLStatusBar::refresh() { - static LLCachedControl show_net_stats(gSavedSettings, "ShowNetStats", false); - bool net_stats_visible = show_net_stats; - + bool net_stats_visible = gSavedSettings.getBOOL("ShowNetStats"); + if (net_stats_visible) { // Adding Net Stat Meter back in @@ -258,30 +260,26 @@ void LLStatusBar::refresh() mSGBandwidth->setThreshold(2, bwtotal); } - // update clock every 10 seconds - if(mClockUpdateTimer.getElapsedTimeF32() > 10.f) - { - mClockUpdateTimer.reset(); - - // Get current UTC time, adjusted for the user's clock - // being off. - time_t utc_time; - utc_time = time_corrected(); - - std::string timeStr = getString("time"); - LLSD substitution; - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - mTextTime->setText(timeStr); - - // set the tooltip to have the date - std::string dtStr = getString("timeTooltip"); - LLStringUtil::format (dtStr, substitution); - mTextTime->setToolTip (dtStr); - } + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time; + utc_time = time_corrected(); + + std::string timeStr = getString("time"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + mTextTime->setText(timeStr); + + // set the tooltip to have the date + std::string dtStr = getString("timeTooltip"); + LLStringUtil::format (dtStr, substitution); + mTextTime->setToolTip (dtStr); LLRect r; const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); + S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; + S32 y = 0; // reshape menu bar to its content's width if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) @@ -289,9 +287,48 @@ void LLStatusBar::refresh() gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight()); } + LLViewerRegion *region = gAgent.getRegion(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + LLRect buttonRect; + + if (LLHUDIcon::iconsNearby()) + { + childGetRect( "scriptout", buttonRect ); + r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); + childSetRect("scriptout",r); + childSetVisible("scriptout", true); + x += buttonRect.getWidth(); + } + else + { + childSetVisible("scriptout", false); + } + + if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK && + ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage()))) + { + // set visibility based on flashing + if( mHealthTimer->hasExpired() ) + { + childSetVisible("health", true); + } + else + { + BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1; + childSetVisible("health", flash); + } + + // Health + childGetRect( "health", buttonRect ); + r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); + childSetRect("health", r); + x += buttonRect.getWidth(); + } + mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - getChildView("stat_btn")->setEnabled(net_stats_visible); + childSetEnabled("stat_btn", net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); @@ -456,6 +493,16 @@ void LLStatusBar::onClickBuyCurrency() LLBuyCurrencyHTML::openCurrencyFloater(); } +static void onClickHealth(void* ) +{ + LLNotificationsUtil::add("NotSafe"); +} + +static void onClickScriptDebug(void*) +{ + LLFloaterScriptDebug::show(LLUUID::null); +} + void LLStatusBar::onMouseEnterVolume() { LLButton* volbtn = getChild( "volume_btn" ); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index c8c86dfd8c..dc95e2b383 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -106,8 +106,6 @@ private: LLButton *mBtnVolume; LLButton *mMediaToggle; - LLView* mScriptOut; - LLFrameTimer mClockUpdateTimer; S32 mBalance; S32 mHealth; diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index 43fe37ac77..6ef42e37f8 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -40,12 +40,20 @@ const LLStyle::Params &LLStyleMap::lookupAgent(const LLUUID &source) if (mMap.find(source) == mMap.end()) { LLStyle::Params style_params; - if (source != LLUUID::null) + if (source != LLUUID::null && source != gAgent.getID() ) { style_params.color.control = "HTMLLinkColor"; style_params.readonly_color.control = "HTMLLinkColor"; - style_params.link_href = LLSLURL("agent", source, "inspect").getSLURLString(); + style_params.link_href = + LLSLURL("agent", source, "inspect").getSLURLString(); } + else + { + // Make the resident's own name white and don't make the name clickable. + style_params.color = LLColor4::white; + style_params.readonly_color = LLColor4::white; + } + mMap[source] = style_params; } return mMap[source]; diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 4a107fefa8..9f8fc1810e 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -36,12 +36,14 @@ //--------------------------------------------------------------------------------- LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p), mTitle(NULL), - mCloseBtn(NULL) + mCloseBtn(NULL), + mIcon(NULL) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_sys_well_item.xml"); mTitle = getChild("title"); mCloseBtn = getChild("close_btn"); + mIcon = getChild("icon"); mTitle->setValue(p.title); mCloseBtn->setClickedCallback(boost::bind(&LLSysWellItem::onClickCloseBtn,this)); diff --git a/indra/newview/llsyswellitem.h b/indra/newview/llsyswellitem.h index d961708a01..54cfafe46e 100644 --- a/indra/newview/llsyswellitem.h +++ b/indra/newview/llsyswellitem.h @@ -73,6 +73,7 @@ private: LLTextBox* mTitle; LLButton* mCloseBtn; + LLIconCtrl* mIcon; LLUUID mID; }; diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 500c2a7b86..0d7b67d31d 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -575,10 +575,6 @@ void LLTexLayerSetBuffer::doUpdate() } restartUpdateTimer(); - - // need to swtich to using this layerset if this is the first update - // after getting the lowest LOD - mTexLayerSet->getAvatar()->updateMeshTextures(); // Print out notification that we uploaded this texture. if (gSavedSettings.getBOOL("DebugAvatarRezTime")) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1625b4bafd..1056b93e3c 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -223,7 +223,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture - getChild("apply_immediate_check")->setValue(FALSE); + childSetValue("apply_immediate_check", FALSE); mNoCopyTextureSelected = TRUE; } mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); @@ -233,7 +233,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) void LLFloaterTexturePicker::setActive( BOOL active ) { - if (!active && getChild("Pipette")->getValue().asBoolean()) + if (!active && childGetValue("Pipette").asBoolean()) { stopUsingPipette(); } @@ -245,7 +245,7 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) mCanApplyImmediately = b; if (!mCanApplyImmediately) { - getChild("apply_immediate_check")->setValue(FALSE); + childSetValue("apply_immediate_check", FALSE); } updateFilterPermMask(); } @@ -400,7 +400,7 @@ BOOL LLFloaterTexturePicker::postBuild() childSetCommitCallback("show_folders_check", onShowFolders, this); - getChildView("show_folders_check")->setVisible( FALSE); + childSetVisible("show_folders_check", FALSE); mFilterEdit = getChild("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); @@ -439,12 +439,12 @@ BOOL LLFloaterTexturePicker::postBuild() mNoCopyTextureSelected = FALSE; - getChild("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately")); + childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); if (!mCanApplyImmediately) { - getChildView("show_folders_check")->setEnabled(FALSE); + childSetEnabled("show_folders_check", FALSE); } getChild("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); @@ -521,10 +521,10 @@ void LLFloaterTexturePicker::draw() updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox - getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); - getChildView("Select")->setEnabled(mActive); - getChildView("Pipette")->setEnabled(mActive); - getChild("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); + childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected); + childSetEnabled("Select", mActive); + childSetEnabled("Pipette", mActive); + childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //BOOL allow_copy = FALSE; if( mOwner ) @@ -541,9 +541,9 @@ void LLFloaterTexturePicker::draw() mTentativeLabel->setVisible( FALSE ); } - getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); - getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID ); - getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); + childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID()); + childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID ); + childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); LLFloater::draw(); @@ -673,13 +673,13 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co PermissionMask LLFloaterTexturePicker::getFilterPermMask() { - bool apply_immediate = getChild("apply_immediate_check")->getValue().asBoolean(); + bool apply_immediate = childGetValue("apply_immediate_check").asBoolean(); return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask; } void LLFloaterTexturePicker::commitIfImmediateSet() { - bool apply_immediate = getChild("apply_immediate_check")->getValue().asBoolean(); + bool apply_immediate = childGetValue("apply_immediate_check").asBoolean(); if (!mNoCopyTextureSelected && apply_immediate && mOwner) { mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE); @@ -752,7 +752,7 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) void LLFloaterTexturePicker::onBtnPipette() { - BOOL pipette_active = getChild("Pipette")->getValue().asBoolean(); + BOOL pipette_active = childGetValue("Pipette").asBoolean(); pipette_active = !pipette_active; if (pipette_active) { diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4e9ebce4d1..5996fe3da7 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -48,7 +48,6 @@ #include "llviewertexturelist.h" #include "llviewertexture.h" #include "llviewerregion.h" -#include "llviewerstats.h" #include "llworld.h" ////////////////////////////////////////////////////////////////////////////// @@ -145,7 +144,7 @@ public: ~LLTextureFetchWorker(); void relese() { --mActiveCount; } - S32 callbackHttpGet(const LLChannelDescriptors& channels, + void callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, bool partial, bool success); void callbackCacheRead(bool success, LLImageFormatted* image, @@ -330,9 +329,8 @@ public: worker->setGetStatus(status, reason); // llwarns << "CURL GET FAILED, status:" << status << " reason:" << reason << llendl; } - - S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success); - mFetcher->removeFromHTTPQueue(mID, data_size); + mFetcher->removeFromHTTPQueue(mID); + worker->callbackHttpGet(channels, buffer, partial, success); } else { @@ -591,7 +589,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; // abort } } - if(mImagePriority < F_ALMOST_ZERO) + if(mImagePriority < 1.0f) { if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR) { @@ -846,10 +844,19 @@ bool LLTextureFetchWorker::doWork(S32 param) { if(mCanUseHTTP) { - //NOTE: - //it seems ok to let sim control the UDP traffic - //so there is no throttle for http here. - // + // *TODO: Integrate this with llviewerthrottle + // Note: LLViewerThrottle uses dynamic throttling which makes sense for UDP, + // but probably not for Textures. + // Set the throttle to the entire bandwidth, assuming UDP packets will get priority + // when they are needed + //F32 max_bandwidth = mFetcher->mMaxBandwidth; + if (mFetcher->isHTTPThrottled(mDesiredSize))// || + //mFetcher->getTextureBandwidth() > max_bandwidth) + { + // Make normal priority and return (i.e. wait until there is room in the queue) + setPriority(LLWorkerThread::PRIORITY_NORMAL | mWorkPriority); + return false; + } mFetcher->removeFromNetworkQueue(this, false); @@ -966,7 +973,6 @@ bool LLTextureFetchWorker::doWork(S32 param) else { resetFormattedData(); - mState = DONE; return true; // failed } } @@ -1259,7 +1265,8 @@ bool LLTextureFetchWorker::deleteOK() if ((haveWork() && // not ok to delete from these states - ((mState >= WRITE_TO_CACHE && mState <= WAIT_ON_WRITE)))) + ((mState == WAIT_HTTP_REQ) || + (mState >= WRITE_TO_CACHE && mState <= WAIT_ON_WRITE)))) { delete_ok = false; } @@ -1338,29 +1345,29 @@ bool LLTextureFetchWorker::processSimulatorPackets() ////////////////////////////////////////////////////////////////////////////// -S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, +void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, bool partial, bool success) { - S32 data_size = 0 ; - LLMutexLock lock(&mWorkMutex); if (mState != WAIT_HTTP_REQ) { llwarns << "callbackHttpGet for unrequested fetch worker: " << mID << " req=" << mSentRequest << " state= " << mState << llendl; - return data_size; + return; } if (mLoaded) { llwarns << "Duplicate callback for " << mID.asString() << llendl; - return data_size ; // ignore duplicate callback + return; // ignore duplicate callback } if (success) { // get length of stream: - data_size = buffer->countAfter(channels.in(), NULL); + S32 data_size = buffer->countAfter(channels.in(), NULL); + + gTextureList.sTextureBits += data_size * 8; // Approximate - does not include header bits LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL; if (data_size > 0) @@ -1397,8 +1404,6 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, } mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); - - return data_size ; } ////////////////////////////////////////////////////////////////////////////// @@ -1517,11 +1522,15 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), - mHTTPTextureBits(0), mCurlGetRequest(NULL) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold")); + + for(S32 i = 0 ; i < TOTAL_TEXTURE_TYPES; i++) + { + mHTTPThrottleFlag[i] = FALSE ; + } } LLTextureFetch::~LLTextureFetch() @@ -1663,11 +1672,69 @@ void LLTextureFetch::addToHTTPQueue(const LLUUID& id) mHTTPTextureQueue.insert(id); } -void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size) +void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id) { LLMutexLock lock(&mNetworkQueueMutex); mHTTPTextureQueue.erase(id); - mHTTPTextureBits += received_size * 8; // Approximate - does not include header bits +} + +void LLTextureFetch::clearHTTPThrottleFlag() +{ + static const F32 WAIT_TIME = 0.3f ; //seconds. + static LLFrameTimer timer ; + + if(timer.getElapsedTimeF32() < WAIT_TIME) //wait for WAIT_TIME + { + return ; + } + timer.reset() ; + + LLMutexLock lock(&mNetworkQueueMutex); + for(S32 i = 0 ; i < TOTAL_TEXTURE_TYPES; i++)//reset the http throttle flags. + { + mHTTPThrottleFlag[i] = FALSE ; + } +} + +//check if need to throttle this fetching request. +//rule: if a request can not be inserted into the http queue due to a full queue, +// block all future insertions of requests with larger fetching size requirement. +//because: +// later insertions are usually at lower priorities; and +// small textures need chance to be fetched. +bool LLTextureFetch::isHTTPThrottled(S32 requested_size) +{ + static const S32 SMALL_TEXTURE_MAX_SIZE = 64 * 64 * 4 ; + static const S32 MEDIUM_TEXTURE_MAX_SIZE = 256 * 256 * 4 ; + static const U32 MAX_HTTP_QUEUE_SIZE = 8 ; + + //determine the class of the texture: SMALL, MEDIUM, or LARGE. + S32 type = LARGE_TEXTURE ; + if(requested_size <= SMALL_TEXTURE_MAX_SIZE) + { + type = SMALL_TEXTURE ; + } + else if(requested_size <= MEDIUM_TEXTURE_MAX_SIZE) + { + type = MEDIUM_TEXTURE ; + } + + LLMutexLock lock(&mNetworkQueueMutex); + + if(mHTTPTextureQueue.size() >= MAX_HTTP_QUEUE_SIZE)//if the http queue is full. + { + if(!mHTTPThrottleFlag[type + 1]) + { + for(S32 i = type + 1 ; i < TOTAL_TEXTURE_TYPES; i++) //block all requests with fetching size larger than this request. + { + mHTTPThrottleFlag[i] = TRUE ; + } + } + + return true ; + } + + return mHTTPThrottleFlag[type] ; //true if this request can not be inserted to the http queue. } void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) @@ -1815,19 +1882,12 @@ bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) //virtual S32 LLTextureFetch::update(U32 max_time_ms) { + S32 res; + static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS"); - - { - mNetworkQueueMutex.lock() ; - mMaxBandwidth = band_width ; - - gTextureList.sTextureBits += mHTTPTextureBits ; - mHTTPTextureBits = 0 ; - - mNetworkQueueMutex.unlock() ; - } - - S32 res = LLWorkerThread::update(max_time_ms); + mMaxBandwidth = band_width ; + + res = LLWorkerThread::update(max_time_ms); if (!mDebugPause) { @@ -1843,6 +1903,7 @@ S32 LLTextureFetch::update(U32 max_time_ms) lldebugs << "processed: " << processed << " messages." << llendl; } } + clearHTTPThrottleFlag(); return res; } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 796109df06..f148eaa918 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -88,7 +88,9 @@ protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); void addToHTTPQueue(const LLUUID& id); - void removeFromHTTPQueue(const LLUUID& id, S32 received_size = 0); + void removeFromHTTPQueue(const LLUUID& id); + bool isHTTPThrottled(S32 requested_size); + void clearHTTPThrottleFlag(); void removeRequest(LLTextureFetchWorker* worker, bool cancel); // Called from worker thread (during doWork) void processCurlRequests(); @@ -128,7 +130,15 @@ private: F32 mMaxBandwidth; LLTextureInfo mTextureInfo; - U32 mHTTPTextureBits; + enum + { + SMALL_TEXTURE = 0 , //size <= 64 * 64 + MEDIUM_TEXTURE, //size <= 256 * 256 + LARGE_TEXTURE, //size > 256 * 256 + DUMMY, + TOTAL_TEXTURE_TYPES + }; + BOOL mHTTPThrottleFlag[TOTAL_TEXTURE_TYPES]; }; #endif // LL_LLTEXTUREFETCH_H diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 4c75b07ae8..a6adf48264 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -124,7 +124,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification pAttachLink->setValue(payload["inventory_name"]); mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]); - getChild("attachment")->setClickedCallback(boost::bind( + childSetActionTextbox("attachment", boost::bind( &LLToastGroupNotifyPanel::onClickAttachment, this)); LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType, diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index d8be70e546..60df98ee99 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1554,7 +1554,7 @@ BOOL LLToolPie::pickRightMouseDownCallback() mute_msg = LLTrans::getString("MuteObject2"); } - gMenuHolder->getChild("Object Mute")->setValue(mute_msg); + gMenuHolder->childSetText("Object Mute", mute_msg); gMenuObject->show(x, y); showVisualContextMenuEffect(); diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index bd4d3c2b78..123b47e97e 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -32,6 +32,7 @@ #include "llcommandhandler.h" #include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" +#include "llfloaterurldisplay.h" #include "llfloaterworldmap.h" #include "llpanellogin.h" #include "llregionhandle.h" @@ -176,6 +177,10 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, bool right_mouse) return true; } + // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. + //LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance("preview_url",LLSD()); + //if(slurl_displayp) slurl_displayp->setName(region_name); + // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, @@ -241,6 +246,21 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& key["z"] = global_pos.mdV[VZ]; LLSideTray::getInstance()->showPanel("panel_places", key); + + // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. + +// // display informational floater, allow user to click teleport btn +// LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance("preview_url",LLSD()); +// if(slurl_displayp) +// { +// url_displayp->displayParcelInfo(region_handle, local_pos); +// if(snapshot_id.notNull()) +// { +// url_displayp->setSnapshotDisplay(snapshot_id); +// } +// std::string locationString = llformat("%s %d, %d, %d", region_name.c_str(), x, y, z); +// url_displayp->setLocationString(locationString); +// } } } diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index 5c5bbdc8f5..acc8d2359a 100644 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -49,12 +49,12 @@ LLViewChildren::LLViewChildren(LLPanel& parent) void LLViewChildren::show(const std::string& id, bool visible) { - mParent.getChildView(id)->setVisible(visible); + mParent.childSetVisible(id, visible); } void LLViewChildren::enable(const std::string& id, bool enabled) { - mParent.getChildView(id)->setEnabled(enabled); + mParent.childSetEnabled(id, enabled); } void LLViewChildren::setText( diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index db7dc3fea6..4847a3d721 100644 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -116,7 +116,7 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id); if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID())) { - rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu + rez_attachment(item, attachmentp); } else if(item && item->isFinished()) { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 522b5a7dfa..ac2037ef68 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -37,7 +37,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "llconsole.h" -#include "lldrawpoolbump.h" #include "lldrawpoolterrain.h" #include "llflexibleobject.h" #include "llfeaturemanager.h" @@ -113,10 +112,6 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue) static bool handleSetShaderChanged(const LLSD& newvalue) { - // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache - gBumpImageList.destroyGL(); - gBumpImageList.restoreGL(); - LLViewerShaderMgr::instance()->setShaders(); return true; } @@ -298,6 +293,15 @@ static bool handleWLSkyDetailChanged(const LLSD&) return true; } +static bool handleRenderLightingDetailChanged(const LLSD& newvalue) +{ + if (gPipeline.isInit()) + { + gPipeline.setLightingDetail(newvalue.asInteger()); + } + return true; +} + static bool handleResetVertexBuffersChanged(const LLSD&) { if (gPipeline.isInit()) @@ -494,10 +498,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); @@ -518,8 +518,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2)); gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2)); gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _2)); @@ -529,8 +528,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2)); gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2)); gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderDeferredShadow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); @@ -557,6 +555,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); + gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index d0ad918c58..8c59b52dc2 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -589,8 +589,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = 3; } - LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred"); - LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred"); + LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha"); LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip"); LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible"); LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate"); @@ -862,6 +861,12 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } + /// We copy the frame buffer straight into a texture here, + /// and then display it again with compositor effects. + /// Using render to texture would be faster/better, but I don't have a + /// grasp of their full display stack just yet. + // gPostProcess->apply(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); + if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.renderDeferredLighting(); @@ -923,10 +928,9 @@ void render_hud_attachments() bool render_particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) && gSavedSettings.getBOOL("RenderHUDParticles"); //only render hud objects - gPipeline.pushRenderTypeMask(); - + U32 mask = gPipeline.getRenderTypeMask(); // turn off everything - gPipeline.andRenderTypeMask(LLPipeline::END_RENDER_TYPES); + gPipeline.setRenderTypeMask(0); // turn on HUD gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD); // turn on HUD particles @@ -980,8 +984,7 @@ void render_hud_attachments() render_hud_elements(); //restore type mask - gPipeline.popRenderTypeMask(); - + gPipeline.setRenderTypeMask(mask); if (has_ui) { gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI); @@ -1106,7 +1109,7 @@ void render_ui(F32 zoom_factor, int subfield) { gPipeline.renderBloom(gSnapshot, zoom_factor, subfield); } - + render_hud_elements(); render_hud_attachments(); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index b572a8cff6..2cc8f233e4 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -75,6 +75,7 @@ #include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" #include "llfloaterpay.h" +#include "llfloaterparcel.h" #include "llfloaterperms.h" #include "llfloaterpostcard.h" #include "llfloaterpostprocess.h" @@ -94,6 +95,7 @@ #include "llfloatertos.h" #include "llfloatertopobjects.h" #include "llfloateruipreview.h" +#include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" #include "llfloatervoiceeffect.h" #include "llfloaterwater.h" @@ -194,12 +196,14 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterPayUtil::registerFloater(); LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("preview_url", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pref_voicedevicesettings", "floater_device_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "preview"); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 75a5b14154..efc5d87a53 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -930,7 +930,7 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) gAgentWearables.editWearableIfRequested(inv_item); // TODO: camera mode may not be changed if a debug setting is tweaked - if( gAgentCamera.cameraCustomizeAvatar() ) + if(gAgentCamera.cameraCustomizeAvatar()) { // If we're in appearance editing mode, the current tab may need to be refreshed LLSidepanelAppearance *panel = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 0cf5fe0ada..dada3ee3b9 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -434,13 +434,13 @@ void LLViewerJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix } } -void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) +void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) { for (child_list_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->updateFaceData(face, pixel_area, damp_wind, terse_update); + joint->updateFaceData(face, pixel_area, damp_wind); } } diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index 76e3833acb..4a5ebf2081 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -120,7 +120,7 @@ public: PickName getPickName() { return mPickName; } virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); + virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); virtual BOOL updateLOD(F32 pixel_area, BOOL activate); virtual void updateJointGeometry(); virtual void dump(); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index ecb7e2064d..01d07f93ef 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -29,11 +29,12 @@ #include "llviewerjointattachment.h" #include "llagentconstants.h" + #include "llviewercontrol.h" #include "lldrawable.h" #include "llgl.h" #include "llrender.h" -#include "llvoavatarself.h" +#include "llvoavatar.h" #include "llvolume.h" #include "pipeline.h" #include "llspatialpartition.h" @@ -157,9 +158,6 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) //----------------------------------------------------------------------------- BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) { - object->extractAttachmentItemID(); - - // Same object reattached if (isObjectAttached(object)) { llinfos << "(same object re-attached)" << llendl; @@ -167,19 +165,20 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) // Pass through anyway to let setupDrawable() // re-connect object to the joint correctly } - - // Two instances of the same inventory item attached -- - // Request detach, and kill the object in the meantime. - if (getAttachedObject(object->getAttachmentItemID())) - { - llinfos << "(same object re-attached)" << llendl; - object->markDead(); - // If this happens to be attached to self, then detach. - LLVOAvatarSelf::detachAttachmentIntoInventory(object->getAttachmentItemID()); - return FALSE; + // Find the inventory item ID of the attached object + LLNameValue* item_id_nv = object->getNVPair("AttachItemID"); + if( item_id_nv ) + { + const char* s = item_id_nv->getString(); + if( s ) + { + LLUUID item_id; + item_id.set(s); + object->setItemID(item_id); + lldebugs << "getNVPair( AttachItemID ) = " << item_id << llendl; + } } - mAttachedObjects.push_back(object); setupDrawable(object); @@ -202,7 +201,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) } calcLOD(); mUpdateXform = TRUE; - + return TRUE; } @@ -298,7 +297,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) { mUpdateXform = FALSE; } - object->setAttachmentItemID(LLUUID::null); + object->setItemID(LLUUID::null); } //----------------------------------------------------------------------------- @@ -424,7 +423,7 @@ const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &o ++iter) { const LLViewerObject* attached_object = (*iter); - if (attached_object->getAttachmentItemID() == object_id) + if (attached_object->getItemID() == object_id) { return attached_object; } @@ -439,7 +438,7 @@ LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_ ++iter) { LLViewerObject* attached_object = (*iter); - if (attached_object->getAttachmentItemID() == object_id) + if (attached_object->getItemID() == object_id) { return attached_object; } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index ae2aa41b3a..d2c29adf27 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -661,9 +661,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 //----------------------------------------------------------------------------- // updateFaceData() //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face"); - -void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) +void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) { mFace = face; @@ -672,8 +670,6 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w return; } - LLFastTimer t(FTM_AVATAR_FACE); - LLStrider verticesp; LLStrider normalsp; LLStrider tex_coordsp; @@ -692,98 +688,29 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w face->mVertexBuffer->getIndexStrider(indicesp); stop_glerror(); - verticesp += mMesh->mFaceVertexOffset; - tex_coordsp += mMesh->mFaceVertexOffset; - normalsp += mMesh->mFaceVertexOffset; - vertex_weightsp += mMesh->mFaceVertexOffset; - clothing_weightsp += mMesh->mFaceVertexOffset; - - const U32* __restrict coords = (U32*) mMesh->getCoords(); - const U32* __restrict tex_coords = (U32*) mMesh->getTexCoords(); - const U32* __restrict normals = (U32*) mMesh->getNormals(); - const U32* __restrict weights = (U32*) mMesh->getWeights(); - const U32* __restrict cloth_weights = (U32*) mMesh->getClothingWeights(); - - const U32 num_verts = mMesh->getNumVertices(); - - U32 i = 0; - - const U32 skip = verticesp.getSkip()/sizeof(U32); - - U32* __restrict v = (U32*) verticesp.get(); - U32* __restrict n = (U32*) normalsp.get(); - - if (terse_update) + for (U16 i = 0; i < mMesh->getNumVertices(); i++) { - for (S32 i = num_verts; i > 0; --i) + verticesp[mMesh->mFaceVertexOffset + i] = *(mMesh->getCoords() + i); + tex_coordsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getTexCoords() + i); + normalsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getNormals() + i); + vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i); + if (damp_wind) { - //morph target application only, only update positions and normals - v[0] = coords[0]; - v[1] = coords[1]; - v[2] = coords[2]; - coords += 3; - v += skip; + clothing_weightsp[mMesh->mFaceVertexOffset + i] = LLVector4(0,0,0,0); } - - for (S32 i = num_verts; i > 0; --i) + else { - n[0] = normals[0]; - n[1] = normals[1]; - n[2] = normals[2]; - normals += 3; - n += skip; + clothing_weightsp[mMesh->mFaceVertexOffset + i] = (*(mMesh->getClothingWeights() + i)); } } - else - { - U32* __restrict tc = (U32*) tex_coordsp.get(); - U32* __restrict vw = (U32*) vertex_weightsp.get(); - U32* __restrict cw = (U32*) clothing_weightsp.get(); - - do - { - v[0] = *(coords++); - v[1] = *(coords++); - v[2] = *(coords++); - v += skip; - - tc[0] = *(tex_coords++); - tc[1] = *(tex_coords++); - tc += skip; - - n[0] = *(normals++); - n[1] = *(normals++); - n[2] = *(normals++); - n += skip; - - vw[0] = *(weights++); - vw += skip; - - cw[0] = *(cloth_weights++); - cw[1] = *(cloth_weights++); - cw[2] = *(cloth_weights++); - cw[3] = *(cloth_weights++); - cw += skip; - } - while (++i < num_verts); - - const U32 idx_count = mMesh->getNumFaces()*3; - - indicesp += mMesh->mFaceIndexOffset; - - U16* __restrict idx = indicesp.get(); - S32* __restrict src_idx = (S32*) mMesh->getFaces(); - - i = 0; - - const S32 offset = (S32) mMesh->mFaceVertexOffset; - - do + for (S32 i = 0; i < mMesh->getNumFaces(); i++) + { + for (U32 j = 0; j < 3; j++) { - *(idx++) = *(src_idx++)+offset; + U32 k = i*3+j+mMesh->mFaceIndexOffset; + indicesp[k] = mMesh->getFaces()[i][j] + mMesh->mFaceVertexOffset; } - while (++i < idx_count); } } } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index cab1205d61..1320bd03f9 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -134,7 +134,7 @@ public: /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); + /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 283669aaef..47a98ff888 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -50,7 +50,6 @@ #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" -#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this! #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -1313,9 +1312,6 @@ void LLViewerMedia::setOpenIDCookie() } getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start)); - - // *HACK: Doing this here is nasty, find a better way. - LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie); } } @@ -2190,8 +2186,7 @@ void LLViewerMediaImpl::navigateReload() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateHome() { - bool rediscover_mimetype = mHomeMimeType.empty(); - navigateTo(mHomeURL, mHomeMimeType, rediscover_mimetype, false); + navigateTo(mHomeURL, "", true, false); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -2303,8 +2298,6 @@ void LLViewerMediaImpl::navigateInternal() // which is really not what we want. LLSD headers = LLSD::emptyMap(); headers["Accept"] = "*/*"; - // Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com - headers["Cookie"] = ""; LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) @@ -2913,23 +2906,14 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { LL_DEBUGS("Media") << "MEDIA_EVENT_NAVIGATE_COMPLETE, uri is: " << plugin->getNavigateURI() << LL_ENDL; - std::string url = plugin->getNavigateURI(); if(getNavState() == MEDIANAVSTATE_BEGUN) { - if(mCurrentMediaURL == url) - { - // This is a navigate that takes us to the same url as the previous navigate. - setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS); - } - else - { - mCurrentMediaURL = url; - setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); - } + mCurrentMediaURL = plugin->getNavigateURI(); + setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { - mCurrentMediaURL = url; + mCurrentMediaURL = plugin->getNavigateURI(); setNavState(MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED); } else @@ -2943,24 +2927,14 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { LL_DEBUGS("Media") << "MEDIA_EVENT_LOCATION_CHANGED, uri is: " << plugin->getLocation() << LL_ENDL; - std::string url = plugin->getLocation(); - if(getNavState() == MEDIANAVSTATE_BEGUN) { - if(mCurrentMediaURL == url) - { - // This is a navigate that takes us to the same url as the previous navigate. - setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS); - } - else - { - mCurrentMediaURL = url; - setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); - } + mCurrentMediaURL = plugin->getLocation(); + setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { - mCurrentMediaURL = url; + mCurrentMediaURL = plugin->getLocation(); setNavState(MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED); } else @@ -3244,9 +3218,7 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state) case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << llendl; break; case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << llendl; break; case MEDIANAVSTATE_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED" << llendl; break; - case MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS" << llendl; break; case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED" << llendl; break; - case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS" << llendl; break; case MEDIANAVSTATE_SERVER_SENT: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_SENT" << llendl; break; case MEDIANAVSTATE_SERVER_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_BEGUN" << llendl; break; case MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED" << llendl; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index e0cc26fa29..fbd0358302 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -231,7 +231,7 @@ public: std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } std::string getMediaEntryURL() { return mMediaEntryURL; } - void setHomeURL(const std::string& home_url, const std::string& mime_type = LLStringUtil::null) { mHomeURL = home_url; mHomeMimeType = mime_type;}; + void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; void clearCache(); std::string getMimeType() { return mMimeType; } void scaleMouse(S32 *mouse_x, S32 *mouse_y); @@ -356,9 +356,7 @@ public: MEDIANAVSTATE_NONE, // State is outside what we need to track for navigation. MEDIANAVSTATE_BEGUN, // a MEDIA_EVENT_NAVIGATE_BEGIN has been received which was not server-directed MEDIANAVSTATE_FIRST_LOCATION_CHANGED, // first LOCATION_CHANGED event after a non-server-directed BEGIN - MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS, // Same as above, but the new URL is identical to the previously navigated URL. MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED, // we received a NAVIGATE_COMPLETE event before the first LOCATION_CHANGED - MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS,// Same as above, but the new URL is identical to the previously navigated URL. MEDIANAVSTATE_SERVER_SENT, // server-directed nav has been requested, but MEDIA_EVENT_NAVIGATE_BEGIN hasn't been received yet MEDIANAVSTATE_SERVER_BEGUN, // MEDIA_EVENT_NAVIGATE_BEGIN has been received which was server-directed MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED, // first LOCATION_CHANGED event after a server-directed BEGIN @@ -395,7 +393,6 @@ private: bool mMovieImageHasMips; std::string mMediaURL; // The last media url set with NavigateTo std::string mHomeURL; - std::string mHomeMimeType; // forced mime type for home url std::string mMimeType; std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events). std::string mCurrentMimeType; // The MIME type that caused the currently loaded plugin to be loaded. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c275068028..476e761c28 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1077,8 +1077,6 @@ class LLAdvancedToggleWireframe : public view_listener_t bool handleEvent(const LLSD& userdata) { gUseWireframe = !(gUseWireframe); - LLPipeline::updateRenderDeferred(); - gPipeline.resetVertexBuffers(); return true; } }; @@ -2050,9 +2048,9 @@ class LLAdvancedEnableRenderDeferred: public view_listener_t }; ///////////////////////////////////// -// Enable Deferred Rendering sub-options +// Enable Global Illumination /// ///////////////////////////////////// -class LLAdvancedEnableRenderDeferredOptions: public view_listener_t +class LLAdvancedEnableRenderDeferredGI: public view_listener_t { bool handleEvent(const LLSD& userdata) { @@ -5848,7 +5846,6 @@ void handle_buy_land() class LLObjectAttachToAvatar : public view_listener_t { public: - LLObjectAttachToAvatar(bool replace) : mReplace(replace) {} static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; } private: @@ -5862,38 +5859,22 @@ private: LLViewerJointAttachment* attachment_point = NULL; if (index > 0) attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); - confirmReplaceAttachment(0, attachment_point); + confirm_replace_attachment(0, attachment_point); } return true; } - static void onNearAttachObject(BOOL success, void *user_data); - void confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point); - - struct CallbackData - { - CallbackData(LLViewerJointAttachment* point, bool replace) : mAttachmentPoint(point), mReplace(replace) {} - - LLViewerJointAttachment* mAttachmentPoint; - bool mReplace; - }; - protected: static LLObjectSelectionHandle sObjectSelection; - bool mReplace; }; LLObjectSelectionHandle LLObjectAttachToAvatar::sObjectSelection; -// static -void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data) +void near_attach_object(BOOL success, void *user_data) { - if (!user_data) return; - CallbackData* cb_data = static_cast(user_data); - if (success) { - const LLViewerJointAttachment *attachment = cb_data->mAttachmentPoint; + const LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; U8 attachment_id = 0; if (attachment) @@ -5913,15 +5894,12 @@ void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data) // interpret 0 as "default location" attachment_id = 0; } - LLSelectMgr::getInstance()->sendAttach(attachment_id, cb_data->mReplace); + LLSelectMgr::getInstance()->sendAttach(attachment_id); } LLObjectAttachToAvatar::setObjectSelection(NULL); - - delete cb_data; } -// static -void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point) +void confirm_replace_attachment(S32 option, void* user_data) { if (option == 0/*YES*/) { @@ -5946,9 +5924,7 @@ void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointA delta = delta * 0.5f; walkToSpot -= delta; - // The callback will be called even if avatar fails to get close enough to the object, so we won't get a memory leak. - CallbackData* user_data = new CallbackData(attachment_point, mReplace); - gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, onNearAttachObject, user_data, stop_distance); + gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, near_attach_object, user_data, stop_distance); gAgentCamera.clearFocusObject(); } } @@ -6068,7 +6044,7 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) const LLViewerObject* attached_object = (*attachment_iter); if (attached_object) { - LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getAttachmentItemID()); + LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getItemID()); if (itemp) { label += std::string(" (") + itemp->getName() + std::string(")"); @@ -6187,14 +6163,14 @@ class LLAttachmentEnableDrop : public view_listener_t { // make sure item is in your inventory (it could be a delayed attach message being sent from the sim) // so check to see if the item is in the inventory already - item = gInventory.getItem((*attachment_iter)->getAttachmentItemID()); + item = gInventory.getItem((*attachment_iter)->getItemID()); if (!item) { // Item does not exist, make an observer to enable the pie menu // when the item finishes fetching worst case scenario // if a fetch is already out there (being sent from a slow sim) // we refetch and there are 2 fetches - LLWornItemFetchedObserver* worn_item_fetched = new LLWornItemFetchedObserver((*attachment_iter)->getAttachmentItemID()); + LLWornItemFetchedObserver* worn_item_fetched = new LLWornItemFetchedObserver((*attachment_iter)->getItemID()); worn_item_fetched->startFetch(); gInventory.addObserver(worn_item_fetched); } @@ -6541,7 +6517,7 @@ void handle_dump_attachments(void*) !attached_object->mDrawable->isRenderType(0)); LLVector3 pos; if (visible) pos = attached_object->mDrawable->getPosition(); - llinfos << "ATTACHMENT " << key << ": item_id=" << attached_object->getAttachmentItemID() + llinfos << "ATTACHMENT " << key << ": item_id=" << attached_object->getItemID() << (attached_object ? " present " : " absent ") << (visible ? "visible " : "invisible ") << " at " << pos @@ -6552,7 +6528,7 @@ void handle_dump_attachments(void*) } -// these are used in the gl menus to set control values, generically. +// these are used in the gl menus to set control values. class LLToggleControl : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6571,44 +6547,8 @@ class LLCheckControl : public view_listener_t std::string callback_data = userdata.asString(); bool new_value = gSavedSettings.getBOOL(callback_data); return new_value; - } -}; - -// not so generic - -class LLAdvancedCheckRenderShadowOption: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - std::string control_name = userdata.asString(); - S32 current_shadow_level = gSavedSettings.getS32(control_name); - if (current_shadow_level == 0) // is off - { - return false; - } - else // is on - { - return true; - } - } -}; +} -class LLAdvancedClickRenderShadowOption: public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - std::string control_name = userdata.asString(); - S32 current_shadow_level = gSavedSettings.getS32(control_name); - if (current_shadow_level == 0) // upgrade to level 2 - { - gSavedSettings.setS32(control_name, 2); - } - else // downgrade to level 0 - { - gSavedSettings.setS32(control_name, 0); - } - return true; - } }; void menu_toggle_attached_lights(void* user_data) @@ -7933,7 +7873,7 @@ void initialize_menus() // Help menu // most items use the ShowFloater method - // Advanced menu + // Advance menu view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole"); view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); @@ -7960,13 +7900,12 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedSelectedTextureInfo(), "Advanced.SelectedTextureInfo"); view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe"); view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe"); - // Develop > Render view_listener_t::addMenu(new LLAdvancedToggleTextureAtlas(), "Advanced.ToggleTextureAtlas"); view_listener_t::addMenu(new LLAdvancedCheckTextureAtlas(), "Advanced.CheckTextureAtlas"); view_listener_t::addMenu(new LLAdvancedEnableObjectObjectOcclusion(), "Advanced.EnableObjectObjectOcclusion"); view_listener_t::addMenu(new LLAdvancedEnableRenderFBO(), "Advanced.EnableRenderFBO"); view_listener_t::addMenu(new LLAdvancedEnableRenderDeferred(), "Advanced.EnableRenderDeferred"); - view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredOptions(), "Advanced.EnableRenderDeferredOptions"); + view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredGI(), "Advanced.EnableRenderDeferredGI"); view_listener_t::addMenu(new LLAdvancedToggleRandomizeFramerate(), "Advanced.ToggleRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame"); @@ -7975,8 +7914,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest"); view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest"); view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles"); - view_listener_t::addMenu(new LLAdvancedCheckRenderShadowOption(), "Advanced.CheckRenderShadowOption"); - view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption"); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER @@ -8133,8 +8070,7 @@ void initialize_menus() commit.add("Object.Touch", boost::bind(&handle_object_touch)); commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand)); commit.add("Object.Delete", boost::bind(&handle_object_delete)); - view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar"); - view_listener_t::addMenu(new LLObjectAttachToAvatar(false), "Object.AttachAddToAvatar"); + view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar"); view_listener_t::addMenu(new LLObjectReturn(), "Object.Return"); view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse"); view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 92c61ddefe..2a6b272741 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3662,7 +3662,6 @@ const F32 THRESHOLD_HEAD_ROT_QDOT = 0.9997f; // ~= 2.5 degrees -- if its less th const F32 MAX_HEAD_ROT_QDOT = 0.99999f; // ~= 0.5 degrees -- if its greater than this then no need to update head_rot // between these values we delay the updates (but no more than one second) -static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE_SEND("Send Message"); void send_agent_update(BOOL force_send, BOOL send_reliable) { @@ -3821,7 +3820,6 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) if (duplicate_count < DUP_MSGS && !gDisconnected) { - LLFastTimer t(FTM_AGENT_UPDATE_SEND); // Build the message msg->newMessageFast(_PREHASH_AgentUpdate); msg->nextBlockFast(_PREHASH_AgentData); @@ -5313,10 +5311,10 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL; - gMenuHolder->getChild("Upload Image")->setLabelArg("[COST]", llformat("%d", upload_cost)); - gMenuHolder->getChild("Upload Sound")->setLabelArg("[COST]", llformat("%d", upload_cost)); - gMenuHolder->getChild("Upload Animation")->setLabelArg("[COST]", llformat("%d", upload_cost)); - gMenuHolder->getChild("Bulk Upload")->setLabelArg("[COST]", llformat("%d", upload_cost)); + gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); + gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); + gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); + gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost)); } void notify_cautioned_script_question(const LLSD& notification, const LLSD& response, S32 orig_questions, BOOL granted) diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 7f7c245717..eade16a075 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -44,7 +44,6 @@ const char* DEFAULT_SLURL_BASE = "https://%s/region/"; const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app"; LLGridManager::LLGridManager() -: mIsInProductionGrid(false) { // by default, we use the 'grids.xml' file in the user settings directory // this file is an LLSD file containing multiple grid definitions. @@ -304,10 +303,6 @@ void LLGridManager::initialize(const std::string& grid_file) addGrid(grid); } - gSavedSettings.getControl("CurrentGrid")->getSignal()->connect(boost::bind(&LLGridManager::updateIsInProductionGrid, this)); - // since above only triggers on changes, trigger the callback manually to initialize state - updateIsInProductionGrid(); - LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL; setGridChoice(mGrid); if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray()) @@ -559,30 +554,23 @@ std::string LLGridManager::getLoginPage() return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE]; } -void LLGridManager::updateIsInProductionGrid() +bool LLGridManager::isInProductionGrid() { - mIsInProductionGrid = false; - // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, // but it seems that loginURI trumps that. std::vector uris; getLoginURIs(uris); - if (uris.empty()) + if (uris.size() < 1) { - mIsInProductionGrid = true; - return; + return 1; } LLStringUtil::toLower(uris[0]); if((uris[0].find("agni") != std::string::npos)) { - mIsInProductionGrid = true; - return; + return true; } -} -bool LLGridManager::isInProductionGrid() -{ - return mIsInProductionGrid; + return false; } void LLGridManager::saveFavorites() diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 15e25b4952..70b06b1dc2 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -131,8 +131,6 @@ public: protected: - void updateIsInProductionGrid(); - // helper function for adding the predefined grids void addSystemGrid(const std::string& label, const std::string& name, @@ -145,7 +143,6 @@ protected: std::string mGrid; std::string mGridFile; LLSD mGridList; - bool mIsInProductionGrid; }; const S32 MAC_ADDRESS_BYTES = 6; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 25cc24da95..2a909f8781 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5227,28 +5227,3 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } -const LLUUID &LLViewerObject::getAttachmentItemID() const -{ - return mAttachmentItemID; -} - -void LLViewerObject::setAttachmentItemID(const LLUUID &id) -{ - mAttachmentItemID = id; -} - -const LLUUID &LLViewerObject::extractAttachmentItemID() -{ - LLUUID item_id = LLUUID::null; - LLNameValue* item_id_nv = getNVPair("AttachItemID"); - if( item_id_nv ) - { - const char* s = item_id_nv->getString(); - if( s ) - { - item_id.set(s); - } - } - setAttachmentItemID(item_id); - return getAttachmentItemID(); -} diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index bcc2cb164f..c3c1b2d106 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -672,15 +672,11 @@ protected: private: static S32 sNumObjects; - //-------------------------------------------------------------------- - // For objects that are attachments - //-------------------------------------------------------------------- public: - const LLUUID &getAttachmentItemID() const; - void setAttachmentItemID(const LLUUID &id); - const LLUUID &extractAttachmentItemID(); // find&set the inventory item ID of the attached object + const LLUUID &getItemID() const { return mAttachmentItemID; } + void setItemID(const LLUUID &id) { mAttachmentItemID = id; } private: - LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. + LLUUID mAttachmentItemID; // ItemID when item is in user inventory. }; /////////////////// diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d078c15316..4c2ea27253 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -311,16 +311,10 @@ S32 LLViewerShaderMgr::getVertexShaderLevel(S32 type) void LLViewerShaderMgr::setShaders() { - //setShaders might be called redundantly by gSavedSettings, so return on reentrance - static bool reentrance = false; - - if (!gPipeline.mInitialized || !sInitialized || reentrance) + if (!gPipeline.mInitialized || !sInitialized) { return; } - - reentrance = true; - // Make sure the compiled shader map is cleared before we recompile shaders. mShaderObjects.clear(); @@ -368,11 +362,17 @@ void LLViewerShaderMgr::setShaders() S32 wl_class = 2; S32 water_class = 2; S32 deferred_class = 0; - - if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - gSavedSettings.getBOOL("RenderDeferred")) + if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") + && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) + { + // user has disabled WindLight in their settings, downgrade + // windlight shaders to stub versions. + wl_class = 1; + } + + if (LLPipeline::sRenderDeferred) { - if (gSavedSettings.getS32("RenderShadowDetail") > 0) + if (gSavedSettings.getBOOL("RenderDeferredShadow")) { if (gSavedSettings.getBOOL("RenderDeferredGI")) { //shadows + gi @@ -387,24 +387,6 @@ void LLViewerShaderMgr::setShaders() { //no shadows deferred_class = 1; } - - //make sure framebuffer objects are enabled - gSavedSettings.setBOOL("RenderUseFBO", TRUE); - - //make sure hardware skinning is enabled - gSavedSettings.setBOOL("RenderAvatarVP", TRUE); - - //make sure atmospheric shaders are enabled - gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); - } - - - if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") - && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) - { - // user has disabled WindLight in their settings, downgrade - // windlight shaders to stub versions. - wl_class = 1; } if(!gSavedSettings.getBOOL("EnableRippleWater")) @@ -529,8 +511,6 @@ void LLViewerShaderMgr::setShaders() gViewerWindow->setCursor(UI_CURSOR_ARROW); } gPipeline.createGLBuffers(); - - reentrance = false; } void LLViewerShaderMgr::unloadShaders() @@ -987,21 +967,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - std::string fragment; - - if (gSavedSettings.getBOOL("RenderDeferredSSAO")) - { - fragment = "deferred/sunLightSSAOF.glsl"; - } - else - { - fragment = "deferred/sunLightF.glsl"; - } - gDeferredSunProgram.mName = "Deferred Sun Shader"; gDeferredSunProgram.mShaderFiles.clear(); gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSunProgram.createShader(NULL, NULL); } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index e55808597c..3e984b6fc3 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -594,7 +594,7 @@ void update_statistics(U32 frame_count) } } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); #if 0 // 1.9.2 diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0ad54f238e..eeca8891c1 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -808,7 +808,7 @@ void LLViewerTexture::generateGLTexture() LLImageGL* LLViewerTexture::getGLTexture() const { llassert(mGLTexturep.notNull()) ; - + return mGLTexturep ; } @@ -1484,62 +1484,53 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) void LLViewerFetchedTexture::processTextureStats() { if(mFullyLoaded) - { - if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more + { + if(mDesiredDiscardLevel <= mMinDesiredDiscardLevel)//already loaded { - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; - mFullyLoaded = FALSE ; + return ; } + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + mFullyLoaded = FALSE ; + return ; } - else + + updateVirtualSize() ; + + static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); + + if (textures_fullres) { - updateVirtualSize() ; - - static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); - - if (textures_fullres) - { - mDesiredDiscardLevel = 0; - } - else if(!mFullWidth || !mFullHeight) + mDesiredDiscardLevel = 0; + } + else if(!mFullWidth || !mFullHeight) + { + mDesiredDiscardLevel = getMaxDiscardLevel() ; + } + else + { + if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) { - mDesiredDiscardLevel = getMaxDiscardLevel() ; - } - else - { - if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) + if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) { - if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) - { - mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 - } - else - { - mDesiredDiscardLevel = 0; - } - } - else if(mKnownDrawSizeChanged)//known draw size is set - { - mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, - log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; - mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 } - mKnownDrawSizeChanged = FALSE ; - - if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) + else { - mFullyLoaded = TRUE ; + mDesiredDiscardLevel = 0; } } - } - - if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture. - { - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ; - if(getDiscardLevel() < 0 || getDiscardLevel() > mDesiredDiscardLevel) + else if(mKnownDrawSizeChanged)//known draw size is set + { + mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, + log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; + mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + } + mKnownDrawSizeChanged = FALSE ; + + if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) { - mFullyLoaded = FALSE ; + mFullyLoaded = TRUE ; } } } @@ -1722,11 +1713,6 @@ void LLViewerFetchedTexture::setDecodePriority(F32 priority) llassert(!mInImageList); mDecodePriority = priority; - - if(mDecodePriority < F_ALMOST_ZERO) - { - mStopFetchingTimer.reset() ; - } } void LLViewerFetchedTexture::setAdditionalDecodePriority(F32 priority) @@ -1918,12 +1904,7 @@ bool LLViewerFetchedTexture::updateFetch() // llinfos << "Calling updateRequestPriority() with decode_priority = 0.0f" << llendl; // calcDecodePriority(); // } - static const F32 MAX_HOLD_TIME = 5.0f ; //seconds to wait before canceling fecthing if decode_priority is 0.f. - if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME) - { - mStopFetchingTimer.reset() ; - LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority); - } + LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority); } } @@ -2083,36 +2064,6 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } } -void LLViewerFetchedTexture::clearCallbackEntryList() -{ - if(mLoadedCallbackList.empty()) - { - return ; - } - - for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); - iter != mLoadedCallbackList.end(); ) - { - LLLoadedCallbackEntry *entryp = *iter; - - // We never finished loading the image. Indicate failure. - // Note: this allows mLoadedCallbackUserData to be cleaned up. - entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData); - iter = mLoadedCallbackList.erase(iter) ; - delete entryp; - } - gTextureList.mCallbackList.erase(this); - - mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; - mLoadedCallbackDesiredDiscardLevel = S8_MAX ; - if(mForceToSaveRawImage) - { - destroySavedRawImage() ; - } - - return ; -} - void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(mLoadedCallbackList.empty() || !callback_list) @@ -2120,7 +2071,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so return ; } - S32 desired_discard = S8_MAX ; + S32 desired_discard = INVALID_DISCARD_LEVEL ; S32 desired_raw_discard = INVALID_DISCARD_LEVEL ; for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); iter != mLoadedCallbackList.end(); ) @@ -2174,7 +2125,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(!callback_list) -{ + { mPauseLoadedCallBacks = FALSE ; return ; } @@ -2203,7 +2154,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(!callback_list) -{ + { return ; } @@ -2690,12 +2641,6 @@ void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, bool from_ } void LLViewerFetchedTexture::destroySavedRawImage() { - clearCallbackEntryList() ; - //if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0 && mDesiredSavedRawDiscardLevel < getDiscardLevel()) - //{ - // return ; //can not destroy the saved raw image before it is fully fetched, otherwise causing callbacks hanging there. - //} - mSavedRawImage = NULL ; mForceToSaveRawImage = FALSE ; mSavedRawDiscardLevel = -1 ; @@ -2946,7 +2891,7 @@ BOOL LLViewerLODTexture::isUpdateFrozen() void LLViewerLODTexture::processTextureStats() { updateVirtualSize() ; - + static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); if (textures_fullres) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 7cb8bea4c8..b8bdeedd03 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -386,7 +386,6 @@ public: void unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list); bool doLoadedCallbacks(); void deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list); - void clearCallbackEntryList() ; void addToCreateTexture(); @@ -557,7 +556,6 @@ protected: // Timers LLFrameTimer mLastPacketTimer; // Time since last packet. - LLFrameTimer mStopFetchingTimer; // Time since mDecodePriority == 0.f. BOOL mInImageList; // TRUE if image is in list (in which case don't reset priority!) BOOL mNeedsCreateTexture; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 13db913f60..2981dc8c82 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1342,7 +1342,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - 0); //gSavedSettings.getU32("RenderFSAASamples")); + gSavedSettings.getU32("RenderFSAASamples")); if (!LLAppViewer::instance()->restoreErrorTrap()) { @@ -2476,6 +2476,17 @@ void LLViewerWindow::updateUI() // only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { + // include all ancestors of captor_view as automatically having mouse + if (captor_view) + { + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } + } + // aggregate visible views that contain mouse cursor in display order LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups(); @@ -3801,6 +3812,140 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); + + // *TODO below code was broken in deferred pipeline + /* + if ((!raw) || preview_width < 10 || preview_height < 10) + { + return FALSE; + } + + if(gResizeScreenTexture) //the window is resizing + { + return FALSE ; + } + + setCursor(UI_CURSOR_WAIT); + + // Hide all the UI widgets first and draw a frame + BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); + + if ( prev_draw_ui != show_ui) + { + LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); + } + + BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; + if (hide_hud) + { + LLPipeline::sShowHUDAttachments = FALSE; + } + + S32 render_name = gSavedSettings.getS32("RenderName"); + gSavedSettings.setS32("RenderName", 0); + LLVOAvatar::updateFreezeCounter(1) ; //pause avatar updating for one frame + + S32 w = preview_width ; + S32 h = preview_height ; + LLVector2 display_scale = mDisplayScale ; + mDisplayScale.setVec((F32)w / mWindowRectRaw.getWidth(), (F32)h / mWindowRectRaw.getHeight()) ; + LLRect window_rect = mWindowRectRaw; + mWindowRectRaw.set(0, h, w, 0); + + gDisplaySwapBuffers = FALSE; + gDepthDirty = TRUE; + glClearColor(0.f, 0.f, 0.f, 0.f); + glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + setup3DRender(); + + LLFontGL::setFontDisplay(FALSE) ; + LLHUDText::setDisplayText(FALSE) ; + if (type == SNAPSHOT_TYPE_OBJECT_ID) + { + gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); + } + else + { + display(do_rebuild, 1.0f, 0, TRUE); + render_ui(); + } + + S32 glformat, gltype, glpixel_length ; + if(SNAPSHOT_TYPE_DEPTH == type) + { + glpixel_length = 4 ; + glformat = GL_DEPTH_COMPONENT ; + gltype = GL_FLOAT ; + } + else + { + glpixel_length = 3 ; + glformat = GL_RGB ; + gltype = GL_UNSIGNED_BYTE ; + } + + raw->resize(w, h, glpixel_length); + glReadPixels(0, 0, w, h, glformat, gltype, raw->getData()); + + if(SNAPSHOT_TYPE_DEPTH == type) + { + LLViewerCamera* camerap = LLViewerCamera::getInstance(); + F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); + F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); + + //calculate the depth + for (S32 y = 0 ; y < h ; y++) + { + for(S32 x = 0 ; x < w ; x++) + { + S32 i = (w * y + x) << 2 ; + + F32 depth_float_i = *(F32*)(raw->getData() + i); + + F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); + U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); + *(raw->getData() + i + 0) = depth_byte; + *(raw->getData() + i + 1) = depth_byte; + *(raw->getData() + i + 2) = depth_byte; + *(raw->getData() + i + 3) = 255; + } + } + } + + LLFontGL::setFontDisplay(TRUE) ; + LLHUDText::setDisplayText(TRUE) ; + mDisplayScale.setVec(display_scale) ; + mWindowRectRaw = window_rect; + setup3DRender(); + gDisplaySwapBuffers = FALSE; + gDepthDirty = TRUE; + + // POST SNAPSHOT + if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); + } + + if (hide_hud) + { + LLPipeline::sShowHUDAttachments = TRUE; + } + + setCursor(UI_CURSOR_ARROW); + + if (do_rebuild) + { + // If we had to do a rebuild, that means that the lists of drawables to be rendered + // was empty before we started. + // Need to reset these, otherwise we call state sort on it again when render gets called the next time + // and we stand a good chance of crashing on rebuild because the render drawable arrays have multiple copies of + // objects on them. + gPipeline.resetDrawOrders(); + } + + gSavedSettings.setS32("RenderName", render_name); + + return TRUE;*/ } // Saves the image from the screen to the specified filename and path. @@ -4445,26 +4590,23 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar) BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar) { - //BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized"); + BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized"); //gResizeScreenTexture = TRUE; - //U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); - //U32 old_fsaa = mWindow->getFSAASamples(); - + U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); + U32 old_fsaa = mWindow->getFSAASamples(); // if not maximized, use the request size if (!mWindow->getMaximized()) { mWindow->setSize(size); } - //if (fsaa == old_fsaa) + if (fsaa == old_fsaa) { return TRUE; } -/* - // Close floaters that don't handle settings change LLFloaterReg::hideInstance("snapshot"); @@ -4480,13 +4622,13 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn LLCoordScreen old_pos; mWindow->getSize(&old_size); - //mWindow->setFSAASamples(fsaa); + mWindow->setFSAASamples(fsaa); result_first_try = mWindow->switchContext(false, size, disable_vsync); if (!result_first_try) { // try to switch back - //mWindow->setFSAASamples(old_fsaa); + mWindow->setFSAASamples(old_fsaa); result_second_try = mWindow->switchContext(false, old_size, disable_vsync); if (!result_second_try) @@ -4540,8 +4682,6 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn gFocusMgr.setKeyboardFocus(keyboard_focus); return success; - - */ } F32 LLViewerWindow::getWorldViewAspectRatio() const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9af1198df1..89ce889a61 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -696,8 +696,10 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mBakedTextureDatas[i].mTextureIndex = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i); } - mDirtyMesh = 2; // Dirty geometry, need to regenerate. + mDirtyMesh = TRUE; // Dirty geometry, need to regenerate. mMeshTexturesDirty = FALSE; + mShadow0Facep = NULL; + mShadow1Facep = NULL; mHeadp = NULL; mIsBuilt = FALSE; @@ -733,6 +735,12 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRippleTimeLast = 0.f; + mShadowImagep = LLViewerTextureManager::getFetchedTextureFromFile("foot_shadow.j2c"); + + // GL NOT ACTIVE HERE + //gGL.getTexUnit(0)->bind(mShadowImagep.get()); + //mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP); + mInAir = FALSE; mStepOnLand = TRUE; @@ -1961,7 +1969,7 @@ void LLVOAvatar::updateMeshData() } if(num_vertices < 1)//skip empty meshes { - continue ; + break ; } if(last_v_num > 0)//put the last inserted part into next vertex buffer. { @@ -1983,8 +1991,6 @@ void LLVOAvatar::updateMeshData() // resize immediately facep->setSize(num_vertices, num_indices); - bool terse_update = false; - if(facep->mVertexBuffer.isNull()) { facep->mVertexBuffer = new LLVertexBufferAvatar(); @@ -1992,16 +1998,8 @@ void LLVOAvatar::updateMeshData() } else { - if (facep->mVertexBuffer->getRequestedIndices() == num_indices && - facep->mVertexBuffer->getRequestedVerts() == num_vertices) - { - terse_update = true; - } - else - { facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ; } - } facep->setGeomIndex(0); facep->setIndicesIndex(0); @@ -2015,7 +2013,7 @@ void LLVOAvatar::updateMeshData() for(S32 k = j ; k < part_index ; k++) { - mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update); + mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR); } stop_glerror(); @@ -2425,6 +2423,12 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) LLJoint::sNumUpdates = 0; LLJoint::sNumTouches = 0; + // *NOTE: this is necessary for the floating name text above your head. + if (mDrawable.notNull()) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_SHADOW, TRUE); + } + BOOL visible = isVisible() || mNeedsAnimUpdate; // update attachments positions @@ -2747,7 +2751,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { // update chat bubble //-------------------------------------------------------------------- - // draw text label over character's head + // draw text label over characters head //-------------------------------------------------------------------- if (mChatTimer.getElapsedTimeF32() > BUBBLE_CHAT_TIME) { @@ -3777,20 +3781,13 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) return num_indices; } - LLFace* face = mDrawable->getFace(0); - - bool needs_rebuild = !face || face->mVertexBuffer.isNull() || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY); - - if (needs_rebuild || mDirtyMesh) + if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) { //LOD changed or new mesh created, allocate new vertex buffer if needed - if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) - { updateMeshData(); - mDirtyMesh = 0; + mDirtyMesh = FALSE; mNeedsSkin = TRUE; mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } - } if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0) { @@ -4037,6 +4034,54 @@ U32 LLVOAvatar::renderRigid() return num_indices; } +U32 LLVOAvatar::renderFootShadows() +{ + U32 num_indices = 0; + + if (!mIsBuilt) + { + return 0; + } + + if (isSelf() && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) + { + return 0; + } + + if (!mIsBuilt) + { + return 0; + } + + // Don't render foot shadows if your lower body is completely invisible. + // (non-humanoid avatars rule!) + if (!isTextureVisible(TEX_LOWER_BAKED)) + { + return 0; + } + + // Update the shadow, tractor, and text label geometry. + if (mDrawable->isState(LLDrawable::REBUILD_SHADOW) && !isImpostor()) + { + updateShadowFaces(); + mDrawable->clearState(LLDrawable::REBUILD_SHADOW); + } + + U32 foot_mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0; + + LLGLDepthTest test(GL_TRUE, GL_FALSE); + //render foot shadows + LLGLEnable blend(GL_BLEND); + gGL.getTexUnit(0)->bind(mShadowImagep, TRUE); + glColor4fv(mShadow0Facep->getRenderColor().mV); + mShadow0Facep->renderIndexed(foot_mask); + glColor4fv(mShadow1Facep->getRenderColor().mV); + mShadow1Facep->renderIndexed(foot_mask); + + return num_indices; +} + U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) { if (!mImpostor.isComplete()) @@ -4162,6 +4207,11 @@ void LLVOAvatar::updateTextures() { setDebugText(llformat("%4.0f:%4.0f", fsqrtf(mMinPixelArea),fsqrtf(mMaxPixelArea))); } + + if( render_avatar ) + { + mShadowImagep->addTextureStats(mPixelArea); + } } @@ -5428,7 +5478,7 @@ BOOL LLVOAvatar::updateJointLODs() if (res) { sNumLODChangesThisFrame++; - dirtyMesh(2); + dirtyMesh(); return TRUE; } } @@ -5452,9 +5502,18 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) mDrawable->addFace(poolp, NULL); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR); + LLFace *facep; + + // Add faces for the foot shadows + facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); + mShadow0Facep = facep; + + facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); + mShadow1Facep = facep; + mNumInitFaces = mDrawable->getNumFaces() ; - dirtyMesh(2); + dirtyMesh(); return mDrawable; } @@ -5493,6 +5552,107 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) return TRUE; } +//----------------------------------------------------------------------------- +// updateShadowFaces() +//----------------------------------------------------------------------------- +void LLVOAvatar::updateShadowFaces() +{ + LLFace *face0p = mShadow0Facep; + LLFace *face1p = mShadow1Facep; + + // + // render avatar shadows + // + if (mInAir || mUpdatePeriod >= IMPOSTOR_PERIOD) + { + face0p->setSize(0, 0); + face1p->setSize(0, 0); + return; + } + + LLSprite sprite(mShadowImagep.notNull() ? mShadowImagep->getID() : LLUUID::null); + sprite.setFollow(FALSE); + const F32 cos_angle = gSky.getSunDirection().mV[2]; + F32 cos_elev = sqrt(1 - cos_angle * cos_angle); + if (cos_angle < 0) cos_elev = -cos_elev; + sprite.setSize(0.4f + cos_elev * 0.8f, 0.3f); + LLVector3 sun_vec = gSky.mVOSkyp ? gSky.mVOSkyp->getToSun() : LLVector3(0.f, 0.f, 0.f); + + if (mShadowImagep->hasGLTexture()) + { + LLVector3 normal; + LLVector3d shadow_pos; + LLVector3 shadow_pos_agent; + F32 foot_height; + + if (mFootLeftp) + { + LLVector3 joint_world_pos = mFootLeftp->getWorldPosition(); + // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now + // but we make an explicit ray trace call in expectation of future improvements + resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), + gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); + shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); + foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; + + // Pull sprite in direction of surface normal + shadow_pos_agent += normal * SHADOW_OFFSET_AMT; + + // Render sprite + sprite.setNormal(normal); + if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) + { + sprite.setColor(0.f, 0.f, 0.f, 0.f); + } + else + { + sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); + } + sprite.setPosition(shadow_pos_agent); + + LLVector3 foot_to_knee = mKneeLeftp->getWorldPosition() - joint_world_pos; + //foot_to_knee.normalize(); + foot_to_knee -= projected_vec(foot_to_knee, sun_vec); + sprite.setYaw(azimuth(sun_vec - foot_to_knee)); + + sprite.updateFace(*face0p); + } + + if (mFootRightp) + { + LLVector3 joint_world_pos = mFootRightp->getWorldPosition(); + // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now + // but we make an explicit ray trace call in expectation of future improvements + resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), + gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); + shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); + foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; + + // Pull sprite in direction of surface normal + shadow_pos_agent += normal * SHADOW_OFFSET_AMT; + + // Render sprite + sprite.setNormal(normal); + if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) + { + sprite.setColor(0.f, 0.f, 0.f, 0.f); + } + else + { + sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); + } + sprite.setPosition(shadow_pos_agent); + + LLVector3 foot_to_knee = mKneeRightp->getWorldPosition() - joint_world_pos; + //foot_to_knee.normalize(); + foot_to_knee -= projected_vec(foot_to_knee, sun_vec); + sprite.setYaw(azimuth(sun_vec - foot_to_knee)); + + sprite.updateFace(*face1p); + } + } +} + //----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- @@ -5508,12 +5668,9 @@ void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) //----------------------------------------------------------------------------- void LLVOAvatar::dirtyMesh() { - dirtyMesh(1); -} -void LLVOAvatar::dirtyMesh(S32 priority) -{ - mDirtyMesh = llmax(mDirtyMesh, priority); + mDirtyMesh = TRUE; } + //----------------------------------------------------------------------------- // hideSkirt() //----------------------------------------------------------------------------- @@ -5547,7 +5704,6 @@ BOOL LLVOAvatar::setParent(LLViewerObject* parent) void LLVOAvatar::addChild(LLViewerObject *childp) { - childp->extractAttachmentItemID(); // find the inventory item this object is associated with. LLViewerObject::addChild(childp); if (childp->mDrawable) { @@ -5636,15 +5792,6 @@ BOOL LLVOAvatar::canAttachMoreObjects() const return (getNumAttachments() < MAX_AGENT_ATTACHMENTS); } -//----------------------------------------------------------------------------- -// canAttachMoreObjects() -// Returns true if we can attach more objects. -//----------------------------------------------------------------------------- -BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const -{ - return (getNumAttachments() + n) <= MAX_AGENT_ATTACHMENTS; -} - //----------------------------------------------------------------------------- // lazyAttach() //----------------------------------------------------------------------------- @@ -6097,14 +6244,10 @@ void LLVOAvatar::updateMeshTextures() // When an avatar is changing clothes and not in Appearance mode, // use the last-known good baked texture until it finish the first // render of the new layerset. - - const BOOL layerset_invalid = !mBakedTextureDatas[i].mTexLayerSet - || !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized() - || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable(); - use_lkg_baked_layer[i] = (!is_layer_baked[i] && (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) - && layerset_invalid); + && mBakedTextureDatas[i].mTexLayerSet + && !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized()); if (use_lkg_baked_layer[i]) { mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE); @@ -7792,15 +7935,18 @@ BOOL LLVOAvatar::updateLOD() BOOL res = updateJointLODs(); LLFace* facep = mDrawable->getFace(0); - if (facep->mVertexBuffer.isNull()) + if (facep->mVertexBuffer.isNull() || + (LLVertexBuffer::sEnableVBOs && + ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) != + (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))) { - dirtyMesh(2); + mDirtyMesh = TRUE; } - if (mDirtyMesh >= 2 || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) { //LOD changed or new mesh created, allocate new vertex buffer if needed updateMeshData(); - mDirtyMesh = 0; + mDirtyMesh = FALSE; mNeedsSkin = TRUE; mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 6d9424c8be..0934f5df36 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -336,6 +336,7 @@ private: **/ public: + U32 renderFootShadows(); U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -572,8 +573,7 @@ protected: void releaseMeshData(); virtual void restoreMeshData(); private: - void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority - S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD + BOOL mDirtyMesh; BOOL mMeshTexturesDirty; typedef std::multimap polymesh_map_t; @@ -681,7 +681,6 @@ public: void rebuildHUD(); void resetHUDAttachments(); BOOL canAttachMoreObjects() const; - BOOL canAttachMoreObjects(U32 n) const; protected: U32 getNumAttachments() const; // O(N), not O(1) @@ -1044,7 +1043,7 @@ protected: // Shared with LLVOAvatarSelf *******************************************************************************/ }; // LLVOAvatar -extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; +extern const F32 SELF_ADDITIONAL_PRI; #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b6055d82e3..a28482b4de 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1009,44 +1009,6 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const return FALSE; } -//----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::attachmentWasRequested(const LLUUID& inv_item_id) const -{ - const F32 REQUEST_EXPIRATION_SECONDS = 5.0; // any request older than this is ignored/removed. - std::map::iterator it = mAttachmentRequests.find(inv_item_id); - if (it != mAttachmentRequests.end()) - { - const LLTimer& request_time = it->second; - F32 request_time_elapsed = request_time.getElapsedTimeF32(); - if (request_time_elapsed > REQUEST_EXPIRATION_SECONDS) - { - mAttachmentRequests.erase(it); - return FALSE; - } - else - { - return TRUE; - } - } - else - { - return FALSE; - } -} - -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::addAttachmentRequest(const LLUUID& inv_item_id) -{ - LLTimer current_time; - mAttachmentRequests[inv_item_id] = current_time; -} - -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::removeAttachmentRequest(const LLUUID& inv_item_id) -{ - mAttachmentRequests.erase(inv_item_id); -} - //----------------------------------------------------------------------------- // getWornAttachment() //----------------------------------------------------------------------------- @@ -1099,10 +1061,8 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view // Should just be the last object added if (attachment->isObjectAttached(viewer_object)) { - const LLUUID& attachment_id = viewer_object->getAttachmentItemID(); + const LLUUID& attachment_id = viewer_object->getItemID(); LLAppearanceMgr::instance().registerAttachment(attachment_id); - // Clear any pending requests once the attachment arrives. - removeAttachmentRequest(attachment_id); } return attachment; @@ -1111,7 +1071,7 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view //virtual BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) { - const LLUUID attachment_id = viewer_object->getAttachmentItemID(); + const LLUUID attachment_id = viewer_object->getItemID(); if (LLVOAvatar::detachObject(viewer_object)) { // the simulator should automatically handle permission revocation @@ -1149,29 +1109,6 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) return FALSE; } -// static -BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) -{ - LLInventoryItem* item = gInventory.getItem(item_id); - if (item) - { - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); - gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject(item_id); - if (found_obj) - { - LLSelectMgr::getInstance()->remove(found_obj); - } - return TRUE; - } - return FALSE; -} - U32 LLVOAvatarSelf::getNumWearables(LLVOAvatarDefines::ETextureIndex i) const { LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); @@ -1682,15 +1619,15 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te if (isSelf()) { if (gAgentAvatarp->isUsingBakedTextures()) - { - requestLayerSetUpdate(type); - } + { + requestLayerSetUpdate(type); + } else - { - LLVisualParamHint::requestHintUpdates(); + { + LLVisualParamHint::requestHintUpdates(); + } } } - } else { tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type), NULL); @@ -2202,11 +2139,6 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) void LLVOAvatarSelf::outputRezDiagnostics() const { - if(!gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) - { - return ; - } - const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32(); llinfos << "REZTIME: Myself rez stats:" << llendl; llinfos << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl; diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index eb2475f666..02d0a28f46 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -285,18 +285,10 @@ protected: public: void updateAttachmentVisibility(U32 camera_mode); BOOL isWearingAttachment(const LLUUID& inv_item_id) const; - BOOL attachmentWasRequested(const LLUUID& inv_item_id) const; - void addAttachmentRequest(const LLUUID& inv_item_id); - void removeAttachmentRequest(const LLUUID& inv_item_id); LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); const std::string getAttachedPointName(const LLUUID& inv_item_id) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); - static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); - -private: - // Track attachments that have been requested but have not arrived yet. - mutable std::map mAttachmentRequests; //-------------------------------------------------------------------- // HUDs diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 7ae8c2c07d..a649c19014 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -969,10 +969,7 @@ void LLVOSky::calcAtmospherics(void) } temp2.mV[1] = llmax(0.f, lighty); - if(temp2.mV[1] > 0.f) - { - temp2.mV[1] = 1.f / temp2.mV[1]; - } + temp2.mV[1] = 1.f / temp2.mV[1]; componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1])); // Distance diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 37a974be28..3e0c65abff 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -442,35 +442,22 @@ void LLVOTree::render(LLAgent &agent) void LLVOTree::setPixelAreaAndAngle(LLAgent &agent) { - LLVector3 center = getPositionAgent();//center of tree. - LLVector3 viewer_pos_agent = gAgentCamera.getCameraPositionAgent(); - LLVector3 lookAt = center - viewer_pos_agent; - F32 dist = lookAt.normVec() ; - F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; + // First calculate values as for any other object (for mAppAngle) + LLViewerObject::setPixelAreaAndAngle(agent); + + // Re-calculate mPixelArea accurately - F32 range = dist - getMinScale()/2; - if (range < F_ALMOST_ZERO || isHUDAttachment()) // range == zero - { - mAppAngle = 180.f; - } - else - { - mAppAngle = (F32) atan2( getMaxScale(), range) * RAD_TO_DEG; - } + // This should be the camera's center, as soon as we move to all region-local. + LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent(); + F32 range_squared = relative_position.lengthSquared() ; F32 max_scale = mBillboardScale * getMaxScale(); F32 area = max_scale * (max_scale*mBillboardRatio); - // Compute pixels per meter at the given range - F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / (tan(LLViewerCamera::getInstance()->getView()) * dist); - mPixelArea = pixels_per_meter * pixels_per_meter * area ; - F32 importance = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ; - mPixelArea = LLFace::adjustPixelArea(importance, mPixelArea) ; - if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea()) - { - mAppAngle = 180.f; - } + // Compute pixels per meter at the given range + F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView()); + mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared; #if 0 // mAppAngle is a bit of voodoo; // use the one calculated LLViewerObject::setPixelAreaAndAngle above diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 761e12020b..4e3be0f703 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -87,14 +87,8 @@ static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { public: - LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) - { - mObject->addMDCImpl(); - } - ~LLMediaDataClientObjectImpl() - { - mObject->removeMDCImpl(); - } + LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {} + LLMediaDataClientObjectImpl() { mObject = NULL; } virtual U8 getMediaDataCount() const { return mObject->getNumTEs(); } @@ -119,18 +113,6 @@ public: } return result; } - virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const - { - LLTextureEntry *te = mObject->getTE(index); - if (te) - { - if (te->getMediaData()) - { - return (te->getMediaData()->getCurrentURL() == url); - } - } - return url.empty(); - } virtual LLUUID getID() const { return mObject->getID(); } @@ -205,7 +187,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mMediaImplList.resize(getNumTEs()); mLastFetchedMediaVersion = -1; mIndexInTex = 0; - mMDCImplCount = 0; } LLVOVolume::~LLVOVolume() @@ -231,12 +212,9 @@ void LLVOVolume::markDead() { if (!mDead) { - if(getMDCImplCount() > 0) - { - LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); - if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); - if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); - } + LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); + if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); + if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); // Detach all media impls from this object for(U32 i = 0 ; i < mMediaImplList.size() ; i++) @@ -2041,12 +2019,12 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu } else { - LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL; + llwarns << "Couldn't find media entry!" << llendl; } if(block_navigation) { - LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL; + llinfos << "blocking navigate to URI " << new_location << llendl; // "bounce back" to the current URL from the media entry mediaNavigateBounceBack(face_index); @@ -2054,7 +2032,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu else if (sObjectMediaNavigateClient) { - LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL; + llinfos << "broadcasting navigate with URI " << new_location << llendl; sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location); } @@ -2076,19 +2054,14 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; - case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: - // This navigate didn't change the current URL. - LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; - break; - case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: // This is the first location changed event after the start of a server-directed nav. Don't broadcast it. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (server-directed)" << llendl; break; default: // This is a subsequent location-changed due to a redirect. Don't broadcast. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (redirect)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (redirect)" << llendl; break; } } @@ -2105,14 +2078,9 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; - case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: - // This navigate didn't change the current URL. - LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; - break; - case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: // This is the the navigate complete event from a server-directed nav. Don't broadcast it. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (server-directed)" << llendl; break; default: @@ -2486,17 +2454,6 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() const -{ - LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params) - { - return params->isLightSpotlight(); - } - return false; -} - - LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); @@ -2956,7 +2913,9 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - !face->canRenderAsMask()) + (!LLPipeline::sFastAlpha || + face->getFaceColor().mV[3] != 1.f || + !face->getTexture()->getIsAlphaMask())) { alpha_wrap = TRUE; break; @@ -3232,10 +3191,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; + BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3260,12 +3220,16 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - - U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; + U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0); LLViewerTexture* tex = facep->getTexture(); - U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); + U8 glow = 0; + + if (type == LLRenderPass::PASS_GLOW) + { + glow = (U8) (facep->getTextureEntry()->getGlow() * 255); + } if (facep->mVertexBuffer.isNull()) { @@ -3330,7 +3294,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); - void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3456,7 +3419,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (facep->canRenderAsMask()) + if (LLPipeline::sFastAlpha && + (te->getColor().mV[VW] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + facep->getTexture()->getIsAlphaMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3558,8 +3524,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); -static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); - void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { llassert(group); @@ -3572,7 +3536,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { - LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3800,12 +3763,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; + BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (facep->canRenderAsMask()) + if (LLPipeline::sFastAlpha && + (te->getColor().mV[VW] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + facep->getTexture()->getIsAlphaMask()) { if (te->getFullbright()) { @@ -3830,76 +3796,66 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) - { //shiny + { if (tex->getPrimaryFormat() == GL_ALPHA) - { //invisiprim+shiny + { registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (LLPipeline::sRenderDeferred) - { //deferred rendering - if (te->getFullbright()) - { //register in post deferred fullbright shiny pass - registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); - if (te->getBumpmap()) - { //register in post deferred bump pass - registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); - } - } - else if (te->getBumpmap()) - { //register in deferred bump pass + { + if (te->getBumpmap()) + { registerFace(group, facep, LLRenderPass::PASS_BUMP); } + else if (te->getFullbright()) + { + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + } else - { //register in deferred simple pass (deferred simple includes shiny) + { llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } else if (fullbright) - { //not deferred, register in standard fullbright shiny pass + { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } else - { //not deferred or fullbright, register in standard shiny pass + { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } else - { //not alpha and not shiny + { if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA) - { //invisiprim + { registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (fullbright) - { //fullbright + { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { //if this is the deferred render and a bump map is present, register in post deferred bump - registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); - } } else { - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { //non-shiny or fullbright deferred bump + if (LLPipeline::sRenderDeferred && te->getBumpmap()) + { registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { //all around simple + { llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } - //not sure why this is here -- shiny HUD attachments maybe? -- davep 5/11/2010 if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump) { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } - //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 if (!is_alpha && !LLPipeline::sRenderDeferred) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); @@ -3911,7 +3867,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 1e9b9737b1..bf9536d0c2 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -209,7 +209,6 @@ public: LLColor3 getLightBaseColor() const; // not scaled by intensity LLColor3 getLightColor() const; // scaled by intensity LLUUID getLightTextureID() const; - bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; void updateSpotLightPriority(); F32 getSpotLightPriority() const; @@ -268,10 +267,6 @@ public: // Returns the "last fetched" media version, or -1 if not fetched yet S32 getLastFetchedMediaVersion() const { return mLastFetchedMediaVersion; } - - void addMDCImpl() { ++mMDCImplCount; } - void removeMDCImpl() { --mMDCImplCount; } - S32 getMDCImplCount() { return mMDCImplCount; } protected: S32 computeLODDetail(F32 distance, F32 radius); @@ -305,7 +300,6 @@ private: media_list_t mMediaImplList; S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1 S32 mIndexInTex; - S32 mMDCImplCount; // statics public: static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d1c0990f90..59c9a692fe 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -46,7 +46,6 @@ #include "llvoavatarself.h" #include "llvoavatardefines.h" #include "llwearable.h" -#include "llviewercontrol.h" using namespace LLVOAvatarDefines; @@ -439,10 +438,8 @@ BOOL LLWearable::importFile( LLFILE* file ) delete mSavedTEMap[te]; } - if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) - { - image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL); - } + image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL); + LLUUID textureid(text_buffer); mTEMap[te] = new LLLocalTextureObject(image, textureid); mSavedTEMap[te] = new LLLocalTextureObject(image, textureid); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index a49dc1b59d..29d2745d6e 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -119,11 +119,7 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - // Updating item's worn status depending on whether it is linked in COF or not. - // We don't use get_is_item_worn() here because this update is triggered by - // an inventory observer upon link in COF beind added or removed so actual - // worn status of a linked item may still remain unchanged. - if (mWornIndicationEnabled && LLAppearanceMgr::instance().isLinkInCOF(mInventoryItemUUID)) + if (mWornIndicationEnabled && get_is_item_worn(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -526,8 +522,6 @@ bool LLWearableItemTypeNameComparator::doCompare(const LLPanelInventoryListItemB const LLWearableType::EType item_wearable_type2 = wearable_item2->getWearableType(); if (item_wearable_type1 != item_wearable_type2) - // If items are of different LLWearableType::EType types they are compared - // by LLWearableType::EType. types order determined in LLWearableType::EType. { // If items are of different LLWearableType::EType types they are compared // by LLWearableType::EType. types order determined in LLWearableType::EType. @@ -550,7 +544,6 @@ LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparato { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); - if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about order rang of items of "<second.mSortAssetTypeByName; - } - +} bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType item_type) const { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); - if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about sorting items of "<second.mSortWearableTypeByName; -} - -/*virtual*/ -bool LLWearableItemCreationDateComparator::doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const -{ - time_t date1 = item1->getCreationDate(); - time_t date2 = item2->getCreationDate(); - - if (date1 == date2) - { - return LLWearableItemNameComparator::doCompare(item1, item2); } - return date1 > date2; + return const_it->second.mSortWearableTypeByName; } ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -static LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; -static const LLWearableItemTypeNameComparator WEARABLE_TYPE_LAYER_COMPARATOR; -static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR; -static const LLWearableItemCreationDateComparator WEARABLE_CREATION_DATE_COMPARATOR; +static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; static const LLDefaultChildRegistry::Register r("wearable_items_list"); @@ -623,7 +594,7 @@ LLWearableItemsList::Params::Params() LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) : LLInventoryItemsList(p) { - setSortOrder(E_SORT_BY_TYPE_LAYER, false); + setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); mIsStandalone = p.standalone; if (mIsStandalone) { @@ -631,7 +602,6 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3)); } mWornIndicationEnabled = p.worn_indication_enabled; - setNoItemsCommentText(LLTrans::getString("LoadingData")); } // virtual @@ -673,15 +643,10 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) LLInventoryModel::EXCLUDE_TRASH, collector); - if(item_array.empty() && gInventory.isCategoryComplete(category_id)) - { - setNoItemsCommentText(LLTrans::getString("EmptyOutfitText")); - } - refreshList(item_array); } -void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uuids) +void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) { // nothing to update if (changed_items_uuids.empty()) return; @@ -703,7 +668,7 @@ void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uui LLUUID linked_uuid = inv_item->getLinkedUUID(); - for (uuid_vec_t::const_iterator iter = changed_items_uuids.begin(); + for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items_uuids.begin(); iter != changed_items_uuids.end(); ++iter) { @@ -729,38 +694,6 @@ void LLWearableItemsList::onRightClick(S32 x, S32 y) ContextMenu::instance().show(this, selected_uuids, x, y); } -void LLWearableItemsList::setSortOrder(ESortOrder sort_order, bool sort_now) -{ - switch (sort_order) - { - case E_SORT_BY_MOST_RECENT: - setComparator(&WEARABLE_CREATION_DATE_COMPARATOR); - break; - case E_SORT_BY_NAME: - setComparator(&WEARABLE_NAME_COMPARATOR); - break; - case E_SORT_BY_TYPE_LAYER: - setComparator(&WEARABLE_TYPE_LAYER_COMPARATOR); - break; - case E_SORT_BY_TYPE_NAME: - { - WEARABLE_TYPE_NAME_COMPARATOR.setOrder(LLAssetType::AT_CLOTHING, LLWearableItemTypeNameComparator::ORDER_RANK_1, false, true); - setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); - break; - } - - // No "default:" to raise compiler warning - // if we're not handling something - } - - mSortOrder = sort_order; - - if (sort_now) - { - sort(); - } -} - ////////////////////////////////////////////////////////////////////////// /// ContextMenu ////////////////////////////////////////////////////////////////////////// @@ -831,8 +764,6 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones - bool can_be_worn = true; - for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { LLUUID id = *it; @@ -868,22 +799,16 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu { ++n_already_worn; } - - if (can_be_worn) - { - can_be_worn = get_can_item_be_worn(item->getLinkedUUID()); - } } // for bool standalone = mParent ? mParent->isStandalone() : false; - bool wear_add_visible = mask & (MASK_CLOTHING|MASK_ATTACHMENT) && n_worn == 0 && can_be_worn && (n_already_worn != 0 || mask & MASK_ATTACHMENT); // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); - setMenuItemVisible(menu, "wear_add", wear_add_visible); - setMenuItemEnabled(menu, "wear_add", canAddWearables(ids)); - setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); + setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0); + setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); + setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); @@ -991,61 +916,20 @@ void LLWearableItemsList::ContextMenu::createNewWearable(const LLUUID& item_id) LLAgentWearables::createWearable(item->getWearableType(), true); } -// Returns true if all the given objects and clothes can be added. +// Can we wear another wearable of the given item's wearable type? // static -bool LLWearableItemsList::ContextMenu::canAddWearables(const uuid_vec_t& item_ids) +bool LLWearableItemsList::ContextMenu::canAddWearable(const LLUUID& item_id) { // TODO: investigate wearables may not be loaded at this point EXT-8231 - U32 n_objects = 0; - boost::unordered_map clothes_by_type; - - // Count given clothes (by wearable type) and objects. - for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if (!item) - { - return false; - } - - if (item->getType() == LLAssetType::AT_OBJECT) - { - ++n_objects; - } - else if (item->getType() == LLAssetType::AT_CLOTHING) - { - ++clothes_by_type[item->getWearableType()]; - } - else - { - llwarns << "Unexpected wearable type" << llendl; - return false; - } - } - - // Check whether we can add all the objects. - if (!isAgentAvatarValid() || !gAgentAvatarp->canAttachMoreObjects(n_objects)) + LLViewerInventoryItem* item = gInventory.getItem(item_id); + if (!item || item->getType() != LLAssetType::AT_CLOTHING) { return false; } - // Check whether we can add all the clothes. - boost::unordered_map::const_iterator m_it; - for (m_it = clothes_by_type.begin(); m_it != clothes_by_type.end(); ++m_it) - { - LLWearableType::EType w_type = m_it->first; - U32 n_clothes = m_it->second; - - U32 wearable_count = gAgentWearables.getWearableCount(w_type); - if ((wearable_count + n_clothes) > LLAgentWearables::MAX_CLOTHING_PER_TYPE) - { - return false; - } - - } - - return true; + U32 wearable_count = gAgentWearables.getWearableCount(item->getWearableType()); + return wearable_count < LLAgentWearables::MAX_CLOTHING_PER_TYPE; } // EOF diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 2b05273dc7..854c37c2c1 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -34,6 +34,7 @@ // newview #include "llinventoryitemslist.h" #include "llinventorylistitem.h" +#include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llwearabletype.h" @@ -319,7 +320,7 @@ protected: /** * All information about sort order is stored in mWearableOrder map * - * mWearableOrder : KEYS VALUES + * mWearableOrder : KYES VALUES * [LLAssetType] [struct LLWearableTypeOrder] * *--------------------------------------------------------------------------------------------- @@ -333,8 +334,8 @@ protected: * For example by spec in MY OUTFITS the order within each items type(LLAssetType) is: * 1. AT_OBJECTS (abc order) * 2. AT_CLOTHINGS - * - by type (types order determined in LLWearableType::EType) - * - outer layer on top + * - by type (types order determined in LLWearableType::EType) + * - outer layer on top * 3. AT_BODYPARTS (abc order) *--------------------------------------------------------------------------------------------- * @@ -373,19 +374,6 @@ private: wearable_type_order_map_t mWearableOrder; }; -/** - * @class LLWearableItemCreationDateComparator - * - * Comparator for sorting wearable list items by creation date (newest go first). - */ -class LLWearableItemCreationDateComparator : public LLWearableItemNameComparator -{ - LOG_CLASS(LLWearableItemCreationDateComparator); - -protected: - /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const; -}; - /** * @class LLWearableItemsList * @@ -426,7 +414,7 @@ public: static void setMenuItemEnabled(LLContextMenu* menu, const std::string& name, bool val); static void updateMask(U32& mask, LLAssetType::EType at); static void createNewWearable(const LLUUID& item_id); - static bool canAddWearables(const uuid_vec_t& item_ids); + static bool canAddWearable(const LLUUID& item_id); LLWearableItemsList* mParent; }; @@ -439,14 +427,6 @@ public: Params(); }; - typedef enum e_sort_order { - // Values should be compatible with InventorySortOrder setting. - E_SORT_BY_NAME = 0, - E_SORT_BY_MOST_RECENT = 1, - E_SORT_BY_TYPE_LAYER = 2, - E_SORT_BY_TYPE_NAME = 3, - } ESortOrder; - virtual ~LLWearableItemsList(); /*virtual*/ void addNewItem(LLViewerInventoryItem* item, bool rearrange = true); @@ -457,14 +437,10 @@ public: * Update items that match UUIDs from changed_items_uuids * or links that point at such items. */ - void updateChangedItems(const uuid_vec_t& changed_items_uuids); + void updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids); bool isStandalone() const { return mIsStandalone; } - ESortOrder getSortOrder() const { return mSortOrder; } - - void setSortOrder(ESortOrder sort_order, bool sort_now = true); - protected: friend class LLUICtrlFactory; LLWearableItemsList(const LLWearableItemsList::Params& p); @@ -473,8 +449,6 @@ protected: bool mIsStandalone; bool mWornIndicationEnabled; - - ESortOrder mSortOrder; }; #endif //LL_LLWEARABLEITEMSLIST_H diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp deleted file mode 100644 index 2b9e5cc8cb..0000000000 --- a/indra/newview/llwebsharing.cpp +++ /dev/null @@ -1,609 +0,0 @@ -/** - * @file llwebsharing.cpp - * @author Aimee - * @brief Web Snapshot Sharing - * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llwebsharing.h" - -#include "llagentui.h" -#include "llbufferstream.h" -#include "llhttpclient.h" -#include "llhttpstatuscodes.h" -#include "llsdserialize.h" -#include "llsdutil.h" -#include "llurl.h" -#include "llviewercontrol.h" - -#include -#include - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingConfigResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingConfigResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else - { - completed(status, reason, content); - } - } - - virtual void error(U32 status, const std::string& reason) - { - LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; - } - - virtual void result(const LLSD& content) - { - LLWebSharing::instance().receiveConfig(content); - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingOpenIDAuthResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingOpenIDAuthResponder); -public: - /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - completed(status, reason, content); - } - - /* virtual */ void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - /// Left empty to override the default LLSD parsing behaviour. - } - - virtual void error(U32 status, const std::string& reason) - { - if (HTTP_UNAUTHORIZED == status) - { - LL_WARNS("WebSharing") << "AU account not authenticated." << LL_ENDL; - // *TODO: No account found on AU, so start the account creation process here. - } - else - { - LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - - } - - virtual void result(const LLSD& content) - { - if (content.has("set-cookie")) - { - // OpenID request succeeded and returned a session cookie. - LLWebSharing::instance().receiveSessionCookie(content["set-cookie"].asString()); - } - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingSecurityTokenResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingSecurityTokenResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - else - { - completed(status, reason, content); - } - } - - virtual void error(U32 status, const std::string& reason) - { - LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; - LLWebSharing::instance().retryOpenIDAuth(); - } - - virtual void result(const LLSD& content) - { - if (content[0].has("st") && content[0].has("expires")) - { - const std::string& token = content[0]["st"].asString(); - const std::string& expires = content[0]["expires"].asString(); - if (LLWebSharing::instance().receiveSecurityToken(token, expires)) - { - // Sucessfully received a valid security token. - return; - } - } - else - { - LL_WARNS("WebSharing") << "No security token received." << LL_ENDL; - } - - LLWebSharing::instance().retryOpenIDAuth(); - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -class LLWebSharingUploadResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(LLWebSharingUploadResponder); -public: - /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. - virtual void completedRaw(U32 status, const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { -/* - // Dump the body, for debugging. - - LLBufferStream istr1(channels, buffer.get()); - std::ostringstream ostr; - std::string body; - - while (istr1.good()) - { - char buf[1024]; - istr1.read(buf, sizeof(buf)); - body.append(buf, istr1.gcount()); - } - LL_DEBUGS("WebSharing") << body << LL_ENDL; -*/ - LLSD content; - LLBufferStream istr(channels, buffer.get()); - LLPointer parser = new LLSDNotationParser(); - - if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) - { - LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; - } - else - { - completed(status, reason, content); - } - } - - virtual void error(U32 status, const std::string& reason) - { - LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; - } - - virtual void result(const LLSD& content) - { - if (content[0].has("result") && content[0].has("id") && - content[0]["id"].asString() == "newMediaItem") - { - // *TODO: Upload successful, continue from here to post metadata and create AU activity. - } - else - { - LL_WARNS("WebSharing") << "Error [" << content[0]["code"].asString() - << "]: " << content[0]["message"].asString() << LL_ENDL; - } - } -}; - - - -/////////////////////////////////////////////////////////////////////////////// -// -LLWebSharing::LLWebSharing() -: mConfig(), - mSecurityToken(LLSD::emptyMap()), - mEnabled(false), - mRetries(0), - mImage(NULL), - mMetadata(LLSD::emptyMap()) -{ -} - -void LLWebSharing::init() -{ - if (!mEnabled) - { - sendConfigRequest(); - } -} - -bool LLWebSharing::shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata) -{ - LL_INFOS("WebSharing") << metadata << LL_ENDL; - - if (mImage) - { - // *TODO: Handle this possibility properly, queue them up? - LL_WARNS("WebSharing") << "Snapshot upload already in progress." << LL_ENDL; - return false; - } - - mImage = snapshot; - mMetadata = metadata; - - // *TODO: Check whether we have a valid security token already and re-use it. - sendOpenIDAuthRequest(); - return true; -} - -bool LLWebSharing::setOpenIDCookie(const std::string& cookie) -{ - LL_DEBUGS("WebSharing") << "Setting OpenID cookie " << cookie << LL_ENDL; - mOpenIDCookie = cookie; - return validateConfig(); -} - -bool LLWebSharing::receiveConfig(const LLSD& config) -{ - LL_DEBUGS("WebSharing") << "Received config data: " << config << LL_ENDL; - mConfig = config; - return validateConfig(); -} - -bool LLWebSharing::receiveSessionCookie(const std::string& cookie) -{ - LL_DEBUGS("WebSharing") << "Received AU session cookie: " << cookie << LL_ENDL; - mSessionCookie = cookie; - - // Fetch a security token using the new session cookie. - LLWebSharing::instance().sendSecurityTokenRequest(); - - return (!mSessionCookie.empty()); -} - -bool LLWebSharing::receiveSecurityToken(const std::string& token, const std::string& expires) -{ - mSecurityToken["st"] = token; - mSecurityToken["expires"] = LLDate(expires); - - if (!securityTokenIsValid(mSecurityToken)) - { - LL_WARNS("WebSharing") << "Invalid security token received: \"" << token << "\" Expires: " << expires << LL_ENDL; - return false; - } - - LL_DEBUGS("WebSharing") << "Received security token: \"" << token << "\" Expires: " << expires << LL_ENDL; - mRetries = 0; - - // Continue the upload process now that we have a security token. - sendUploadRequest(); - - return true; -} - -void LLWebSharing::sendConfigRequest() -{ - std::string config_url = gSavedSettings.getString("SnapshotConfigURL"); - LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "application/json"; - - LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers); -} - -void LLWebSharing::sendOpenIDAuthRequest() -{ - std::string auth_url = mConfig["openIdAuthUrl"]; - LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mOpenIDCookie; - headers["Accept"] = "*/*"; - - // Send request, successful login will trigger fetching a security token. - LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers); -} - -bool LLWebSharing::retryOpenIDAuth() -{ - if (mRetries++ >= MAX_AUTH_RETRIES) - { - LL_WARNS("WebSharing") << "Exceeded maximum number of authorization attempts, aborting." << LL_ENDL; - mRetries = 0; - return false; - } - - LL_WARNS("WebSharing") << "Authorization failed, retrying (" << mRetries << "/" << MAX_AUTH_RETRIES << ")" << LL_ENDL; - sendOpenIDAuthRequest(); - return true; -} - -void LLWebSharing::sendSecurityTokenRequest() -{ - std::string token_url = mConfig["securityTokenUrl"]; - LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL; - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; - - headers["Accept"] = "application/json"; - headers["Content-Type"] = "application/json"; - - std::ostringstream body; - body << "{ \"gadgets\": [{ \"url\":\"" - << mConfig["gadgetSpecUrl"].asString() - << "\" }] }"; - - // postRaw() takes ownership of the buffer and releases it later. - size_t size = body.str().size(); - U8 *data = new U8[size]; - memcpy(data, body.str().data(), size); - - // Send request, receiving a valid token will trigger snapshot upload. - LLHTTPClient::postRaw(token_url, data, size, new LLWebSharingSecurityTokenResponder(), headers); -} - -void LLWebSharing::sendUploadRequest() -{ - LLUriTemplate upload_template(mConfig["openSocialRpcUrlTemplate"].asString()); - std::string upload_url(upload_template.buildURI(mSecurityToken)); - - LL_DEBUGS("WebSharing") << "Posting upload to: " << upload_url << LL_ENDL; - - static const std::string BOUNDARY("------------abcdef012345xyZ"); - - LLSD headers = LLSD::emptyMap(); - headers["Cookie"] = mSessionCookie; - - headers["Accept"] = "application/json"; - headers["Content-Type"] = "multipart/form-data; boundary=" + BOUNDARY; - - std::ostringstream body; - body << "--" << BOUNDARY << "\r\n" - << "Content-Disposition: form-data; name=\"request\"\r\n\r\n" - << "[{" - << "\"method\":\"mediaItems.create\"," - << "\"params\": {" - << "\"userId\":[\"@me\"]," - << "\"groupId\":\"@self\"," - << "\"mediaItem\": {" - << "\"mimeType\":\"image/jpeg\"," - << "\"type\":\"image\"," - << "\"url\":\"@field:image1\"" - << "}" - << "}," - << "\"id\":\"newMediaItem\"" - << "}]" - << "--" << BOUNDARY << "\r\n" - << "Content-Disposition: form-data; name=\"image1\"\r\n\r\n"; - - // Insert the image data. - // *FIX: Treating this as a string will probably screw it up ... - U8* image_data = mImage->getData(); - for (S32 i = 0; i < mImage->getDataSize(); ++i) - { - body << image_data[i]; - } - - body << "\r\n--" << BOUNDARY << "--\r\n"; - - // postRaw() takes ownership of the buffer and releases it later. - size_t size = body.str().size(); - U8 *data = new U8[size]; - memcpy(data, body.str().data(), size); - - // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(upload_url, data, size, new LLWebSharingUploadResponder(), headers); -} - -bool LLWebSharing::validateConfig() -{ - // Check the OpenID Cookie has been set. - if (mOpenIDCookie.empty()) - { - mEnabled = false; - return mEnabled; - } - - if (!mConfig.isMap()) - { - mEnabled = false; - return mEnabled; - } - - // Template to match the received config against. - LLSD required(LLSD::emptyMap()); - required["gadgetSpecUrl"] = ""; - required["loginTokenUrl"] = ""; - required["openIdAuthUrl"] = ""; - required["photoPageUrlTemplate"] = ""; - required["openSocialRpcUrlTemplate"] = ""; - required["securityTokenUrl"] = ""; - required["tokenBasedLoginUrlTemplate"] = ""; - required["viewerIdUrl"] = ""; - - std::string mismatch(llsd_matches(required, mConfig)); - if (!mismatch.empty()) - { - LL_WARNS("WebSharing") << "Malformed config data response: " << mismatch << LL_ENDL; - mEnabled = false; - return mEnabled; - } - - mEnabled = true; - return mEnabled; -} - -// static -bool LLWebSharing::securityTokenIsValid(LLSD& token) -{ - return (token.has("st") && - token.has("expires") && - (token["st"].asString() != "") && - (token["expires"].asDate() > LLDate::now())); -} - - - -/////////////////////////////////////////////////////////////////////////////// -// -LLUriTemplate::LLUriTemplate(const std::string& uri_template) - : - mTemplate(uri_template) -{ -} - -std::string LLUriTemplate::buildURI(const LLSD& vars) -{ - // *TODO: Separate parsing the template from building the URI. - // Parsing only needs to happen on construction/assignnment. - - static const std::string VAR_NAME_REGEX("[[:alpha:]][[:alnum:]\\._-]*"); - // Capture var name with and without surrounding {} - static const std::string VAR_REGEX("\\{(" + VAR_NAME_REGEX + ")\\}"); - // Capture delimiter and comma separated list of var names. - static const std::string JOIN_REGEX("\\{-join\\|(&)\\|(" + VAR_NAME_REGEX + "(?:," + VAR_NAME_REGEX + ")*)\\}"); - - std::string uri = mTemplate; - boost::smatch results; - - // Validate and expand join operators : {-join|&|var1,var2,...} - - boost::regex join_regex(JOIN_REGEX); - - while (boost::regex_search(uri, results, join_regex)) - { - // Extract the list of var names from the results. - std::string delim = results[1].str(); - std::string var_list = results[2].str(); - - // Expand the list of vars into a query string with their values - std::string query = expandJoin(delim, var_list, vars); - - // Substitute the query string into the template. - uri = boost::regex_replace(uri, join_regex, query, boost::format_first_only); - } - - // Expand vars : {var1} - - boost::regex var_regex(VAR_REGEX); - - std::set var_names; - std::string::const_iterator start = uri.begin(); - std::string::const_iterator end = uri.end(); - - // Extract the var names used. - while (boost::regex_search(start, end, results, var_regex)) - { - var_names.insert(results[1].str()); - start = results[0].second; - } - - // Replace each var with its value. - for (std::set::const_iterator it = var_names.begin(); it != var_names.end(); ++it) - { - std::string var = *it; - if (vars.has(var)) - { - boost::replace_all(uri, "{" + var + "}", vars[var].asString()); - } - } - - return uri; -} - -std::string LLUriTemplate::expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars) -{ - std::ostringstream query; - - typedef boost::tokenizer > tokenizer; - boost::char_separator sep(","); - tokenizer var_names(var_list, sep); - tokenizer::const_iterator it = var_names.begin(); - - // First var does not need a delimiter - if (it != var_names.end()) - { - const std::string& name = *it; - if (vars.has(name)) - { - // URL encode the value before appending the name=value pair. - query << name << "=" << escapeURL(vars[name].asString()); - } - } - - for (++it; it != var_names.end(); ++it) - { - const std::string& name = *it; - if (vars.has(name)) - { - // URL encode the value before appending the name=value pair. - query << delim << name << "=" << escapeURL(vars[name].asString()); - } - } - - return query.str(); -} - -// static -std::string LLUriTemplate::escapeURL(const std::string& unescaped) -{ - char* escaped = curl_escape(unescaped.c_str(), unescaped.size()); - std::string result = escaped; - curl_free(escaped); - return result; -} - diff --git a/indra/newview/llwebsharing.h b/indra/newview/llwebsharing.h deleted file mode 100644 index 70046ff1d8..0000000000 --- a/indra/newview/llwebsharing.h +++ /dev/null @@ -1,230 +0,0 @@ -/** - * @file llwebsharing.h - * @author Aimee - * @brief Web Snapshot Sharing - * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLWEBSHARING_H -#define LL_LLWEBSHARING_H - -#include "llimagejpeg.h" -#include "llsingleton.h" - - - -/** - * @class LLWebSharing - * - * Manages authentication to, and interaction with, a web service allowing the - * upload of snapshot images taken within the viewer, using OpenID and the - * OpenSocial APIs. - * http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RPC-Protocol.html - */ -class LLWebSharing : public LLSingleton -{ - LOG_CLASS(LLWebSharing); -public: - /* - * Performs initial setup, by requesting config data from the web service if - * it has not already been received. - */ - void init(); - - /* - * @return true if both the OpenID cookie and config data have been received. - */ - bool enabled() const { return mEnabled; }; - - /* - * Sets the OpenID cookie to use for login to the web service. - * - * @param cookie a string containing the OpenID cookie. - * - * @return true if both the OpenID cookie and config data have been received. - */ - bool setOpenIDCookie(const std::string& cookie); - - /* - * Receive config data used to connect to the web service. - * - * @param config an LLSD map of URL templates for the web service end-points. - * - * @return true if both the OpenID cookie and config data have been received. - * - * @see sendConfigRequest() - */ - bool receiveConfig(const LLSD& config); - - /* - * Receive the session cookie from the web service, which is the result of - * the OpenID login process. - * - * @see sendOpenIDAuthRequest() - */ - bool receiveSessionCookie(const std::string& cookie); - - /* - * Receive a security token for the upload service. - * - * @see sendSecurityTokenRequest() - */ - bool receiveSecurityToken(const std::string& token, const std::string& expires); - - /* - * Restarts the authentication process if the maximum number of retries has - * not been exceeded. - * - * @return true if retrying, false if LLWebSharing::MAX_AUTH_RETRIES has been exceeded. - */ - bool retryOpenIDAuth(); - - /* - * Post a snapshot to the upload service. - * - * @return true if accepted for upload, false if already uploading another image. - */ - bool shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata); - -private: - static const S32 MAX_AUTH_RETRIES = 4; - - friend class LLSingleton; - - LLWebSharing(); - ~LLWebSharing() {}; - - /* - * Request a map of URLs and URL templates to the web service end-points. - * - * @see receiveConfig() - */ - void sendConfigRequest(); - - /* - * Initiate the OpenID login process. - * - * @see receiveSessionCookie() - */ - void sendOpenIDAuthRequest(); - - /* - * Request a security token for the upload service. - * - * @see receiveSecurityToken() - */ - void sendSecurityTokenRequest(); - - /* - * Request a security token for the upload service. - * - * @see receiveSecurityToken() - */ - void sendUploadRequest(); - - /* - * Checks all necessary config information has been received, and sets mEnabled. - * - * @return true if both the OpenID cookie and config data have been received. - */ - bool validateConfig(); - - /* - * Checks the security token is present and has not expired. - * - * @param token an LLSD map containing the token string and the time it expires. - * - * @return true if the token is not empty and has not expired. - */ - static bool securityTokenIsValid(LLSD& token); - - std::string mOpenIDCookie; - std::string mSessionCookie; - LLSD mSecurityToken; - - LLSD mConfig; - bool mEnabled; - - LLPointer mImage; - LLSD mMetadata; - - S32 mRetries; -}; - -/** - * @class LLUriTemplate - * - * @brief Builds complete URIs, given URI template and a map of keys and values - * to use for substition. - * Note: This is only a partial implementation of a draft standard required - * by the web API used by LLWebSharing. - * See: http://tools.ietf.org/html/draft-gregorio-uritemplate-03 - * - * @see LLWebSharing - */ -class LLUriTemplate -{ - LOG_CLASS(LLUriTemplate); -public: - LLUriTemplate(const std::string& uri_template); - ~LLUriTemplate() {}; - - /* - * Builds a complete URI from the template. - * - * @param vars an LLSD map of keys and values for substitution. - * - * @return a string containing the complete URI. - */ - std::string buildURI(const LLSD& vars); - -private: - /* - * Builds a URL query string. - * - * @param delim a string containing the separator to use between name=value pairs. - * @param var_list a string containing a comma separated list of variable names. - * @param vars an LLSD map of keys and values for substitution. - * - * @return a URL query string. - */ - std::string expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars); - - /* - * URL escape the given string. - * LLWeb::escapeURL() only does a partial escape, so this uses curl_escape() instead. - */ - static std::string escapeURL(const std::string& unescaped); - - std::string mTemplate; -}; - - - -#endif // LL_LLWEBSHARING_H diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 2ad43ff394..5cd01d337b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1049,11 +1049,9 @@ void LLWorld::disconnectRegions() } } -static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim"); void process_enable_simulator(LLMessageSystem *msg, void **user_data) { - LLFastTimer t(FTM_ENABLE_SIMULATOR); // enable the appropriate circuit for this simulator and // add its values into the gSimulator structure U64 handle; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e4c2ca9ae3..a3b402c1a3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -185,7 +185,6 @@ std::string gPoolNames[] = }; void drawBox(const LLVector3& c, const LLVector3& r); -void drawBoxOutline(const LLVector3& pos, const LLVector3& size); U32 nhpo2(U32 v) { @@ -263,8 +262,7 @@ BOOL LLPipeline::sRenderHighlight = TRUE; BOOL LLPipeline::sForceOldBakedUpload = FALSE; S32 LLPipeline::sUseOcclusion = 0; BOOL LLPipeline::sDelayVBUpdate = TRUE; -BOOL LLPipeline::sAutoMaskAlphaDeferred = TRUE; -BOOL LLPipeline::sAutoMaskAlphaNonDeferred = FALSE; +BOOL LLPipeline::sFastAlpha = TRUE; BOOL LLPipeline::sDisableShaders = FALSE; BOOL LLPipeline::sRenderBump = TRUE; BOOL LLPipeline::sUseTriStrips = TRUE; @@ -324,6 +322,7 @@ LLPipeline::LLPipeline() : mInitialized(FALSE), mVertexShadersEnabled(FALSE), mVertexShadersLoaded(0), + mRenderTypeMask(0), mRenderDebugFeatureMask(0), mRenderDebugMask(0), mOldRenderDebugMask(0), @@ -377,11 +376,7 @@ void LLPipeline::init() LLViewerStats::getInstance()->mTrianglesDrawnStat.reset(); resetFrameStats(); - for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) - { - mRenderTypeEnabled[i] = TRUE; //all rendering types start enabled - } - + mRenderTypeMask = 0xffffffff; // All render types start on mRenderDebugFeatureMask = 0xffffffff; // All debugging features on mRenderDebugMask = 0; // All debug starts off @@ -408,8 +403,6 @@ void LLPipeline::init() { mSpotLightFade[i] = 1.f; } - - setLightingDetail(-1); } LLPipeline::~LLPipeline() @@ -512,7 +505,6 @@ void LLPipeline::destroyGL() } static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); - void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -569,12 +561,9 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale"); - //HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug) - U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0; - for (U32 i = 0; i < 4; i++) { - mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); } @@ -583,9 +572,11 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) for (U32 i = 4; i < 6; i++) { - mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE); + mShadow[i].allocate(width, height, 0, TRUE, FALSE); } + + width = nhpo2(resX)/2; height = nhpo2(resY)/2; mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE); @@ -630,11 +621,9 @@ void LLPipeline::updateRenderDeferred() { BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && LLRenderTarget::sUseFBO && - LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && gSavedSettings.getBOOL("VertexShaderEnable") && gSavedSettings.getBOOL("RenderAvatarVP") && - (gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) && - !gUseWireframe; + gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; sRenderDeferred = deferred; } @@ -909,18 +898,13 @@ S32 LLPipeline::setLightingDetail(S32 level) if (level < 0) { - if (gSavedSettings.getBOOL("VertexShaderEnable")) - { - level = 1; - } - else - { - level = 0; - } + level = gSavedSettings.getS32("RenderLightingDetail"); } level = llclamp(level, 0, getMaxLightingDetail()); if (level != mLightingDetail) { + gSavedSettings.setS32("RenderLightingDetail", level); + mLightingDetail = level; if (mVertexShadersLoaded == 1) @@ -1524,10 +1508,8 @@ BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) { - const F32 X = 65536.f; - - min = LLVector3(X,X,X); - max = LLVector3(-X,-X,-X); + min = LLVector3(F32_MAX, F32_MAX, F32_MAX); + max = LLVector3(-F32_MAX, -F32_MAX, -F32_MAX); U32 saved_camera_id = LLViewerCamera::sCurCameraID; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; @@ -1966,31 +1948,23 @@ void LLPipeline::updateGeom(F32 max_dtime) void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); - - if(drawablep && !drawablep->isDead()) + if(!drawablep || drawablep->isDead()) { + return; + } + if (drawablep->isSpatialBridge()) { - const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - llassert(root); // trying to catch a bad assumption - if (root && // // this test may not be needed, see above - root->getVObj()->isAttachment()) - { - LLDrawable* rootparent = root->getParent(); - if (rootparent) // this IS sometimes NULL - { - LLViewerObject *vobj = rootparent->getVObj(); - llassert(vobj); // trying to catch a bad assumption - if (vobj) // this test may not be needed, see above + LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; + + if (root && root->getParent() && root->getVObj() && root->getVObj()->isAttachment()) { - const LLVOAvatar* av = vobj->asAvatar(); + LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); if (av && av->isImpostor()) { return; } } - } - } sCull->pushBridge((LLSpatialBridge*) drawablep); } else @@ -2000,7 +1974,6 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) drawablep->setVisible(camera); } -} void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) { @@ -2209,13 +2182,14 @@ static LLFastTimer::DeclareTimer FTM_RESET_DRAWORDER("Reset Draw Order"); void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { - if (hasAnyRenderType(LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_GROUND, - LLPipeline::RENDER_TYPE_TERRAIN, - LLPipeline::RENDER_TYPE_TREE, - LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_WATER, - LLPipeline::END_RENDER_TYPES)) + const U32 face_mask = (1 << LLPipeline::RENDER_TYPE_AVATAR) | + (1 << LLPipeline::RENDER_TYPE_GROUND) | + (1 << LLPipeline::RENDER_TYPE_TERRAIN) | + (1 << LLPipeline::RENDER_TYPE_TREE) | + (1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_WATER); + + if (mRenderTypeMask & face_mask) { //clear faces from face pools LLFastTimer t(FTM_RESET_DRAWORDER); @@ -3435,14 +3409,26 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); + renderHighlights(); + mHighlightFaces.clear(); + + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + gObjectList.resetObjectBeacons(); + } + if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); doOcclusion(camera); - gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); } } @@ -3605,17 +3591,12 @@ void LLPipeline::renderDebug() for (U32 i = 0; i < 8; i++) { - LLVector3* frust = mShadowCamera[i].mAgentFrustum; - if (i > 3) - { //render shadow frusta as volumes - if (mShadowFrustPoints[i-4].empty()) { - continue; - } - gGL.color4fv(col+(i-4)*4); + LLVector3* frust = mShadowCamera[i].mAgentFrustum; + gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); @@ -3643,49 +3624,31 @@ void LLPipeline::renderDebug() if (i < 4) { + gGL.begin(LLRender::LINES); - if (i == 0 || !mShadowFrustPoints[i].empty()) + F32* c = col+i*4; + for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) { - //render visible point cloud - gGL.flush(); - glPointSize(8.f); - gGL.begin(LLRender::POINTS); - F32* c = col+i*4; gGL.color3fv(c); - for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) + for (U32 k = 0; k < mShadowFrustPoints[i].size(); ++k) + { + if (j != k) { gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - + gGL.vertex3fv(mShadowFrustPoints[i][k].mV); } - gGL.end(); - - gGL.flush(); - glPointSize(1.f); - - LLVector3* ext = mShadowExtents[i]; - LLVector3 pos = (ext[0]+ext[1])*0.5f; - LLVector3 size = (ext[1]-ext[0])*0.5f; - drawBoxOutline(pos, size); - - //render camera frustum splits as outlines - gGL.begin(LLRender::LINES); - gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[1].mV); - gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[2].mV); - gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[3].mV); - gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[0].mV); - gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[5].mV); - gGL.vertex3fv(frust[5].mV); gGL.vertex3fv(frust[6].mV); - gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[7].mV); - gGL.vertex3fv(frust[7].mV); gGL.vertex3fv(frust[4].mV); - gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); - gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); - gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); - gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); - gGL.end(); } + if (!mShadowFrustOrigin[i].isExactlyZero()) + { + gGL.vertex3fv(mShadowFrustPoints[i][j].mV); + gGL.color4f(1,1,1,1); + gGL.vertex3fv(mShadowFrustOrigin[i].mV); + } + } + gGL.end(); } /*for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -4597,42 +4560,32 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = llmax(light->getLightRadius(), 0.001f); + F32 atten, quad; - F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. - float linatten = x / (light_radius); // % of brightness at radius - +#if 0 //1.9.1 + if (pool->getVertexShaderLevel() > 0) + { + atten = light_radius; + quad = llmax(light->getLightFalloff(), 0.0001f); + } + else +#endif + { + F32 x = (3.f * (1.f + light->getLightFalloff())); + atten = x / (light_radius); // % of brightness at radius + quad = 0.0f; + } mHWLightColors[cur_light] = light_color; S32 gllight = GL_LIGHT0+cur_light; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); + glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); - if (light->isLightSpotlight() // directional (spot-)light - && (LLPipeline::sRenderDeferred || gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"))) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on - { - LLVector3 spotparams = light->getSpotLightParams(); - LLQuaternion quat = light->getRenderRotation(); - LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction - at_axis *= quat; - //llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; - glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); - glLightf (gllight, GL_SPOT_EXPONENT, 2.0f); // 2.0 = good old dot product ^ 2 - glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere - const float specular[] = {0.f, 0.f, 0.f, 0.f}; - glLightfv(gllight, GL_SPECULAR, specular); - } - else // omnidirectional (point) light - { + glLightf (gllight, GL_LINEAR_ATTENUATION, atten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); - - // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight - const float specular[] = {0.f, 0.f, 0.f, 1.f}; - glLightfv(gllight, GL_SPECULAR, specular); - //llinfos << "boring light" << llendl; - } cur_light++; if (cur_light >= 8) { @@ -4659,10 +4612,13 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; + F32 atten, quad; + { F32 x = 3.f; - float linatten = x / (light_radius); // % of brightness at radius - + atten = x / (light_radius); // % of brightness at radius + quad = 0.0f; + } mHWLightColors[2] = light_color; S32 gllight = GL_LIGHT2; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); @@ -4670,8 +4626,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); + glLightf (gllight, GL_LINEAR_ATTENUATION, atten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); } @@ -4792,16 +4748,16 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) enableLights(mask); glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); - /*if (mLightingDetail >= 2) + if (mLightingDetail >= 2) { glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default - }*/ + } } void LLPipeline::disableLights() { enableLights(0); // no lighting (full bright) - //glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default + glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default } //============================================================================ @@ -4991,7 +4947,8 @@ void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light) //static void LLPipeline::toggleRenderType(U32 type) { - gPipeline.mRenderTypeEnabled[type] = !gPipeline.mRenderTypeEnabled[type]; + U32 bit = (1<activate(); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); - - if (LLRenderTarget::sUseFBO) - { //copy depth buffer from mScreen to framebuffer - LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), - 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); - } } @@ -5884,12 +5834,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } -static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred"); - void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* gi_source, LLRenderTarget* last_gi_post, U32 noise_map) { - LLFastTimer t(FTM_BIND_DEFERRED); - if (noise_map == 0xFFFFFFFF) { noise_map = mNoiseMap; @@ -6227,16 +6173,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen matrix_nondiag, matrix_nondiag, matrix_diag}; shader.uniformMatrix3fv("ssao_effect_mat", 1, GL_FALSE, ssao_effect_mat); - F32 shadow_offset_error = 1.f + gSavedSettings.getF32("RenderShadowOffsetError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); - F32 shadow_bias_error = 1.f + gSavedSettings.getF32("RenderShadowBiasError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); - shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")*shadow_offset_error); - shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")*shadow_bias_error); - shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset")); - shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias")); - + shader.uniform1f("alpha_soften", gSavedSettings.getF32("RenderDeferredAlphaSoften")); + shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")); + shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")); shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale")); shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset")); @@ -6330,6 +6271,8 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0); } + if (gSavedSettings.getBOOL("RenderDeferredShadow")) + { glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_PROJECTION); @@ -6337,9 +6280,7 @@ void LLPipeline::renderDeferredLighting() glLoadIdentity(); mDeferredLight[0].bindTarget(); - - if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0) - { + if (gSavedSettings.getBOOL("RenderDeferredSun")) { //paint shadow/SSAO light map (direct lighting lightmap) LLFastTimer ftm(FTM_SUN_SHADOW); bindDeferredShader(gDeferredSunProgram, 0); @@ -6380,22 +6321,18 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredSunProgram); } - } else { - glClearColor(1,1,1,1); mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT); - glClearColor(0,0,0,0); } mDeferredLight[0].flush(); - { //global illumination specific block (still experimental) if (gSavedSettings.getBOOL("RenderDeferredBlurLight") && gSavedSettings.getBOOL("RenderDeferredGI")) { LLFastTimer ftm(FTM_EDGE_DETECTION); - //generate edge map + //get edge map LLGLDisable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); LLGLDepthTest depth(GL_FALSE); @@ -6492,9 +6429,8 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredPostGIProgram); } } - } - if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + if (gSavedSettings.getBOOL("RenderDeferredBlurLight")) { //soften direct lighting lightmap LLFastTimer ftm(FTM_SOFTEN_SHADOW); //blur lightmap @@ -6564,6 +6500,7 @@ void LLPipeline::renderDeferredLighting() stop_glerror(); glPopMatrix(); stop_glerror(); + } //copy depth and stencil from deferred screen //mScreen.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), @@ -6572,15 +6509,11 @@ void LLPipeline::renderDeferredLighting() if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) { mDeferredLight[1].bindTarget(); - // clear color buffer here (GI) - zeroing alpha (glow) is important or it will accumulate against sky - glClearColor(0,0,0,0); - mScreen.clear(GL_COLOR_BUFFER_BIT); + mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT); } else { mScreen.bindTarget(); - // clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky - glClearColor(0,0,0,0); mScreen.clear(GL_COLOR_BUFFER_BIT); } @@ -6617,16 +6550,15 @@ void LLPipeline::renderDeferredLighting() LLGLDisable stencil(GL_STENCIL_TEST); gGL.setSceneBlendType(LLRender::BT_ALPHA); - gPipeline.pushRenderTypeMask(); - - gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_CLOUDS, - LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::END_RENDER_TYPES); + U32 render_mask = mRenderTypeMask; + mRenderTypeMask = mRenderTypeMask & + ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); renderGeomPostDeferred(*LLViewerCamera::getInstance()); - gPipeline.popRenderTypeMask(); + mRenderTypeMask = render_mask; } BOOL render_local = gSavedSettings.getBOOL("RenderDeferredLocalLights"); @@ -6671,15 +6603,6 @@ void LLPipeline::renderDeferredLighting() continue; } - if (volume->isAttachment()) - { - if (!sRenderAttachedLights) - { - continue; - } - } - - LLVector3 center = drawablep->getPositionAgent(); F32* c = center.mV; F32 s = volume->getLightRadius()*1.5f; @@ -6730,7 +6653,7 @@ void LLPipeline::renderDeferredLighting() { //draw box if camera is outside box if (render_local) { - if (volume->isLightSpotlight()) + if (volume->getLightTexture()) { drawablep->getVOVolume()->updateSpotLightPriority(); spot_lights.push_back(drawablep); @@ -6747,7 +6670,7 @@ void LLPipeline::renderDeferredLighting() } else if (render_fullscreen) { - if (volume->isLightSpotlight()) + if (volume->getLightTexture()) { drawablep->getVOVolume()->updateSpotLightPriority(); fullscreen_spot_lights.push_back(drawablep); @@ -6948,48 +6871,29 @@ void LLPipeline::renderDeferredLighting() LLGLDisable blend(GL_BLEND); LLGLDisable stencil(GL_STENCIL_TEST); - pushRenderTypeMask(); - andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_GLOW, - LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_PASS_SIMPLE, - LLPipeline::RENDER_TYPE_PASS_ALPHA, - LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_BUMP, - LLPipeline::RENDER_TYPE_PASS_POST_BUMP, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, - LLPipeline::RENDER_TYPE_PASS_GLOW, - LLPipeline::RENDER_TYPE_PASS_GRASS, - LLPipeline::RENDER_TYPE_PASS_SHINY, - LLPipeline::RENDER_TYPE_PASS_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, - LLPipeline::RENDER_TYPE_AVATAR, - END_RENDER_TYPES); + U32 render_mask = mRenderTypeMask; + mRenderTypeMask = mRenderTypeMask & + ((1 << LLPipeline::RENDER_TYPE_ALPHA) | + (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) | + (1 << LLPipeline::RENDER_TYPE_VOLUME) | + (1 << LLPipeline::RENDER_TYPE_GLOW) | + (1 << LLPipeline::RENDER_TYPE_BUMP) | + (1 << LLPipeline::RENDER_TYPE_PASS_SIMPLE) | + (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA) | + (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK) | + (1 << LLPipeline::RENDER_TYPE_PASS_BUMP) | + (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT) | + (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK) | + (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY) | + (1 << LLPipeline::RENDER_TYPE_PASS_GLOW) | + (1 << LLPipeline::RENDER_TYPE_PASS_GRASS) | + (1 << LLPipeline::RENDER_TYPE_PASS_SHINY) | + (1 << LLPipeline::RENDER_TYPE_PASS_INVISIBLE) | + (1 << LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY) | + (1 << LLPipeline::RENDER_TYPE_AVATAR)); renderGeomPostDeferred(*LLViewerCamera::getInstance()); - popRenderTypeMask(); - } - - { - //render highlights, etc. - renderHighlights(); - mHighlightFaces.clear(); - - renderDebug(); - - LLVertexBuffer::unbind(); - - if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - LLHUDObject::renderAll(); - gObjectList.resetObjectBeacons(); - } + mRenderTypeMask = render_mask; } mScreen.flush(); @@ -7225,7 +7129,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLPipeline::sUseOcclusion = llmin(occlusion, 1); - gPipeline.pushRenderTypeMask(); + U32 type_mask = gPipeline.mRenderTypeMask; glh::matrix4f projection = glh_get_current_projection(); glh::matrix4f mat; @@ -7294,47 +7198,43 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) glCullFace(GL_FRONT); static LLCullResult ref_result; - + U32 ref_mask = 0; if (LLDrawPoolWater::sNeedsDistortionUpdate) { //initial sky pass (no user clip plane) { //mask out everything but the sky - gPipeline.pushRenderTypeMask(); - gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::END_RENDER_TYPES); + U32 tmp = mRenderTypeMask; + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); static LLCullResult result; updateCull(camera, result); stateSort(camera, result); - andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_CLOUDS, - LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::END_RENDER_TYPES); - + mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | + (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_SKY)); renderGeom(camera, TRUE); - gPipeline.popRenderTypeMask(); + mRenderTypeMask = tmp; } - gPipeline.pushRenderTypeMask(); + U32 mask = mRenderTypeMask; + mRenderTypeMask &= ~((1< 0) - { //mask out selected geometry based on reflection detail - if (detail < 4) - { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); if (detail < 3) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); + mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_PARTICLES); if (detail < 2) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); + mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_AVATAR); + if (detail < 1) + { + mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_VOLUME); } } } @@ -7345,18 +7245,19 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) stateSort(camera, ref_result); } + ref_mask = mRenderTypeMask; + mRenderTypeMask = mask; + } if (LLDrawPoolWater::sNeedsDistortionUpdate) { - if (gSavedSettings.getS32("RenderReflectionDetail") > 0) + mRenderTypeMask = ref_mask; + if (gSavedSettings.getBOOL("RenderWaterReflections")) { gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); renderGeom(camera); } } - - gPipeline.popRenderTypeMask(); - } glCullFace(GL_BACK); glPopMatrix(); mWaterRef.flush(); @@ -7369,20 +7270,18 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (last_update) { camera.setFar(camera_in.getFar()); - clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, - LLPipeline::RENDER_TYPE_GROUND, - END_RENDER_TYPES); + mRenderTypeMask = type_mask & (~(1<cameraUnderWater() ? FALSE : TRUE; if (LLPipeline::sUnderWaterRender) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_GROUND, - LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_CLOUDS, - LLPipeline::RENDER_TYPE_WL_SKY, - END_RENDER_TYPES); + mRenderTypeMask &= ~((1<setup3DViewport(); - gPipeline.popRenderTypeMask(); + mRenderTypeMask = type_mask; LLDrawPoolWater::sNeedsReflectionUpdate = FALSE; LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); @@ -7614,169 +7513,112 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLPipeline::sShadowRender = FALSE; } -static LLFastTimer::DeclareTimer FTM_VISIBLE_CLOUD("Visible Cloud"); + BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector& fp, LLVector3 light_dir) { - LLFastTimer t(FTM_VISIBLE_CLOUD); //get point cloud of intersection of frust and min, max + //get set of planes + std::vector ps; + if (getVisibleExtents(camera, min, max)) { return FALSE; } - //get set of planes on bounding box - std::vector bp; - - bp.push_back(LLPlane(min, LLVector3(-1,0,0))); - bp.push_back(LLPlane(min, LLVector3(0,-1,0))); - bp.push_back(LLPlane(min, LLVector3(0,0,-1))); - bp.push_back(LLPlane(max, LLVector3(1,0,0))); - bp.push_back(LLPlane(max, LLVector3(0,1,0))); - bp.push_back(LLPlane(max, LLVector3(0,0,1))); - - //potential points - std::vector pp; + ps.push_back(LLPlane(min, LLVector3(-1,0,0))); + ps.push_back(LLPlane(min, LLVector3(0,-1,0))); + ps.push_back(LLPlane(min, LLVector3(0,0,-1))); + ps.push_back(LLPlane(max, LLVector3(1,0,0))); + ps.push_back(LLPlane(max, LLVector3(0,1,0))); + ps.push_back(LLPlane(max, LLVector3(0,0,1))); - //add corners of AABB - pp.push_back(LLVector3(min.mV[0], min.mV[1], min.mV[2])); - pp.push_back(LLVector3(max.mV[0], min.mV[1], min.mV[2])); - pp.push_back(LLVector3(min.mV[0], max.mV[1], min.mV[2])); - pp.push_back(LLVector3(max.mV[0], max.mV[1], min.mV[2])); - pp.push_back(LLVector3(min.mV[0], min.mV[1], max.mV[2])); - pp.push_back(LLVector3(max.mV[0], min.mV[1], max.mV[2])); - pp.push_back(LLVector3(min.mV[0], max.mV[1], max.mV[2])); - pp.push_back(LLVector3(max.mV[0], max.mV[1], max.mV[2])); - - //add corners of camera frustum - for (U32 i = 0; i < 8; i++) + /*if (!light_dir.isExactlyZero()) { - pp.push_back(camera.mAgentFrustum[i]); - } + LLPlane ucp; + LLPlane mcp; + F32 maxd = -1.f; + F32 mind = 1.f; - //bounding box line segments - U32 bs[] = - { - 0,1, - 1,3, - 3,2, - 2,0, - - 4,5, - 5,7, - 7,6, - 6,4, - - 0,4, - 1,5, - 3,7, - 2,6 - }; - - for (U32 i = 0; i < 12; i++) - { //for each line segment in bounding box - for (U32 j = 0; j < 6; j++) - { //for each plane in camera frustum - const LLPlane& cp = camera.getAgentPlane(j); - const LLVector3& v1 = pp[bs[i*2+0]]; - const LLVector3& v2 = pp[bs[i*2+1]]; - const LLVector3 n(cp.mV); - - LLVector3 line = v1-v2; - - F32 d1 = line*n; - F32 d2 = -cp.dist(v2); - - F32 t = d2/d1; - - if (t > 0.f && t < 1.f) + for (U32 i = 0; i < ps.size(); ++i) + { //pick the plane most aligned to lightDir for user clip plane + LLVector3 n(ps[i].mV); + F32 da = n*light_dir; + if (da > maxd) { - LLVector3 intersect = v2+line*t; - pp.push_back(intersect); + maxd = da; + ucp = ps[i]; } + + if (da < mind) + { + mind = da; + mcp = ps[i]; } } - //camera frustum line segments - const U32 fs[] = - { - 0,1, - 1,2, - 2,3, - 3,1, - - 4,5, - 5,6, - 6,7, - 7,4, + camera.setUserClipPlane(ucp); + + ps.clear(); + ps.push_back(ucp); + ps.push_back(mcp); + }*/ - 0,4, - 1,5, - 2,6, - 3,7 - }; - - LLVector3 center = (max+min)*0.5f; - LLVector3 size = (max-min)*0.5f; + for (U32 i = 0; i < 6; i++) + { + ps.push_back(camera.getAgentPlane(i)); + } + + //get set of points where planes intersect and points are not above any plane + fp.clear(); - for (U32 i = 0; i < 12; i++) + for (U32 i = 0; i < ps.size(); ++i) { - for (U32 j = 0; j < 6; ++j) + for (U32 j = 0; j < ps.size(); ++j) { - const LLVector3& v1 = pp[fs[i*2+0]+8]; - const LLVector3& v2 = pp[fs[i*2+1]+8]; - const LLPlane& cp = bp[j]; - const LLVector3 n(cp.mV); - - LLVector3 line = v1-v2; - - F32 d1 = line*n; - F32 d2 = -cp.dist(v2); - - F32 t = d2/d1; - - if (t > 0.f && t < 1.f) + for (U32 k = 0; k < ps.size(); ++k) { - LLVector3 intersect = v2+line*t; - pp.push_back(intersect); - } - } + if (i == j || + i == k || + k == j) + { + continue; } - LLVector3 ext[] = { min-LLVector3(0.05f,0.05f,0.05f), - max+LLVector3(0.05f,0.05f,0.05f) }; + LLVector3 n1,n2,n3; + F32 d1,d2,d3; - for (U32 i = 0; i < pp.size(); ++i) - { - bool found = true; + n1.setVec(ps[i].mV); + n2.setVec(ps[j].mV); + n3.setVec(ps[k].mV); - const F32* p = pp[i].mV; + d1 = ps[i].mV[3]; + d2 = ps[j].mV[3]; + d3 = ps[k].mV[3]; - for (U32 j = 0; j < 3; ++j) - { - if (p[j] < ext[0].mV[j] || - p[j] > ext[1].mV[j]) - { - found = false; - break; - } - } + //get point of intersection of 3 planes "p" + LLVector3 p = (-d1*(n2%n3)-d2*(n3%n1)-d3*(n1%n2))/(n1*(n2%n3)); - for (U32 j = 0; j < 6; ++j) - { - const LLPlane& cp = camera.getAgentPlane(j); - F32 dist = cp.dist(pp[i]); - if (dist > 0.05f) //point is above some plane, not contained + if (llround(p*n1+d1, 0.0001f) == 0.f && + llround(p*n2+d2, 0.0001f) == 0.f && + llround(p*n3+d3, 0.0001f) == 0.f) + { //point is on all three planes + BOOL found = TRUE; + for (U32 l = 0; l < ps.size() && found; ++l) { - found = false; - break; + if (llround(ps[l].dist(p), 0.0001f) > 0.0f) + { //point is above some plane, not contained + found = FALSE; } } if (found) { - fp.push_back(pp[i]); + fp.push_back(p); + } + } + } } } @@ -7877,22 +7719,21 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector fp; - main_camera.calcAgentFrustumPlanes(main_camera.mAgentFrustum); - LLVector3 min,max; - getVisiblePointCloud(main_camera,min,max,fp); + getVisiblePointCloud(camera,min,max,fp); if (fp.empty()) { - if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA)) - { - mShadowCamera[0] = main_camera; - mShadowExtents[0][0] = min; - mShadowExtents[0][1] = max; - - mShadowFrustPoints[0].clear(); - mShadowFrustPoints[1].clear(); - mShadowFrustPoints[2].clear(); - mShadowFrustPoints[3].clear(); - } - popRenderTypeMask(); + mRenderTypeMask = type_mask; return; } @@ -8226,7 +8070,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) shadow_cam = camera; shadow_cam.setFar(16.f); - LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + LLViewerCamera::updateFrustumPlanes(shadow_cam); LLVector3* frust = shadow_cam.mAgentFrustum; @@ -8238,11 +8082,10 @@ void LLPipeline::generateSunShadow(LLCamera& camera) for (U32 i = 0; i < 4; i++) { LLVector3 delta = frust[i+4]-eye; - delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f; delta.normVec(); F32 dp = delta*pn; - frust[i] = eye + (delta*dist[j]*0.95f)/dp; - frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp; + frust[i] = eye + (delta*dist[j])/dp; + frust[i+4] = eye + (delta*dist[j+1])/dp; } shadow_cam.calcAgentFrustumPlanes(frust); @@ -8583,13 +8426,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } - //hack to disable projector shadows - static bool clear = true; - bool gen_shadow = gSavedSettings.getS32("RenderShadowDetail") > 1; - if (gen_shadow) - { - clear = true; F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); //update shadow targets @@ -8717,20 +8554,6 @@ void LLPipeline::generateSunShadow(LLCamera& camera) mShadow[i+4].flush(); } - } - else - { - if (clear) - { - clear = false; - for (U32 i = 4; i < 6; i++) - { - mShadow[i].bindTarget(); - mShadow[i].clear(); - mShadow[i].flush(); - } - } - } if (!gSavedSettings.getBOOL("CameraOffset")) { @@ -8754,7 +8577,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) gGLLastProjection[i] = last_projection[i]; } - popRenderTypeMask(); + mRenderTypeMask = type_mask; } void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture) @@ -8790,36 +8613,38 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); + U32 mask; BOOL muted = LLMuteList::getInstance()->isMuted(avatar->getID()); - pushRenderTypeMask(); - if (muted) { - andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); + mask = 1 << LLPipeline::RENDER_TYPE_AVATAR; } else { - andRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_GRASS, - LLPipeline::RENDER_TYPE_SIMPLE, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_ALPHA, - LLPipeline::RENDER_TYPE_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_SIMPLE, - LLPipeline::RENDER_TYPE_PASS_ALPHA, - LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, - LLPipeline::RENDER_TYPE_PASS_SHINY, - LLPipeline::RENDER_TYPE_PASS_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, - END_RENDER_TYPES); + mask = (1<endAlphaGroups(); } -BOOL LLPipeline::hasRenderType(const U32 type) const -{ - return mRenderTypeEnabled[type]; -} - -void LLPipeline::setRenderTypeMask(U32 type, ...) -{ - va_list args; - - va_start(args, type); - while (type < END_RENDER_TYPES) - { - mRenderTypeEnabled[type] = TRUE; - type = va_arg(args, U32); - } - va_end(args); - - if (type > END_RENDER_TYPES) - { - llerrs << "Invalid render type." << llendl; - } -} - -BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const -{ - va_list args; - - va_start(args, type); - while (type < END_RENDER_TYPES) - { - if (mRenderTypeEnabled[type]) - { - return TRUE; - } - type = va_arg(args, U32); - } - va_end(args); - - if (type > END_RENDER_TYPES) - { - llerrs << "Invalid render type." << llendl; - } - - return FALSE; -} - -void LLPipeline::pushRenderTypeMask() -{ - std::string cur_mask; - cur_mask.assign((const char*) mRenderTypeEnabled, sizeof(mRenderTypeEnabled)); - mRenderTypeEnableStack.push(cur_mask); -} - -void LLPipeline::popRenderTypeMask() -{ - if (mRenderTypeEnableStack.empty()) - { - llerrs << "Depleted render type stack." << llendl; - } - - memcpy(mRenderTypeEnabled, mRenderTypeEnableStack.top().data(), sizeof(mRenderTypeEnabled)); - mRenderTypeEnableStack.pop(); -} - -void LLPipeline::andRenderTypeMask(U32 type, ...) -{ - va_list args; - - BOOL tmp[NUM_RENDER_TYPES]; - for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) - { - tmp[i] = FALSE; - } - - va_start(args, type); - while (type < END_RENDER_TYPES) - { - if (mRenderTypeEnabled[type]) - { - tmp[type] = TRUE; - } - - type = va_arg(args, U32); - } - va_end(args); - - if (type > END_RENDER_TYPES) - { - llerrs << "Invalid render type." << llendl; - } - - for (U32 i = 0; i < LLPipeline::NUM_RENDER_TYPES; ++i) - { - mRenderTypeEnabled[i] = tmp[i]; - } - -} - -void LLPipeline::clearRenderTypeMask(U32 type, ...) -{ - va_list args; - - va_start(args, type); - while (type < END_RENDER_TYPES) - { - mRenderTypeEnabled[type] = FALSE; - - type = va_arg(args, U32); - } - va_end(args); - - if (type > END_RENDER_TYPES) - { - llerrs << "Invalid render type." << llendl; - } -} - diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index fe0683d29f..c43e0c2ceb 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -40,8 +40,6 @@ #include "lldrawable.h" #include "llrendertarget.h" -#include - class LLViewerTexture; class LLEdge; class LLFace; @@ -273,25 +271,12 @@ public: LLCullResult::sg_list_t::iterator beginAlphaGroups(); LLCullResult::sg_list_t::iterator endAlphaGroups(); - void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); - + BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1< mRenderTypeEnableStack; - + U32 mRenderTypeMask; U32 mRenderDebugFeatureMask; U32 mRenderDebugMask; diff --git a/indra/newview/res/have_artwork_bundle.marker b/indra/newview/res/have_artwork_bundle.marker deleted file mode 100644 index 1dbb238d53..0000000000 --- a/indra/newview/res/have_artwork_bundle.marker +++ /dev/null @@ -1 +0,0 @@ -If this file exists then you have the artwork bundle installed, which is packaged separately from the Viewer source in the open-source tree. This marker is for the benefit of the build system so it can warn you properly if it's not there. :) diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index 5e8cee1f5f..a575aabbca 100644 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -149,7 +149,7 @@ BEGIN VALUE "FileDescription", "Second Life" VALUE "FileVersion", "2.1.1.0" VALUE "InternalName", "Second Life" - VALUE "LegalCopyright", "Copyright � 2001-2010, Linden Research, Inc." + VALUE "LegalCopyright", "Copyright © 2001-2010, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" VALUE "ProductVersion", "2.1.1.0" diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 5ba1fc9b21..2188c71ff9 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -113,7 +113,7 @@ reference="LtYellow" /> + reference="White" /> diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index cae6146880..b9bc45a10b 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -21,7 +21,7 @@ This string CHANGE2 is extracted. Just a test. changes. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 6c1214f152..c9b013099b 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -67,7 +67,7 @@ height="150" name="chat_history" parse_highlights="true" - parse_urls="true" + allow_html="true" left="1" width="249"> diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index 3b26c2ab59..ec097a8e87 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -25,7 +25,7 @@ single_instance="true" width="320"> + width="200"> Replace with: + width="175" /> + width="100"> Shortcut Key: + width="75" /> + width="75" /> + width="215"> + +http://pdp36.lindenlab.com:12777/ + unknown - - + name="postcard" /> + name="texture" /> + name="local" /> [SIZE] KB diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 514b0a501b..a96dbe3553 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2322,7 +2322,6 @@ even though the user gets a free copy. layout="topleft" left_pad="15" name="color trans" - text_readonly_color="LabelDisabledColor" top="6" width="110"> Transparency % @@ -2347,7 +2346,6 @@ even though the user gets a free copy. layout="topleft" left_delta="0" name="glow label" - text_readonly_color="LabelDisabledColor" top_pad="8" width="80"> Glow @@ -2378,7 +2376,6 @@ even though the user gets a free copy. layout="topleft" left="10" name="tex gen" - text_readonly_color="LabelDisabledColor" top_pad="5" width="90"> Mapping @@ -2407,7 +2404,6 @@ even though the user gets a free copy. layout="topleft" name="label shininess" left_pad="4" - text_readonly_color="LabelDisabledColor" top_pad="-36" width="90"> Shininess @@ -2444,7 +2440,6 @@ even though the user gets a free copy. layout="topleft" left_pad="4" name="label bumpiness" - text_readonly_color="LabelDisabledColor" top_pad="-36" width="90"> Bumpiness @@ -2570,8 +2565,7 @@ even though the user gets a free copy. height="10" layout="topleft" left="10" - name="rpt" - text_readonly_color="LabelDisabledColor" + name="tex scale" top_pad="4" width="200"> Repeats / Face @@ -2660,7 +2654,6 @@ even though the user gets a free copy. layout="topleft" left="10" name="tex offset" - text_readonly_color="LabelDisabledColor" width="200"> Texture Offset @@ -2744,9 +2737,9 @@ even though the user gets a free copy. follows="top|left" tool_tip="Edit this Media" height="12" - image_disabled="Icon_Gear_Background" - image_selected="Icon_Gear_Press" - image_unselected="Icon_Gear_Foreground" + image_disabled="Icon_Gear_Foreground" + image_selected="Icon_Gear_Background" + image_unselected="Icon_Gear_Press" layout="topleft" left_pad="10" name="edit_media" diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index eb2e7ea788..8aeec46ba3 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -26,7 +26,7 @@ Owner [OWNER] Touch Sit - - - - - - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml index 76f68c6d4b..8ec7689819 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -88,15 +88,6 @@ - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 77cc3910fd..3e38503e43 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -94,9 +94,6 @@ - - - - @@ -126,9 +124,7 @@ - - - - - - - - @@ -593,7 +579,6 @@ - - - - - - - @@ -765,9 +744,7 @@ - - @@ -793,9 +770,7 @@ function="ToggleControl" parameter="ShowSelectionBeam" /> - - --> - - @@ -935,9 +908,7 @@ function="ShowHelp" parameter="report_bug" /> - - @@ -951,6 +922,17 @@ name="Advanced" tear_off="true" visible="false"> + + + + @@ -977,9 +959,7 @@ function="Floater.Show" parameter="window_size" /> - - @@ -1000,9 +980,7 @@ function="ToggleControl" parameter="DisableCameraConstraints" /> - - @@ -1033,9 +1011,7 @@ function="ToggleControl" parameter="CompressSnapshotsToDisk" /> - - - - @@ -1419,7 +1393,17 @@ function="Advanced.ToggleFeature" parameter="flexible" /> - + + + + + @@ -1447,9 +1431,7 @@ function="ToggleControl" parameter="MouseSmooth" /> - - - + + + + + - - - - - - - - - - - - - - - - - - - + - @@ -1699,7 +1662,6 @@ function="ToggleControl" parameter="QAMode" /> - - - @@ -1814,9 +1774,7 @@ function="Advanced.DumpInfoToConsole" parameter="capabilities" /> - - @@ -1904,9 +1862,7 @@ function="ToggleControl" parameter="DebugShowColor" /> - - - - - - - + label="Deferred Rendering" + name="Deferred Rendering"> @@ -2230,31 +2181,7 @@ function="Advanced.EnableRenderDeferred" /> - - - - - - - - - - + function="Advanced.EnableRenderDeferredGI" /> - - @@ -2289,24 +2214,14 @@ parameter="RenderDebugPipeline" /> - - - - + label="Fast Alpha" + name="Fast Alpha"> + parameter="RenderFastAlpha" /> + parameter="RenderFastAlpha" /> - - @@ -2420,9 +2333,7 @@ - - @@ -2443,9 +2354,7 @@ function="ToggleControl" parameter="PingInterpolate" /> - - - @@ -2979,9 +2887,7 @@ function="Advanced.DumpAvatarLocalTextures" /> - - @@ -3018,9 +2924,7 @@ function="ToggleControl" parameter="ShowConsoleWindow" /> - - @@ -3355,9 +3259,7 @@ name="PublicIssueTrackerHelp_url" parameter="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker" /> - - diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml index 5feac53c33..8af2e1eaca 100644 --- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml @@ -13,7 +13,7 @@ layout="topleft" name="wear_wear"> + function="Wearable.Add" /> - - - - - - - - - [QUESTION] - - - - diff --git a/indra/newview/skins/default/xui/en/panel_bars.xml b/indra/newview/skins/default/xui/en/panel_bars.xml new file mode 100644 index 0000000000..96722ce278 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_bars.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml index 216a265164..4f989a6f6f 100644 --- a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml @@ -41,7 +41,7 @@ height="16" layout="topleft" left_pad="5" - parse_urls="false" + allow_html="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index 17e8d4d2df..9124ad528d 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -21,7 +21,7 @@ top="3" width="18" /> - + diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index 268cb4e5f9..e66cf400b4 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -202,7 +202,7 @@ value="Category:" width="140" />