QAR-782 Merge featurettes batch #2

merge featurettes-6-merge-2 -> release
dataserver-is-deprecated
master
Steven Bennetts 2008-08-13 19:37:05 +00:00
parent 0a3b9e8e14
commit b9b4a4d934
46 changed files with 760 additions and 491 deletions

View File

@ -186,6 +186,8 @@ Jacek Antonelli
VWR-597
VWR-2448
VWR-3605
JB Kraft
VWR-5283
Joghert LeSabre
VWR-64
Kage Pixel

View File

@ -126,6 +126,9 @@ const S32 LSL_PRIM_SCULPT_TYPE_SPHERE = 1;
const S32 LSL_PRIM_SCULPT_TYPE_TORUS = 2;
const S32 LSL_PRIM_SCULPT_TYPE_PLANE = 3;
const S32 LSL_PRIM_SCULPT_TYPE_CYLINDER = 4;
const S32 LSL_PRIM_SCULPT_TYPE_MASK = 7;
const S32 LSL_PRIM_SCULPT_FLAG_INVERT = 64;
const S32 LSL_PRIM_SCULPT_FLAG_MIRROR = 128;
const S32 LSL_ALL_SIDES = -1;
const S32 LSL_LINK_ROOT = 1;

View File

@ -82,11 +82,6 @@ const F32 TAPER_MAX = 1.f;
const F32 SKEW_MIN = -0.95f;
const F32 SKEW_MAX = 0.95f;
const S32 SCULPT_REZ_1 = 6; // changed from 4 to 6 - 6 looks round whereas 4 looks square
const S32 SCULPT_REZ_2 = 8;
const S32 SCULPT_REZ_3 = 16;
const S32 SCULPT_REZ_4 = 32;
const F32 SCULPT_MIN_AREA = 0.002f;
BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm)
@ -523,31 +518,9 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F3
}
S32 sculpt_sides(F32 detail)
{
// detail is usually one of: 1, 1.5, 2.5, 4.0.
if (detail <= 1.0)
{
return SCULPT_REZ_1;
}
if (detail <= 2.0)
{
return SCULPT_REZ_2;
}
if (detail <= 3.0)
{
return SCULPT_REZ_3;
}
else
{
return SCULPT_REZ_4;
}
}
BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split, BOOL is_sculpted)
BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split,
BOOL is_sculpted, S32 sculpt_size)
{
LLMemType m1(LLMemType::MTYPE_VOLUME);
@ -691,7 +664,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai
S32 sides = (S32)circle_detail;
if (is_sculpted)
sides = sculpt_sides(detail);
sides = sculpt_size;
genNGon(params, sides);
@ -1182,7 +1155,8 @@ const LLVector2 LLPathParams::getEndScale() const
return end_scale;
}
BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, BOOL is_sculpted)
BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
BOOL is_sculpted, S32 sculpt_size)
{
LLMemType m1(LLMemType::MTYPE_VOLUME);
@ -1245,7 +1219,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, BOOL is
S32 sides = (S32)llfloor(llfloor((MIN_DETAIL_FACES * detail + twist_mag * 3.5f * (detail-0.5f))) * params.getRevolutions());
if (is_sculpted)
sides = sculpt_sides(detail);
sides = sculpt_size;
genNGon(params, sides);
}
@ -1310,7 +1284,8 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, BOOL is
return TRUE;
}
BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split, BOOL is_sculpted)
BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split,
BOOL is_sculpted, S32 sculpt_size)
{
LLMemType m1(LLMemType::MTYPE_VOLUME);
@ -2030,6 +2005,12 @@ void LLVolume::sculptGeneratePlaceholder()
// create the vertices from the map
void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type)
{
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
BOOL reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror); // XOR
LLMemType m1(LLMemType::MTYPE_VOLUME);
S32 sizeS = mPathp->mPath.size();
@ -2044,13 +2025,21 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
S32 i = t + line;
Point& pt = mMesh[i];
U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width);
S32 reversed_t = t;
if (reverse_horizontal)
{
reversed_t = sizeT - t - 1;
}
U32 x = (U32) ((F32)reversed_t/(sizeT-1) * (F32) sculpt_width);
U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height);
if (y == 0) // top row stitching
{
// pinch?
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
if (sculpt_stitching == LL_SCULPT_TYPE_SPHERE)
{
x = sculpt_width / 2;
}
@ -2059,7 +2048,7 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
if (y == sculpt_height) // bottom row stitching
{
// wrap?
if (sculpt_type == LL_SCULPT_TYPE_TORUS)
if (sculpt_stitching == LL_SCULPT_TYPE_TORUS)
{
y = 0;
}
@ -2069,7 +2058,7 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
}
// pinch?
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
if (sculpt_stitching == LL_SCULPT_TYPE_SPHERE)
{
x = sculpt_width / 2;
}
@ -2078,9 +2067,9 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
if (x == sculpt_width) // side stitching
{
// wrap?
if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_type == LL_SCULPT_TYPE_TORUS) ||
(sculpt_type == LL_SCULPT_TYPE_CYLINDER))
if ((sculpt_stitching == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_stitching == LL_SCULPT_TYPE_TORUS) ||
(sculpt_stitching == LL_SCULPT_TYPE_CYLINDER))
{
x = 0;
}
@ -2092,12 +2081,69 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
}
pt.mPos = sculpt_xy_to_vector(x, y, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
if (sculpt_mirror)
{
pt.mPos.mV[VX] *= -1.f;
}
}
line += sizeT;
}
}
const S32 SCULPT_REZ_1 = 6; // changed from 4 to 6 - 6 looks round whereas 4 looks square
const S32 SCULPT_REZ_2 = 8;
const S32 SCULPT_REZ_3 = 16;
const S32 SCULPT_REZ_4 = 32;
S32 sculpt_sides(F32 detail)
{
// detail is usually one of: 1, 1.5, 2.5, 4.0.
if (detail <= 1.0)
{
return SCULPT_REZ_1;
}
if (detail <= 2.0)
{
return SCULPT_REZ_2;
}
if (detail <= 3.0)
{
return SCULPT_REZ_3;
}
else
{
return SCULPT_REZ_4;
}
}
// determine the number of vertices in both s and t direction for this sculpt
void sculpt_calc_mesh_resolution(U16 width, U16 height, U8 type, F32 detail, S32& s, S32& t)
{
S32 vertices = sculpt_sides(detail);
F32 ratio;
if ((width == 0) || (height == 0))
ratio = 1.f;
else
ratio = (F32) width / (F32) height;
s = (S32)(vertices / fsqrtf(ratio));
s = llmax(s, 3); // no degenerate sizes, please
t = vertices * vertices / s;
t = llmax(t, 3); // no degenerate sizes, please
s = vertices * vertices / t;
}
// sculpt replaces generate() for sculpted surfaces
void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
{
@ -2112,11 +2158,16 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
data_is_empty = TRUE;
}
mPathp->generate(mParams.getPathParams(), mDetail, 0, TRUE);
mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(), mDetail, 0, TRUE);
S32 requested_sizeS = 0;
S32 requested_sizeT = 0;
S32 sizeS = mPathp->mPath.size();
S32 sizeT = mProfilep->mProfile.size();
sculpt_calc_mesh_resolution(sculpt_width, sculpt_height, sculpt_type, mDetail, requested_sizeS, requested_sizeT);
mPathp->generate(mParams.getPathParams(), mDetail, 0, TRUE, requested_sizeS);
mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(), mDetail, 0, TRUE, requested_sizeT);
S32 sizeS = mPathp->mPath.size(); // we requested a specific size, now see what we really got
S32 sizeT = mProfilep->mProfile.size(); // we requested a specific size, now see what we really got
// weird crash bug - DEV-11158 - trying to collect more data:
if ((sizeS == 0) || (sizeT == 0))
@ -4871,6 +4922,13 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
LLMemType m1(LLMemType::MTYPE_VOLUME);
BOOL flat = mTypeMask & FLAT_MASK;
U8 sculpt_type = volume->getParams().getSculptType();
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
BOOL sculpt_reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror); // XOR
S32 num_vertices, num_indices;
const std::vector<LLVolume::Point>& mesh = volume->getMesh();
@ -4937,6 +4995,11 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
}
}
if (sculpt_reverse_horizontal)
{
ss = 1.f - ss;
}
// Check to see if this triangle wraps around the array.
if (mBeginS + s >= max_s)
{
@ -5098,9 +5161,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
BOOL s_bottom_converges = ((mVertices[0].mPosition - mVertices[mNumS*(mNumT-2)].mPosition).magVecSquared() < 0.000001f);
BOOL s_top_converges = ((mVertices[mNumS-1].mPosition - mVertices[mNumS*(mNumT-2)+mNumS-1].mPosition).magVecSquared() < 0.000001f);
U8 sculpt_type = volume->getParams().getSculptType();
if (sculpt_type == LL_SCULPT_TYPE_NONE) // logic for non-sculpt volumes
if (sculpt_stitching == LL_SCULPT_TYPE_NONE) // logic for non-sculpt volumes
{
if (volume->getPath().isOpen() == FALSE)
{ //wrap normals on T
@ -5149,15 +5210,15 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
BOOL wrap_s = FALSE;
BOOL wrap_t = FALSE;
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
if (sculpt_stitching == LL_SCULPT_TYPE_SPHERE)
average_poles = TRUE;
if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_type == LL_SCULPT_TYPE_TORUS) ||
(sculpt_type == LL_SCULPT_TYPE_CYLINDER))
if ((sculpt_stitching == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_stitching == LL_SCULPT_TYPE_TORUS) ||
(sculpt_stitching == LL_SCULPT_TYPE_CYLINDER))
wrap_s = TRUE;
if (sculpt_type == LL_SCULPT_TYPE_TORUS)
if (sculpt_stitching == LL_SCULPT_TYPE_TORUS)
wrap_t = TRUE;

View File

@ -175,7 +175,7 @@ const LLFaceID LL_FACE_OUTER_SIDE_3 = 0x1 << 8;
//============================================================================
// sculpt types
// sculpt types + flags
const U8 LL_SCULPT_TYPE_NONE = 0;
const U8 LL_SCULPT_TYPE_SPHERE = 1;
@ -183,6 +183,10 @@ const U8 LL_SCULPT_TYPE_TORUS = 2;
const U8 LL_SCULPT_TYPE_PLANE = 3;
const U8 LL_SCULPT_TYPE_CYLINDER = 4;
const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | LL_SCULPT_TYPE_CYLINDER;
const U8 LL_SCULPT_FLAG_INVERT = 64;
const U8 LL_SCULPT_FLAG_MIRROR = 128;
class LLProfileParams
@ -680,7 +684,8 @@ public:
BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); }
BOOL isOpen() const { return mOpen; }
void setDirty() { mDirty = TRUE; }
BOOL generate(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
BOOL generate(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0,
BOOL is_sculpted = FALSE, S32 sculpt_size = 0);
BOOL isConcave() const { return mConcave; }
public:
struct Face
@ -749,7 +754,8 @@ public:
virtual ~LLPath();
void genNGon(const LLPathParams& params, S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f);
virtual BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
virtual BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0,
BOOL is_sculpted = FALSE, S32 sculpt_size = 0);
BOOL isOpen() const { return mOpen; }
F32 getStep() const { return mStep; }
@ -775,7 +781,8 @@ class LLDynamicPath : public LLPath
{
public:
LLDynamicPath() : LLPath() { }
/*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
/*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0,
BOOL is_sculpted = FALSE, S32 sculpt_size = 0);
};
// Yet another "face" class - caches volume-specific, but not instance-specific data for faces)
@ -943,6 +950,8 @@ private:
F32 sculptGetSurfaceArea(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data);
void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
void sculptGeneratePlaceholder();
void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t);
protected:
BOOL generate();

View File

@ -2570,6 +2570,17 @@ void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace)
mReplaceNewlinesWithSpaces = replace;
}
LLWString LLLineEditor::getConvertedText() const
{
LLWString text = getWText();
LLWStringUtil::trim(text);
if (!mReplaceNewlinesWithSpaces)
{
LLWStringUtil::replaceChar(text,182,'\n'); // Convert paragraph symbols back into newlines.
}
return text;
}
static LLRegisterWidget<LLSearchEditor> r2("search_editor");

View File

@ -140,6 +140,8 @@ public:
const std::string& getText() const { return mText.getString(); }
const LLWString& getWText() const { return mText.getWString(); }
LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines
S32 getLength() const { return mText.length(); }
S32 getCursor() const { return mCursorPos; }

View File

@ -3484,8 +3484,8 @@ BOOL LLPieMenu::appendPieMenu(LLPieMenu *menu)
// virtual
void LLPieMenu::arrange()
{
const S32 rect_height = 180;
const S32 rect_width = 180;
const S32 rect_height = 190;
const S32 rect_width = 190;
// all divide by 6
const S32 CARD_X = 60;

View File

@ -72,6 +72,8 @@ const S32 UI_TEXTEDITOR_BUFFER_BLOCK_SIZE = 512;
const S32 UI_TEXTEDITOR_BORDER = 1;
const S32 UI_TEXTEDITOR_H_PAD = 4;
const S32 UI_TEXTEDITOR_V_PAD_TOP = 4;
const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4;
const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds
const S32 CURSOR_THICKNESS = 2;
const S32 SPACES_PER_TAB = 4;
@ -85,6 +87,7 @@ const S32 PREEDIT_STANDOUT_GAP = 1;
const S32 PREEDIT_STANDOUT_POSITION = 2;
const S32 PREEDIT_STANDOUT_THICKNESS = 2;
LLColor4 LLTextEditor::mLinkColor = LLColor4::blue;
void (* LLTextEditor::mURLcallback)(const std::string&) = NULL;
bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL;
@ -269,6 +272,7 @@ LLTextEditor::LLTextEditor(
mFocusBgColor( LLUI::sColorsGroup->getColor( "TextBgFocusColor" ) ),
mReadOnly(FALSE),
mWordWrap( FALSE ),
mShowLineNumbers ( FALSE ),
mTabsToNextField( TRUE ),
mCommitOnFocusLost( FALSE ),
mHideScrollbarForShortDocs( FALSE ),
@ -397,7 +401,8 @@ void LLTextEditor::updateLineStartList(S32 startpos)
{
mLineStartList.push_back(line_info(seg_idx,seg_offset));
BOOL line_ended = FALSE;
S32 line_width = 0;
S32 start_x = mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0;
S32 line_width = start_x;
while(!line_ended && seg_idx < seg_num)
{
LLTextSegment* segment = mSegments[seg_idx];
@ -427,7 +432,7 @@ void LLTextEditor::updateLineStartList(S32 startpos)
const llwchar* str = mWText.c_str() + start_idx;
S32 drawn = mGLFont->maxDrawableChars(str, (F32)abs(mTextRect.getWidth()) - line_width,
end_idx - start_idx, mWordWrap, mAllowEmbeddedItems );
if( 0 == drawn && line_width == 0)
if( 0 == drawn && line_width == start_x)
{
// If at the beginning of a line, draw at least one character, even if it doesn't all fit.
drawn = 1;
@ -798,7 +803,12 @@ void LLTextEditor::getSelectedSegments(std::vector<const LLTextSegment*>& segmen
S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const
{
// If round is true, if the position is on the right half of a character, the cursor
if(mShowLineNumbers)
{
local_x -= UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
}
// If round is true, if the position is on the right half of a character, the cursor
// will be put to its right. If round is false, the cursor will always be put to the
// character's left.
@ -2467,20 +2477,15 @@ void LLTextEditor::drawBackground()
S32 right = getRect().getWidth();
S32 bottom = 0;
LLColor4 bg_color = mReadOnlyBgColor;
if( !mReadOnly )
{
if (gFocusMgr.getKeyboardFocus() == this)
{
bg_color = mFocusBgColor;
}
else
{
bg_color = mWriteableBgColor;
}
LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor
: gFocusMgr.getKeyboardFocus() == this ? mFocusBgColor : mWriteableBgColor;
if( mShowLineNumbers ) {
gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor ); // line number area always read-only
gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, right, bottom, bg_color); // body text area to the right of line numbers
gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator
} else {
gl_rect_2d(left, top, right, bottom, bg_color); // body text area
}
gl_rect_2d(left, top, right, bottom, bg_color);
LLView::draw();
}
@ -2593,12 +2598,13 @@ void LLTextEditor::drawSelectionBackground()
const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor;
F32 alpha = hasFocus() ? 1.f : 0.5f;
gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha );
S32 margin_offset = mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0;
if( selection_left_y == selection_right_y )
{
// Draw from selection start to selection end
gl_rect_2d( selection_left_x, selection_left_y + line_height + 1,
selection_right_x, selection_right_y);
gl_rect_2d( selection_left_x + margin_offset, selection_left_y + line_height + 1,
selection_right_x + margin_offset, selection_right_y);
}
else
{
@ -2610,16 +2616,16 @@ void LLTextEditor::drawSelectionBackground()
S32 line_end = line_endings.front();
line_endings.pop();
gl_rect_2d( selection_left_x, selection_left_y + line_height + 1,
line_end, selection_left_y );
gl_rect_2d( selection_left_x + margin_offset, selection_left_y + line_height + 1,
line_end + margin_offset, selection_left_y );
S32 line_num = left_line_num + 1;
while(line_endings.size())
{
S32 vert_offset = -(line_num - left_line_num) * line_height;
// Draw the block between the two lines
gl_rect_2d( mTextRect.mLeft, selection_left_y + vert_offset + line_height + 1,
line_endings.front(), selection_left_y + vert_offset);
gl_rect_2d( mTextRect.mLeft + margin_offset, selection_left_y + vert_offset + line_height + 1,
line_endings.front() + margin_offset, selection_left_y + vert_offset);
line_endings.pop();
line_num++;
}
@ -2629,8 +2635,8 @@ void LLTextEditor::drawSelectionBackground()
{
selection_right_x += CURSOR_THICKNESS;
}
gl_rect_2d( mTextRect.mLeft, selection_right_y + line_height + 1,
selection_right_x, selection_right_y );
gl_rect_2d( mTextRect.mLeft + margin_offset, selection_right_y + line_height + 1,
selection_right_x + margin_offset, selection_right_y );
}
}
}
@ -2693,6 +2699,11 @@ void LLTextEditor::drawCursor()
cur_pos++;
}
if(mShowLineNumbers)
{
cursor_left += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
}
// Draw the cursor
if( cursor_visible )
{
@ -2859,10 +2870,7 @@ void LLTextEditor::drawText()
{
const LLWString &text = mWText;
const S32 text_len = getLength();
if( text_len <= 0 )
{
return;
}
if( text_len <= 0 ) return;
S32 selection_left = -1;
S32 selection_right = -1;
// Draw selection even if we don't have keyboard focus for search/replace
@ -2874,14 +2882,26 @@ void LLTextEditor::drawText()
LLGLSUIDefault gls_ui;
S32 cur_line = mScrollbar->getDocPos();
// There are several concepts that are important for understanding the following drawing code.
// The document is logically a sequence of characters (stored in a LLWString).
// Variables below with "start" or "end" in their names refer to positions or offsets into it.
// Next there are two kinds of "line" variables to understand. Newline characters in the
// character sequence represent logical lines. These are what get numbered and so variables
// representing this kind of line have "num" in their names.
// The others represent line fragments or displayed lines which the scrollbar deals with.
// When the "show line numbers" property is turned on, we draw line numbers to the left of the
// beginning of each logical line and not in front of wrapped "continuation" display lines. -MG
S32 cur_line = mScrollbar->getDocPos(); // scrollbar counts each wrap as a new line.
S32 num_lines = getLineCount();
if (cur_line >= num_lines)
{
return;
}
if (cur_line >= num_lines) return;
S32 line_start = getLineStart(cur_line);
S32 prev_start = getLineStart(cur_line-1);
S32 cur_line_num = getLineForPosition(line_start); // doesn't count wraps. i.e. only counts newlines.
S32 prev_line_num = getLineForPosition(prev_start);
BOOL cur_line_is_continuation = cur_line_num > 0 && cur_line_num == prev_line_num;
BOOL line_wraps = FALSE;
LLTextSegment t(line_start);
segment_list_t::iterator seg_iter;
seg_iter = std::upper_bound(mSegments.begin(), mSegments.end(), &t, LLTextSegment::compare());
@ -2900,12 +2920,36 @@ void LLTextEditor::drawText()
next_start = getLineStart(cur_line + 1);
line_end = next_start;
}
if ( text[line_end-1] == '\n' )
line_wraps = text[line_end-1] != '\n';
if ( ! line_wraps )
{
--line_end;
--line_end; // don't attempt to draw the newline char.
}
F32 text_x = (F32)mTextRect.mLeft;
F32 text_start = (F32)mTextRect.mLeft;
F32 text_x = text_start + (mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0);
// draw the line numbers
if( mShowLineNumbers && !cur_line_is_continuation)
{
const LLFontGL *num_font = LLFontGL::sMonospace;
F32 y_top = text_y + ((F32)llround(num_font->getLineHeight()) / 2);
const LLWString ltext = utf8str_to_wstring(llformat("%*d", UI_TEXTEDITOR_LINE_NUMBER_DIGITS, cur_line_num ));
BOOL is_cur_line = getCurrentLine() == cur_line_num;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
const LLColor4 fg_color = is_cur_line ? LLColor4::black : LLColor4::grey4;
num_font->render(
ltext, // string to draw
0, // begin offset
3., // x
y_top, // y
fg_color,
LLFontGL::LEFT, // horizontal alignment
LLFontGL::VCENTER, // vertical alignment
style,
S32_MAX, // max chars
UI_TEXTEDITOR_LINE_NUMBER_MARGIN); // max pixels
}
S32 seg_start = line_start;
while( seg_start < line_end )
@ -2950,16 +2994,28 @@ void LLTextEditor::drawText()
drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x );
if( text_x == text_start && mShowLineNumbers )
{
text_x += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
}
// Note: text_x is incremented by drawClippedSegment()
seg_start += clipped_len;
}
}
// move down one line
text_y -= (F32)line_height;
// move down one line
text_y -= (F32)line_height;
if( line_wraps )
{
cur_line_num--;
}
cur_line_is_continuation = line_wraps; // so as to not not number the continuation lines
line_start = next_start;
cur_line++;
cur_line_num++;
}
}
@ -3258,8 +3314,7 @@ void LLTextEditor::setCursorAndScrollToEnd()
updateScrollFromCursor();
}
void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap )
void LLTextEditor::getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap )
{
if( include_wordwrap )
{
@ -3271,7 +3326,7 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo
S32 line_count = 0;
S32 line_start = 0;
S32 i;
for( i = 0; text[i] && (i < mCursorPos); i++ )
for( i = 0; text[i] && (i < position); i++ )
{
if( '\n' == text[i] )
{
@ -3284,6 +3339,23 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo
}
}
void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap )
{
getLineAndColumnForPosition(mCursorPos, line, col, include_wordwrap);
}
S32 LLTextEditor::getCurrentLine()
{
return getLineForPosition(mCursorPos);
}
S32 LLTextEditor::getLineForPosition(S32 position)
{
S32 line, col;
getLineAndColumnForPosition(position, &line, &col, FALSE);
return line;
}
void LLTextEditor::endOfLine()
{
@ -4152,6 +4224,8 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node)
node->getAttributeBOOL("word_wrap", word_wrap);
setWordWrap(word_wrap);
node->getAttributeBOOL("show_line_numbers", mShowLineNumbers);
node->getAttributeBOOL("track_bottom", mTrackBottom);
LLColor4 color;

View File

@ -160,7 +160,10 @@ public:
void setCursorPos(S32 offset);
void setCursorAndScrollToEnd();
void getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap );
void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
S32 getLineForPosition(S32 position);
S32 getCurrentLine();
void loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
@ -500,6 +503,7 @@ private:
BOOL mReadOnly;
BOOL mWordWrap;
BOOL mShowLineNumbers;
BOOL mTabsToNextField; // if true, tab moves focus to next field, else inserts spaces
BOOL mCommitOnFocusLost;

View File

@ -724,9 +724,9 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s
tool_tip = getShowNamesToolTip();
}
BOOL showNamesTextBox = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL;
BOOL show_names_text_box = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL;
if( !handled && (blockMouseEvent(x, y) || showNamesTextBox) && !tool_tip.empty())
if( !handled && (blockMouseEvent(x, y) || show_names_text_box))
{
msg = tool_tip;

View File

@ -501,6 +501,9 @@ extern "C" { int yyerror(const char *fmt, ...); }
"PRIM_SCULPT_TYPE_TORUS" { count(); yylval.ival = LSL_PRIM_SCULPT_TYPE_TORUS; return(INTEGER_CONSTANT); }
"PRIM_SCULPT_TYPE_PLANE" { count(); yylval.ival = LSL_PRIM_SCULPT_TYPE_PLANE; return(INTEGER_CONSTANT); }
"PRIM_SCULPT_TYPE_CYLINDER" { count(); yylval.ival = LSL_PRIM_SCULPT_TYPE_CYLINDER; return(INTEGER_CONSTANT); }
"PRIM_SCULPT_TYPE_MASK" { count(); yylval.ival = LSL_PRIM_SCULPT_TYPE_MASK; return(INTEGER_CONSTANT); }
"PRIM_SCULPT_FLAG_MIRROR" { count(); yylval.ival = LSL_PRIM_SCULPT_FLAG_MIRROR; return(INTEGER_CONSTANT); }
"PRIM_SCULPT_FLAG_INVERT" { count(); yylval.ival = LSL_PRIM_SCULPT_FLAG_INVERT; return(INTEGER_CONSTANT); }
"MASK_BASE" { count(); yylval.ival = 0; return(INTEGER_CONSTANT); }
"MASK_OWNER" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); }

View File

@ -404,6 +404,9 @@ PRIM_SCULPT_TYPE_SPHERE Stitch edges in a sphere-like way
PRIM_SCULPT_TYPE_TORUS Stitch edges in a torus-like way
PRIM_SCULPT_TYPE_PLANE Do not stitch edges
PRIM_SCULPT_TYPE_CYLINDER Stitch edges in a cylinder-like way
PRIM_SCULPT_TYPE_MASK Mask used to determine stitching type
PRIM_SCULPT_FLAG_INVERT Flag to specify that the surface normals should be inverted
PRIM_SCULPT_FLAG_MIRROR Flag to specify that the prim should be reflected along X axis
MASK_BASE Base permissions
MASK_OWNER Owner permissions

View File

@ -23,6 +23,22 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>UserChatColor</key>
<map>
<key>Comment</key>
<string>Color of your chat messages</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.0196078431372</real>
<real>0.6862745098039</real>
<real>0.9803921568627</real>
<real>1</real>
</array>
</map>
<key>AgentChatColor</key>
<map>
<key>Comment</key>
@ -1090,16 +1106,16 @@
<real>0.5</real>
</map>
<key>ChatFontSize</key>
<map>
<key>Comment</key>
<string>Size of chat text in chat console (0 = small, 1 = medium, 2 = big)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1</integer>
</map>
<map>
<key>Comment</key>
<string>Size of chat text in chat console (0 = small, 1 = big)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ChatFullWidth</key>
<map>
<key>Comment</key>
@ -1134,16 +1150,16 @@
<integer>1</integer>
</map>
<key>ChatPersistTime</key>
<map>
<key>Comment</key>
<string>Time for which chat stays visible in console (seconds)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>20</real>
</map>
<map>
<key>Comment</key>
<string>Time for which chat stays visible in console (seconds)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>20.0</real>
</map>
<key>ChatShowTimestamps</key>
<map>
<key>Comment</key>
@ -1867,16 +1883,16 @@
<integer>0</integer>
</map>
<key>ConsoleBackgroundOpacity</key>
<map>
<key>Comment</key>
<string>Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.700</real>
</map>
<map>
<key>Comment</key>
<string>Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.700</real>
</map>
<key>ConsoleBufferSize</key>
<map>
<key>Comment</key>
@ -2605,7 +2621,7 @@
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>speaker_name</string>
<string>speaking_status</string>
</map>
<key>FloaterAdvancedSkyRect</key>
<map>
@ -4505,17 +4521,6 @@
<key>Value</key>
<real>128.0</real>
</map>
<key>MapShowClassifieds</key>
<map>
<key>Comment</key>
<string>Show locations associated with classified ads on world map</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>MapShowEvents</key>
<map>
<key>Comment</key>
@ -5049,21 +5054,21 @@
<integer>0</integer>
</map>
<key>ObjectChatColor</key>
<map>
<key>Comment</key>
<string>Color of chat messages from objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>1</real>
<real>0.5</real>
<real>0.0</real>
<real>1</real>
</array>
</map>
<map>
<key>Comment</key>
<string>Color of chat messages from objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>1</real>
<real>0.5</real>
<real>0.0</real>
<real>1</real>
</array>
</map>
<key>OpenDebugStatAdvanced</key>
<map>
<key>Comment</key>
@ -7056,17 +7061,28 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>ShowObjectUpdates</key>
<key>ShowInInventory</key>
<map>
<key>Comment</key>
<string>Show when update messages are received for individual objects</string>
<string>Automatically opens inventory to show accepted objects</string>
<key>Persist</key>
<integer>0</integer>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>ShowObjectUpdates</key>
<map>
<key>Comment</key>
<string>Show when update messages are received for individual objects</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowOverlayTitle</key>
<map>
<key>Comment</key>
@ -7393,6 +7409,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotFormat</key>
<map>
<key>Comment</key>
<string>Save snapshots in this format (0 = PNG, 1 = JPEG, 2 = BMP)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotLocalLastResolution</key>
<map>
<key>Comment</key>
@ -7404,17 +7431,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotFormat</key>
<map>
<key>Comment</key>
<string>Save snapshots in this format (0 = PNG, 1 = JPEG, 2 = BMP)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotPostcardLastResolution</key>
<map>
<key>Comment</key>

View File

@ -855,6 +855,9 @@ bool LLAppViewer::init()
bool LLAppViewer::mainLoop()
{
mMainloopTimeout = new LLWatchdogTimeout();
// *FIX:Mani - Make this a setting, once new settings exist in this branch.
//-------------------------------------------
// Run main loop until time to quit
//-------------------------------------------

View File

@ -378,40 +378,40 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
void LLChatBar::sendChat( EChatType type )
{
LLWString text;
if (mInputEditor) text = mInputEditor->getWText();
LLWStringUtil::trim(text);
LLWStringUtil::replaceChar(text,182,'\n'); // Convert paragraph symbols back into newlines.
if (!text.empty())
if (mInputEditor)
{
// store sent line in history, duplicates will get filtered
if (mInputEditor) mInputEditor->updateHistory();
// Check if this is destined for another channel
S32 channel = 0;
stripChannelNumber(text, &channel);
std::string utf8text = wstring_to_utf8str(text);
// Try to trigger a gesture, if not chat to a script.
std::string utf8_revised_text;
if (0 == channel)
LLWString text = mInputEditor->getConvertedText();
if (!text.empty())
{
// discard returned "found" boolean
gGestureManager.triggerAndReviseString(utf8text, &utf8_revised_text);
}
else
{
utf8_revised_text = utf8text;
}
// store sent line in history, duplicates will get filtered
if (mInputEditor) mInputEditor->updateHistory();
// Check if this is destined for another channel
S32 channel = 0;
stripChannelNumber(text, &channel);
std::string utf8text = wstring_to_utf8str(text);
// Try to trigger a gesture, if not chat to a script.
std::string utf8_revised_text;
if (0 == channel)
{
// discard returned "found" boolean
gGestureManager.triggerAndReviseString(utf8text, &utf8_revised_text);
}
else
{
utf8_revised_text = utf8text;
}
utf8_revised_text = utf8str_trim(utf8_revised_text);
utf8_revised_text = utf8str_trim(utf8_revised_text);
if (!utf8_revised_text.empty())
{
// Chat with animation
sendChatFromViewer(utf8_revised_text, type, TRUE);
if (!utf8_revised_text.empty())
{
// Chat with animation
sendChatFromViewer(utf8_revised_text, type, TRUE);
}
}
}
childSetValue("Chat Editor", LLStringUtil::null);
gAgent.stopTyping();

View File

@ -42,6 +42,7 @@
#include "llviewercontrol.h"
#include "llui.h"
#include "llappviewer.h"
#include "lltracker.h"
// static
std::set<std::string> LLFirstUse::sConfigVariables;
@ -162,9 +163,13 @@ void LLFirstUse::useTeleport()
{
if (gSavedSettings.getWarning("FirstTeleport"))
{
gSavedSettings.setWarning("FirstTeleport", FALSE);
LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal();
if(teleportDestination != LLVector3d::zero)
{
gSavedSettings.setWarning("FirstTeleport", FALSE);
LLNotifyBox::showXml("FirstTeleport");
LLNotifyBox::showXml("FirstTeleport");
}
}
}

View File

@ -194,7 +194,6 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
sInstance->requestVOInventory();
}
void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
InventoryObjectList* inv,
S32 serial_num,
@ -290,6 +289,11 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
removeVOInventoryListener();
}
void LLFloaterBuy::close(bool app_quitting)
{
LLSelectMgr::getInstance()->deselectAll();
LLFloater::close(app_quitting);
}
// static
void LLFloaterBuy::onClickBuy(void*)

View File

@ -65,6 +65,8 @@ protected:
S32 serial_num,
void* data);
/*virtual*/ void close(bool app_quitting = false);
static void onClickBuy(void*);
static void onClickCancel(void*);

View File

@ -205,9 +205,10 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL
chat.mFromID != LLUUID::null &&
(line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
{
line = line.substr(chat.mFromName.length());
std::string start_line = line.substr(0, chat.mFromName.length() + 1);
line = line.substr(chat.mFromName.length() + 1);
const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID);
edit->appendStyledText(chat.mFromName, false, prepend_newline, &sourceStyle);
edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle);
prepend_newline = false;
}
edit->appendColoredText(line, false, prepend_newline, color);
@ -420,7 +421,14 @@ LLColor4 get_text_color(const LLChat& chat)
}
else
{
text_color = gSavedSettings.getColor4("AgentChatColor");
if(gAgent.getID() == chat.mFromID)
{
text_color = gSavedSettings.getColor4("UserChatColor");
}
else
{
text_color = gSavedSettings.getColor4("AgentChatColor");
}
}
break;
case CHAT_SOURCE_OBJECT:

