00001
00032 #ifndef LL_LLFLOATERCUSTOMIZE_H
00033 #define LL_LLFLOATERCUSTOMIZE_H
00034
00035 #include <map>
00036
00037 #include "llfloater.h"
00038 #include "llstring.h"
00039 #include "v3dmath.h"
00040 #include "lltimer.h"
00041 #include "llundo.h"
00042 #include "llviewermenu.h"
00043 #include "llvoavatar.h"
00044 #include "llwearable.h"
00045 #include "lliconctrl.h"
00046
00047 class LLButton;
00048 class LLIconCtrl;
00049 class LLColorSwatchCtrl;
00050 class LLGenePool;
00051 class LLInventoryObserver;
00052 class LLJoint;
00053 class LLLineEditor;
00054 class LLMakeOutfitDialog;
00055 class LLRadioGroup;
00056 class LLScrollableContainerView;
00057 class LLScrollingPanelList;
00058 class LLTabContainerVertical;
00059 class LLTextBox;
00060 class LLTextureCtrl;
00061 class LLViewerJointMesh;
00062 class LLViewerVisualParam;
00063 class LLVisualParam;
00064 class LLVisualParamReset;
00065 class LLWearableSaveAsDialog;
00066 class LLPanelEditWearable;
00067
00069
00070
00071 class LLFloaterCustomize : public LLFloater
00072 {
00073 public:
00074 typedef std::pair<BOOL, LLViewerVisualParam*> editable_param;
00075 typedef std::map<F32, editable_param> param_map;
00076
00077 public:
00078 LLFloaterCustomize();
00079 virtual ~LLFloaterCustomize();
00080 virtual BOOL postBuild();
00081
00082
00083 virtual void onClose(bool app_quitting);
00084 virtual void draw();
00085
00086
00087 void clearScrollingPanelList();
00088 void generateVisualParamHints(LLViewerJointMesh* joint_mesh,
00089 param_map& params);
00090
00091 const LLString& getEditGroup();
00092 void addVisualParamToUndoBuffer( LLViewerVisualParam* param, F32 current_weight );
00093
00094 void updateScrollingPanelList(BOOL allow_modify);
00095
00096 void setWearable(EWearableType type, LLWearable* wearable, U32 perm_mask, BOOL is_complete);
00097
00098 LLPanelEditWearable* getCurrentWearablePanel() { return mWearablePanelList[ sCurrentWearableType ]; }
00099
00100 virtual BOOL isDirty() const;
00101
00102 void askToSaveAllIfDirty( void(*next_step_callback)(BOOL proceed, void* userdata), void* userdata );
00103
00104 void spawnWearableAppearance( EWearableType type );
00105
00106 void switchToDefaultSubpart();
00107
00108 static void setCurrentWearableType( EWearableType type );
00109 static EWearableType getCurrentWearableType() { return sCurrentWearableType; }
00110
00111
00112 static void onBtnSaveAll( void* userdata );
00113 static void onBtnSnapshot( void* userdata );
00114 static void onBtnMakeOutfit( void* userdata );
00115 static void onMakeOutfitCommit( LLMakeOutfitDialog* dialog, void* userdata );
00116
00117 static void onTabChanged( void* userdata, bool from_click );
00118 static void onSaveAllDialog( S32 option, void* userdata );
00119
00120 void fetchInventory();
00121 void updateInventoryUI();
00122 void updateScrollingPanelUI();
00123
00124 protected:
00125 LLPanelEditWearable* mWearablePanelList[ WT_COUNT ];
00126
00127 static EWearableType sCurrentWearableType;
00128
00129 LLScrollingPanelList* mScrollingPanelList;
00130 LLScrollableContainerView* mScrollContainer;
00131 LLGenePool* mGenePool;
00132 LLVisualParamReset* mResetParams;
00133
00134 LLInventoryObserver* mInventoryObserver;
00135
00136 void (*mNextStepAfterSaveAllCallback)(BOOL proceed, void* userdata);
00137 void* mNextStepAfterSaveAllUserdata;
00138
00139
00140 protected:
00141
00142 static void* createWearablePanel(void* userdata);
00143
00144 void initWearablePanels();
00145 void initScrollingPanelList();
00146 };
00147
00148 extern LLFloaterCustomize* gFloaterCustomize;
00149
00150
00151 #endif // LL_LLFLOATERCUSTOMIZE_H