llrender and lldir merge. Removed duplicate assets from skins. cleaned up skin textures.xml files to only include changes from default.
This commit is contained in:
@@ -466,7 +466,7 @@ void LLMultiSlider::draw()
|
||||
F32 opacity = getEnabled() ? 1.f : 0.3f;
|
||||
|
||||
// Track
|
||||
LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr thumb_imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2;
|
||||
LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset );
|
||||
|
||||
@@ -1297,14 +1297,20 @@ LLXMLNodePtr LLNotificationTemplates::checkForXMLTemplate(LLXMLNodePtr item)
|
||||
|
||||
bool LLNotificationTemplates::loadTemplates()
|
||||
{
|
||||
const std::string xml_filename = "notifications.xml";
|
||||
LL_INFOS() << "Reading notifications template" << LL_ENDL;
|
||||
// Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it
|
||||
// output all relevant pathnames instead of just the ones from the most
|
||||
// specific skin.
|
||||
std::vector<std::string> search_paths =
|
||||
gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS);
|
||||
|
||||
std::string base_filename = search_paths.front();
|
||||
LLXMLNodePtr root;
|
||||
|
||||
BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
|
||||
BOOL success = LLXMLNode::getLayeredXMLNode(root, search_paths);
|
||||
|
||||
if (!success || root.isNull() || !root->hasName( "notifications" ))
|
||||
{
|
||||
LL_ERRS() << "Problem reading UI Notifications file: " << xml_filename << LL_ENDL;
|
||||
LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1337,7 +1343,7 @@ bool LLNotificationTemplates::loadTemplates()
|
||||
if (!item->hasName("notification"))
|
||||
{
|
||||
LL_WARNS() << "Unexpected entity " << item->getName()->mString <<
|
||||
" found in " << xml_filename << LL_ENDL;
|
||||
" found in notifications.xml [language=]" << LLUI::getLanguage() << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1347,14 +1353,20 @@ bool LLNotificationTemplates::loadTemplates()
|
||||
|
||||
bool LLNotifications::loadNotifications()
|
||||
{
|
||||
const std::string xml_filename = "notifications.xml";
|
||||
LL_INFOS() << "Reading notifications template" << LL_ENDL;
|
||||
// Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it
|
||||
// output all relevant pathnames instead of just the ones from the most
|
||||
// specific skin.
|
||||
std::vector<std::string> search_paths =
|
||||
gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS);
|
||||
|
||||
std::string base_filename = search_paths.front();
|
||||
LLXMLNodePtr root;
|
||||
|
||||
BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
|
||||
BOOL success = LLXMLNode::getLayeredXMLNode(root, search_paths);
|
||||
|
||||
if (!success || root.isNull() || !root->hasName( "notifications" ))
|
||||
{
|
||||
LL_ERRS() << "Problem reading UI Notifications file: " << xml_filename << LL_ENDL;
|
||||
LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,8 +92,9 @@
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include <boost/range.hpp>
|
||||
// we want to minimize external dependencies, but this one is important
|
||||
#include "llsd.h"
|
||||
#include "llinstancetracker.h"
|
||||
@@ -102,6 +103,7 @@
|
||||
#include "llavatarname.h"
|
||||
#include "llevents.h"
|
||||
#include "llfunctorregistry.h"
|
||||
#include "llinitparam.h"
|
||||
#include "llui.h"
|
||||
#include "llxmlnode.h"
|
||||
#include "llnotificationptr.h"
|
||||
@@ -131,6 +133,70 @@ class LLNotificationForm
|
||||
LOG_CLASS(LLNotificationForm);
|
||||
|
||||
public:
|
||||
struct FormElementBase : public LLInitParam::Block<FormElementBase>
|
||||
{
|
||||
Optional<std::string> name;
|
||||
Optional<bool> enabled;
|
||||
|
||||
FormElementBase();
|
||||
};
|
||||
|
||||
struct FormIgnore : public LLInitParam::Block<FormIgnore, FormElementBase>
|
||||
{
|
||||
Optional<std::string> text;
|
||||
Optional<bool> save_option;
|
||||
Optional<std::string> control;
|
||||
Optional<bool> invert_control;
|
||||
|
||||
FormIgnore();
|
||||
};
|
||||
|
||||
struct FormButton : public LLInitParam::Block<FormButton, FormElementBase>
|
||||
{
|
||||
Mandatory<S32> index;
|
||||
Mandatory<std::string> text;
|
||||
Optional<std::string> ignore;
|
||||
Optional<bool> is_default;
|
||||
|
||||
Mandatory<std::string> type;
|
||||
|
||||
FormButton();
|
||||
};
|
||||
|
||||
struct FormInput : public LLInitParam::Block<FormInput, FormElementBase>
|
||||
{
|
||||
Mandatory<std::string> type;
|
||||
Optional<S32> width;
|
||||
Optional<S32> max_length_chars;
|
||||
Optional<std::string> text;
|
||||
|
||||
Optional<std::string> value;
|
||||
FormInput();
|
||||
};
|
||||
|
||||
struct FormElement : public LLInitParam::ChoiceBlock<FormElement>
|
||||
{
|
||||
Alternative<FormButton> button;
|
||||
Alternative<FormInput> input;
|
||||
|
||||
FormElement();
|
||||
};
|
||||
|
||||
struct FormElements : public LLInitParam::Block<FormElements>
|
||||
{
|
||||
Multiple<FormElement> elements;
|
||||
FormElements();
|
||||
};
|
||||
|
||||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
Optional<std::string> name;
|
||||
Optional<FormIgnore> ignore;
|
||||
Optional<FormElements> form_elements;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
||||
typedef enum e_ignore_type
|
||||
{
|
||||
IGNORE_NO,
|
||||
|
||||
@@ -48,16 +48,16 @@
|
||||
static LLRegisterWidget<LLProgressBar> r("progress_bar");
|
||||
|
||||
LLProgressBar::LLProgressBar(const std::string& name, const LLRect &rect)
|
||||
: LLView(name, rect, FALSE),
|
||||
mImageBar( NULL ),
|
||||
mImageShadow( NULL )
|
||||
: LLView(name, rect, FALSE)
|
||||
//mImageBar( NULL ),
|
||||
// mImageShadow( NULL )
|
||||
{
|
||||
mPercentDone = 0.f;
|
||||
|
||||
// Defaults:
|
||||
|
||||
setImageBar("rounded_square.tga");
|
||||
setImageShadow("rounded_square_soft.tga");
|
||||
setImageBar("Rounded_Square");
|
||||
setImageShadow("Rounded_Square_Soft");
|
||||
|
||||
mColorBackground = LLColor4(0.3254f, 0.4000f, 0.5058f, 1.0f);
|
||||
mColorBar = LLColor4(0.5764f, 0.6627f, 0.8352f, 1.0f);
|
||||
@@ -75,10 +75,8 @@ void LLProgressBar::draw()
|
||||
static LLTimer timer;
|
||||
F32 alpha = getDrawContext().mAlpha;
|
||||
|
||||
//LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga");
|
||||
LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga");
|
||||
LLUIImagePtr bar_bg_imagep = LLUI::getUIImage("progressbar_track.tga");
|
||||
//LLUIImagePtr bar_imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("ProgressBar");
|
||||
LLUIImagePtr bar_bg_imagep = LLUI::getUIImage("ProgressTrack");
|
||||
LLColor4 background_color = LLUI::sColorsGroup->getColor("LoginProgressBarBgColor");
|
||||
|
||||
bar_bg_imagep->draw(getLocalRect(), background_color % alpha);
|
||||
@@ -95,12 +93,12 @@ void LLProgressBar::setPercent(const F32 percent)
|
||||
|
||||
void LLProgressBar::setImageBar( const std::string &bar_name )
|
||||
{
|
||||
mImageBar = LLUI::getUIImage(bar_name)->getImage();
|
||||
//mImageBar = LLUI::getUIImage(bar_name)->getImage();
|
||||
}
|
||||
|
||||
void LLProgressBar::setImageShadow(const std::string &shadow_name)
|
||||
{
|
||||
mImageShadow = LLUI::getUIImage(shadow_name)->getImage();
|
||||
//mImageShadow = LLUI::getUIImage(shadow_name)->getImage();
|
||||
}
|
||||
|
||||
void LLProgressBar::setColorBar(const LLColor4 &c)
|
||||
@@ -140,14 +138,14 @@ LLView* LLProgressBar::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
|
||||
LLProgressBar *progress = new LLProgressBar(name, LLRect());
|
||||
|
||||
|
||||
std::string image_bar;
|
||||
/*std::string image_bar;
|
||||
if (node->hasAttribute("image_bar")) node->getAttributeString("image_bar",image_bar);
|
||||
if (image_bar != LLStringUtil::null) progress->setImageBar(image_bar);
|
||||
|
||||
|
||||
std::string image_shadow;
|
||||
if (node->hasAttribute("image_shadow")) node->getAttributeString("image_shadow",image_shadow);
|
||||
if (image_shadow != LLStringUtil::null) progress->setImageShadow(image_shadow);
|
||||
if (image_shadow != LLStringUtil::null) progress->setImageShadow(image_shadow);*/
|
||||
|
||||
|
||||
LLColor4 color_bar;
|
||||
|
||||
@@ -62,13 +62,13 @@ public:
|
||||
protected:
|
||||
F32 mPercentDone;
|
||||
|
||||
LLPointer<LLTexture> mImageBar;
|
||||
//<LLTexture> mImageBar;
|
||||
//LLUUID mImageBarID;
|
||||
//LLString mImageBarName;
|
||||
LLColor4 mColorBar;
|
||||
LLColor4 mColorBar2;
|
||||
|
||||
LLPointer<LLTexture> mImageShadow;
|
||||
//LLPointer<LLTexture> mImageShadow;
|
||||
//LLUUID mImageShadowID;
|
||||
//LLString mImageShadowName;
|
||||
LLColor4 mColorShadow;
|
||||
|
||||
@@ -511,7 +511,7 @@ void LLScrollbar::draw()
|
||||
|
||||
|
||||
// Draw background and thumb.
|
||||
LLUIImage* rounded_rect_imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImage* rounded_rect_imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
if (!rounded_rect_imagep)
|
||||
{
|
||||
|
||||
@@ -203,7 +203,7 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p)
|
||||
// initialize rounded rect image
|
||||
if (!mRoundedRectImage)
|
||||
{
|
||||
mRoundedRectImage = LLUI::getUIImage("rounded_square.tga");
|
||||
mRoundedRectImage = LLUI::getUIImage("Rounded_Square");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,9 @@ LLSlider::LLSlider(
|
||||
mMouseDownSignal( NULL ),
|
||||
mMouseUpSignal( NULL )
|
||||
{
|
||||
mThumbImage = LLUI::getUIImage("icn_slide-thumb_dark.tga");
|
||||
mTrackImage = LLUI::getUIImage("icn_slide-groove_dark.tga");
|
||||
mTrackHighlightImage = LLUI::getUIImage("icn_slide-highlight.tga");
|
||||
mThumbImage = LLUI::getUIImage("SliderThumb_Off");
|
||||
mTrackImage = LLUI::getUIImage("SliderTrack_Horiz");
|
||||
mTrackHighlightImage = LLUI::getUIImage("SliderTrack_Horiz_Highlight");
|
||||
|
||||
// properly handle setting the starting thumb rect
|
||||
// do it this way to handle both the operating-on-settings
|
||||
|
||||
@@ -223,32 +223,33 @@ std::string LLUI::getLanguage()
|
||||
//static
|
||||
std::string LLUI::locateSkin(const std::string& filename)
|
||||
{
|
||||
std::string slash = gDirUtilp->getDirDelimiter();
|
||||
std::string found_file = filename;
|
||||
if (!gDirUtilp->fileExists(found_file))
|
||||
if (gDirUtilp->fileExists(found_file))
|
||||
{
|
||||
found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS?
|
||||
return found_file;
|
||||
}
|
||||
if (sConfigGroup && sConfigGroup->controlExists("Language"))
|
||||
|
||||
found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS?
|
||||
if (gDirUtilp->fileExists(found_file))
|
||||
{
|
||||
if (!gDirUtilp->fileExists(found_file))
|
||||
{
|
||||
std::string localization = getLanguage();
|
||||
std::string local_skin = "xui" + slash + localization + slash + filename;
|
||||
found_file = gDirUtilp->findSkinnedFilename(local_skin);
|
||||
}
|
||||
return found_file;
|
||||
}
|
||||
if (!gDirUtilp->fileExists(found_file))
|
||||
|
||||
found_file = gDirUtilp->findSkinnedFilename(LLDir::XUI, filename);
|
||||
if (! found_file.empty())
|
||||
{
|
||||
std::string local_skin = "xui" + slash + "en-us" + slash + filename;
|
||||
found_file = gDirUtilp->findSkinnedFilename(local_skin);
|
||||
return found_file;
|
||||
}
|
||||
if (!gDirUtilp->fileExists(found_file))
|
||||
|
||||
found_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, filename);
|
||||
if (gDirUtilp->fileExists(found_file))
|
||||
{
|
||||
found_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, filename);
|
||||
return found_file;
|
||||
}
|
||||
return found_file;
|
||||
}
|
||||
LL_WARNS("LLUI") << "Can't find '" << filename
|
||||
<< "' in user settings, any skin directory or app_settings" << LL_ENDL;
|
||||
return "";
|
||||
}
|
||||
|
||||
//static
|
||||
LLVector2 LLUI::getWindowSize()
|
||||
|
||||
@@ -174,7 +174,7 @@ const std::vector<std::string>& LLUICtrlFactory::getXUIPaths()
|
||||
//-----------------------------------------------------------------------------
|
||||
bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root)
|
||||
{
|
||||
std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename);
|
||||
std::string full_filename = gDirUtilp->findSkinnedFilenameBaseLang(LLDir::XUI, xui_filename);
|
||||
if (full_filename.empty())
|
||||
{
|
||||
// try filename as passed in since sometimes we load an xml file from a user-supplied path
|
||||
@@ -194,29 +194,21 @@ bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNo
|
||||
LL_WARNS() << "Problem reading UI description file: " << full_filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> paths =
|
||||
gDirUtilp->findSkinnedFilenames(LLDir::XUI, xui_filename);
|
||||
|
||||
LLXMLNodePtr updateRoot;
|
||||
|
||||
std::vector<std::string>::const_iterator itor;
|
||||
|
||||
for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor)
|
||||
for ( auto& layer_filename : paths )
|
||||
{
|
||||
std::string nodeName;
|
||||
std::string updateName;
|
||||
|
||||
std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename);
|
||||
if(layer_filename.empty())
|
||||
{
|
||||
// no localized version of this file, that's ok, keep looking
|
||||
continue;
|
||||
}
|
||||
|
||||
LLXMLNodePtr updateRoot;
|
||||
if (!LLXMLNode::parseFile(layer_filename, updateRoot, NULL))
|
||||
{
|
||||
LL_WARNS() << "Problem reading localized UI description file: " << (*itor) + gDirUtilp->getDirDelimiter() + xui_filename << LL_ENDL;
|
||||
LL_WARNS() << "Problem reading localized UI description file: " << layer_filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string updateName;
|
||||
std::string nodeName;
|
||||
updateRoot->getAttributeString("name", updateName);
|
||||
root->getAttributeString("name", nodeName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user