View File

@ -573,16 +573,15 @@ void LLPanelFriends::onClickIM(void* user_data)
}
// static
void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name)
void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
{
// HACK: folder id stored as "message"
LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
std::string message = calling_card_folder_id.asString();
send_improved_im(target_id,
target_name,
message,
IM_ONLINE,
IM_FRIENDSHIP_OFFERED);
IM_FRIENDSHIP_OFFERED,
calling_card_folder_id);
}
struct LLAddFriendData
@ -592,12 +591,12 @@ struct LLAddFriendData
};
// static
void LLPanelFriends::callbackAddFriend(S32 option, void* data)
void LLPanelFriends::callbackAddFriend(S32 option, const std::string& text, void* data)
{
LLAddFriendData* add = (LLAddFriendData*)data;
if (option == 0)
{
requestFriendship(add->mID, add->mName);
requestFriendship(add->mID, add->mName, text);
}
delete add;
}
@ -629,7 +628,7 @@ void LLPanelFriends::requestFriendshipDialog(const LLUUID& id,
// TODO: accept a line of text with this dialog
LLStringUtil::format_map_t args;
args["[NAME]"] = name;
gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, data);
gViewerWindow->alertXmlEditText("AddFriend", args, NULL, NULL, callbackAddFriend, data);
}
// static

