summaryrefslogtreecommitdiffstats
path: root/pokemodr/commands/RandomizeFlagCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/commands/RandomizeFlagCommand.cpp')
-rw-r--r--pokemodr/commands/RandomizeFlagCommand.cpp44
1 files changed, 44 insertions, 0 deletions
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());
+}