From d8973a8ed86925ea5611520c3b7b989ccc238bb4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 22 May 2008 20:21:23 +0000 Subject: [FIX] Dialog commands now use "Species" instead of "Pokemon" [ADD] More Dialog Command widgets git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@165 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/commands/JumpCommand.cpp | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pokemodr/commands/JumpCommand.cpp (limited to 'pokemodr/commands/JumpCommand.cpp') diff --git a/pokemodr/commands/JumpCommand.cpp b/pokemodr/commands/JumpCommand.cpp new file mode 100644 index 00000000..aa9df52d --- /dev/null +++ b/pokemodr/commands/JumpCommand.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2008 Ben Boeckel + * + * 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 . + */ + +// Header include +#include "JumpCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" +#include "../../pokemod/Pokemod.h" + +JumpCommand::JumpCommand(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); + varDialog->addItem(dialog->dialog().mid(0, 25), dialog->id()); + } +} + +QString JumpCommand::commandString() const +{ + return QString("@%1#%2#%3@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varDialog->itemData(varDialog->currentIndex()).toInt()); +} -- cgit