View File

@ -80,7 +80,7 @@ public:
// Just request friendship, no dialog.
static void requestFriendship(const LLUUID& target_id,
const std::string& target_name);
const std::string& target_name, const std::string& message);
private:
@ -119,7 +119,7 @@ private:
// callback methods
static void onSelectName(LLUICtrl* ctrl, void* user_data);
static void callbackAddFriend(S32 option, void* user_data);
static void callbackAddFriend(S32 option, const std::string& text, void* user_data);
static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
static void onMaximumSelect(void* user_data);

View File

@ -392,10 +392,10 @@ void LLFloaterPostcard::sendPostcard()
{
gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE);
}
// give user feedback of the event
gViewerWindow->playSnapshotAnimAndSound();
LLUploadDialog::modalUploadDialog("Uploading...\n\nPostcard");
LLUploadDialog::modalUploadDialog(getString("upload_message"));
// don't destroy the window until the upload is done
// this way we keep the information in the form

View File

@ -49,7 +49,7 @@ public:
SNAPSHOT_FORMAT_BMP
} ESnapshotFormat;
LLFloaterSnapshot();
LLFloaterSnapshot();
virtual ~LLFloaterSnapshot();
/*virtual*/ BOOL postBuild();

View File

@ -127,50 +127,38 @@ BOOL LLFloaterTOS::postBuild()
{
childSetAction("Continue", onContinue, this);
childSetAction("Cancel", onCancel, this);
childSetCommitCallback("tos_agreement", updateAgree, this);
childSetCommitCallback("agree_chk", updateAgree, this);
if ( mType != TOS_TOS )
{
// this displays the critical message
LLTextEditor *Editor = getChild<LLTextEditor>("tos_text");
if (Editor)
{
Editor->setHandleEditKeysDirectly( TRUE );
Editor->setEnabled( FALSE );
Editor->setReadOnlyFgColor(LLColor4::white);
Editor->setWordWrap(TRUE);
Editor->setFocus(TRUE);
}
childSetValue("tos_text", LLSD(mMessage));
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
editor->setHandleEditKeysDirectly( TRUE );
editor->setEnabled( FALSE );
editor->setWordWrap(TRUE);
editor->setFocus(TRUE);
editor->setValue(LLSD(mMessage));
return TRUE;
}
// disable Agree to TOS radio button until the page has fully loaded
LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement");
if ( tos_agreement )
{
tos_agreement->setEnabled( false );
};
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( false );
// hide the SL text widget if we're displaying TOS with using a browser widget.
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
if ( editor )
{
editor->setVisible( FALSE );
};
editor->setVisible( FALSE );
LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
if ( web_browser )
{
// start to observe it so we see navigate complete events
if ( web_browser )
{
web_browser->addObserver( this );
};
web_browser->addObserver( this );
gResponsePtr = LLIamHere::build( this );
LLHTTPClient::get( getString( "real_url" ), gResponsePtr );
};
}
return TRUE;
}
@ -194,11 +182,8 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
{
// normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads)
// but if the page is unavailable, we need to do this now
LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement");
if ( tos_agreement )
{
tos_agreement->setEnabled( true );
};
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( true );
if ( web_browser )
{
@ -236,8 +221,8 @@ void LLFloaterTOS::draw()
void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata )
{
LLFloaterTOS* self = (LLFloaterTOS*) userdata;
std::string agree = self->childGetValue("tos_agreement").asString();
self->childSetEnabled("Continue", (agree == "radio_agree") );
bool agree = self->childGetValue("agree_chk").asBoolean();
self->childSetEnabled("Continue", agree);
}
// static
@ -286,10 +271,7 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn )
{
llinfos << "NAVIGATE COMPLETE" << llendl;
// enable Agree to TOS radio button now that page has loaded
LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement");
if ( tos_agreement )
{
tos_agreement->setEnabled( true );
};
LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( true );
};
}

