slight PROP description change, don't save invalid PROP preferences

This commit is contained in:
jacob1 2014-01-16 11:09:55 -05:00
parent 69c9be0e99
commit 02aba363c3
2 changed files with 4 additions and 4 deletions

View File

@ -96,9 +96,6 @@ void PropertyWindow::SetProperty()
{ {
if(property->GetOption().second!=-1 && textField->GetText().length() > 0) if(property->GetOption().second!=-1 && textField->GetText().length() > 0)
{ {
Client::Ref().SetPref("Prop.Type", property->GetOption().second);
Client::Ref().SetPref("Prop.Value", textField->GetText());
std::string value = textField->GetText(); std::string value = textField->GetText();
try { try {
switch(properties[property->GetOption().second].Type) switch(properties[property->GetOption().second].Type)
@ -209,7 +206,10 @@ void PropertyWindow::SetProperty()
tool->propType = properties[property->GetOption().second].Type; tool->propType = properties[property->GetOption().second].Type;
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
new ErrorMessage("Could not set property", "Invalid value provided"); new ErrorMessage("Could not set property", "Invalid value provided");
return;
} }
Client::Ref().SetPref("Prop.Type", property->GetOption().second);
Client::Ref().SetPref("Prop.Value", textField->GetText());
} }
} }

View File

@ -82,7 +82,7 @@ class PropertyTool: public Tool
{ {
public: public:
PropertyTool(): PropertyTool():
Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field.", 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL) Tool(0, "PROP", "Property Drawing Tool. Use to alter the properties of elements in the field.", 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL)
{ {
} }
StructProperty::PropertyType propType; StructProperty::PropertyType propType;