From a4eabe00d6c32d0d15d77362428fb2d05a0ec0d7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 22 May 2008 06:05:31 +0000 Subject: [ADD] New Dialog widgets [FIX] FlipFlag was misnamed git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@163 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- Changelog | 8 ++++++ pokemodr/DialogUI.cpp | 13 +++++++-- pokemodr/commands/FlagFlipCommand.cpp | 44 ------------------------------ pokemodr/commands/FlagFlipCommand.h | 41 ---------------------------- pokemodr/commands/FlipFlagCommand.cpp | 44 ++++++++++++++++++++++++++++++ pokemodr/commands/FlipFlagCommand.h | 43 +++++++++++++++++++++++++++++ pokemodr/commands/RandomizeFlagCommand.cpp | 44 ++++++++++++++++++++++++++++++ pokemodr/commands/RandomizeFlagCommand.h | 43 +++++++++++++++++++++++++++++ pokemodr/commands/SetFlagCommand.cpp | 44 ++++++++++++++++++++++++++++++ pokemodr/commands/SetFlagCommand.h | 43 +++++++++++++++++++++++++++++ pokemodr/commands/UnsetFlagCommand.cpp | 44 ++++++++++++++++++++++++++++++ pokemodr/commands/UnsetFlagCommand.h | 43 +++++++++++++++++++++++++++++ pokemodr/pokemodr.pro | 10 +++++-- 13 files changed, 375 insertions(+), 89 deletions(-) delete mode 100644 pokemodr/commands/FlagFlipCommand.cpp delete mode 100644 pokemodr/commands/FlagFlipCommand.h create mode 100644 pokemodr/commands/FlipFlagCommand.cpp create mode 100644 pokemodr/commands/FlipFlagCommand.h create mode 100644 pokemodr/commands/RandomizeFlagCommand.cpp create mode 100644 pokemodr/commands/RandomizeFlagCommand.h create mode 100644 pokemodr/commands/SetFlagCommand.cpp create mode 100644 pokemodr/commands/SetFlagCommand.h create mode 100644 pokemodr/commands/UnsetFlagCommand.cpp create mode 100644 pokemodr/commands/UnsetFlagCommand.h diff --git a/Changelog b/Changelog index 4eee2ddf..c4908577 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,11 @@ +----------------- +Rev: 163 +Date: 22 May 2008 +User: MathStuf +----------------- +[ADD] New Dialog widgets +[FIX] FlipFlag was misnamed + ----------------- Rev: 162 Date: 21 May 2008 diff --git a/pokemodr/DialogUI.cpp b/pokemodr/DialogUI.cpp index cf76b9cc..3f2ac065 100644 --- a/pokemodr/DialogUI.cpp +++ b/pokemodr/DialogUI.cpp @@ -19,7 +19,10 @@ #include "DialogUI.h" // Command includes -#include "commands/FlagFlipCommand.h" +#include "commands/FlipFlagCommand.h" +#include "commands/SetFlagCommand.h" +#include "commands/UnsetFlagCommand.h" +#include "commands/RandomizeFlagCommand.h" // Pokemod includes #include "../pokemod/Dialog.h" @@ -76,11 +79,17 @@ void DialogUI::on_varCommand_activated(const int command) switch (command) { case Dialog::FlipFlag: - commandWidget = new FlagFlipCommand(pokemod, command); + commandWidget = new FlipFlagCommand(pokemod, command); break; case Dialog::SetFlag: + commandWidget = new SetFlagCommand(pokemod, command); + break; case Dialog::UnsetFlag: + commandWidget = new UnsetFlagCommand(pokemod, command); + break; case Dialog::RandomizeFlag: + commandWidget = new RandomizeFlagCommand(pokemod, command); + break; case Dialog::TestFlag: case Dialog::DialogC: case Dialog::YesNo: diff --git a/pokemodr/commands/FlagFlipCommand.cpp b/pokemodr/commands/FlagFlipCommand.cpp deleted file mode 100644 index fa3fea0d..00000000 --- a/pokemodr/commands/FlagFlipCommand.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 "FlagFlipCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" - -// Qt includes -#include -#include - -FlagFlipCommand::FlagFlipCommand(const Pokemod * pokemod, const int command) : - CommandWidget(pokemod, command) -{ - QVBoxLayout* vboxLayout = new QVBoxLayout(this); - QHBoxLayout* hboxLayout = new QHBoxLayout; - boxFlag = new QGroupBox("Flag to flip"); - varFlag = new KIntNumInput(); - varFlag->setRange(0, INT_MAX); - hboxLayout->addWidget(varFlag); - boxFlag->setLayout(hboxLayout); - vboxLayout->addWidget(boxFlag); -} - -QString FlagFlipCommand::commandString() const -{ - return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); -} diff --git a/pokemodr/commands/FlagFlipCommand.h b/pokemodr/commands/FlagFlipCommand.h deleted file mode 100644 index 7323a475..00000000 --- a/pokemodr/commands/FlagFlipCommand.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 . - */ - -#ifndef __POKEMODR_FLAGFLIPCOMMAND__ -#define __POKEMODR_FLAGFLIPCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Qt includes -#include - -// KDE includes -#include - -class FlagFlipCommand : public CommandWidget -{ - public: - FlagFlipCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; - private: - QGroupBox* boxFlag; - KIntNumInput* varFlag; -}; - -#endif diff --git a/pokemodr/commands/FlipFlagCommand.cpp b/pokemodr/commands/FlipFlagCommand.cpp new file mode 100644 index 00000000..8a40ff2b --- /dev/null +++ b/pokemodr/commands/FlipFlagCommand.cpp @@ -0,0 +1,44 @@ +/* + * 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 "FlipFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include +#include + +FlipFlagCommand::FlipFlagCommand(const Pokemod * pokemod, const int command) : + CommandWidget(pokemod, command) +{ + QVBoxLayout* vboxLayout = new QVBoxLayout(this); + QHBoxLayout* hboxLayout = new QHBoxLayout; + boxFlag = new QGroupBox("Flag to flip"); + varFlag = new KIntNumInput(); + varFlag->setRange(0, INT_MAX); + hboxLayout->addWidget(varFlag); + boxFlag->setLayout(hboxLayout); + vboxLayout->addWidget(boxFlag); +} + +QString FlipFlagCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); +} diff --git a/pokemodr/commands/FlipFlagCommand.h b/pokemodr/commands/FlipFlagCommand.h new file mode 100644 index 00000000..fd2790cb --- /dev/null +++ b/pokemodr/commands/FlipFlagCommand.h @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +#ifndef __POKEMODR_FLIPFLAGCOMMAND__ +#define __POKEMODR_FLIPFLAGCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Qt includes +#include + +// KDE includes +#include + +class FlipFlagCommand : public CommandWidget +{ + Q_OBJECT + + public: + FlipFlagCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; + private: + QGroupBox* boxFlag; + KIntNumInput* varFlag; +}; + +#endif diff --git a/pokemodr/commands/RandomizeFlagCommand.cpp b/pokemodr/commands/RandomizeFlagCommand.cpp new file mode 100644 index 00000000..4bea5f1a --- /dev/null +++ b/pokemodr/commands/RandomizeFlagCommand.cpp @@ -0,0 +1,44 @@ +/* + * 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 "RandomizeFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include +#include + +RandomizeFlagCommand::RandomizeFlagCommand(const Pokemod * pokemod, const int command) : + CommandWidget(pokemod, command) +{ + QVBoxLayout* vboxLayout = new QVBoxLayout(this); + QHBoxLayout* hboxLayout = new QHBoxLayout; + boxFlag = new QGroupBox("Flag to randomize"); + varFlag = new KIntNumInput(); + varFlag->setRange(0, INT_MAX); + hboxLayout->addWidget(varFlag); + boxFlag->setLayout(hboxLayout); + vboxLayout->addWidget(boxFlag); +} + +QString RandomizeFlagCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); +} diff --git a/pokemodr/commands/RandomizeFlagCommand.h b/pokemodr/commands/RandomizeFlagCommand.h new file mode 100644 index 00000000..25eb73e0 --- /dev/null +++ b/pokemodr/commands/RandomizeFlagCommand.h @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +#ifndef __POKEMODR_RANDOMIZEFLAGCOMMAND__ +#define __POKEMODR_RANDOMIZEFLAGCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Qt includes +#include + +// KDE includes +#include + +class RandomizeFlagCommand : public CommandWidget +{ + Q_OBJECT + + public: + RandomizeFlagCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; + private: + QGroupBox* boxFlag; + KIntNumInput* varFlag; +}; + +#endif 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 + * + * 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 "SetFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include +#include + +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()); +} diff --git a/pokemodr/commands/SetFlagCommand.h b/pokemodr/commands/SetFlagCommand.h new file mode 100644 index 00000000..d0f50b55 --- /dev/null +++ b/pokemodr/commands/SetFlagCommand.h @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +#ifndef __POKEMODR_SETFLAGCOMMAND__ +#define __POKEMODR_SETFLAGCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Qt includes +#include + +// KDE includes +#include + +class SetFlagCommand : public CommandWidget +{ + Q_OBJECT + + public: + SetFlagCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; + private: + QGroupBox* boxFlag; + KIntNumInput* varFlag; +}; + +#endif diff --git a/pokemodr/commands/UnsetFlagCommand.cpp b/pokemodr/commands/UnsetFlagCommand.cpp new file mode 100644 index 00000000..41ef61f6 --- /dev/null +++ b/pokemodr/commands/UnsetFlagCommand.cpp @@ -0,0 +1,44 @@ +/* + * 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 "UnsetFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include +#include + +UnsetFlagCommand::UnsetFlagCommand(const Pokemod * pokemod, const int command) : + CommandWidget(pokemod, command) +{ + QVBoxLayout* vboxLayout = new QVBoxLayout(this); + QHBoxLayout* hboxLayout = new QHBoxLayout; + boxFlag = new QGroupBox("Flag to unset"); + varFlag = new KIntNumInput(); + varFlag->setRange(0, INT_MAX); + hboxLayout->addWidget(varFlag); + boxFlag->setLayout(hboxLayout); + vboxLayout->addWidget(boxFlag); +} + +QString UnsetFlagCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); +} diff --git a/pokemodr/commands/UnsetFlagCommand.h b/pokemodr/commands/UnsetFlagCommand.h new file mode 100644 index 00000000..f3617f2f --- /dev/null +++ b/pokemodr/commands/UnsetFlagCommand.h @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +#ifndef __POKEMODR_UNSETFLAGCOMMAND__ +#define __POKEMODR_UNSETFLAGCOMMAND__ + +// Command includes +#include "CommandWidget.h" + +// Qt includes +#include + +// KDE includes +#include + +class UnsetFlagCommand : public CommandWidget +{ + Q_OBJECT + + public: + UnsetFlagCommand(const Pokemod* pokemod, const int command); + + QString commandString() const; + private: + QGroupBox* boxFlag; + KIntNumInput* varFlag; +}; + +#endif diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 10a2746f..a2397f5a 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -142,7 +142,10 @@ SOURCES += AbilityUI.cpp \ models/TypeGroupModel.cpp \ models/TypeModel.cpp \ commands/CommandWidget.cpp \ - commands/FlagFlipCommand.cpp + commands/FlipFlagCommand.cpp \ + commands/SetFlagCommand.cpp \ + commands/UnsetFlagCommand.cpp \ + commands/RandomizeFlagCommand.cpp HEADERS += AbilityUI.h \ AbilityEffectUI.h \ @@ -256,7 +259,10 @@ HEADERS += AbilityUI.h \ models/TypeGroupModel.h \ models/TypeModel.h \ commands/CommandWidget.h \ - commands/FlagFlipCommand.h + commands/FlipFlagCommand.h \ + commands/SetFlagCommand.h \ + commands/UnsetFlagCommand.h \ + commands/RandomizeFlagCommand.h FORMS += gui/ability.ui \ gui/abilityeffect.ui \ -- cgit