View File

@ -398,12 +398,18 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
if (!isMinimized() && isFrontmost())
{
F32 slider_value = (F32)childGetValue("zoom slider").asReal();
slider_value += ((F32)clicks * -0.3333f);
childSetValue("zoom slider", LLSD(slider_value));
return TRUE;
LLRect area;
childGetRect("search_results", area);
if(!area.pointInRect(x, y))
{
F32 slider_value = (F32)childGetValue("zoom slider").asReal();
slider_value += ((F32)clicks * -0.3333f);
childSetValue("zoom slider", LLSD(slider_value));
return TRUE;
}
}
return FALSE;
return LLFloater::handleScrollWheel(x, y, clicks);
}

View File

@ -1238,6 +1238,7 @@ BOOL LLFloaterIMPanel::postBuild()
mInputEditor->setCallbackUserData(this);
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setReplaceNewlinesWithSpaces( FALSE );
childSetAction("profile_callee_btn", onClickProfile, this);
childSetAction("group_info_btn", onClickGroupInfo, this);
@ -1925,8 +1926,6 @@ void deliver_message(const std::string& utf8_text,
void LLFloaterIMPanel::sendMsg()
{
LLWString text = mInputEditor->getWText();
LLWStringUtil::trim(text);
if (!gAgent.isGodlike()
&& (mDialog == IM_NOTHING_SPECIAL)
&& mOtherParticipantUUID.isNull())
@ -1934,57 +1933,63 @@ void LLFloaterIMPanel::sendMsg()
llinfos << "Cannot send IM to everyone unless you're a god." << llendl;
return;
}
if(text.length() > 0)
if (mInputEditor)
{
// Truncate and convert to UTF8 for transport
std::string utf8_text = wstring_to_utf8str(text);
utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1);
if ( mSessionInitialized )
LLWString text = mInputEditor->getConvertedText();
if(!text.empty())
{
deliver_message(utf8_text,
mSessionUUID,
mOtherParticipantUUID,
mDialog);
// local echo
if((mDialog == IM_NOTHING_SPECIAL) &&
(mOtherParticipantUUID.notNull()))
// Truncate and convert to UTF8 for transport
std::string utf8_text = wstring_to_utf8str(text);
utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1);
if ( mSessionInitialized )
{
std::string history_echo;
gAgent.buildFullname(history_echo);
deliver_message(utf8_text,
mSessionUUID,
mOtherParticipantUUID,
mDialog);
// Look for IRC-style emotes here.
std::string prefix = utf8_text.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
// local echo
if((mDialog == IM_NOTHING_SPECIAL) &&
(mOtherParticipantUUID.notNull()))
{
utf8_text.replace(0,3,"");
std::string history_echo;
gAgent.buildFullname(history_echo);
// Look for IRC-style emotes here.
std::string prefix = utf8_text.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
{
utf8_text.replace(0,3,"");
}
else
{
history_echo += ": ";
}
history_echo += utf8_text;
BOOL other_was_typing = mOtherTyping;
addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID());
if (other_was_typing)
{
addTypingIndicator(mOtherTypingName);
}
}
else
{
history_echo += ": ";
}
history_echo += utf8_text;
BOOL other_was_typing = mOtherTyping;
addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID());
if (other_was_typing)
{
addTypingIndicator(mOtherTypingName);
}
}
}
else
{
//queue up the message to send once the session is
//initialized
mQueuedMsgsForInit.append(utf8_text);
else
{
//queue up the message to send once the session is
//initialized
mQueuedMsgsForInit.append(utf8_text);
}
}
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT);
}
mInputEditor->setText(LLStringUtil::null);

