Merge branch 'DRTVWR-588-maint-W' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/llui/llkeywords.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llpreviewscript.cpp
#	indra/newview/llpreviewscript.h
#	indra/newview/llscripteditor.cpp
#	indra/newview/llscripteditor.h
#	indra/newview/skins/default/textures/textures.xml
#	indra/newview/skins/default/xui/en/panel_script_ed.xml
master
Ansariel 2023-08-02 12:43:03 +02:00
commit 3cd4077c73
19 changed files with 348 additions and 72 deletions

View File

@ -502,7 +502,7 @@ LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring");
// Walk through a string, applying the rules specified by the keyword token list and
// create a list of color segments.
void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor, LLTextEditor& editor)
void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLWString& wtext, LLTextEditor& editor, LLStyleConstSP style)
{
LL_RECORD_BLOCK_TIME(FTM_SYNTAX_COLORING);
seg_list->clear();
@ -515,10 +515,10 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
S32 text_len = wtext.size() + 1;
// <FS:Ansariel> Script editor ignoring font selection
//seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
LLStyleSP style = getDefaultStyle(editor);
style->setColor(defaultColor);
seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) );
//seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) );
LLStyleSP actual_style = getDefaultStyle(editor);
actual_style->setColor(style->getColor());
seg_list->push_back( new LLNormalTextSegment( actual_style, 0, text_len, editor ) );
// </FS:Ansariel>
const llwchar* base = wtext.c_str();
@ -534,7 +534,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), cur-base);
// </FS:Ansariel>
text_segment->setToken( 0 );
insertSegment( *seg_list, text_segment, text_len, defaultColor, editor);
insertSegment( *seg_list, text_segment, text_len, style, editor);
cur++;
if( !*cur || *cur == '\n' )
{
@ -572,7 +572,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
S32 seg_end = cur - base;
//create segments from seg_start to seg_end
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, style, editor);
line_done = TRUE; // to break out of second loop.
break;
}
@ -679,7 +679,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
seg_end = seg_start + between_delimiters + cur_delimiter->getLengthHead();
}
insertSegments(wtext, *seg_list,cur_delimiter, text_len, seg_start, seg_end, defaultColor, editor);
insertSegments(wtext, *seg_list,cur_delimiter, text_len, seg_start, seg_end, style, editor);
/*
// <FS:Ansariel> Script editor ignoring font selection
//LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_delimiter->getColor(), seg_start, seg_end, editor );
@ -723,7 +723,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
// LL_INFOS("SyntaxLSL") << "Seg: [" << word.c_str() << "]" << LL_ENDL;
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, style, editor);
}
cur += seg_len;
continue;
@ -738,9 +738,12 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
}
void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* cur_token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor )
void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* cur_token, S32 text_len, S32 seg_start, S32 seg_end, LLStyleConstSP style, LLTextEditor& editor )
{
std::string::size_type pos = wtext.find('\n',seg_start);
// <FS:Ansariel> Script editor ignoring font selection
//LLStyleConstSP cur_token_style = new LLStyle(LLStyle::Params().font(style->getFont()).color(cur_token->getColor()));
while (pos!=-1 && pos < (std::string::size_type)seg_end)
{
@ -753,7 +756,7 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmen
LLTextSegmentPtr text_segment = new LLNormalTextSegment( style, seg_start, pos, editor );
// </FS:Ansariel>
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
insertSegment( seg_list, text_segment, text_len, style, editor);
}
// <FS:Ansariel> Script editor ignoring font selection
@ -761,20 +764,20 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmen
LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), pos);
// </FS:Ansariel>
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
insertSegment( seg_list, text_segment, text_len, style, editor);
seg_start = pos+1;
pos = wtext.find('\n',seg_start);
}
// <FS:Ansariel> Script editor ignoring font selection
//LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor );
LLStyleSP style = getDefaultStyle(editor);
style->setColor(cur_token->getColor());
LLTextSegmentPtr text_segment = new LLNormalTextSegment( style, seg_start, seg_end, editor );
//LLTextSegmentPtr text_segment = new LLNormalTextSegment(cur_token_style, seg_start, seg_end, editor);
LLStyleSP actual_style = getDefaultStyle(editor);
actual_style->setColor(cur_token->getColor());
LLTextSegmentPtr text_segment = new LLNormalTextSegment(actual_style, seg_start, seg_end, editor);
// </FS:Ansariel>
text_segment->setToken( cur_token );
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
insertSegment( seg_list, text_segment, text_len, style, editor);
}
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor )
@ -803,6 +806,32 @@ void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSe
}
}
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, LLStyleConstSP style, LLTextEditor& editor )
{
LLTextSegmentPtr last = seg_list.back();
S32 new_seg_end = new_segment->getEnd();
if( new_segment->getStart() == last->getStart() )
{
seg_list.pop_back();
}
else
{
last->setEnd( new_segment->getStart() );
}
seg_list.push_back( new_segment );
if( new_seg_end < text_len )
{
// <FS:Ansariel> Script editor ignoring font selection
//seg_list.push_back( new LLNormalTextSegment( style, new_seg_end, text_len, editor ) );
LLStyleSP actual_style = getDefaultStyle(editor);
actual_style->setColor(style->getColor());
seg_list.push_back(new LLNormalTextSegment(actual_style, new_seg_end, text_len, editor));
// </FS:Ansariel>
}
}
// <FS:Ansariel> Re-add support for Cinder's legacy file format
bool LLKeywords::loadFromLegacyFile(const std::string& filename)
{

View File

@ -29,6 +29,7 @@
#include "lldir.h"
#include "llstyle.h"
#include "llstring.h"
#include "v3color.h"
#include "v4color.h"
@ -121,8 +122,8 @@ public:
void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
const LLWString& text,
const LLColor4 &defaultColor,
class LLTextEditor& editor);
class LLTextEditor& editor,
LLStyleConstSP style);
void initialize(LLSD SyntaxXML);
void processTokens();
@ -187,9 +188,11 @@ protected:
S32 text_len,
S32 seg_start,
S32 seg_end,
const LLColor4 &defaultColor,
LLStyleConstSP style,
LLTextEditor& editor);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, LLStyleConstSP style, LLTextEditor& editor );
bool mLoaded;
LLSD mSyntax;
word_token_map_t mWordTokenMap;

View File

@ -7754,6 +7754,17 @@
<key>Backup</key>
<integer>0</integer>
</map>
<key>LSLFontSizeName</key>
<map>
<key>Comment</key>
<string>UNUSED - Text font size in LSL editor</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>Monospace</string>
</map>
<key>GridStatusRSS</key>
<map>
<key>Comment</key>

View File

@ -446,6 +446,7 @@ public:
if (item)
{
LLFavoritesBarCtrl::sWaitingForCallabck = 0.f;
LLFavoritesOrderStorage::instance().setSortIndex(item, mSortField);
item->setComplete(TRUE);
@ -491,6 +492,9 @@ struct LLFavoritesSort
}
};
F64 LLFavoritesBarCtrl::sWaitingForCallabck = 0.f;
LLFavoritesBarCtrl::Params::Params()
: image_drag_indication("image_drag_indication"),
more_button("more_button"),
@ -510,7 +514,7 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
mShowDragMarker(FALSE),
mLandingTab(NULL),
mLastTab(NULL),
mTabsHighlightEnabled(TRUE),
mItemsListDirty(false),
mUpdateDropDownItems(true),
mRestoreOverflowMenu(false),
mGetPrevItems(true),
@ -765,6 +769,9 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
int sortField = 0;
LLPointer<LLItemCopiedCallback> cb;
const F64 CALLBACK_WAIT_TIME = 30.f;
sWaitingForCallabck = LLTimer::getTotalSeconds() + CALLBACK_WAIT_TIME;
// current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i)
{
@ -838,16 +845,22 @@ void LLFavoritesBarCtrl::changed(U32 mask)
LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID());
}
updateButtons();
if (!mItemsChangedTimer.getStarted())
{
mItemsChangedTimer.start();
}
else
{
mItemsChangedTimer.reset();
}
if (sWaitingForCallabck < LLTimer::getTotalSeconds())
{
updateButtons();
if (!mItemsChangedTimer.getStarted())
{
mItemsChangedTimer.start();
}
else
{
mItemsChangedTimer.reset();
}
}
else
{
mItemsListDirty = true;
}
}
}
@ -901,6 +914,18 @@ void LLFavoritesBarCtrl::draw()
mItemsChangedTimer.start();
}
if (mItemsListDirty && sWaitingForCallabck < LLTimer::getTotalSeconds())
{
updateButtons();
if (!mItemsChangedTimer.getStarted())
{
mItemsChangedTimer.start();
}
else
{
mItemsChangedTimer.reset();
}
}
}
const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
@ -929,6 +954,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update)
return;
}
mItemsListDirty = false;
mItems.clear();
if (!collectFavoriteItems(mItems))

View File

@ -56,6 +56,7 @@ public:
protected:
LLFavoritesBarCtrl(const Params&);
friend class LLUICtrlFactory;
friend class LLItemCopiedCallback;
public:
virtual ~LLFavoritesBarCtrl();
@ -87,7 +88,6 @@ protected:
void onButtonRightClick(LLUUID id,LLView* button,S32 x,S32 y,MASK mask);
void onButtonMouseDown(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
void onOverflowMenuItemMouseDown(LLUUID id, LLUICtrl* item, S32 x, S32 y, MASK mask);
void onButtonMouseUp(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
void onEndDrag();
@ -171,7 +171,8 @@ private:
BOOL mStartDrag;
LLInventoryModel::item_array_t mItems;
BOOL mTabsHighlightEnabled;
static F64 sWaitingForCallabck;
bool mItemsListDirty;
S32 mMouseX;
S32 mMouseY;

View File

@ -127,6 +127,7 @@
#include "llpresetsmanager.h"
#include "llviewercontrol.h"
#include "llpresetsmanager.h"
#include "llinventoryfunctions.h"
#include "llsearchableui.h"
#include "llperfstats.h"
@ -2970,25 +2971,6 @@ void LLFloaterPreference::onChangeMaturity()
getChild<LLIconCtrl>("rating_icon_adult")->setVisible(sim_access == SIM_ACCESS_ADULT);
}
std::string get_category_path(LLUUID cat_id)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
std::string localized_cat_name;
if (!LLTrans::findString(localized_cat_name, "InvFolder " + cat->getName()))
{
localized_cat_name = cat->getName();
}
if (cat->getParentUUID().notNull())
{
return get_category_path(cat->getParentUUID()) + " > " + localized_cat_name;
}
else
{
return localized_cat_name;
}
}
std::string get_category_path(LLFolderType::EType cat_type)
{
LLUUID cat_id = gInventory.findUserDefinedCategoryUUIDForType(cat_type);

View File

@ -2094,6 +2094,24 @@ void move_items_to_new_subfolder(const uuid_vec_t& selected_uuids, const std::st
}
std::string get_category_path(LLUUID cat_id)
{
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
std::string localized_cat_name;
if (!LLTrans::findString(localized_cat_name, "InvFolder " + cat->getName()))
{
localized_cat_name = cat->getName();
}
if (cat->getParentUUID().notNull())
{
return get_category_path(cat->getParentUUID()) + " > " + localized_cat_name;
}
else
{
return localized_cat_name;
}
}
///----------------------------------------------------------------------------
/// LLInventoryCollectFunctor implementations
///----------------------------------------------------------------------------

View File

@ -104,6 +104,7 @@ void move_items_to_new_subfolder(const uuid_vec_t& selected_uuids, const std::st
void move_items_to_folder(const LLUUID& new_cat_uuid, const uuid_vec_t& selected_uuids);
bool is_only_cats_selected(const uuid_vec_t& selected_uuids);
bool is_only_items_selected(const uuid_vec_t& selected_uuids);
std::string get_category_path(LLUUID cat_id);
/** Miscellaneous global functions
** **

View File

@ -87,6 +87,9 @@
#include "llexperiencecache.h"
#include "llfloaterexperienceprofile.h"
#include "llviewerassetupload.h"
//#include "lltoggleablemenu.h" // <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//#include "llmenubutton.h" // <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
#include "llinventoryfunctions.h"
#include "llloadingindicator.h" // <FS:Kadah> Compile indicator
#include "lliconctrl.h" // <FS:Kadah> Compile indicator
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
@ -587,6 +590,15 @@ BOOL LLScriptEdCore::postBuild()
LLSyntaxIdLSL::getInstance()->initialize();
processKeywords();
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//mCommitCallbackRegistrar.add("FontSize.Set", boost::bind(&LLScriptEdCore::onChangeFontSize, this, _2));
//mEnableCallbackRegistrar.add("FontSize.Check", boost::bind(&LLScriptEdCore::isFontSizeChecked, this, _2));
//LLToggleableMenu *context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
// "menu_lsl_font_size.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
//getChild<LLMenuButton>("font_btn")->setMenu(context_menu, LLMenuButton::MP_BOTTOM_LEFT, true);
// </FS:Ansariel>
return TRUE;
}
@ -1834,6 +1846,20 @@ LLUUID LLScriptEdCore::getAssociatedExperience()const
}
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//void LLScriptEdCore::onChangeFontSize(const LLSD &userdata)
//{
// const std::string font_name = userdata.asString();
// gSavedSettings.setString("LSLFontSizeName", font_name);
//}
//
//bool LLScriptEdCore::isFontSizeChecked(const LLSD &userdata)
//{
// const std::string current_size_name = LLScriptEditor::getScriptFontSize();
// const std::string size_name = userdata.asString();
//
// return (size_name == current_size_name);
//}
void LLScriptEdCore::onFontChanged()
{
LLFontGL* font = LLFontGL::getFont(LLFontDescriptor(gSavedSettings.getString("FSScriptingFontName"), gSavedSettings.getString("FSScriptingFontSize"), LLFontGL::NORMAL));
@ -2111,6 +2137,21 @@ bool LLScriptEdContainer::onExternalChange(const std::string& filename)
return true;
}
BOOL LLScriptEdContainer::handleKeyHere(KEY key, MASK mask)
{
if (('A' == key) && (MASK_CONTROL == (mask & MASK_MODIFIERS)))
{
mScriptEd->selectAll();
return TRUE;
}
if (!LLPreview::handleKeyHere(key, mask))
{
return mScriptEd->handleKeyHere(key, mask);
}
return TRUE;
}
// <FS:Ansariel> FIRE-16740: Color syntax highlighting changes don't immediately appear in script window
void LLScriptEdContainer::updateStyle()
{
@ -2174,10 +2215,14 @@ BOOL LLPreviewLSL::postBuild()
if (item)
{
getChild<LLUICtrl>("desc")->setValue(item->getDescription());
std::string item_path = get_category_path(item->getParentUUID());
getChild<LLUICtrl>("path_txt")->setValue(item_path);
getChild<LLUICtrl>("path_txt")->setToolTip(item_path);
}
childSetCommitCallback("desc", LLPreview::onText, this);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
return LLPreview::postBuild();
}

View File

@ -36,6 +36,7 @@
#include "llfloatergotoline.h"
#include "lllivefile.h"
#include "llsyntaxid.h"
#include "llscripteditor.h"
#include <boost/signals2.hpp>
class LLLiveLSLFile;
@ -167,7 +168,15 @@ public:
void setAssetID( const LLUUID& asset_id){ mAssetID = asset_id; };
LLUUID getAssetID() { return mAssetID; }
private:
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//bool isFontSizeChecked(const LLSD &userdata);
//void onChangeFontSize(const LLSD &size_name);
// </FS:Ansarie>
virtual BOOL handleKeyHere(KEY key, MASK mask);
void selectAll() { mEditor->selectAll(); }
private:
// NaCl - LSL Preprocessor
void onToggleProc();
boost::signals2::connection mTogglePreprocConnection;
@ -186,8 +195,6 @@ private: // <FS:Ansariel> Show keyword help on F1
void selectFirstError();
virtual BOOL handleKeyHere(KEY key, MASK mask);
void enableSave(BOOL b) {mEnableSave = b;}
// <FS:CR> Advanced Script Editor
@ -287,6 +294,8 @@ public:
// <FS:Ansariel> FIRE-16740: Color syntax highlighting changes don't immediately appear in script window
void updateStyle();
BOOL handleKeyHere(KEY key, MASK mask);
protected:
std::string getTmpFileName(const std::string& script_name);
// [SL:KB] - Patch: Build-ScriptRecover | Checked: 2011-11-23 (Catznip-3.2.0) | Added: Catznip-3.2.0

View File

@ -30,6 +30,7 @@
#include "llsyntaxid.h"
#include "lllocalcliprect.h"
#include "llviewercontrol.h"
#include "llpreviewscript.h"
@ -40,13 +41,15 @@ const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 40;
static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor");
LLScriptEditor::Params::Params()
: show_line_numbers("show_line_numbers", true)
: show_line_numbers("show_line_numbers", true),
default_font_size("default_font_size", false)
{}
LLScriptEditor::LLScriptEditor(const Params& p)
: LLTextEditor(p)
, mShowLineNumbers(p.show_line_numbers)
, mShowLineNumbers(p.show_line_numbers),
mUseDefaultFontSize(p.default_font_size)
{
if (mShowLineNumbers)
{
@ -55,6 +58,13 @@ LLScriptEditor::LLScriptEditor(const Params& p)
}
}
BOOL LLScriptEditor::postBuild()
{
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//gSavedSettings.getControl("LSLFontSizeName")->getCommitSignal()->connect(boost::bind(&LLScriptEditor::onFontSizeChange, this));
return LLTextEditor::postBuild();
}
void LLScriptEditor::draw()
{
{
@ -117,15 +127,11 @@ void LLScriptEditor::drawLineNumbers()
// draw the line numbers
if(line.mLineNum != last_line_num && line.mRect.mTop <= scrolled_view_rect.mTop)
{
// <FS:Ansariel> Script editor ignoring font selection
//const LLFontGL *num_font = LLFontGL::getFontMonospace();
const LLFontGL *num_font = getFont();
// </FS:Ansariel>
const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
BOOL is_cur_line = cursor_line == line.mLineNum;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
num_font->render(
getFont()->render(
ltext, // string to draw
0, // begin offset
UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x
@ -153,8 +159,12 @@ void LLScriptEditor::loadKeywords()
LL_PROFILE_ZONE_SCOPED;
mKeywords.processTokens();
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getScriptFont()).color(mDefaultColor.get()));
LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getFont()).color(mDefaultColor.get()));
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
mKeywords.findSegments(&segment_list, getWText(), *this, style);
mSegments.clear();
segment_set_t::iterator insert_it = mSegments.begin();
@ -180,7 +190,8 @@ void LLScriptEditor::loadKeywords(const std::string& filename,
mKeywords.addToken(LLKeywordToken::TT_WORD, name, color, tooltips[i] );
}
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getFont()).color(mDefaultColor.get()));
mKeywords.findSegments(&segment_list, getWText(), *this, style);
mSegments.clear();
segment_set_t::iterator insert_it = mSegments.begin();
@ -197,9 +208,14 @@ void LLScriptEditor::updateSegments()
if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
{
LL_PROFILE_ZONE_SCOPED;
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getScriptFont()).color(mDefaultColor.get()));
LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getFont()).color(mDefaultColor.get()));
// HACK: No non-ascii keywords for now
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
mKeywords.findSegments(&segment_list, getWText(), *this, style);
clearSegments();
for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
@ -250,6 +266,28 @@ void LLScriptEditor::drawSelectionBackground()
}
}
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//std::string LLScriptEditor::getScriptFontSize()
//{
// static LLCachedControl<std::string> size_name(gSavedSettings, "LSLFontSizeName", "Monospace");
// return size_name;
//}
//
//LLFontGL* LLScriptEditor::getScriptFont()
//{
// std::string font_size_name = mUseDefaultFontSize ? "Monospace" : getScriptFontSize();
// return LLFontGL::getFont(LLFontDescriptor("Monospace", font_size_name, 0));
//}
//
//void LLScriptEditor::onFontSizeChange()
//{
// if (!mUseDefaultFontSize)
// {
// needsReflow();
// }
//}
// </FS:Ansariel>
// <FS> Improved Home-key behavior
//virtual
void LLScriptEditor::startOfLine()

View File

@ -37,7 +37,7 @@ public:
struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>
{
Optional<bool> show_line_numbers;
Optional<bool> default_font_size;
Params();
};
@ -45,6 +45,7 @@ public:
// LLView override
virtual void draw();
BOOL postBuild();
// <FS> Improved Home-key behavior
// LLTextBase override
@ -56,7 +57,13 @@ public:
LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
// <FS:Ansariel> Re-add legacy format support
// <FS:Ansariel> FIRE-20818: User-selectable font and size for script editor
//static std::string getScriptFontSize();
//LLFontGL* getScriptFont();
//void onFontSizeChange();
// <FS:Ansariel>
// <FS:Ansariel> Re-add legacy format support
void loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
const std::vector<std::string>& tooltips,
@ -80,6 +87,7 @@ private:
LLKeywords mKeywords;
bool mShowLineNumbers;
bool mUseDefaultFontSize;
};
#endif // LL_SCRIPTEDITOR_H

View File

@ -7400,6 +7400,22 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
args["OBJECTNAME"] = object_name;
args["NAME"] = clean_owner_name;
S32 known_questions = 0;
// SL-19346, SL-19528 - No DEBIT warning for GRID & PRIVILEGED
if (experienceid.notNull())
{
const LLSD& experience = LLExperienceCache::instance().get(experienceid);
if (!experience.isUndefined())
{
S32 properties = experience[LLExperienceCache::PROPERTIES].asInteger();
if ((properties | LLExperienceCache::PROPERTY_GRID) &&
(properties | LLExperienceCache::PROPERTY_PRIVILEGED))
{
questions ^= SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit;
}
}
}
bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit;
// check the received permission flags against each permission
BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1055,6 +1055,9 @@ with the same filename but different name
<texture name="System_Notification" file_name="icons/SL_Logo.png" preload="true"/>
<texture name="Icon_Attachment_Small" file_name="icons/Icon_Attachment_Small.png" preload="true"/>
<texture name="Icon_Attachment_Large" file_name="icons/Icon_Attachment_Large.png" preload="true"/>
<texture name="Icon_Color_Palette" file_name="icons/Icon_Color_Palette.png" preload="false"/>
<texture name="Icon_Font_Size" file_name="icons/Icon_Font_Size.png" preload="false"/>
<!-- StarLight Textures -->

View File

@ -2,10 +2,10 @@
<floater
legacy_header_height="18"
can_resize="true"
height="570"
height="593"
layout="topleft"
min_height="271"
min_width="290"
min_width="320"
name="preview lsl text"
help_topic="preview_lsl_text"
save_rect="true"
@ -21,7 +21,7 @@
layout="topleft"
left="10"
name="script panel"
top="42"
top="65"
width="497" />
<icon
follows="top|right"
@ -33,6 +33,20 @@
name="lock"
top="1"
width="18" />
<text
type="string"
length="1"
follows="left|top|right"
width="490"
use_ellipses="true"
font="SansSerif"
height="19"
layout="topleft"
left="13"
name="path_txt"
text_color="white"
top="21">
</text>
<text
type="string"
length="1"
@ -42,7 +56,7 @@
layout="topleft"
left="13"
name="desc txt"
top="19"
top_pad="5"
width="80">
Description:
</text>

View File

@ -170,4 +170,12 @@
comment="Size of small font (points, or 1/72 of an inch)"
size="7.6"
/>
<font_size name="SmallLSL"
comment="Size of small font for LSL editor (points, or 1/72 of an inch)"
size="7"
/>
<font_size name="HugeLSL"
comment="Size of huge font for LSL editor (points, or 1/72 of an inch)"
size="12"
/>
</fonts>

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<toggleable_menu
bottom="806"
layout="topleft"
left="0"
mouse_opaque="false"
name="menu_font_size"
visible="false">
<menu_item_check
label="Small"
layout="topleft"
name="font_small">
<on_click
function="FontSize.Set"
parameter="SmallLSL" />
<on_check
function="FontSize.Check"
parameter="SmallLSL" />
</menu_item_check>
<menu_item_check
label="Default"
layout="topleft"
name="font_monospace">
<on_click
function="FontSize.Set"
parameter="Monospace" />
<on_check
function="FontSize.Check"
parameter="Monospace" />
</menu_item_check>
<menu_item_check
label="Medium"
layout="topleft"
name="font_medium">
<on_click
function="FontSize.Set"
parameter="Medium" />
<on_check
function="FontSize.Check"
parameter="Medium" />
</menu_item_check>
<menu_item_check
label="Large"
layout="topleft"
name="font_large">
<on_click
function="FontSize.Set"
parameter="Large" />
<on_check
function="FontSize.Check"
parameter="Large" />
</menu_item_check>
<menu_item_check
label="Huge"
layout="topleft"
name="font_huge">
<on_click
function="FontSize.Set"
parameter="HugeLSL" />
<on_check
function="FontSize.Check"
parameter="HugeLSL" />
</menu_item_check>
</toggleable_menu>