summaryrefslogtreecommitdiff
path: root/src/gui/textcommandeditor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-19 19:33:14 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-19 19:45:23 +0300
commit479e8a53ec90c19890dfb4b3746c4453769d806a (patch)
tree1d6499dd44145107e0d28dc4e3fbd96a214d4d7c /src/gui/textcommandeditor.cpp
parent5583ed6cb475a3fbc717f717971f0887ecc0226a (diff)
downloadmv-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.gz
mv-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.bz2
mv-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.xz
mv-479e8a53ec90c19890dfb4b3746c4453769d806a.zip
Add comment field to spells/commands.
Diffstat (limited to 'src/gui/textcommandeditor.cpp')
-rw-r--r--src/gui/textcommandeditor.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp
index 282f23ee1..0bd25fcb5 100644
--- a/src/gui/textcommandeditor.cpp
+++ b/src/gui/textcommandeditor.cpp
@@ -168,7 +168,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
Window(_("Command Editor"), false, 0, "commandeditor.xml")
{
int w = 350;
- int h = 350;
+ int h = 370;
mEnabledKeyboard = keyboard.isEnabled();
keyboard.setEnabled(false);
@@ -197,6 +197,9 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
mCommandLabel = new Label(_("Command:"));
mCommandTextField = new TextField();
+ mCommentLabel = new Label(_("Comment:"));
+ mCommentTextField = new TextField();
+
mManaLabel = new Label(_("Mana:"));
mManaField = new IntTextField(0);
mManaField->setRange(0, 500);
@@ -248,6 +251,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
mSymbolTextField->setText(command->getSymbol());
mCommandTextField->setText(command->getCommand());
+ mCommentTextField->setText(command->getComment());
mManaField->setValue(command->getMana());
mTypeDropDown->setSelected(command->getTargetType());
mMagicLvlField->setValue(command->getBaseLvl());
@@ -263,25 +267,29 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
placer(2, 1, mSymbolTextField, 3).setPadding(3);
placer(0, 2, mCommandLabel, 2).setPadding(3);
placer(2, 2, mCommandTextField, 4).setPadding(3);
- placer(0, 3, mTypeLabel, 2).setPadding(3);
- placer(2, 3, mTypeDropDown, 3).setPadding(3);
- placer(0, 4, mIconLabel, 2).setPadding(3);
- placer(2, 4, mIconDropDown, 3).setPadding(3);
+ placer(0, 3, mCommentLabel, 2).setPadding(3);
+ placer(2, 3, mCommentTextField, 4).setPadding(3);
+
+ placer(0, 4, mTypeLabel, 2).setPadding(3);
+ placer(2, 4, mTypeDropDown, 3).setPadding(3);
+
+ placer(0, 5, mIconLabel, 2).setPadding(3);
+ placer(2, 5, mIconDropDown, 3).setPadding(3);
- placer(0, 5, mManaLabel, 2).setPadding(3);
- placer(2, 5, mManaField, 3).setPadding(3);
- placer(0, 6, mMagicLvlLabel, 2).setPadding(3);
- placer(2, 6, mMagicLvlField, 3).setPadding(3);
+ placer(0, 6, mManaLabel, 2).setPadding(3);
+ placer(2, 6, mManaField, 3).setPadding(3);
+ placer(0, 7, mMagicLvlLabel, 2).setPadding(3);
+ placer(2, 7, mMagicLvlField, 3).setPadding(3);
- placer(0, 7, mSchoolLabel, 2).setPadding(3);
- placer(2, 7, mSchoolDropDown, 3).setPadding(3);
- placer(0, 8, mSchoolLvlLabel, 2).setPadding(3);
- placer(2, 8, mSchoolLvlField, 3).setPadding(3);
+ placer(0, 8, mSchoolLabel, 2).setPadding(3);
+ placer(2, 8, mSchoolDropDown, 3).setPadding(3);
+ placer(0, 9, mSchoolLvlLabel, 2).setPadding(3);
+ placer(2, 9, mSchoolLvlField, 3).setPadding(3);
- placer(0, 9, mSaveButton, 2).setPadding(3);
- placer(2, 9, mCancelButton, 2).setPadding(3);
- placer(4, 9, mDeleteButton, 2).setPadding(3);
+ placer(0, 10, mSaveButton, 2).setPadding(3);
+ placer(2, 10, mCancelButton, 2).setPadding(3);
+ placer(4, 10, mDeleteButton, 2).setPadding(3);
setWidth(w);
setHeight(h);
@@ -375,6 +383,7 @@ void TextCommandEditor::save()
mCommand->setSymbol(mSymbolTextField->getText());
mCommand->setCommand(mCommandTextField->getText());
+ mCommand->setComment(mCommentTextField->getText());
mCommand->setMana(mManaField->getValue());
mCommand->setTargetType(
static_cast<SpellTarget>(mTypeDropDown->getSelected()));
@@ -392,6 +401,7 @@ void TextCommandEditor::deleteCommand()
mCommand->setCommandType(TEXT_COMMAND_TEXT);
mCommand->setSymbol("");
mCommand->setCommand("");
+ mCommand->setComment("");
mCommand->setMana(0);
mCommand->setTargetType(NOTARGET);
mCommand->setIcon("");