View File

@ -120,7 +120,6 @@ BOOL LLOverlayBar::postBuild()
{
childSetAction("IM Received",onClickIMReceived,this);
childSetAction("Set Not Busy",onClickSetNotBusy,this);
childSetAction("Release Keys",onClickReleaseKeys,this);
childSetAction("Mouselook",onClickMouselook,this);
childSetAction("Stand Up",onClickStandUp,this);
childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
@ -210,17 +209,6 @@ void LLOverlayBar::refresh()
buttons_changed = TRUE;
}
BOOL controls_grabbed = gAgent.anyControlGrabbed();
button = getChild<LLButton>("Release Keys");
if (button && button->getVisible() != controls_grabbed)
{
button->setVisible(controls_grabbed);
sendChildToFront(button);
moveChildToBackOfTabGroup(button);
buttons_changed = TRUE;
}
BOOL mouselook_grabbed;
mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
|| gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);
@ -295,12 +283,6 @@ void LLOverlayBar::onClickSetNotBusy(void*)
}
// static
void LLOverlayBar::onClickReleaseKeys(void*)
{
gAgent.forceReleaseControls();
}
// static
void LLOverlayBar::onClickResetView(void* data)
{

View File

@ -68,7 +68,6 @@ public:
static void onClickIMReceived(void* data);
static void onClickSetNotBusy(void* data);
static void onClickReleaseKeys(void* data);
static void onClickMouselook(void* data);
static void onClickStandUp(void* data);
static void onClickResetView(void* data);

View File

@ -459,9 +459,9 @@ BOOL LLPanelAvatarNotes::postBuild(void)
BOOL LLPanelAvatarWeb::postBuild(void)
{
childSetAction("load",onClickLoad,this);
childSetAction("open",onClickOpen,this);
childSetAction("home",onClickLoad,this);
childSetKeystrokeCallback("url_edit", onURLKeystroke, this);
childSetCommitCallback("load", onCommitLoad, this);
childSetAction("web_profile_help",onClickWebProfileHelp,this);
childSetCommitCallback("url_edit",onCommitURL,this);
@ -544,31 +544,26 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb()
void LLPanelAvatarWeb::enableControls(BOOL self)
{
childSetEnabled("url_edit",self);
childSetVisible("status_text",!self && !mURL.empty());
childSetVisible("status_text",!self && !mHome.empty());
childSetText("status_text", LLStringUtil::null);
}
void LLPanelAvatarWeb::setWebURL(std::string url)
{
bool changed_url = (mURL != url);
bool changed_url = (mHome != url);
mURL = url;
bool have_url = !mURL.empty();
mHome = url;
bool have_url = !mHome.empty();
childSetText("url_edit",mURL);
childSetEnabled("load",have_url);
childSetEnabled("open",have_url);
childSetVisible("home",false);
childSetVisible("load",true);
childSetText("url_edit", mHome);
childSetEnabled("load", mHome.length() > 0);
if (have_url
&& gSavedSettings.getBOOL("AutoLoadWebProfiles"))
{
if (changed_url)
{
load();
load(mHome);
}
}
else
@ -577,7 +572,7 @@ void LLPanelAvatarWeb::setWebURL(std::string url)
}
BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
childSetVisible("status_text",!own_avatar && !mURL.empty());
childSetVisible("status_text",!own_avatar && !mHome.empty());
}
@ -607,47 +602,45 @@ void LLPanelAvatarWeb::load(std::string url)
mWebBrowser->navigateTo( url );
}
// If we have_url then we loaded so use the home button
// Or if the url in address bar is not the home url show the home button.
bool use_home = (have_url
|| url != mURL);
childSetVisible("profile_html",have_url);
childSetVisible("load",!use_home);
childSetVisible("home",use_home);
childSetEnabled("load",!use_home);
childSetEnabled("home",use_home);
childSetEnabled("open",have_url);
childSetVisible("profile_html", have_url);
}
void LLPanelAvatarWeb::load()
{
load(mURL);
}
// static
void LLPanelAvatarWeb::onClickLoad(void* data)
//static
void LLPanelAvatarWeb::onURLKeystroke(LLLineEditor* editor, void* data)
{
LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data;
if (!self) return;
self->load();
LLSD::String url = editor->getText();
self->childSetEnabled("load", url.length() > 0);
return;
}
// static
void LLPanelAvatarWeb::onClickOpen(void* data)
void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data)
{
LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data;
if (!self) return;
std::string url = self->childGetText("url_edit");
if (!url.empty())
LLSD::String valstr = ctrl->getValue().asString();
LLSD::String urlstr = self->childGetText("url_edit");
if (valstr == "") // load url string into browser panel
{
LLWeb::loadURLExternal(url);
self->load(urlstr);
}
else if (valstr == "open") // open in user's external browser
{
if (!urlstr.empty())
{
LLWeb::loadURLExternal(urlstr);
}
}
else if (valstr == "home") // reload profile owner's home page
{
if (!self->mHome.empty())
{
self->load(self->mHome);
}
}
}

