diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 04:02:07 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 04:02:07 +0000 |
| commit | 25984412ffc414de66b7fc990bb53cbfcf2a6993 (patch) | |
| tree | 2e59c7d61583a5964fb87562395351b3624c9e64 | |
| parent | 3e72425d8566687631cb7b7fc1b299efd8a4877e (diff) | |
[FIX] API of FractionWidget and PointWidget
[ADD] FlagWidget
[FIX] Changed MapEffect, MapTrainer, and MapWarp to use FlagWidget
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@132 6ecfd1a5-f3ed-3746-8530-beee90d26b22
| -rw-r--r-- | Changelog | 9 | ||||
| -rw-r--r-- | pokemod/MapTrainer.cpp | 16 | ||||
| -rw-r--r-- | pokemod/MapTrainer.h | 6 | ||||
| -rw-r--r-- | pokemodr/FlagWidget.cpp | 62 | ||||
| -rw-r--r-- | pokemodr/FlagWidget.h | 50 | ||||
| -rw-r--r-- | pokemodr/FractionWidget.cpp | 26 | ||||
| -rw-r--r-- | pokemodr/FractionWidget.h | 17 | ||||
| -rw-r--r-- | pokemodr/MapTrainerUI.cpp | 22 | ||||
| -rw-r--r-- | pokemodr/MapTrainerUI.h | 4 | ||||
| -rw-r--r-- | pokemodr/MapWarpUI.cpp | 21 | ||||
| -rw-r--r-- | pokemodr/MapWarpUI.h | 4 | ||||
| -rw-r--r-- | pokemodr/PointWidget.h | 4 | ||||
| -rw-r--r-- | pokemodr/TODO | 8 | ||||
| -rw-r--r-- | pokemodr/gui/flag.ui | 39 | ||||
| -rw-r--r-- | pokemodr/gui/mapeffect.ui | 46 | ||||
| -rw-r--r-- | pokemodr/gui/maptrainer.ui | 35 | ||||
| -rw-r--r-- | pokemodr/gui/mapwarp.ui | 41 | ||||
| -rw-r--r-- | pokemodr/pokemodr.pro | 3 |
18 files changed, 252 insertions, 161 deletions
@@ -1,4 +1,13 @@ ----------------- +Rev: 132 +Date: 15 May 2008 +User: MathStuf +----------------- +[FIX] API of FractionWidget and PointWidget +[ADD] FlagWidget +[FIX] Changed MapEffect, MapTrainer, and MapWarp to use FlagWidget + +----------------- Rev: 131 Date: 14 May 2008 User: MathStuf diff --git a/pokemod/MapTrainer.cpp b/pokemod/MapTrainer.cpp index 03d0fcba..2da60aa2 100644 --- a/pokemod/MapTrainer.cpp +++ b/pokemod/MapTrainer.cpp @@ -41,7 +41,7 @@ MapTrainer::MapTrainer(const Map* parent, const int id) : m_sight(0), m_direction(INT_MAX), m_numberFight(1), - m_flag(0, 0), + m_appearFlag(0, 0), m_dialog(INT_MAX), m_leadTeamMember(INT_MAX) { @@ -95,7 +95,7 @@ void MapTrainer::load(const QDomElement& xml, int id) LOAD(int, sight); LOAD(int, direction); LOAD(int, numberFight); - LOAD(Flag, flag); + LOAD(Flag, appearFlag); LOAD(int, dialog); LOAD_SUB(newTeamMember, MapTrainerTeamMember); LOAD(int, leadTeamMember); @@ -110,7 +110,7 @@ QDomElement MapTrainer::save() const SAVE(int, sight); SAVE(int, direction); SAVE(int, numberFight); - SAVE(Flag, flag); + SAVE(Flag, appearFlag); SAVE(int, dialog); SAVE_SUB(MapTrainerTeamMember, teamMember); return xml; @@ -166,9 +166,9 @@ void MapTrainer::setNumberFight(const int numberFight) m_numberFight = numberFight; } -void MapTrainer::setFlag(const Flag& flag) +void MapTrainer::setAppearFlag(const Flag& appearFlag) { - m_flag = flag; + m_appearFlag = appearFlag; } void MapTrainer::setDialog(const int dialog) @@ -221,9 +221,9 @@ int MapTrainer::numberFight() const return m_numberFight; } -Flag MapTrainer::flag() const +Flag MapTrainer::appearFlag() const { - return m_flag; + return m_appearFlag; } int MapTrainer::dialog() const @@ -328,7 +328,7 @@ MapTrainer& MapTrainer::operator=(const MapTrainer& rhs) COPY(sight); COPY(direction); COPY(numberFight); - COPY(flag); + COPY(appearFlag); COPY(dialog); COPY(leadTeamMember); COPY_SUB(MapTrainerTeamMember, teamMember); diff --git a/pokemod/MapTrainer.h b/pokemod/MapTrainer.h index 02a9eb2e..4bfaf3bc 100644 --- a/pokemod/MapTrainer.h +++ b/pokemod/MapTrainer.h @@ -54,7 +54,7 @@ class MapTrainer : public Object void setSight(const int sight); void setDirection(const int direction); void setNumberFight(const int numberFight); - void setFlag(const Flag& flag); + void setAppearFlag(const Flag& appearFlag); void setDialog(const int dialog); void setLeadTeamMember(const int leadMember); @@ -64,7 +64,7 @@ class MapTrainer : public Object int sight() const; int direction() const; int numberFight() const; - Flag flag() const; + Flag appearFlag() const; int dialog() const; int leadTeamMember() const; @@ -93,7 +93,7 @@ class MapTrainer : public Object int m_sight; int m_direction; int m_numberFight; - Flag m_flag; + Flag m_appearFlag; int m_dialog; int m_leadTeamMember; QList<MapTrainerTeamMember*> m_teamMember; diff --git a/pokemodr/FlagWidget.cpp b/pokemodr/FlagWidget.cpp new file mode 100644 index 00000000..70f47a45 --- /dev/null +++ b/pokemodr/FlagWidget.cpp @@ -0,0 +1,62 @@ +/* + * 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 "FlagWidget.h" + +// Qt includes +#include <QMetaObject> + +FlagWidget::FlagWidget(QWidget* parent, const Flag& value) : + QGroupBox(parent), + m_value(value) +{ + setupUi(this); + QMetaObject::connectSlotsByName(this); + connect(this, SIGNAL(clicked(bool)), SLOT(boxClicked(bool))); +} + +Flag FlagWidget::value() const +{ + return m_value; +} + +void FlagWidget::setValue(const Flag& value) +{ + m_value = value; + setChecked(m_value.status() == Flag::Ignore); + varFlag->setValue(m_value.flag()); + varState->setCheckState((m_value.status() == Flag::On) ? Qt::Checked : Qt::Unchecked); + emit(valueChanged(m_value)); +} + +void FlagWidget::boxClicked(const bool clicked) +{ + if (!clicked) + m_value.setStatus(Flag::Ignore); +} + +void FlagWidget::on_varFlag_valueChanged(const int flag) +{ + m_value.setFlag(flag); +} + +void FlagWidget::on_varState_checked(const bool state) +{ + m_value.setStatus(state ? Flag::On : Flag::Off); +} + diff --git a/pokemodr/FlagWidget.h b/pokemodr/FlagWidget.h new file mode 100644 index 00000000..1543f723 --- /dev/null +++ b/pokemodr/FlagWidget.h @@ -0,0 +1,50 @@ +/* + * 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 __FLAGWIDGET__ +#define __FLAGWIDGET__ + +// General includes +#include "../general/Flag.h" + +// Qt includes +#include <QWidget> + +// Form include +#include "ui_flag.h" + +class FlagWidget : public QGroupBox, private Ui::formFlag +{ + Q_OBJECT + + public: + FlagWidget(QWidget* parent, const Flag& value = Flag(0, Flag::Off)); + + Flag value() const; + signals: + void valueChanged(const Flag&); + public slots: + void setValue(const Flag& value); + protected slots: + void boxClicked(const bool clicked); + void on_varFlag_valueChanged(const int flag); + void on_varState_checked(const bool state); + private: + Flag m_value; +}; + +#endif diff --git a/pokemodr/FractionWidget.cpp b/pokemodr/FractionWidget.cpp index ba2a505d..a418133a 100644 --- a/pokemodr/FractionWidget.cpp +++ b/pokemodr/FractionWidget.cpp @@ -28,7 +28,17 @@ FractionWidget::FractionWidget(QWidget* parent, const Fraction& value) : { setupUi(this); QMetaObject::connectSlotsByName(this); - connect(this, SIGNAL(valueChanged(Fraction)), SLOT(updateValue())); + connect(this, SIGNAL(valueChanged(const Fraction&)), SLOT(updateValue())); +} + +int FractionWidget::behavior() const +{ + return m_behavior; +} + +Fraction FractionWidget::value() const +{ + return m_value; } void FractionWidget::setBehavior(const int behavior) @@ -48,17 +58,7 @@ void FractionWidget::setValue(const Fraction& value) emit(valueChanged(m_value)); } -int FractionWidget::behavior() const -{ - return m_behavior; -} - -Fraction FractionWidget::value() const -{ - return m_value; -} - -void FractionWidget::on_varNumerator_valueChanged(const int& numerator) +void FractionWidget::on_varNumerator_valueChanged(const int numerator) { m_value.setNumerator(numerator); if (0 < m_behavior) @@ -68,7 +68,7 @@ void FractionWidget::on_varNumerator_valueChanged(const int& numerator) emit(valueChanged(m_value)); } -void FractionWidget::on_varDenominator_valueChanged(const int& denominator) +void FractionWidget::on_varDenominator_valueChanged(const int denominator) { m_value.setDenominator(denominator); if (m_behavior < 0) diff --git a/pokemodr/FractionWidget.h b/pokemodr/FractionWidget.h index 87da9ddd..a79221c5 100644 --- a/pokemodr/FractionWidget.h +++ b/pokemodr/FractionWidget.h @@ -15,8 +15,8 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __FRACWIDGET__ -#define __FRACWIDGET__ +#ifndef __FRACTIONWIDGET__ +#define __FRACTIONWIDGET__ // General includes #include "../general/Fraction.h" @@ -34,17 +34,18 @@ class FractionWidget : public QWidget, private Ui::formFraction public: FractionWidget(QWidget* parent, const Fraction& value = Fraction(1, 1)); - void setBehavior(const int behavior); - void setValue(const Fraction& value); - int behavior() const; Fraction value() const; signals: - void valueChanged(Fraction); + void valueChanged(const Fraction&); public slots: - void on_varNumerator_valueChanged(const int& numerator); - void on_varDenominator_valueChanged(const int& denominator); + void setBehavior(const int behavior); + void setValue(const Fraction& value); + void updateValue(); + protected slots: + void on_varNumerator_valueChanged(const int numerator); + void on_varDenominator_valueChanged(const int denominator); private: int m_behavior; Fraction m_value; diff --git a/pokemodr/MapTrainerUI.cpp b/pokemodr/MapTrainerUI.cpp index 8ad8a32c..acf31c6e 100644 --- a/pokemodr/MapTrainerUI.cpp +++ b/pokemodr/MapTrainerUI.cpp @@ -89,12 +89,7 @@ void MapTrainerUI::setGui() varSight->setValue(static_cast<MapTrainer*>(modified())->sight()); varDirection->setCurrentIndex(static_cast<MapTrainer*>(modified())->direction()); varNumberFight->setValue(static_cast<MapTrainer*>(modified())->numberFight()); - boxFlag->setChecked((static_cast<MapTrainer*>(modified())->flag().status() == Flag::Ignore) ? Qt::Unchecked : Qt::Checked); - if (boxFlag->isChecked()) - { - varFlag->setValue(static_cast<MapTrainer*>(modified())->flag().flag()); - varState->setCheckState((static_cast<MapTrainer*>(modified())->flag().status() == Flag::On) ? Qt::Checked : Qt::Unchecked); - } + varAppearFlag->setValue(static_cast<MapTrainer*>(modified())->appearFlag()); varDialog->setCurrentIndex(varDialog->findData(static_cast<MapTrainer*>(modified())->dialog())); varLeadTeamMember->setCurrentIndex(varLeadTeamMember->findData(static_cast<MapTrainer*>(modified())->leadTeamMember())); } @@ -142,20 +137,9 @@ void MapTrainerUI::on_varNumberFight_valueChanged(const int numberFight) static_cast<MapTrainer*>(modified())->setNumberFight(numberFight); } -void MapTrainerUI::on_boxFlag_toggled(const bool flagUsed) -{ - if (!flagUsed) - static_cast<MapTrainer*>(modified())->setFlag(Flag(varFlag->value(), Flag::Ignore)); -} - -void MapTrainerUI::on_varFlag_valueChanged(const int flag) -{ - static_cast<MapTrainer*>(modified())->setFlag(Flag(flag, boxFlag->isChecked() ? Flag::Ignore : (varState->isChecked() ? Flag::On : Flag::Off))); -} - -void MapTrainerUI::on_varState_toggled(const bool status) +void MapTrainerUI::on_varAppearFlag_changed(const Flag& appearFlag) { - static_cast<MapTrainer*>(modified())->setFlag(Flag(varFlag->value(), status ? Flag::On : Flag::Off)); + static_cast<MapTrainer*>(modified())->setAppearFlag(appearFlag); } void MapTrainerUI::on_varDialog_currentIndexChanged(const int dialog) diff --git a/pokemodr/MapTrainerUI.h b/pokemodr/MapTrainerUI.h index 89df3e5d..fa76d79b 100644 --- a/pokemodr/MapTrainerUI.h +++ b/pokemodr/MapTrainerUI.h @@ -43,9 +43,7 @@ class MapTrainerUI : public ObjectUI, private Ui::formMapTrainer void on_varSight_valueChanged(const int sight); void on_varDirection_currentIndexChanged(const int direction); void on_varNumberFight_valueChanged(const int numberFight); - void on_boxFlag_toggled(const bool flagUsed); - void on_varFlag_valueChanged(const int flag); - void on_varState_toggled(const bool state); + void on_varAppearFlag_changed(const Flag& appearFlag); void on_varDialog_currentIndexChanged(const int dialog); void on_varLeadTeamMember_currentIndexChanged(const int leadTeamMember); private slots: diff --git a/pokemodr/MapWarpUI.cpp b/pokemodr/MapWarpUI.cpp index a0f498c7..d24cb17f 100644 --- a/pokemodr/MapWarpUI.cpp +++ b/pokemodr/MapWarpUI.cpp @@ -101,12 +101,7 @@ void MapWarpUI::setGui() } } varToWarp->setCurrentIndex(varToMap->findData(static_cast<MapWarp*>(modified())->toWarp())); - boxFlag->setChecked((static_cast<MapWarp*>(modified())->workingFlag().status() == Flag::Ignore) ? Qt::Unchecked : Qt::Checked); - if (boxFlag->isChecked()) - { - varFlag->setValue(static_cast<MapWarp*>(modified())->workingFlag().flag()); - varState->setCheckState((static_cast<MapWarp*>(modified())->workingFlag().status() == Flag::On) ? Qt::Checked : Qt::Unchecked); - } + varWorkingFlag->setValue(static_cast<MapWarp*>(modified())->workingFlag()); varDialog->setCurrentIndex(varDialog->findData(static_cast<MapWarp*>(modified())->dialog())); } @@ -174,21 +169,11 @@ void MapWarpUI::on_varToWarp_currentIndexChanged(const int toWarp) static_cast<MapWarp*>(modified())->setToWarp(toWarp); } -void MapWarpUI::on_boxFlag_toggled(const bool flagUsed) +void MapWarpUI::on_varWorkingFlag_valueChanged(const Flag& workingFlag) { - if (!flagUsed) - static_cast<MapWarp*>(modified())->setWorkingFlag(Flag(varFlag->value(), Flag::Ignore)); + static_cast<MapWarp*>(modified())->setWorkingFlag(workingFlag); } -void MapWarpUI::on_varFlag_valueChanged(const int flag) -{ - static_cast<MapWarp*>(modified())->setWorkingFlag(Flag(flag, boxFlag->isChecked() ? Flag::Ignore : (varState->isChecked() ? Flag::On : Flag::Off))); -} - -void MapWarpUI::on_varState_toggled(const bool status) -{ - static_cast<MapWarp*>(modified())->setWorkingFlag(Flag(varFlag->value(), status ? Flag::On : Flag::Off)); -} void MapWarpUI::on_varDialog_currentIndexChanged(const int dialog) { diff --git a/pokemodr/MapWarpUI.h b/pokemodr/MapWarpUI.h index 708781c2..f31976d2 100644 --- a/pokemodr/MapWarpUI.h +++ b/pokemodr/MapWarpUI.h @@ -47,9 +47,7 @@ class MapWarpUI : public ObjectUI, private Ui::formMapWarp void on_varFog_stateChanged(const int fog); void on_varToMap_currentIndexChanged(const int toMap); void on_varToWarp_currentIndexChanged(const int toWarp); - void on_boxFlag_toggled(const bool flagUsed); - void on_varFlag_valueChanged(const int flag); - void on_varState_toggled(const bool state); + void on_varWorkingFlag_valueChanged(const Flag& workingFlag); void on_varDialog_currentIndexChanged(const int dialog); private slots: void initGui(); diff --git a/pokemodr/PointWidget.h b/pokemodr/PointWidget.h index 711bb74a..4ff72148 100644 --- a/pokemodr/PointWidget.h +++ b/pokemodr/PointWidget.h @@ -36,11 +36,11 @@ class PointWidget : public QWidget, private Ui::formPoint Point value() const; signals: - void valueChanged(bool); + void valueChanged(const Point&); public slots: void setValue(const Point& value); void setMaximum(const Point& maximum); - + protected slots: void on_varX_valueChanged(const int& x); void on_varY_valueChanged(const int& y); private: diff --git a/pokemodr/TODO b/pokemodr/TODO index 502f8be6..3a530988 100644 --- a/pokemodr/TODO +++ b/pokemodr/TODO @@ -4,9 +4,13 @@ ItemEffect MapEffect MoveEffect +Set Fraction widget behavior correctly + +Set better permissions on slots + Set sub class stuff by passing it on to subclasses via setData -Flag widget TilemapModel is (probably) wrong -BaseModel -> BaseObjectModel in GroupModel +Test code: + BaseModel -> BaseObjectModel in GroupModel diff --git a/pokemodr/gui/flag.ui b/pokemodr/gui/flag.ui new file mode 100644 index 00000000..49ae08b8 --- /dev/null +++ b/pokemodr/gui/flag.ui @@ -0,0 +1,39 @@ +<ui version="4.0" > + <class>formFlag</class> + <widget class="QGroupBox" name="formFlag" > + <property name="checkable" > + <bool>true</bool> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KIntNumInput" name="varFlag" > + <property name="toolTip" > + <string>The number of the flag</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="varState" > + <property name="toolTip" > + <string>Whether the flag has to be on or off</string> + </property> + <property name="text" > + <string>State</string> + </property> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/mapeffect.ui b/pokemodr/gui/mapeffect.ui index d504b9c2..7bac51a7 100644 --- a/pokemodr/gui/mapeffect.ui +++ b/pokemodr/gui/mapeffect.ui @@ -57,7 +57,7 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="PointWidget" native="1" name="varCoordinate" > + <widget class="PointWidget" name="varCoordinate" > <property name="toolTip" > <string>The coordinate of the effect</string> </property> @@ -67,35 +67,16 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxExistFlag" > + <widget class="FlagWidget" name="varExistFlag" > + <property name="toolTip" > + <string>The flag that determines whether the effect is active or not</string> + </property> <property name="title" > <string>Exist Flag</string> </property> <property name="checkable" > <bool>true</bool> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varExistFlag" > - <property name="toolTip" > - <string>flag which determines if the effect is on the overworld</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="varState" > - <property name="toolTip" > - <string>Whether the flag has to be on, off, or is ignored</string> - </property> - <property name="text" > - <string>State</string> - </property> - </widget> - </item> - </layout> </widget> </item> <item> @@ -267,11 +248,6 @@ <header>kcombobox.h</header> </customwidget> <customwidget> - <class>KIntNumInput</class> - <extends>QWidget</extends> - <header>knuminput.h</header> - </customwidget> - <customwidget> <class>KLineEdit</class> <extends>QLineEdit</extends> <header>klineedit.h</header> @@ -281,6 +257,18 @@ <extends>QPushButton</extends> <header>kpushbutton.h</header> </customwidget> + <customwidget> + <class>PointWidget</class> + <extends>QWidget</extends> + <header>../PointWidget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>FlagWidget</class> + <extends>QGroupBox</extends> + <header>../FlagWidget.h</header> + <container>1</container> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/maptrainer.ui b/pokemodr/gui/maptrainer.ui index 57663bad..2ab7b7ae 100644 --- a/pokemodr/gui/maptrainer.ui +++ b/pokemodr/gui/maptrainer.ui @@ -70,7 +70,7 @@ </property> <layout class="QVBoxLayout" > <item> - <widget class="PointWidget" native="1" name="varCoordinate" /> + <widget class="PointWidget" name="varCoordinate" /> </item> </layout> </widget> @@ -130,35 +130,16 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxFlag" > + <widget class="FlagWidget" name="varAppearFlag" > + <property name="toolTip" > + <string>The flag that determines whether the trainer is active or not</string> + </property> <property name="title" > <string>Appear Flag</string> </property> <property name="checkable" > <bool>true</bool> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag that determines if the trainer is on the map or not</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="varState" > - <property name="toolTip" > - <string>Whether the flag has to be on, off, or is ignored</string> - </property> - <property name="text" > - <string>State</string> - </property> - </widget> - </item> - </layout> </widget> </item> <item> @@ -222,6 +203,12 @@ <header>../PointWidget.h</header> <container>1</container> </customwidget> + <customwidget> + <class>FlagWidget</class> + <extends>QGroupBox</extends> + <header>../FlagWidget.h</header> + <container>1</container> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/pokemodr/gui/mapwarp.ui b/pokemodr/gui/mapwarp.ui index f4e21bee..f5536d5b 100644 --- a/pokemodr/gui/mapwarp.ui +++ b/pokemodr/gui/mapwarp.ui @@ -192,35 +192,16 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxFlag" > + <widget class="FlagWidget" name="varWorkingFlag" > + <property name="toolTip" > + <string>The flag that controls whether the warp is active or not</string> + </property> <property name="title" > - <string>Flag</string> + <string>Working Flag</string> </property> <property name="checkable" > <bool>true</bool> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag that determines if the warp works or not</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="varState" > - <property name="toolTip" > - <string>Whether the flag has to be on, off, or is ignored</string> - </property> - <property name="text" > - <string>State</string> - </property> - </widget> - </item> - </layout> </widget> </item> <item> @@ -248,11 +229,6 @@ <header>kcombobox.h</header> </customwidget> <customwidget> - <class>KIntNumInput</class> - <extends>QWidget</extends> - <header>knuminput.h</header> - </customwidget> - <customwidget> <class>KLineEdit</class> <extends>QLineEdit</extends> <header>klineedit.h</header> @@ -271,6 +247,13 @@ <class>PointWidget</class> <extends>QWidget</extends> <header>../PointWidget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>FlagWidget</class> + <extends>QGroupBox</extends> + <header>../FlagWidget.h</header> + <container>1</container> </customwidget> </customwidgets> <resources/> diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 38115fb9..7c6461f1 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -71,6 +71,7 @@ SOURCES += AbilityUI.cpp \ CoinListObjectUI.cpp \ EggGroupUI.cpp \ FileDialog.cpp \ + FlagWidget.cpp \ FractionWidget.cpp \ ItemUI.cpp \ ItemTypeUI.cpp \ @@ -146,6 +147,7 @@ HEADERS += AbilityUI.h \ CoinListObjectUI.h \ EggGroupUI.h \ FileDialog.h \ + FlagWidget.h \ FractionWidget.h \ ItemUI.h \ ItemTypeUI.h \ @@ -224,6 +226,7 @@ FORMS += gui/ability.ui \ gui/coinlistobject.ui \ gui/dialog.ui \ gui/egggroup.ui \ + gui/flag.ui \ gui/fraction.ui \ gui/item.ui \ gui/itemeffect.ui \ |
