diff options
Diffstat (limited to 'pokemodr/commands/SetFlagCommand.cpp')
| -rw-r--r-- | pokemodr/commands/SetFlagCommand.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pokemodr/commands/SetFlagCommand.cpp b/pokemodr/commands/SetFlagCommand.cpp new file mode 100644 index 00000000..3b775659 --- /dev/null +++ b/pokemodr/commands/SetFlagCommand.cpp @@ -0,0 +1,44 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "SetFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include <QHBoxLayout> +#include <QVBoxLayout> + +SetFlagCommand::SetFlagCommand(const Pokemod * pokemod, const int command) : + CommandWidget(pokemod, command) +{ + QVBoxLayout* vboxLayout = new QVBoxLayout(this); + QHBoxLayout* hboxLayout = new QHBoxLayout; + boxFlag = new QGroupBox("Flag to set"); + varFlag = new KIntNumInput(); + varFlag->setRange(0, INT_MAX); + hboxLayout->addWidget(varFlag); + boxFlag->setLayout(hboxLayout); + vboxLayout->addWidget(boxFlag); +} + +QString SetFlagCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); +} |