View File

@ -147,10 +147,9 @@ public:
void setWebURL(std::string url);
void load();
void load(std::string url);
static void onClickLoad(void* data);
static void onClickOpen(void* data);
static void onURLKeystroke(LLLineEditor* editor, void* data);
static void onCommitLoad(LLUICtrl* ctrl, void* data);
static void onCommitURL(LLUICtrl* ctrl, void* data);
static void onClickWebProfileHelp(void *);
@ -159,7 +158,7 @@ public:
virtual void onLocationChange( const EventType& eventIn );
private:
std::string mURL;
std::string mHome;
LLWebBrowserCtrl* mWebBrowser;
};

View File

@ -433,6 +433,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword);
LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text");
create_new_account_text->setClickedCallback(onClickNewAccount);
#endif
// get the web browser control
@ -1063,9 +1066,15 @@ void LLPanelLogin::onClickConnect(void *)
}
else
{
// empty first or last name
// same as clicking new account
onClickNewAccount(NULL);
if (gHideLinks)
{
gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks");
}
else
{
gViewerWindow->alertXml("MustHaveAccountToLogIn",
LLPanelLogin::newAccountAlertCallback);
}
}
}
}
@ -1077,7 +1086,7 @@ void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
if (0 == option)
{
llinfos << "Going to account creation URL" << llendl;
LLWeb::loadURL( CREATE_ACCOUNT_URL );
LLWeb::loadURLExternal( CREATE_ACCOUNT_URL );
}
else
{
@ -1089,15 +1098,7 @@ void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
// static
void LLPanelLogin::onClickNewAccount(void*)
{
if (gHideLinks)
{
gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks");
}
else
{
gViewerWindow->alertXml("MustHaveAccountToLogIn",
LLPanelLogin::newAccountAlertCallback);
}
LLWeb::loadURLExternal( CREATE_ACCOUNT_URL );
}
@ -1121,15 +1122,15 @@ void LLPanelLogin::onClickVersion(void*)
LLFloaterAbout::show(NULL);
}
//static
void LLPanelLogin::onClickForgotPassword(void*)
{
if (sInstance )
{
LLWeb::loadURL(sInstance->getString( "forgot_password_url" ));
LLWeb::loadURLExternal(sInstance->getString( "forgot_password_url" ));
}
}
// static
void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
{

View File

@ -289,9 +289,12 @@ BOOL LLPanelObject::postBuild()
}
mLabelSculptType = getChild<LLTextBox>("label sculpt type");
mCtrlSculptType = getChild<LLComboBox>( "sculpt type control");
mCtrlSculptType = getChild<LLComboBox>("sculpt type control");
childSetCommitCallback("sculpt type control", onCommitSculptType, this);
mCtrlSculptMirror = getChild<LLCheckBoxCtrl>("sculpt mirror control");
childSetCommitCallback("sculpt mirror control", onCommitSculptType, this);
mCtrlSculptInvert = getChild<LLCheckBoxCtrl>("sculpt invert control");
childSetCommitCallback("sculpt invert control", onCommitSculptType, this);
// Start with everyone disabled
clearCtrls();
@ -1057,6 +1060,8 @@ void LLPanelObject::getState( )
mCtrlSculptTexture->setVisible(sculpt_texture_visible);
mLabelSculptType->setVisible(sculpt_texture_visible);
mCtrlSculptType->setVisible(sculpt_texture_visible);
mCtrlSculptMirror->setVisible(sculpt_texture_visible);
mCtrlSculptInvert->setVisible(sculpt_texture_visible);
// sculpt texture
@ -1086,12 +1091,29 @@ void LLPanelObject::getState( )
mTextureCtrl->setImageAssetID(LLUUID::null);
}
U8 sculpt_type = sculpt_params->getSculptType();
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
if (mCtrlSculptType)
{
mCtrlSculptType->setCurrentByIndex(sculpt_params->getSculptType());
mCtrlSculptType->setCurrentByIndex(sculpt_stitching);
mCtrlSculptType->setEnabled(editable);
}
if (mCtrlSculptMirror)
{
mCtrlSculptMirror->set(sculpt_mirror);
mCtrlSculptMirror->setEnabled(editable);
}
if (mCtrlSculptInvert)
{
mCtrlSculptInvert->set(sculpt_invert);
mCtrlSculptInvert->setEnabled(editable);
}
if (mLabelSculptType)
{
mLabelSculptType->setEnabled(TRUE);
@ -1725,9 +1747,18 @@ void LLPanelObject::sendSculpt()
if (mCtrlSculptTexture)
sculpt_params.setSculptTexture(mCtrlSculptTexture->getImageAssetID());
if (mCtrlSculptType)
sculpt_params.setSculptType(mCtrlSculptType->getCurrentIndex());
U8 sculpt_type = 0;
if (mCtrlSculptType)
sculpt_type |= mCtrlSculptType->getCurrentIndex();
if ((mCtrlSculptMirror) && (mCtrlSculptMirror->get()))
sculpt_type |= LL_SCULPT_FLAG_MIRROR;
if ((mCtrlSculptInvert) && (mCtrlSculptInvert->get()))
sculpt_type |= LL_SCULPT_FLAG_INVERT;
sculpt_params.setSculptType(sculpt_type);
mObject->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE);
}

View File

