llfloatercustomize.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**
  2. * @file llfloatercustomize.h
  3. * @brief The customize avatar floater, triggered by "Appearance..."
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLFLOATERCUSTOMIZE_H
  33. #define LL_LLFLOATERCUSTOMIZE_H
  34. #include <map>
  35. #include "llfloater.h"
  36. #include "llviewerwearable.h"
  37. class LLInventoryObserver;
  38. class LLJoint;
  39. class LLPanelEditWearable;
  40. class LLScrollingPanelList;
  41. class LLViewerJointMesh;
  42. class LLViewerVisualParam;
  43. class LLVisualParamReset;
  44. class LLFloaterCustomize final : public LLFloater
  45. {
  46. protected:
  47. LOG_CLASS(LLFloaterCustomize);
  48. public:
  49. typedef std::pair<bool, LLViewerVisualParam*> editable_param;
  50. typedef std::map<F32, editable_param> param_map;
  51. public:
  52. LLFloaterCustomize();
  53. ~LLFloaterCustomize() override;
  54. // Inherited methods from LLFloater (and above)
  55. bool postBuild() override;
  56. void onClose(bool app_quitting) override;
  57. void draw() override;
  58. void open() override;
  59. bool isDirty() const override;
  60. static bool isVisible();
  61. // New methods
  62. void clearScrollingPanelList();
  63. void generateVisualParamHints(LLPanelEditWearable* panelp,
  64. LLViewerJointMesh* joint_meshp,
  65. param_map& params, LLWearable* wearablep,
  66. bool use_hints, LLJoint* jointp);
  67. void updateScrollingPanelList(bool allow_modify);
  68. void setWearable(LLWearableType::EType type, LLViewerWearable* wearablep,
  69. U32 perm_mask, bool is_complete);
  70. void askToSaveIfDirty(void(*next_step_callback)(bool, void*), void* data);
  71. void switchToDefaultSubpart();
  72. static void updateAvatarHeightDisplay();
  73. static void setCurrentWearableType(LLWearableType::EType type);
  74. LL_INLINE static LLWearableType::EType getCurrentWearableType()
  75. {
  76. return sCurrentWearableType;
  77. }
  78. LL_INLINE LLPanelEditWearable* getCurrentWearablePanel()
  79. {
  80. return mWearablePanelList[sCurrentWearableType];
  81. }
  82. void fetchInventory();
  83. void updateInventoryUI();
  84. void updateScrollingPanelUI();
  85. void updateWearableType(LLWearableType::EType type, LLViewerWearable* w);
  86. private:
  87. void initWearablePanels();
  88. void initScrollingPanelList();
  89. // Callbacks
  90. static void onBtnOk(void* userdata);
  91. static void onBtnMakeOutfit(void* userdata);
  92. static void onTabChanged(void* userdata, bool from_click);
  93. static void onTabPrecommit(void* userdata, bool from_click);
  94. bool onSaveDialog(const LLSD& notification, const LLSD& response);
  95. static void onCommitChangeTab(bool proceed, void* userdata);
  96. static void* createWearablePanel(void* userdata);
  97. private:
  98. LLPanelEditWearable* mWearablePanelList[LLWearableType::WT_COUNT];
  99. LLScrollingPanelList* mScrollingPanelList;
  100. LLVisualParamReset* mResetParams;
  101. LLInventoryObserver* mInventoryObserver;
  102. void (*mNextStepAfterSaveCallback)(bool proceed,
  103. void* userdata);
  104. void* mNextStepAfterSaveUserdata;
  105. static LLWearableType::EType sCurrentWearableType;
  106. static uuid_list_t sFetchingRequests;
  107. };
  108. extern LLFloaterCustomize* gFloaterCustomizep;
  109. #endif // LL_LLFLOATERCUSTOMIZE_H