summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-22 06:05:31 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-22 06:05:31 +0000
commita4eabe00d6c32d0d15d77362428fb2d05a0ec0d7 (patch)
treeefa01b3be952c8b32b381e019803f1e1e6c4afbd
parentc2d90a8019125dc260db1882ebc292e4e52f3969 (diff)
downloadsigen-a4eabe00d6c32d0d15d77362428fb2d05a0ec0d7.tar.gz
sigen-a4eabe00d6c32d0d15d77362428fb2d05a0ec0d7.tar.xz
sigen-a4eabe00d6c32d0d15d77362428fb2d05a0ec0d7.zip
[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
-rw-r--r--Changelog8
-rw-r--r--pokemodr/DialogUI.cpp13
-rw-r--r--pokemodr/commands/FlipFlagCommand.cpp (renamed from pokemodr/commands/FlagFlipCommand.cpp)6
-rw-r--r--pokemodr/commands/FlipFlagCommand.h (renamed from pokemodr/commands/FlagFlipCommand.h)10
-rw-r--r--pokemodr/commands/RandomizeFlagCommand.cpp44
-rw-r--r--pokemodr/commands/RandomizeFlagCommand.h43
-rw-r--r--pokemodr/commands/SetFlagCommand.cpp44
-rw-r--r--pokemodr/commands/SetFlagCommand.h43
-rw-r--r--pokemodr/commands/UnsetFlagCommand.cpp44
-rw-r--r--pokemodr/commands/UnsetFlagCommand.h43
-rw-r--r--pokemodr/pokemodr.pro10
11 files changed, 297 insertions, 11 deletions
diff --git a/Changelog b/Changelog
index 4eee2ddf..c4908577 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,12 @@
-----------------
+Rev: 163
+Date: 22 May 2008
+User: MathStuf
+-----------------
+[ADD] New Dialog widgets
+[FIX] FlipFlag was misnamed
+
+-----------------
Rev: 162
Date: 21 May 2008
User: MathStuf
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/FlipFlagCommand.cpp
index fa3fea0d..8a40ff2b 100644
--- a/pokemodr/commands/FlagFlipCommand.cpp
+++ b/pokemodr/commands/FlipFlagCommand.cpp
@@ -16,7 +16,7 @@
*/
// Header include
-#include "FlagFlipCommand.h"
+#include "FlipFlagCommand.h"
// Pokemod includes
#include "../../pokemod/Dialog.h"
@@ -25,7 +25,7 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
-FlagFlipCommand::FlagFlipCommand(const Pokemod * pokemod, const int command) :
+FlipFlagCommand::FlipFlagCommand(const Pokemod * pokemod, const int command) :
CommandWidget(pokemod, command)
{
QVBoxLayout* vboxLayout = new QVBoxLayout(this);
@@ -38,7 +38,7 @@ FlagFlipCommand::FlagFlipCommand(const Pokemod * pokemod, const int command) :
vboxLayout->addWidget(boxFlag);
}
-QString FlagFlipCommand::commandString() const
+QString FlipFlagCommand::commandString() const
{
return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value());
}
diff --git a/pokemodr/commands/FlagFlipCommand.h b/pokemodr/commands/FlipFlagCommand.h
index 7323a475..fd2790cb 100644
--- a/pokemodr/commands/FlagFlipCommand.h
+++ b/pokemodr/commands/FlipFlagCommand.h
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEMODR_FLAGFLIPCOMMAND__
-#define __POKEMODR_FLAGFLIPCOMMAND__
+#ifndef __POKEMODR_FLIPFLAGCOMMAND__
+#define __POKEMODR_FLIPFLAGCOMMAND__
// Command includes
#include "CommandWidget.h"
@@ -27,10 +27,12 @@
// KDE includes
#include <KIntNumInput>
-class FlagFlipCommand : public CommandWidget
+class FlipFlagCommand : public CommandWidget
{
+ Q_OBJECT
+
public:
- FlagFlipCommand(const Pokemod* pokemod, const int command);
+ FlipFlagCommand(const Pokemod* pokemod, const int command);
QString commandString() const;
private:
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 <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 "RandomizeFlagCommand.h"
+
+// Pokemod includes
+#include "../../pokemod/Dialog.h"
+
+// Qt includes
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+
+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 <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_RANDOMIZEFLAGCOMMAND__
+#define __POKEMODR_RANDOMIZEFLAGCOMMAND__
+
+// Command includes
+#include "CommandWidget.h"
+
+// Qt includes
+#include <QGroupBox>
+
+// KDE includes
+#include <KIntNumInput>
+
+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 <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());
+}
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 <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_SETFLAGCOMMAND__
+#define __POKEMODR_SETFLAGCOMMAND__
+
+// Command includes
+#include "CommandWidget.h"
+
+// Qt includes
+#include <QGroupBox>
+
+// KDE includes
+#include <KIntNumInput>
+
+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 <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 "UnsetFlagCommand.h"
+
+// Pokemod includes
+#include "../../pokemod/Dialog.h"
+
+// Qt includes
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+
+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 <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_UNSETFLAGCOMMAND__
+#define __POKEMODR_UNSETFLAGCOMMAND__
+
+// Command includes
+#include "CommandWidget.h"
+
+// Qt includes
+#include <QGroupBox>
+
+// KDE includes
+#include <KIntNumInput>
+
+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 \