@ -170,6 +170,8 @@ protected:
LLTextureCtrl *mCtrlSculptTexture;
LLTextBox *mLabelSculptType;
LLComboBox *mCtrlSculptType;
LLCheckBoxCtrl *mCtrlSculptMirror;
LLCheckBoxCtrl *mCtrlSculptInvert;
LLVector3 mCurEulerDegrees; // to avoid sending rotation when not changed
BOOL mIsPhysical; // to avoid sending "physical" when not changed

View File

@ -189,6 +189,8 @@
// exported globals
//
bool gAgentMovementCompleted = false;
std::string gInitialOutfit;
std::string gInitialOutfitGender;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
@ -1607,6 +1609,9 @@ bool idle_startup()
gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") );
LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0);
gViewerWindow->adjustControlRectanglesForFirstUse(window);
if (gSavedSettings.getBOOL("ShowCameraControls"))
{
LLFloaterCamera::showInstance();
@ -2242,6 +2247,21 @@ bool idle_startup()
{
F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
// We now have an inventory skeleton, so if this is a user's first
// login, we can start setting up their clothing and avatar
// appearance. This helps to avoid the generic "Ruth" avatar in
// the orientation island tutorial experience. JC
if (gAgent.isFirstLogin()
&& !sInitialOutfit.empty() // registration set up an outfit
&& !sInitialOutfitGender.empty() // and a gender
&& gAgent.getAvatarObject() // can't wear clothes without object
&& !gAgent.isGenderChosen() ) // nothing already loading
{
// Start loading the wearables, textures, gestures
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
// We now have an inventory skeleton, so if this is a user's first
// login, we can start setting up their clothing and avatar
// appearance. This helps to avoid the generic "Ruth" avatar in

View File

@ -61,7 +61,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID &source)
LLStyleSP style(new LLStyle);
style->setVisible(true);
style->setFontName(LLStringUtil::null);
if (source != gAgent.getID() && source != LLUUID::null)
if (source != LLUUID::null)
{
style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());

View File

@ -466,6 +466,27 @@ void LLToolBrushLand::render()
}
}
/*
* Draw vertical lines from each vertex straight up in world space
* with lengths indicating the current "strength" slider.
* Decorate the tops and bottoms of the lines like this:
*
* Raise Revert
* /|\ ___
* | |
* | |
*
* Rough Smooth
* /|\ ___
* | |
* | |
* \|/..........._|_
*
* Lower Flatten
* | |
* | |
* \|/..........._|_
*/
void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region,
const LLVector3& pos_world)
{
@ -479,19 +500,55 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region
S32 i = (S32) pos_region.mV[VX];
S32 j = (S32) pos_region.mV[VY];
S32 half_edge = llfloor(LAND_BRUSH_SIZE[mBrushIndex]);
S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
F32 force = gSavedSettings.getF32("LandBrushForce"); // .1 to 100?
gGL.begin(LLVertexBuffer::POINTS);
gGL.begin(LLVertexBuffer::LINES);
for(S32 di = -half_edge; di <= half_edge; di++)
{
if((i+di) < 0 || (i+di) >= (S32)land.mGridsPerEdge) continue;
for(S32 dj = -half_edge; dj <= half_edge; dj++)
{
if( (j+dj) < 0 || (j+dj) >= (S32)land.mGridsPerEdge ) continue;
gGL.vertex3f(pos_world.mV[VX] + di, pos_world.mV[VY] + dj,
land.getZ((i+di)+(j+dj)*land.mGridsPerEdge));
const F32
wx = pos_world.mV[VX] + di,
wy = pos_world.mV[VY] + dj,
wz = land.getZ((i+di)+(j+dj)*land.mGridsPerEdge),
norm_dist = sqrt((float)di*di + dj*dj) / half_edge,
force_scale = sqrt(2.f) - norm_dist, // 1 at center, 0 at corner
wz2 = wz + .2 + (.2 + force/100) * force_scale, // top vertex
tic = .075f; // arrowhead size
// vertical line
gGL.vertex3f(wx, wy, wz);
gGL.vertex3f(wx, wy, wz2);
if(radioAction == E_LAND_RAISE || radioAction == E_LAND_NOISE) // up arrow
{
gGL.vertex3f(wx, wy, wz2);
gGL.vertex3f(wx+tic, wy, wz2-tic);
gGL.vertex3f(wx, wy, wz2);
gGL.vertex3f(wx-tic, wy, wz2-tic);
}
if(radioAction == E_LAND_LOWER || radioAction == E_LAND_NOISE) // down arrow
{
gGL.vertex3f(wx, wy, wz);
gGL.vertex3f(wx+tic, wy, wz+tic);
gGL.vertex3f(wx, wy, wz);
gGL.vertex3f(wx-tic, wy, wz+tic);
}
if(radioAction == E_LAND_REVERT || radioAction == E_LAND_SMOOTH) // flat top
{
gGL.vertex3f(wx-tic, wy, wz2);
gGL.vertex3f(wx+tic, wy, wz2);
}
if(radioAction == E_LAND_LEVEL || radioAction == E_LAND_SMOOTH) // flat bottom
{
gGL.vertex3f(wx-tic, wy, wz);
gGL.vertex3f(wx+tic, wy, wz);
}
}
}
gGL.end();
glPopMatrix();
}

View File

@ -44,6 +44,7 @@
#include "lldynamictexture.h"
#include "lldrawpoolalpha.h"
#include "llfeaturemanager.h"
#include "llfirstuse.h"
#include "llframestats.h"
#include "llhudmanager.h"
#include "llimagebmp.h"
@ -379,6 +380,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if( arrival_fraction > 1.f )
{
arrival_fraction = 1.f;
LLFirstUse::useTeleport();
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
}
gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate

View File

@ -1036,8 +1036,7 @@ void init_client_menu(LLMenuGL* menu)
menu->appendSeparator();
menu->append(new LLMenuItemToggleGL("Show Updates",
&gShowObjectUpdates,
'U', MASK_ALT | MASK_SHIFT | MASK_CONTROL));
&gShowObjectUpdates));
menu->appendSeparator();
@ -2912,8 +2911,7 @@ void request_friendship(const LLUUID& dest_id)
}
if (!fullname.empty())
{
LLPanelFriends::requestFriendship(dest_id, fullname);
LLNotifyBox::showXml("OfferedFriendship", args);
LLPanelFriends::requestFriendshipDialog(dest_id, fullname);
}
else
{
@ -4493,6 +4491,25 @@ class LLToolsStopAllAnimations : public view_listener_t
}
};
class LLToolsReleaseKeys : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gAgent.forceReleaseControls();
return true;
}
};
class LLToolsEnableReleaseKeys : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() );
return true;
}
};
//void handle_hinge(void*)
//{
// LLSelectMgr::getInstance()->sendHinge(1);
@ -7825,6 +7842,8 @@ void initialize_menus()
addMenu(new LLToolsLink(), "Tools.Link");
addMenu(new LLToolsUnlink(), "Tools.Unlink");
addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations");
addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys");
addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys");
addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection");
addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake");
addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy");

View File

@ -108,6 +108,7 @@
#include "lltool.h"
#include "lltoolbar.h"
#include "lltoolmgr.h"
#include "lltrans.h"
#include "llui.h" // for make_ui_sound
#include "lluploaddialog.h"
#include "llviewercamera.h"
@ -828,13 +829,15 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
{
continue;
}
LLAssetType::EType asset_type = item->getType();
//if we are throttled, don't display them - Gigs
if (check_offer_throttle(from_name, false))
{
// I'm not sure this is a good idea. JC
bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
//bool show_keep_discard = true;
switch(item->getType())
switch(asset_type)
{
case LLAssetType::AT_NOTECARD:
open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
@ -858,6 +861,11 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
return;
}
if(gSavedSettings.getBOOL("ShowInInventory") &&
asset_type != LLAssetType::AT_CALLINGCARD)
{
LLInventoryView::showAgentInventory(TRUE);
}
//Trash Check
LLUUID trash_id;
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
@ -1909,8 +1917,18 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
else
{
args["[NAME]"] = name;
LLNotifyBox::showXml("OfferFriendship", args,
&friendship_offer_callback, (void*)offer);
if(message.empty())
{
//support for frienship offers from clients before July 2008
LLNotifyBox::showXml("OfferFriendshipNoMessage", args,
&friendship_offer_callback, (void*)offer);
}
else
{
args["[MESSAGE]"] = message;
LLNotifyBox::showXml("OfferFriendship", args,
&friendship_offer_callback, (void*)offer);
}
}
}
break;
@ -2163,7 +2181,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
chat.mTime = LLFrameTimer::getElapsedSeconds();
BOOL is_self = (from_id == gAgent.getID());
BOOL is_busy = gAgent.getBusy();
BOOL is_muted = FALSE;
@ -2279,14 +2296,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
switch(chat.mChatType)
{
case CHAT_TYPE_WHISPER:
if (is_self)
{
verb = " whisper: ";
}
else
{
verb = " whispers: ";
}
verb = " " + LLTrans::getString("whisper") + " ";
break;
case CHAT_TYPE_DEBUG_MSG:
case CHAT_TYPE_OWNER:
@ -2294,14 +2304,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
verb = ": ";
break;
case CHAT_TYPE_SHOUT:
if (is_self)
{
verb = " shout: ";
}
else
{
verb = " shouts: ";
}
verb = " " + LLTrans::getString("shout") + " ";
break;
case CHAT_TYPE_START:
case CHAT_TYPE_STOP:
@ -2313,14 +2316,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
break;
}
if (is_self)
{
chat.mText = std::string("You");
}
else
{
chat.mText = from_name;
}
chat.mText = from_name;
chat.mText += verb;
chat.mText += mesg;
}
@ -2642,9 +2639,6 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
// gTeleportDisplay = TRUE;
// gTeleportDisplayTimer.reset();
// gViewerWindow->setShowProgress(TRUE);
// This could be first use of teleport, so test for that
LLFirstUse::useTeleport();
}
// stuff we have to do every time we get an AvatarInitComplete from a sim

