Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-07-23 14:53:47 +02:00
12 changed files with 102 additions and 76 deletions

View File

@@ -558,7 +558,9 @@ void LLPanel::initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory)
child->getAttributeString("name", string_name);
if (!string_name.empty())
{
mUIStrings[string_name] = child->getTextContents();
std::string contents = child->getTextContents();
child->getAttributeString("value", contents);
mUIStrings[string_name] = contents;
}
}
else

View File

@@ -2616,9 +2616,17 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
if (child->getAttributeString("sort", sortname))
columns[index]["sort"] = sortname;
BOOL sort_ascending = true;
if (child->getAttributeBOOL("sort_ascending", sort_ascending))
std::string sort_direction("ascending");
if (child->getAttributeString("sort_direction", sort_direction))
{
columns[index]["sort_direction"] = sort_direction;
}
else // Singu Note: if a scroll list does not provide sort_direction, provide sort_ascending to sort as expected
{
bool sort_ascending = true;
child->getAttribute_bool("sort_ascending", sort_ascending);
columns[index]["sort_ascending"] = sort_ascending;
}
S32 columnwidth = -1;
if (child->getAttributeS32("width", columnwidth))

View File

@@ -2116,6 +2116,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AppearanceSpecialLighting</key>
<map>
<key>Comment</key>
<string>When in appearance editing mode, avatar is shown with special lighting</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>1</boolean>
</map>
<key>ApplyColorImmediately</key>
<map>
<key>Comment</key>

View File

@@ -2080,13 +2080,11 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new,
void LLAppearanceMgr::updatePanelOutfitName(const std::string& name)
{
// MULTI-WEARABLE TODO
/*LLSidepanelAppearance* panel_appearance =
dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance"));
LLFloaterCustomize* panel_appearance = LLFloaterCustomize::instanceExists() ? LLFloaterCustomize::getInstance() : NULL;
if (panel_appearance)
{
panel_appearance->refreshCurrentOutfitName(name);
}*/
}
}
void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter)

View File

