diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-22 20:21:23 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-22 20:21:23 +0000 |
| commit | d8973a8ed86925ea5611520c3b7b989ccc238bb4 (patch) | |
| tree | 62750320998f804891eaa10393f2f85fe9813a70 | |
| parent | ff959ab192499da1c3f66c238ca6c29a76d4b871 (diff) | |
[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
28 files changed, 849 insertions, 28 deletions
@@ -1,4 +1,12 @@ ----------------- +Rev: 165 +Date: 22 May 2008 +User: MathStuf +----------------- +[FIX] Dialog commands now use "Species" instead of "Pokemon" +[ADD] More Dialog Command widgets + +----------------- Rev: 164 Date: 22 May 2008 User: MathStuf diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp index 791949a3..a812ab16 100644 --- a/pokemod/Dialog.cpp +++ b/pokemod/Dialog.cpp @@ -30,8 +30,8 @@ #include "Rules.h" #include "Species.h" -const QStringList Dialog::CommandStr = QStringList() << "Flip Flag" << "Set Flag" << "Unset Flag" << "Randomize Flag" << "Test Flag" << "Dialog" << "Yes/No" << "Item Shop" << "Give Item" << "Take Item" << "Check Item" << "Coin List" << "Teach Move" << "Delete Move" << "Give Pokemon" << "Take Pokemon" << "Show Pokemon" << "View Pokemon" << "Give Money" << "Take Money" << "Move Effect" << "Turn Effect" << "Check Direction" << "Check Roster" << "Check Levels" << "Check Species" << "Check Held Items" << "Check Money" << "Trade" << "Daycare" << "Battle" << "Badge" << "Warp" << "Name" << "Music" << "Sound Effect" << "Timer" << "Map Sign" << "Wild Scope" << "Safari" << "Heal Party" << "Refresh" << "Clear" << "Pause" << "New Line" << "Exit" << "Menu"; -const QStringList Dialog::CommandAbbrStr = QStringList() << "FF" << "SF" << "UF" << "RF" << "TF" << "D" << "YN" << "ItS" << "GIt" << "TIt" << "CIt" << "CL" << "TMv" << "DMv" << "GPk" << "TPk" << "SPk" << "VPk" << "G$" << "T$" << "MvEf" << "TEf" << "CD" << "CR" << "CLv" << "CS" << "CHIt" << "C$" << "T" << "Dc" << "Bat" << "Bdg" << "W" << "N" << "Ms" << "SFX" << "Tmr" << "MS" << "WS" << "S" << "HP" << "R" << "C" << "P" << "NL" << "X" << "M"; +const QStringList Dialog::CommandStr = QStringList() << "Flip Flag" << "Set Flag" << "Unset Flag" << "Randomize Flag" << "Test Flag" << "Jump" << "Yes/No" << "Item Shop" << "Give Item" << "Take Item" << "Check Item" << "Coin List" << "Teach Move" << "Delete Move" << "Give Species" << "Take Species" << "Show Species" << "View Species" << "Give Money" << "Take Money" << "Move Effect" << "Turn Effect" << "Check Direction" << "Check Roster" << "Check Levels" << "Check Species" << "Check Held Items" << "Check Money" << "Trade" << "Daycare" << "Battle" << "Badge" << "Warp" << "Name" << "Music" << "Sound Effect" << "Timer" << "Map Sign" << "Wild Scope" << "Safari" << "Heal Party" << "Refresh" << "Clear" << "Pause" << "New Line" << "Exit" << "Menu"; +const QStringList Dialog::CommandAbbrStr = QStringList() << "FF" << "SF" << "UF" << "RF" << "TF" << "J" << "YN" << "ItS" << "GIt" << "TIt" << "CIt" << "CL" << "TMv" << "DMv" << "GSp" << "TSp" << "SSp" << "VSp" << "G$" << "T$" << "MvEf" << "TEf" << "CD" << "CR" << "CLv" << "CS" << "CHIt" << "C$" << "T" << "Dc" << "Bat" << "Bdg" << "W" << "N" << "Ms" << "SFX" << "Tmr" << "MS" << "WS" << "S" << "HP" << "R" << "C" << "P" << "NL" << "X" << "M"; const QList<int> Dialog::CommandNumArgs = QList<int>() << 1 << 1 << 1 << 1 << 3 << 2 << 2 << 1 << 4 << 4 << 4 << 1 << 5 << 3 << 7 << 4 << 1 << 4 << 1 << 4 << 6 << 3 << 6 << 5 << 5 << 4 << 4 << 5 << 6 << 1 << 2 << 1 << 2 << 1 << 2 << 1 << 3 << 1 << 1 << 3 << 0 << 0 << 0 << 0 << 0 << 0; Dialog::Dialog(const Dialog& dialog) : @@ -137,7 +137,7 @@ void Dialog::validate() invError = numArgs; } break; - case DialogC: + case Jump: if (numArgs == 1) { if ((arg != "Call") && (arg != "Goto") && (arg != "0") && (arg != "1")) @@ -238,7 +238,7 @@ void Dialog::validate() break; } break; - case GivePokemon: + case GiveSpecies: switch (numArgs) { case 1: @@ -273,8 +273,8 @@ void Dialog::validate() break; } break; - case TakePokemon: - case ViewPokemon: + case TakeSpecies: + case ViewSpecies: case CheckSpecies: switch (numArgs) { @@ -293,7 +293,7 @@ void Dialog::validate() break; } break; - case ShowPokemon: + case ShowSpecies: if (numArgs == 1) { if (!ok || (static_cast<const Pokemod*>(pokemod())->speciesIndex(temp) == INT_MAX)) diff --git a/pokemod/Dialog.h b/pokemod/Dialog.h index 6da41746..f282c90a 100644 --- a/pokemod/Dialog.h +++ b/pokemod/Dialog.h @@ -39,7 +39,7 @@ class Dialog : public Object UnsetFlag = 2, RandomizeFlag = 3, TestFlag = 4, - DialogC = 5, + Jump = 5, YesNo = 6, ItemShop = 7, GiveItem = 8, @@ -49,10 +49,10 @@ class Dialog : public Object TeachMove = 12, CheckMove = 13, DeleteMove = 14, - GivePokemon = 15, - TakePokemon = 16, - ShowPokemon = 17, - ViewPokemon = 18, + GiveSpecies = 15, + TakeSpecies = 16, + ShowSpecies = 17, + ViewSpecies = 18, GiveMoney = 19, TakeMoney = 20, MoveEffect = 21, diff --git a/pokemodr/DialogUI.cpp b/pokemodr/DialogUI.cpp index 3f2ac065..79cce899 100644 --- a/pokemodr/DialogUI.cpp +++ b/pokemodr/DialogUI.cpp @@ -23,6 +23,11 @@ #include "commands/SetFlagCommand.h" #include "commands/UnsetFlagCommand.h" #include "commands/RandomizeFlagCommand.h" +#include "commands/TestFlagCommand.h" +#include "commands/JumpCommand.h" +#include "commands/YesNoCommand.h" +#include "commands/ItemShopCommand.h" +#include "commands/GiveItemCommand.h" // Pokemod includes #include "../pokemod/Dialog.h" @@ -91,49 +96,136 @@ void DialogUI::on_varCommand_activated(const int command) commandWidget = new RandomizeFlagCommand(pokemod, command); break; case Dialog::TestFlag: - case Dialog::DialogC: + commandWidget = new TestFlagCommand(pokemod, command); + break; + case Dialog::Jump: + commandWidget = new JumpCommand(pokemod, command); + break; case Dialog::YesNo: + commandWidget = new YesNoCommand(pokemod, command); + break; case Dialog::ItemShop: + commandWidget = new ItemShopCommand(pokemod, command); + break; case Dialog::GiveItem: + commandWidget = new GiveItemCommand(pokemod, command); + break; case Dialog::TakeItem: +// commandWidget = new TakeItemCommand(pokemod, command); + break; case Dialog::CheckItem: +// commandWidget = new CheckItemCommand(pokemod, command); + break; case Dialog::CoinList: +// commandWidget = new CoinListCommand(pokemod, command); + break; case Dialog::TeachMove: +// commandWidget = new TeachMoveCommand(pokemod, command); + break; case Dialog::CheckMove: +// commandWidget = new CheckMoveCommand(pokemod, command); + break; case Dialog::DeleteMove: - case Dialog::GivePokemon: - case Dialog::TakePokemon: - case Dialog::ShowPokemon: - case Dialog::ViewPokemon: +// commandWidget = new DeleteMoveCommand(pokemod, command); + break; + case Dialog::GiveSpecies: +// commandWidget = new GivePokemonCommand(pokemod, command); + break; + case Dialog::TakeSpecies: +// commandWidget = new TakePokemonCommand(pokemod, command); + break; + case Dialog::ShowSpecies: +// commandWidget = new ShowPokemonCommand(pokemod, command); + break; + case Dialog::ViewSpecies: +// commandWidget = new ViewPokemonCommand(pokemod, command); + break; case Dialog::GiveMoney: +// commandWidget = new GiveMoneyCommand(pokemod, command); + break; case Dialog::TakeMoney: +// commandWidget = new TakeMoneyCommand(pokemod, command); + break; case Dialog::MoveEffect: +// commandWidget = new MoveEffectCommand(pokemod, command); + break; case Dialog::TurnEffect: +// commandWidget = new TurnEffectCommand(pokemod, command); + break; case Dialog::CheckDirection: +// commandWidget = new CheckDirectionCommand(pokemod, command); + break; case Dialog::CheckRoster: +// commandWidget = new CheckRosterCommand(pokemod, command); + break; case Dialog::CheckLevels: +// commandWidget = new CheckLevelsCommand(pokemod, command); + break; case Dialog::CheckSpecies: +// commandWidget = new CheckSpeciesCommand(pokemod, command); + break; case Dialog::CheckHeldItems: +// commandWidget = new CheckHeldItemsCommand(pokemod, command); + break; case Dialog::CheckMoney: +// commandWidget = new CheckMoneyCommand(pokemod, command); + break; case Dialog::Trade: +// commandWidget = new TradeCommand(pokemod, command); + break; case Dialog::Daycare: +// commandWidget = new DaycareCommand(pokemod, command); + break; case Dialog::Battle: +// commandWidget = new BattleCommand(pokemod, command); + break; case Dialog::Badge: +// commandWidget = new BadgeCommand(pokemod, command); + break; case Dialog::Warp: +// commandWidget = new WarpCommand(pokemod, command); + break; case Dialog::Name: +// commandWidget = new NameCommand(pokemod, command); + break; case Dialog::Music: +// commandWidget = new MusicCommand(pokemod, command); + break; case Dialog::SoundEffect: +// commandWidget = new SoundEffectCommand(pokemod, command); + break; case Dialog::Timer: +// commandWidget = new TimerCommand(pokemod, command); + break; case Dialog::MapSign: +// commandWidget = new MapSignCommand(pokemod, command); + break; case Dialog::WildScope: +// commandWidget = new WildScopeCommand(pokemod, command); + break; case Dialog::Safari: +// commandWidget = new SafariCommand(pokemod, command); + break; case Dialog::HealParty: +// commandWidget = new HealPartyCommand(pokemod, command); + break; case Dialog::Refresh: +// commandWidget = new RefreshCommand(pokemod, command); + break; case Dialog::Clear: +// commandWidget = new ClearCommand(pokemod, command); + break; case Dialog::Pause: +// commandWidget = new PauseCommand(pokemod, command); + break; case Dialog::NewLine: +// commandWidget = new NewLineCommand(pokemod, command); + break; case Dialog::Exit: +// commandWidget = new ExitCommand(pokemod, command); + break; case Dialog::Menu: +// commandWidget = new MenuCommand(pokemod, command); break; } if (commandWidget) diff --git a/pokemodr/commands/FlipFlagCommand.cpp b/pokemodr/commands/FlipFlagCommand.cpp index 3f1c396a..c82f8e08 100644 --- a/pokemodr/commands/FlipFlagCommand.cpp +++ b/pokemodr/commands/FlipFlagCommand.cpp @@ -21,7 +21,7 @@ // Pokemod includes #include "../../pokemod/Dialog.h" -FlipFlagCommand::FlipFlagCommand(const Pokemod * pokemod, const int command) : +FlipFlagCommand::FlipFlagCommand(const Pokemod* pokemod, const int command) : CommandWidget(pokemod, command) { setupUi(this); diff --git a/pokemodr/commands/FlipFlagCommand.h b/pokemodr/commands/FlipFlagCommand.h index 0d082fcb..f80939c9 100644 --- a/pokemodr/commands/FlipFlagCommand.h +++ b/pokemodr/commands/FlipFlagCommand.h @@ -21,7 +21,7 @@ // Command includes #include "CommandWidget.h" -// Form includes +// Form include #include "ui_flipflag.h" class FlipFlagCommand : public CommandWidget, private Ui::formFlipFlag diff --git a/pokemodr/commands/GiveItemCommand.cpp b/pokemodr/commands/GiveItemCommand.cpp new file mode 100644 index 00000000..93c1b31d --- /dev/null +++ b/pokemodr/commands/GiveItemCommand.cpp @@ -0,0 +1,48 @@ +/* + * 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 "GiveItemCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" +#include "../../pokemod/Item.h" +#include "../../pokemod/Pokemod.h" + +GiveItemCommand::GiveItemCommand(const Pokemod* pokemod, const int command) : + CommandWidget(pokemod, command) +{ + setupUi(this); + varJump->addItem("Call"); + varJump->addItem("Goto"); + for (int i = 0; i < m_pokemod->itemCount(); ++i) + { + const Item* item = m_pokemod->item(i); + varItem->addItem(item->name(), item->id()); + } + for (int i = 0; i < m_pokemod->dialogCount(); ++i) + { + const Dialog* dialog = m_pokemod->dialog(i); + varTaken->addItem(dialog->dialog().mid(0, 25), dialog->id()); + varKept->addItem(dialog->dialog().mid(0, 25), dialog->id()); + } +} + +QString GiveItemCommand::commandString() const +{ + return QString("@%1#%2#%3#%4#%5@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varItem->itemData(varItem->currentIndex()).toInt()).arg(varTaken->itemData(varTaken->currentIndex()).toInt()).arg(varKept->itemData(varKept->currentIndex()).toInt()); +} diff --git a/pokemodr/commands/GiveItemCommand.h b/pokemodr/commands/GiveItemCommand.h new file mode 100644 index 00000000..633f673d --- /dev/null +++ b/pokemodr/commands/GiveItemCommand.h @@ -0,0 +1,37 @@ +/* + * 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/>. + */ + +#ifndef __POKEMODR_GIVEITEMCOMMAND__ +#define __POKEMODR_GIVEITEMCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Form include +#include "ui_giveitem.h" + +class GiveItemCommand : public CommandWidget, private Ui::formGiveItem +{ + Q_OBJECT + + public: + GiveItemCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; +}; + +#endif diff --git a/pokemodr/commands/ItemShopCommand.cpp b/pokemodr/commands/ItemShopCommand.cpp new file mode 100644 index 00000000..938077e1 --- /dev/null +++ b/pokemodr/commands/ItemShopCommand.cpp @@ -0,0 +1,40 @@ +/* + * 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 "ItemShopCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" +#include "../../pokemod/Pokemod.h" +#include "../../pokemod/Store.h" + +ItemShopCommand::ItemShopCommand(const Pokemod* pokemod, const int command) : + CommandWidget(pokemod, command) +{ + setupUi(this); + for (int i = 0; i < m_pokemod->storeCount(); ++i) + { + const Store* store = m_pokemod->store(i); + varItemShop->addItem(store->name(), store->id()); + } +} + +QString ItemShopCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varItemShop->itemData(varItemShop->currentIndex()).toInt()); +} diff --git a/pokemodr/commands/ItemShopCommand.h b/pokemodr/commands/ItemShopCommand.h new file mode 100644 index 00000000..2da03599 --- /dev/null +++ b/pokemodr/commands/ItemShopCommand.h @@ -0,0 +1,37 @@ +/* + * 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/>. + */ + +#ifndef __POKEMODR_ITEMSHOPCOMMAND__ +#define __POKEMODR_ITEMSHOPCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Form include +#include "ui_itemshop.h" + +class ItemShopCommand : public CommandWidget, private Ui::formItemShop +{ + Q_OBJECT + + public: + ItemShopCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; +}; + +#endif 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 <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 "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()); +} diff --git a/pokemodr/commands/JumpCommand.h b/pokemodr/commands/JumpCommand.h new file mode 100644 index 00000000..8bddac20 --- /dev/null +++ b/pokemodr/commands/JumpCommand.h @@ -0,0 +1,37 @@ +/* + * 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/>. + */ + +#ifndef __POKEMODR_JUMPCOMMAND__ +#define __POKEMODR_JUMPCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Form include +#include "ui_jump.h" + +class JumpCommand : public CommandWidget, private Ui::formJump +{ + Q_OBJECT + + public: + JumpCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; +}; + +#endif diff --git a/pokemodr/commands/RandomizeFlagCommand.cpp b/pokemodr/commands/RandomizeFlagCommand.cpp index 144abb14..224111e9 100644 --- a/pokemodr/commands/RandomizeFlagCommand.cpp +++ b/pokemodr/commands/RandomizeFlagCommand.cpp @@ -21,7 +21,7 @@ // Pokemod includes #include "../../pokemod/Dialog.h" -RandomizeFlagCommand::RandomizeFlagCommand(const Pokemod * pokemod, const int command) : +RandomizeFlagCommand::RandomizeFlagCommand(const Pokemod* pokemod, const int command) : CommandWidget(pokemod, command) { setupUi(this); diff --git a/pokemodr/commands/RandomizeFlagCommand.h b/pokemodr/commands/RandomizeFlagCommand.h index 9a930c5f..fa713ee8 100644 --- a/pokemodr/commands/RandomizeFlagCommand.h +++ b/pokemodr/commands/RandomizeFlagCommand.h @@ -21,7 +21,7 @@ // Command includes #include "CommandWidget.h" -// Form includes +// Form include #include "ui_randomizeflag.h" class RandomizeFlagCommand : public CommandWidget, private Ui::formRandomizeFlag diff --git a/pokemodr/commands/SetFlagCommand.cpp b/pokemodr/commands/SetFlagCommand.cpp index 7dbb2fa2..4600035c 100644 --- a/pokemodr/commands/SetFlagCommand.cpp +++ b/pokemodr/commands/SetFlagCommand.cpp @@ -21,7 +21,7 @@ // Pokemod includes #include "../../pokemod/Dialog.h" -SetFlagCommand::SetFlagCommand(const Pokemod * pokemod, const int command) : +SetFlagCommand::SetFlagCommand(const Pokemod* pokemod, const int command) : CommandWidget(pokemod, command) { setupUi(this); diff --git a/pokemodr/commands/SetFlagCommand.h b/pokemodr/commands/SetFlagCommand.h index da0571bd..a3d16415 100644 --- a/pokemodr/commands/SetFlagCommand.h +++ b/pokemodr/commands/SetFlagCommand.h @@ -21,7 +21,7 @@ // Command includes #include "CommandWidget.h" -// Form includes +// Form include #include "ui_setflag.h" class SetFlagCommand : public CommandWidget, private Ui::formSetFlag 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()); +} diff --git a/pokemodr/commands/TestFlagCommand.h b/pokemodr/commands/TestFlagCommand.h new file mode 100644 index 00000000..5d11ef12 --- /dev/null +++ b/pokemodr/commands/TestFlagCommand.h @@ -0,0 +1,37 @@ +/* + * 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/>. + */ + +#ifndef __POKEMODR_TESTFLAGCOMMAND__ +#define __POKEMODR_TESTFLAGCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Form include +#include "ui_testflag.h" + +class TestFlagCommand : public CommandWidget, private Ui::formTestFlag +{ + Q_OBJECT + + public: + TestFlagCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; +}; + +#endif diff --git a/pokemodr/commands/UnsetFlagCommand.cpp b/pokemodr/commands/UnsetFlagCommand.cpp index 72196344..723d1cfa 100644 --- a/pokemodr/commands/UnsetFlagCommand.cpp +++ b/pokemodr/commands/UnsetFlagCommand.cpp @@ -21,7 +21,7 @@ // Pokemod includes #include "../../pokemod/Dialog.h" -UnsetFlagCommand::UnsetFlagCommand(const Pokemod * pokemod, const int command) : +UnsetFlagCommand::UnsetFlagCommand(const Pokemod* pokemod, const int command) : CommandWidget(pokemod, command) { setupUi(this); diff --git a/pokemodr/commands/UnsetFlagCommand.h b/pokemodr/commands/UnsetFlagCommand.h index fdb72ff3..a10437f4 100644 --- a/pokemodr/commands/UnsetFlagCommand.h +++ b/pokemodr/commands/UnsetFlagCommand.h @@ -21,7 +21,7 @@ // Command includes #include "CommandWidget.h" -// Form includes +// Form include #include "ui_unsetflag.h" class UnsetFlagCommand : public CommandWidget, private Ui::formUnsetFlag diff --git a/pokemodr/commands/YesNoCommand.cpp b/pokemodr/commands/YesNoCommand.cpp new file mode 100644 index 00000000..bda5f502 --- /dev/null +++ b/pokemodr/commands/YesNoCommand.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 "YesNoCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" +#include "../../pokemod/Pokemod.h" + +YesNoCommand::YesNoCommand(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); + varYes->addItem(dialog->dialog().mid(0, 25), dialog->id()); + varNo->addItem(dialog->dialog().mid(0, 25), dialog->id()); + } +} + +QString YesNoCommand::commandString() const +{ + return QString("@%1#%2#%3@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varYes->itemData(varYes->currentIndex()).toInt()).arg(varNo->itemData(varNo->currentIndex()).toInt()); +} diff --git a/pokemodr/commands/YesNoCommand.h b/pokemodr/commands/YesNoCommand.h new file mode 100644 index 00000000..4a6efd25 --- /dev/null +++ b/pokemodr/commands/YesNoCommand.h @@ -0,0 +1,37 @@ +/* + * 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/>. + */ + +#ifndef __POKEMODR_YESNOCOMMAND__ +#define __POKEMODR_YESNOCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Form include +#include "ui_yesno.h" + +class YesNoCommand : public CommandWidget, private Ui::formYesNo +{ + Q_OBJECT + + public: + YesNoCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; +}; + +#endif diff --git a/pokemodr/gui/commands/giveitem.ui b/pokemodr/gui/commands/giveitem.ui new file mode 100644 index 00000000..4756c8f3 --- /dev/null +++ b/pokemodr/gui/commands/giveitem.ui @@ -0,0 +1,80 @@ +<ui version="4.0" > + <class>formGiveItem</class> + <widget class="QWidget" name="formGiveItem" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="boxJump" > + <property name="title" > + <string>Jump Action</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KComboBox" name="varJump" > + <property name="toolTip" > + <string>How the dialog jumped to is treated</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxItem" > + <property name="title" > + <string>Item</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="KComboBox" name="varItem" > + <property name="toolTip" > + <string>The item to give the user</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxTaken" > + <property name="title" > + <string>Dialog if Taken</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item> + <widget class="KComboBox" name="varTaken" > + <property name="toolTip" > + <string>The dialog to jump to if the user took the item</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxKept" > + <property name="title" > + <string>Dialog if Kept</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="KComboBox" name="varKept" > + <property name="toolTip" > + <string>The dialog to jump to if the item cannot be given to the user</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/commands/itemshop.ui b/pokemodr/gui/commands/itemshop.ui new file mode 100644 index 00000000..8e4e0c47 --- /dev/null +++ b/pokemodr/gui/commands/itemshop.ui @@ -0,0 +1,28 @@ +<ui version="4.0" > + <class>formItemShop</class> + <widget class="QWidget" name="formItemShop" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="boxItemShop" > + <property name="title" > + <string>Item Shop</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KComboBox" name="varItemShop" /> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/commands/jump.ui b/pokemodr/gui/commands/jump.ui new file mode 100644 index 00000000..39dcecaa --- /dev/null +++ b/pokemodr/gui/commands/jump.ui @@ -0,0 +1,48 @@ +<ui version="4.0" > + <class>formJump</class> + <widget class="QWidget" name="formJump" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="boxJump" > + <property name="title" > + <string>Jump Action</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KComboBox" name="varJump" > + <property name="toolTip" > + <string>How the dialog jumped to is treated</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxDialog" > + <property name="title" > + <string>Dialog</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="KComboBox" name="varDialog" > + <property name="toolTip" > + <string>The dialog to jump to</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/commands/testflag.ui b/pokemodr/gui/commands/testflag.ui new file mode 100644 index 00000000..27812ed3 --- /dev/null +++ b/pokemodr/gui/commands/testflag.ui @@ -0,0 +1,88 @@ +<ui version="4.0" > + <class>formTestFlag</class> + <widget class="QWidget" name="formTestFlag" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="boxJump" > + <property name="title" > + <string>Jump Action</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KComboBox" name="varJump" > + <property name="toolTip" > + <string>How the dialog jumped to is treated</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxFlag" > + <property name="title" > + <string>Flag</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="KIntNumInput" name="varFlag" > + <property name="toolTip" > + <string>The flag to test</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSet" > + <property name="title" > + <string>Dialog if Set</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item> + <widget class="KComboBox" name="varSet" > + <property name="toolTip" > + <string>The dialog to jump to if the flag is set</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxUnset" > + <property name="title" > + <string>Dialog if Unset</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="KComboBox" name="varUnset" > + <property name="toolTip" > + <string>The dialog to jump to if the flag is unset</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/commands/yesno.ui b/pokemodr/gui/commands/yesno.ui new file mode 100644 index 00000000..5cc6c078 --- /dev/null +++ b/pokemodr/gui/commands/yesno.ui @@ -0,0 +1,64 @@ +<ui version="4.0" > + <class>formYesNo</class> + <widget class="QWidget" name="formYesNo" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="boxJump" > + <property name="title" > + <string>Jump Action</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KComboBox" name="varJump" > + <property name="toolTip" > + <string>How the dialog jumped to is treated</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxYes" > + <property name="title" > + <string>Dialog if Yes</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4" > + <item> + <widget class="KComboBox" name="varYes" > + <property name="toolTip" > + <string>The dialog to jump to if the user answers yes</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxNo" > + <property name="title" > + <string>Dialog if No</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="KComboBox" name="varNo" > + <property name="toolTip" > + <string>The dialog to jump to if the user answers no</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 3a0914d8..15917c27 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -145,7 +145,12 @@ SOURCES += AbilityUI.cpp \ commands/FlipFlagCommand.cpp \ commands/SetFlagCommand.cpp \ commands/UnsetFlagCommand.cpp \ - commands/RandomizeFlagCommand.cpp + commands/RandomizeFlagCommand.cpp \ + commands/TestFlagCommand.cpp \ + commands/JumpCommand.cpp \ + commands/YesNoCommand.cpp \ + commands/ItemShopCommand.cpp \ + commands/GiveItemCommand.cpp HEADERS += AbilityUI.h \ AbilityEffectUI.h \ @@ -262,7 +267,12 @@ HEADERS += AbilityUI.h \ commands/FlipFlagCommand.h \ commands/SetFlagCommand.h \ commands/UnsetFlagCommand.h \ - commands/RandomizeFlagCommand.h + commands/RandomizeFlagCommand.h \ + commands/TestFlagCommand.h \ + commands/JumpCommand.h \ + commands/YesNoCommand.h \ + commands/ItemShopCommand.h \ + commands/GiveItemCommand.h FORMS += gui/ability.ui \ gui/abilityeffect.ui \ @@ -305,7 +315,12 @@ FORMS += gui/ability.ui \ gui/commands/flipflag.ui \ gui/commands/setflag.ui \ gui/commands/unsetflag.ui \ - gui/commands/randomizeflag.ui + gui/commands/randomizeflag.ui \ + gui/commands/testflag.ui \ + gui/commands/jump.ui \ + gui/commands/yesno.ui \ + gui/commands/itemshop.ui \ + gui/commands/giveitem.ui LATEX += pokemodr.tex |
