From 02aba363c37efb01f25d03e25485bc6d9be3ea11 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 16 Jan 2014 11:09:55 -0500 Subject: [PATCH] slight PROP description change, don't save invalid PROP preferences --- src/gui/game/PropertyTool.cpp | 6 +++--- src/gui/game/Tool.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index 73c6c8328..72d085750 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -96,9 +96,6 @@ void PropertyWindow::SetProperty() { 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(); try { switch(properties[property->GetOption().second].Type) @@ -209,7 +206,10 @@ void PropertyWindow::SetProperty() tool->propType = properties[property->GetOption().second].Type; } catch (const std::exception& ex) { 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()); } } diff --git a/src/gui/game/Tool.h b/src/gui/game/Tool.h index ee603b348..641611ffe 100644 --- a/src/gui/game/Tool.h +++ b/src/gui/game/Tool.h @@ -82,7 +82,7 @@ class PropertyTool: public Tool { public: 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;