From a87505333e0fcd5ba06da76d0d66e469121e8b30 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Nov 2022 23:39:55 +0200 Subject: SL-18448 Save material button in tools floater --- indra/newview/llpanelface.cpp | 11 +++++++++-- indra/newview/llpanelface.h | 1 + indra/newview/skins/default/xui/en/panel_tools_texture.xml | 11 ++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index c4d7eb46df..06f69e6fb5 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -203,6 +203,7 @@ BOOL LLPanelFace::postBuild() childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); childSetAction("pbr_from_inventory", &LLPanelFace::onClickBtnLoadInvPBR, this); childSetAction("edit_selected_pbr", &LLPanelFace::onClickBtnEditPBR, this); + childSetAction("save_selected_pbr", &LLPanelFace::onClickBtnSavePBR, this); LLTextureCtrl* mTextureCtrl; LLTextureCtrl* mShinyTextureCtrl; @@ -969,6 +970,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } getChildView("pbr_from_inventory")->setEnabled(editable); getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material); + getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material); LLTextureCtrl* texture_ctrl = getChild("texture control"); LLTextureCtrl* shinytexture_ctrl = getChild("shinytexture control"); @@ -1749,8 +1751,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChildView("button align")->setEnabled(FALSE); getChildView("pbr_from_inventory")->setEnabled(FALSE); getChildView("edit_selected_pbr")->setEnabled(FALSE); - //getChildView("has media")->setEnabled(FALSE); - //getChildView("media info set")->setEnabled(FALSE); + getChildView("save_selected_pbr")->setEnabled(FALSE); updateVisibility(); @@ -2682,6 +2683,7 @@ void LLPanelFace::updateVisibility() getChildView("pbr_control")->setVisible(show_pbr); getChildView("pbr_from_inventory")->setVisible(show_pbr); getChildView("edit_selected_pbr")->setVisible(show_pbr); + getChildView("save_selected_pbr")->setVisible(show_pbr); } // static @@ -3669,6 +3671,11 @@ void LLPanelFace::onClickBtnEditPBR(void* userdata) LLMaterialEditor::loadLive(); } +void LLPanelFace::onClickBtnSavePBR(void* userdata) +{ + LLMaterialEditor::saveObjectsMaterialAs(); +} + enum EPasteMode { PASTE_COLOR, diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 38d81e44ba..27c1bb5f33 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -230,6 +230,7 @@ protected: static void onAlignTexture(void*); static void onClickBtnLoadInvPBR(void* userdata); static void onClickBtnEditPBR(void* userdata); + static void onClickBtnSavePBR(void* userdata); public: // needs to be accessible to selection manager void onCopyColor(); // records all selected faces diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index e2d571324f..da74b65848 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -267,6 +267,15 @@ name="edit_selected_pbr" label="Edit Selected" width="140"/> +