@@ -32,53 +32,25 @@
#include "llviewerprecompiledheaders.h"
#include "llimagejpeg.h"
#include "llfloatercustomize.h"
#include "llfontgl.h"
#include "llbutton.h"
#include "lliconctrl.h"
#include "llresmgr.h"
#include "llmorphview.h"
#include "llfloatertools.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "lltoolmorph.h"
#include "llvoavatarself.h"
#include "llradiogroup.h"
#include "lltoolmgr.h"
#include "llviewermenu.h"
#include "llappearancemgr.h"
#include "llmakeoutfitdialog.h"
#include "llmorphview.h"
#include "llnotificationsutil.h"
#include "lloutfitobserver.h"
#include "llpaneleditwearable.h"
#include "llscrollcontainer.h"
#include "llscrollingpanelparam.h"
#include "llsliderctrl.h"
#include "llviewerwindow.h"
#include "llinventoryfunctions.h"
#include "llinventoryobserver.h"
#include "llinventoryicon.h"
#include "lltextbox.h"
#include "lllineeditor.h"
#include "llviewertexturelist.h"
#include "llfocusmgr.h"
#include "llviewerwindow.h"
#include "llviewercamera.h"
#include "llappearance.h"
#include "imageids.h"
#include "llassetstorage.h"
#include "lltexturectrl.h"
#include "lltextureentry.h"
#include "llwearablelist.h"
#include "llviewerinventory.h"
#include "lldbstrings.h"
#include "llcolorswatch.h"
#include "llglheaders.h"
#include "llui.h"
#include "llviewermessage.h"
#include "llviewercontrol.h"
#include "lltoolmorph.h"
#include "lluictrlfactory.h"
#include "llnotificationsutil.h"
#include "llpaneleditwearable.h"
#include "llmakeoutfitdialog.h"
#include "llagentcamera.h"
#include "llappearancemgr.h"
#include "llviewerinventory.h"
#include "llviewerwearable.h"
#include "llvoavatarself.h"
#include "statemachine/aifilepicker.h"
#include "llxmltree.h"
@@ -158,6 +130,11 @@ LLFloaterCustomize::LLFloaterCustomize()
mInventoryObserver = new LLFloaterCustomizeObserver(this);
gInventory.addObserver(mInventoryObserver);
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
outfit_observer.addBOFReplacedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
outfit_observer.addBOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
outfit_observer.addCOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
LLCallbackMap::map_t factory_map;
const std::string &invalid_name = LLWearableType::getTypeName(LLWearableType::WT_INVALID);
for(U32 type=LLWearableType::WT_SHAPE;type<LLWearableType::WT_INVALID;++type)
@@ -192,6 +169,7 @@ BOOL LLFloaterCustomize::postBuild()
{
getChild<LLUICtrl>("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this));
getChild<LLUICtrl>("Save Outfit")->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance()));
refreshCurrentOutfitName(); // Initialize tooltip for save outfit button
getChild<LLUICtrl>("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this));
getChild<LLUICtrl>("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
@@ -225,6 +203,44 @@ BOOL LLFloaterCustomize::postBuild()
return TRUE;
}
void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name)
{
LLUICtrl* save_outfit_btn = getChild<LLUICtrl>("Save Outfit");
// Set current outfit status (wearing/unsaved).
bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
//std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing");
//mOutfitStatus->setText(cof_status_str);
save_outfit_btn->setEnabled(dirty); // No use saving unless dirty
if (name == "")
{
std::string outfit_name;
if (LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name))
{
//mCurrentLookName->setText(outfit_name);
LLStringUtil::format_map_t args;
args["[OUTFIT]"] = outfit_name;
save_outfit_btn->setToolTip(getString("Save changes to", args));
return;
}
std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit";
//mCurrentLookName->setText(getString(string_name));
save_outfit_btn->setToolTip(getString(string_name));
//mOpenOutfitBtn->setEnabled(FALSE);
save_outfit_btn->setEnabled(false); // Can't save right now
}
else
{
//mCurrentLookName->setText(name);
LLStringUtil::format_map_t args;
args["[OUTFIT]"] = name;
save_outfit_btn->setToolTip(getString("Save changes to", args));
// Can't just call update verbs since the folder link may not have been created yet.
//mOpenOutfitBtn->setEnabled(TRUE);
}
}
//static
void LLFloaterCustomize::editWearable(LLViewerWearable* wearable, bool disable_camera_switch)
{
@@ -779,7 +795,7 @@ void LLFloaterCustomize::updateVisiblity(bool force_disable_camera_switch/*=fals
{
if(force_disable_camera_switch || !gAgentCamera.cameraCustomizeAvatar() || !gAgentCamera.getCameraAnimating() || (gMorphView && gMorphView->getVisible()))
{
if(gAgentAvatarp)gAgentAvatarp->mSpecialRenderMode = 3;
if (gAgentAvatarp && gSavedSettings.getBOOL("AppearanceSpecialLighting")) gAgentAvatarp->mSpecialRenderMode = 3;
setVisibleAndFrontmost(TRUE);
}
}
@@ -862,7 +878,7 @@ void LLFloaterCustomize::saveCurrentWearables()
bool LLFloaterCustomize::onSaveDialog(const LLSD& notification, const LLSD& response )
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(option == 0)
{
saveCurrentWearables();

View File

@@ -33,38 +33,16 @@
#ifndef LL_LLFLOATERCUSTOMIZE_H
#define LL_LLFLOATERCUSTOMIZE_H
#include <map>
#include "llfloater.h"
#include "llstring.h"
#include "v3dmath.h"
#include "lltimer.h"
#include "llundo.h"
#include "llviewermenu.h"
#include "llwearable.h"
#include "lliconctrl.h"
#include "llsingleton.h"
class LLButton;
class LLIconCtrl;
class LLColorSwatchCtrl;
class LLGenePool;
class LLInventoryObserver;
class LLJoint;
class LLLineEditor;
class LLMakeOutfitDialog;
class LLRadioGroup;
class LLScrollContainer;
class LLScrollingPanelList;
class LLTabContainer;
class LLTextBox;
class LLTextureCtrl;
class LLViewerJointMesh;
class LLViewerVisualParam;
class LLVisualParam;
class LLVisualParamReset;
class LLViewerWearable;
class LLWearableSaveAsDialog;
class LLVisualParamReset;
class LLPanelEditWearable;
class AIFilePicker;
@@ -78,22 +56,24 @@ public:
LLFloaterCustomize();
virtual ~LLFloaterCustomize();
// Inherted methods
// Inherited methods
/*virtual*/ BOOL postBuild();
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void draw();
void refreshCurrentOutfitName(const std::string& name = "");
// Creation procedures
static void editWearable(LLViewerWearable* wearable, bool disable_camera_switch);
static void show();
private:
// Initilization
// Initialization
void initWearablePanels();
void initScrollingPanelList();
// Deinitilization
// Destruction
void delayedClose(bool proceed, bool app_quitting);
// Setters/Getters

View File

@@ -42,7 +42,6 @@
#include "llavataractions.h"
#include "llcallingcard.h"
#include "llfirstuse.h"
#include "llfloaterchat.h"
#include "llfloatercustomize.h"
#include "llfloateropenobject.h"
#include "llfloaterproperties.h"
@@ -73,6 +72,7 @@
#include "lltrans.h"
#include "llviewerassettype.h"
#include "llviewerfoldertype.h"
#include "llviewermenu.h"
#include "llviewermessage.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"

View File

@@ -400,4 +400,6 @@ und dieses anziehen.</text>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Outfit erstellen..." label_selected="Outfit erstellen..." name="Make Outfit"/>
<button name="Save Outfit" label="Speichere Outfit"/>
<string name="No Outfit" value="Kein Outfit"/>
<string name="Changing outfits" value="Outfits ändern"/>
</floater>

View File

@@ -1452,4 +1452,7 @@ one from scratch and wear it.
mouse_opaque="true" name="Make Outfit" left="10" scale_image="true"
width="100" />
<button bottom="-536" follows="left|bottom" height="20" left="110" width="100" name="Save Outfit" label="Save Outfit"/>
<string name="Save changes to" value="Save changes to [OUTFIT]"/>
<string name="No Outfit" value="No Outfit"/>
<string name="Changing outfits" value="Changing outfits"/>
</floater>

View File

@@ -613,4 +613,6 @@ una nueva y vistiéndotela.
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Hacer un Vestuario..." label_selected="Hacer un Vestuario..." name="Make Outfit"/>
<string name="No Outfit" value="No hay vestuario"/>
<string name="Changing outfits" value="Cambiar de vestuario"/>
</floater>

View File

@@ -487,4 +487,6 @@ inventaire. Vous pouvez aussi en créer une nouvelle et la porter.
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Créer un ensemble" label_selected="Créer un ensemble" name="Make Outfit" left="200" width="125"/>
<button left="90" name="Save Outfit" label="sauvegarder"/>
<string name="No Outfit" value="Aucune tenue"/>
<string name="Changing outfits" value="Changement de tenue"/>
</floater>

View File

@@ -480,4 +480,6 @@ partir de um esboço e usá-lo.
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Criar Vestimenta..." label_selected="Criar Vestimenta..." name="Make Outfit" left="117" width="125" />
<string name="No Outfit" value="Nenhum"/>
<string name="Changing outfits" value="Mudando de look"/>
</floater>