Minor fix to AscentPrefsVan for linux - And in general. Thanks for bringing that to my attention, Verissimo!

Aside from that, getting ready to actually activate another vanity feature. Probably see it in a couple hours.

Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
Beeks
2010-08-26 17:18:32 -04:00
parent 15d74dc41a
commit 1fb1c12068
5 changed files with 356 additions and 250 deletions

View File

@@ -62,9 +62,14 @@ public:
private:
static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data);
void refreshValues();
//General
BOOL mUseAccountSettings;
//Colors
BOOL mShowSelfClientTag;
BOOL mShowSelfClientTagColor;
BOOL mUseAccountSettings;
BOOL mCustomTagOn;
std::string mCustomTagLabel;
LLColor4 mCustomTagColor;
LLColor4 mEffectColor;
U32 mSelectedClient;
};
@@ -75,6 +80,22 @@ LLPrefsAscentVanImpl::LLPrefsAscentVanImpl()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml");
childSetCommitCallback("use_account_settings_check", onCommitCheckBox, this);
childSetCommitCallback("customize_own_tag_check", onCommitCheckBox, this);
if (gSavedSettings.getBOOL("AscentUseCustomTag"))
{
childEnable("custom_tag_label_text");
childEnable("custom_tag_label_box");
childEnable("custom_tag_color_text");
childEnable("custom_tag_color_swatch");
}
else
{
childDisable("custom_tag_label_text");
childDisable("custom_tag_label_box");
childDisable("custom_tag_color_text");
childDisable("custom_tag_color_swatch");
}
refresh();
}
@@ -82,8 +103,31 @@ LLPrefsAscentVanImpl::LLPrefsAscentVanImpl()
//static
void LLPrefsAscentVanImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentVanImpl* self = (LLPrefsAscentVanImpl*)user_data;
self->refresh();
llinfos << "Control named " << ctrl->getControlName() << llendl;
if (ctrl->getControlName() == "AscentStoreSettingsPerAccount")
{
self->refresh();
}
else
{
if (gSavedSettings.getBOOL("AscentUseCustomTag"))
{
self->childEnable("custom_tag_label_text");
self->childEnable("custom_tag_label_box");
self->childEnable("custom_tag_color_text");
self->childEnable("custom_tag_color_swatch");
}
else
{
self->childDisable("custom_tag_label_text");
self->childDisable("custom_tag_label_box");
self->childDisable("custom_tag_color_text");
self->childDisable("custom_tag_color_swatch");
}
}
}
void LLPrefsAscentVanImpl::refreshValues()
@@ -103,7 +147,7 @@ void LLPrefsAscentVanImpl::refreshValues()
}
else
{
mSelectedClient = gSavedPerAccountSettings.getU32("AscentSpoofClientIndex");
mSelectedClient = gSavedPerAccountSettings.getU32("AscentSpoofClientIndex");
mEffectColor = gSavedPerAccountSettings.getColor4("EffectColor");
}
}
@@ -111,10 +155,13 @@ void LLPrefsAscentVanImpl::refreshValues()
void LLPrefsAscentVanImpl::refresh()
{
refreshValues();
//General
//General --------------------------------------------------------------------------------
childSetValue("use_account_settings_check", mUseAccountSettings);
//Colors
llinfos << "Refreshing Vanity panel." << llendl;
//Colors ---------------------------------------------------------------------------------
LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
combo->setCurrentByIndex(mSelectedClient);
childSetValue("show_self_tag_check", mShowSelfClientTag);
childSetValue("show_self_tag_color_check", mShowSelfClientTagColor);
@@ -134,9 +181,7 @@ void LLPrefsAscentVanImpl::refresh()
}
// tag spoofing comboxbox
LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
combo->setCurrentByIndex(mSelectedClient);
}
@@ -149,8 +194,10 @@ void LLPrefsAscentVanImpl::apply()
{
std::string client_uuid;
U32 client_index;
//Colors
//General -----------------------------------------------------------------------------
//Colors ------------------------------------------------------------------------------
LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
if (combo)
{
@@ -158,7 +205,7 @@ void LLPrefsAscentVanImpl::apply()
//Don't rebake if it's not neccesary.
if (client_index != mSelectedClient)
{
client_uuid = combo->getSelectedValue();
client_uuid = combo->getSelectedValue().asString();
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
{
gSavedSettings.setString("AscentSpoofClientUUID", client_uuid);
@@ -177,6 +224,8 @@ void LLPrefsAscentVanImpl::apply()
avatar->forceBakeAllTextures(slam_for_debug);
}
}
gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check"));
gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check"));
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
{
@@ -189,8 +238,7 @@ void LLPrefsAscentVanImpl::apply()
gSavedPerAccountSettings.setColor4("EffectColor", childGetValue("effect_color_swatch"));
}
gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check"));
gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check"));
refreshValues();
}