View File

@ -472,7 +472,7 @@ public:
ypos += y_inc;
}
// only display these messages if we are actually rendering beacons at this moment
if (LLPipeline::getRenderBeacons(NULL) && LLPipeline::getProcessBeacons(NULL))
if (LLPipeline::getRenderBeacons(NULL) && gSavedSettings.getBOOL("BeaconAlwaysOn"))
{
if (LLPipeline::getRenderParticleBeacons(NULL))
{
@ -1398,7 +1398,7 @@ LLViewerWindow::LLViewerWindow(
// Default to application directory.
LLViewerWindow::sSnapshotBaseName = "Snapshot";
LLViewerWindow::sMovieBaseName = "SLmovie";
LLViewerWindow::sSnapshotDir.clear();
resetSnapshotLoc();
// create window
mWindow = LLWindowManager::createWindow(
@ -1746,8 +1746,6 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
adjust_rect_top_left("FloaterLandRect5", window);
adjust_rect_top_left("FloaterHUDRect2", window);
adjust_rect_top_left("FloaterFindRect2", window);
adjust_rect_top_left("FloaterGestureRect2", window);
@ -1769,8 +1767,26 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
r.getHeight());
gSavedSettings.setRect("FloaterInventoryRect", r);
}
// adjust_rect_top_left("FloaterHUDRect2", window);
// slightly off center to be left of the avatar.
r = gSavedSettings.getRect("FloaterHUDRect2");
r.setOriginAndSize(
window.getWidth()/3 - r.getWidth()/2,
window.getHeight()/2 - r.getHeight()/2,
r.getWidth(),
r.getHeight());
gSavedSettings.setRect("FloaterHUDRect2", r);
}
//Rectangles need to be adjusted after the window is constructed
//in order for proper centering to take place
void LLViewerWindow::adjustControlRectanglesForFirstUse(const LLRect& window)
{
adjust_rect_bottom_center("FloaterMoveRect2", window);
adjust_rect_top_center("FloaterCameraRect3", window);
}
void LLViewerWindow::initWorldUI()
{
@ -2678,13 +2694,6 @@ BOOL LLViewerWindow::handlePerFrameHover()
}
}
gPipeline.sRenderProcessBeacons = FALSE;
KEY key = gKeyboard->currentKey();
if (((mask & MASK_CONTROL) && ('N' == key || 'n' == key)) || gSavedSettings.getBOOL("BeaconAlwaysOn"))
{
gPipeline.sRenderProcessBeacons = TRUE;
}
BOOL handled = FALSE;
BOOL handled_by_top_ctrl = FALSE;
@ -3735,8 +3744,8 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image)
else
pick_type = LLFilePicker::FFSAVE_ALL; // ???
// Get a directory if this is the first time.
if (sSnapshotDir.empty())
// Get a base file location if needed.
if ( ! isSnapshotLocSet())
{
std::string proposed_name( sSnapshotBaseName );
proposed_name.append( extension );

View File

@ -136,7 +136,8 @@ public:
void initGLDefaults();
void initBase();
void adjustRectanglesForFirstUse(const LLRect& full_window);
void adjustRectanglesForFirstUse(const LLRect& window);
void adjustControlRectanglesForFirstUse(const LLRect& window);
void initWorldUI();
//
@ -280,8 +281,9 @@ public:
BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR);
BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE,
BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_IMAGE_SIZE );
BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) ;
BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); }
void resetSnapshotLoc() const { sSnapshotDir.clear(); }
BOOL saveImageNumbered(LLImageFormatted *image);
// Reset the directory where snapshots are saved.

View File

@ -179,7 +179,6 @@ void LLWorldMap::eraseItems()
mPGEvents.clear();
mMatureEvents.clear();
mLandForSale.clear();
mClassifieds.clear();
}
// mAgentLocationsMap.clear(); // persists
// mNumAgents.clear(); // persists
@ -310,11 +309,6 @@ void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer)
sendItemRequest(MAP_ITEM_LAND_FOR_SALE);
}
if (mClassifieds.size() == 0)
{
sendItemRequest(MAP_ITEM_CLASSIFIED);
}
clearImageRefs();
clearSimFlags();
}
@ -768,9 +762,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**)
}
case MAP_ITEM_CLASSIFIED: // classifieds
{
// HACK: Z-height is in Extra2 field.
new_item.mPosGlobal.mdV[VZ] = (F64)extra2;
LLWorldMap::getInstance()->mClassifieds.push_back(new_item);
//DEPRECATED: no longer used
break;
}
case MAP_ITEM_AGENT_LOCATIONS: // agent locations

View File

@ -192,7 +192,6 @@ public:
item_info_list_t mPGEvents;
item_info_list_t mMatureEvents;
item_info_list_t mLandForSale;
item_info_list_t mClassifieds;
std::map<U64,S32> mNumAgents;

View File

@ -717,11 +717,6 @@ void LLWorldMapView::draw()
drawGenericItems(LLWorldMap::getInstance()->mLandForSale, sForSaleImage);
}
if (gSavedSettings.getBOOL("MapShowClassifieds"))
{
drawGenericItems(LLWorldMap::getInstance()->mClassifieds, sClassifiedsImage);
}
if (gSavedSettings.getBOOL("MapShowEvents"))
{
drawEvents();
@ -1549,10 +1544,6 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask,
{
(*it).mSelected = FALSE;
}
for (it = LLWorldMap::getInstance()->mClassifieds.begin(); it != LLWorldMap::getInstance()->mClassifieds.end(); ++it)
{
(*it).mSelected = FALSE;
}
// Select event you clicked on
if (gSavedSettings.getBOOL("MapShowEvents"))
@ -1601,21 +1592,6 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask,
}
}
if (gSavedSettings.getBOOL("MapShowClassifieds"))
{
for (it = LLWorldMap::getInstance()->mClassifieds.begin(); it != LLWorldMap::getInstance()->mClassifieds.end(); ++it)
{
LLItemInfo& classified = *it;
if (checkItemHit(x, y, classified, id, true))
{
*hit_type = MAP_ITEM_CLASSIFIED;
mItemPicked = TRUE;
return;
}
}
}
// If we get here, we haven't clicked on an icon
gFloaterWorldMap->trackLocation(pos_global);

View File

@ -211,7 +211,6 @@ BOOL LLPipeline::sRenderParticleBeacons = FALSE;
BOOL LLPipeline::sRenderSoundBeacons = FALSE;
BOOL LLPipeline::sRenderBeacons = FALSE;
BOOL LLPipeline::sRenderHighlight = TRUE;
BOOL LLPipeline::sRenderProcessBeacons = FALSE;
S32 LLPipeline::sUseOcclusion = 0;
BOOL LLPipeline::sFastAlpha = TRUE;
BOOL LLPipeline::sDisableShaders = FALSE;
@ -2084,8 +2083,8 @@ void LLPipeline::postSort(LLCamera& camera)
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
}
// only render if the flag is set. The flag is only set if the right key is pressed, we are in edit mode or the toggle is set in the menus
if (sRenderProcessBeacons)
// only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus
if (gSavedSettings.getBOOL("BeaconAlwaysOn"))
{
if (sRenderScriptedTouchBeacons)
{
@ -3969,12 +3968,6 @@ BOOL LLPipeline::getRenderHighlights(void*)
return sRenderHighlight;
}
// static
BOOL LLPipeline::getProcessBeacons(void* data)
{
return sRenderProcessBeacons;
}
LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end,
S32* face_hit,
LLVector3* intersection, // return the intersection point

View File

@ -273,8 +273,6 @@ public:
static void toggleRenderHighlights(void* data);
static BOOL getRenderHighlights(void* data);
static BOOL getProcessBeacons(void* data);
private:
void unloadShaders();
void addToQuickLookup( LLDrawPool* new_poolp );
@ -550,7 +548,6 @@ protected:
public:
static BOOL sRenderBeacons;
static BOOL sRenderHighlight;
static BOOL sRenderProcessBeacons;
};
void render_bbox(const LLVector3 &min, const LLVector3 &max);