diff options
Diffstat (limited to 'pokemodr/commands/TestFlagCommand.cpp')
| -rw-r--r-- | pokemodr/commands/TestFlagCommand.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pokemodr/commands/TestFlagCommand.cpp b/pokemodr/commands/TestFlagCommand.cpp new file mode 100644 index 00000000..2cac0588 --- /dev/null +++ b/pokemodr/commands/TestFlagCommand.cpp @@ -0,0 +1,42 @@ +/* + * 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 "TestFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" +#include "../../pokemod/Pokemod.h" + +TestFlagCommand::TestFlagCommand(const Pokemod* pokemod, const int command) : + CommandWidget(pokemod, command) +{ + setupUi(this); + varJump->addItem("Call"); + varJump->addItem("Goto"); + for (int i = 0; i < m_pokemod->dialogCount(); ++i) + { + const Dialog* dialog = m_pokemod->dialog(i); + varSet->addItem(dialog->dialog().mid(0, 25), dialog->id()); + varUnset->addItem(dialog->dialog().mid(0, 25), dialog->id()); + } +} + +QString TestFlagCommand::commandString() const +{ + return QString("@%1#%2#%3#%4#%5@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varFlag->value()).arg(varSet->itemData(varSet->currentIndex()).toInt()).arg(varUnset->itemData(varUnset->currentIndex()).toInt()); +} |
