diff options
Diffstat (limited to 'pokemodr')
-rw-r--r-- | pokemodr/PokeModTreeItem.cpp | 46 | ||||
-rw-r--r-- | pokemodr/PokeModTreeItem.h | 16 | ||||
-rw-r--r-- | pokemodr/PokeModrUI.cpp | 8 | ||||
-rw-r--r-- | pokemodr/gui/itemtype.ui | 21 | ||||
-rw-r--r-- | pokemodr/gui/maptrainer.ui | 119 | ||||
-rw-r--r-- | pokemodr/gui/pokemod.ui | 3 | ||||
-rw-r--r-- | pokemodr/gui/rules.ui | 3 | ||||
-rw-r--r-- | pokemodr/gui/species.ui | 56 | ||||
-rw-r--r-- | pokemodr/gui/tile.ui | 3 | ||||
-rw-r--r-- | pokemodr/gui/trainer.ui | 150 | ||||
-rw-r--r-- | pokemodr/gui/type.ui | 6 | ||||
-rw-r--r-- | pokemodr/pokemodr.pro | 26 |
12 files changed, 307 insertions, 150 deletions
diff --git a/pokemodr/PokeModTreeItem.cpp b/pokemodr/PokeModTreeItem.cpp index 35ad701d..e44e14c6 100644 --- a/pokemodr/PokeModTreeItem.cpp +++ b/pokemodr/PokeModTreeItem.cpp @@ -459,7 +459,7 @@ void PokeModTreeItem::makeMenu(const QPoint& pos) { } -Object* PokeModTreeItem::makeCopy() +Object* PokeModTreeItem::copy() { if (obj) { @@ -501,3 +501,47 @@ Object* PokeModTreeItem::makeCopy() } return NULL; } + +Object* PokeModTreeItem::cut() +{ + // TODO: actually cut the item + if (obj) + { + QString name(obj->getClassName()); +#define IF_IS_CLASS(class) if (name == #class) return new ::class(obj->getPokemod(), *static_cast< ::class* >(obj), obj->getId()); + IF_IS_CLASS(Ability) + else IF_IS_CLASS(AbilityEffect) + else IF_IS_CLASS(Author) + else IF_IS_CLASS(Badge) + else IF_IS_CLASS(CoinList) + else IF_IS_CLASS(CoinListObject) + else IF_IS_CLASS(Dialog) + else IF_IS_CLASS(EggGroup) + else IF_IS_CLASS(Item) + else IF_IS_CLASS(ItemEffect) + else IF_IS_CLASS(ItemType) + else IF_IS_CLASS(Map) + else IF_IS_CLASS(MapEffect) + else IF_IS_CLASS(MapTrainer) + else IF_IS_CLASS(MapTrainerTeamMember) + else IF_IS_CLASS(MapWarp) + else IF_IS_CLASS(MapWildList) + else IF_IS_CLASS(MapWildListEncounter) + else IF_IS_CLASS(Move) + else IF_IS_CLASS(MoveEffect) + else IF_IS_CLASS(Nature) + else if (name == "Pokemod") return new Pokemod(*static_cast<Pokemod*>(obj)); + else if (name == "Rules") return new Rules(obj->getPokemod()); + else IF_IS_CLASS(Species) + else IF_IS_CLASS(SpeciesAbility) + else IF_IS_CLASS(SpeciesEvolution) + else IF_IS_CLASS(SpeciesItem) + else IF_IS_CLASS(SpeciesMove) + else IF_IS_CLASS(Store) + else IF_IS_CLASS(Tile) + else IF_IS_CLASS(Time) + else IF_IS_CLASS(Type) +#undef IF_IS_CLASS + } + return NULL; +} diff --git a/pokemodr/PokeModTreeItem.h b/pokemodr/PokeModTreeItem.h index f778acf7..48326536 100644 --- a/pokemodr/PokeModTreeItem.h +++ b/pokemodr/PokeModTreeItem.h @@ -60,7 +60,12 @@ class PokeModTreeItem : public QObject, public QTreeWidgetItem } void makeMenu(const QPoint& pos); - Object* makeCopy(); + void save() + { + ui->on_buttonApply_clicked(); + } + Object* copy(); + Object* cut(); void paste(Object* o) { if (obj) @@ -92,6 +97,15 @@ class PokeModTreeItem : public QObject, public QTreeWidgetItem { return obj; } + Pokemod* getPokemod() + { + if (obj) + { + if (obj->getClassName() == "Pokemod") + return static_cast<Pokemod*>(obj); + } + return static_cast<PokeModTreeItem*>(QTreeWidgetItem::parent())->getPokemod(); + } public slots: void updateName(); void changed(const bool c) diff --git a/pokemodr/PokeModrUI.cpp b/pokemodr/PokeModrUI.cpp index 060fab31..adc1e2b2 100644 --- a/pokemodr/PokeModrUI.cpp +++ b/pokemodr/PokeModrUI.cpp @@ -216,7 +216,7 @@ void PokeModrUI::on_actionSave_triggered() { if (!treePokemod->currentItem()) return; - treePokemod->currentItem()->save(); + static_cast<PokeModTreeItem*>(treePokemod->currentItem())->save(); static_cast<Pokemod*>(static_cast<PokeModTreeItem*>(treePokemod->currentItem())->getObject())->getPokemod()->save(); } @@ -227,8 +227,8 @@ void PokeModrUI::on_actionSaveAs_triggered() QString dir = KFileDialog::getExistingDirectory(KUrl(KStandardDirs::locateLocal("data", "pokegen/pokemods", true)), this, QString::fromUtf8("Open PokéMod")); if (dir != "") { - treePokemod->currentItem()->save(); - static_cast<Pokemod*>(static_cast<PokeModTreeItem*>(treePokemod->currentItem())->getObject())->getPokemod()->setPath(dir); + static_cast<PokeModTreeItem*>(treePokemod->currentItem())->save(); + static_cast<PokeModTreeItem*>(treePokemod->currentItem())->getPokemod()->setPath(dir); } } @@ -256,7 +256,7 @@ void PokeModrUI::on_actionCopy_triggered() return; if (clipboard) delete clipboard; - clipboard = static_cast<PokeModTreeItem*>(treePokemod->currentItem())->makeCopy(); + clipboard = static_cast<PokeModTreeItem*>(treePokemod->currentItem())->copy(); } void PokeModrUI::on_actionPaste_triggered() diff --git a/pokemodr/gui/itemtype.ui b/pokemodr/gui/itemtype.ui index 038cc389..10e44be8 100644 --- a/pokemodr/gui/itemtype.ui +++ b/pokemodr/gui/itemtype.ui @@ -85,10 +85,31 @@ </layout> </widget> </item> + <item> + <widget class="QGroupBox" name="boxCount" > + <property name="title" > + <string>Count</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varCount" > + <property name="toolTip" > + <string>The way the items count towards the storage limit</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> diff --git a/pokemodr/gui/maptrainer.ui b/pokemodr/gui/maptrainer.ui index 15b53c17..a573c906 100644 --- a/pokemodr/gui/maptrainer.ui +++ b/pokemodr/gui/maptrainer.ui @@ -48,6 +48,22 @@ </widget> </item> <item> + <widget class="QGroupBox" name="boxTrainerClass" > + <property name="title" > + <string>Trainer Class</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KComboBox" name="varTrainerClass" > + <property name="toolTip" > + <string>The base class of the trainer</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="boxCoordinate" > <property name="title" > <string>Coordinate</string> @@ -83,42 +99,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxSkin" > - <property name="title" > - <string>Skin</string> - </property> - <layout class="QHBoxLayout" > - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </spacer> - </item> - <item> - <widget class="KPushButton" name="varSkin" > - <property name="minimumSize" > - <size> - <width>192</width> - <height>128</height> - </size> - </property> - <property name="toolTip" > - <string>Skin of the trainer</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="boxSight" > <property name="title" > <string>Sight</string> @@ -173,22 +153,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxAI" > - <property name="title" > - <string>AI</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varAI" > - <property name="toolTip" > - <string>The AI scheme used</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="boxAppearFlag" > <property name="title" > <string>Appear Flag</string> @@ -223,55 +187,14 @@ <item> <widget class="QGroupBox" name="boxDialogs" > <property name="title" > - <string>Dialogs</string> + <string>Dialog</string> </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxOverworldDialog" > - <property name="title" > - <string>Overworld</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varOverworlDialog" > - <property name="toolTip" > - <string>The dialog used when talked to in the overworld</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxLoseDialog" > - <property name="title" > - <string>Lose</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varLoseDialog" > - <property name="toolTip" > - <string>The dialog used when the trainer loses</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> + <layout class="QHBoxLayout" > <item> - <widget class="QGroupBox" name="boxWinDialog" > - <property name="title" > - <string>Win</string> + <widget class="KComboBox" name="varDialog" > + <property name="toolTip" > + <string>The dialog used when the trainer is encountered</string> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varWinDialog" > - <property name="toolTip" > - <string>The dialog used when the trainer wins</string> - </property> - </widget> - </item> - </layout> </widget> </item> </layout> diff --git a/pokemodr/gui/pokemod.ui b/pokemodr/gui/pokemod.ui index 6942e581..846794d3 100644 --- a/pokemodr/gui/pokemod.ui +++ b/pokemodr/gui/pokemod.ui @@ -414,9 +414,6 @@ </item> <item> <widget class="QGroupBox" name="boxEffectiveness" > - <property name="title" > - <string/> - </property> <layout class="QVBoxLayout" > <item> <widget class="KIntNumInput" name="varEffectivenessNum" > diff --git a/pokemodr/gui/rules.ui b/pokemodr/gui/rules.ui index 63037d39..af06d33a 100644 --- a/pokemodr/gui/rules.ui +++ b/pokemodr/gui/rules.ui @@ -55,9 +55,6 @@ <property name="toolTip" > <string>If checked, breeding will be enabled</string> </property> - <property name="statusTip" > - <string/> - </property> <property name="text" > <string>Breeding</string> </property> diff --git a/pokemodr/gui/species.ui b/pokemodr/gui/species.ui index 76b070e6..37db392a 100644 --- a/pokemodr/gui/species.ui +++ b/pokemodr/gui/species.ui @@ -8,9 +8,6 @@ <layout class="QHBoxLayout" > <item> <widget class="KPushButton" name="buttonApply" > - <property name="toolTip" > - <string/> - </property> <property name="text" > <string>&Apply</string> </property> @@ -21,9 +18,6 @@ </item> <item> <widget class="KPushButton" name="buttonDiscard" > - <property name="toolTip" > - <string/> - </property> <property name="text" > <string>&Discard</string> </property> @@ -101,9 +95,6 @@ </item> <item> <widget class="KIntNumInput" name="varRunChanceNum" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Numerator</string> </property> @@ -114,9 +105,45 @@ </item> <item> <widget class="KIntNumInput" name="varRunChanceDenom" > + <property name="label" > + <string>Denominator</string> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxFleeChance" > + <property name="title" > + <string>Flee Chance</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="KLineEdit" name="varFleeChance" > <property name="toolTip" > - <string/> + <string>Chance that the player can flee from a wild battle</string> </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varFleeChanceNum" > + <property name="label" > + <string>Numerator</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varFleeChanceDenom" > <property name="label" > <string>Denominator</string> </property> @@ -156,9 +183,6 @@ </item> <item> <widget class="KIntNumInput" name="varItemChanceDenom" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Denominator</string> </property> @@ -436,9 +460,6 @@ </item> <item> <widget class="KIntNumInput" name="varGenderChanceNum" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Numerator</string> </property> @@ -449,9 +470,6 @@ </item> <item> <widget class="KIntNumInput" name="varGenderChanceDenom" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Denominator</string> </property> diff --git a/pokemodr/gui/tile.ui b/pokemodr/gui/tile.ui index 1f6138b8..7ce875b7 100644 --- a/pokemodr/gui/tile.ui +++ b/pokemodr/gui/tile.ui @@ -39,9 +39,6 @@ <property name="toolTip" > <string>Name of the tile</string> </property> - <property name="text" > - <string/> - </property> <property name="showClearButton" stdset="0" > <bool>true</bool> </property> diff --git a/pokemodr/gui/trainer.ui b/pokemodr/gui/trainer.ui new file mode 100644 index 00000000..7c5bc964 --- /dev/null +++ b/pokemodr/gui/trainer.ui @@ -0,0 +1,150 @@ +<ui version="4.0" > + <class>formTrainer</class> + <widget class="QWidget" name="formTrainer" > + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="boxButtons" > + <layout class="QHBoxLayout" > + <item> + <widget class="KPushButton" name="buttonApply" > + <property name="text" > + <string>&Apply</string> + </property> + <property name="shortcut" > + <string>Ctrl+Return</string> + </property> + </widget> + </item> + <item> + <widget class="KPushButton" name="buttonDiscard" > + <property name="text" > + <string>&Discard</string> + </property> + <property name="shortcut" > + <string>Esc</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxName" > + <property name="title" > + <string>Name</string> + </property> + <layout class="QHBoxLayout" > + <item> + <widget class="KLineEdit" name="varName" > + <property name="toolTip" > + <string>The name of the trainer type</string> + </property> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="KIntNumInput" name="varMoneyFactor" > + <property name="toolTip" > + <string>Multiplier for the money earned from the battle when won</string> + </property> + <property name="label" > + <string>Money Factor</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxSkin" > + <property name="title" > + <string>Skin</string> + </property> + <layout class="QHBoxLayout" > + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </spacer> + </item> + <item> + <widget class="KPushButton" name="varSkin" > + <property name="minimumSize" > + <size> + <width>192</width> + <height>128</height> + </size> + </property> + <property name="toolTip" > + <string>Skin of the trainer</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="boxAI" > + <property name="title" > + <string>AI</string> + </property> + <layout class="QHBoxLayout" > + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </spacer> + </item> + <item> + <widget class="KPushButton" name="varAI" > + <property name="toolTip" > + <string>The AI profile used</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header>knuminput.h</header> + </customwidget> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KPushButton</class> + <extends>QPushButton</extends> + <header>kpushbutton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/pokemodr/gui/type.ui b/pokemodr/gui/type.ui index f6ba148d..404e6925 100644 --- a/pokemodr/gui/type.ui +++ b/pokemodr/gui/type.ui @@ -65,9 +65,6 @@ </item> <item> <widget class="KIntNumInput" name="varSTABNum" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Numerator</string> </property> @@ -78,9 +75,6 @@ </item> <item> <widget class="KIntNumInput" name="varSTABDenom" > - <property name="toolTip" > - <string/> - </property> <property name="label" > <string>Denominator</string> </property> diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 931f255d..43278b1b 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -74,11 +74,16 @@ SOURCES += AbilityUI.cpp \ ItemUI.cpp \ ItemTypeUI.cpp \ MapUI.cpp \ + MapTrainerTeamMemberUI.cpp \ + MapWarpUI.cpp \ + MapWildListUI.cpp \ + MapWildListEncounterUI.cpp \ MoveUI.cpp \ NatureUI.cpp \ PokemodUI.cpp \ PokeModr.cpp \ PokeModrUI.cpp \ + PokeModTreeItem.cpp \ RulesUI.cpp \ SpeciesUI.cpp \ SpeciesAbilityUI.cpp \ @@ -90,12 +95,7 @@ SOURCES += AbilityUI.cpp \ TilemapModel.cpp \ TileUI.cpp \ TimeUI.cpp \ - TypeUI.cpp \ - MapWarpUI.cpp \ - MapWildListEncounterUI.cpp \ - MapTrainerTeamMemberUI.cpp \ - MapWildListUI.cpp \ - PokeModTreeItem.cpp + TypeUI.cpp HEADERS += AbilityUI.h \ AuthorUI.h \ @@ -107,6 +107,10 @@ HEADERS += AbilityUI.h \ ItemUI.h \ ItemTypeUI.h \ MapUI.h \ + MapTrainerTeamMemberUI.h \ + MapWarpUI.h \ + MapWildListUI.h \ + MapWildListEncounterUI.h \ MoveUI.h \ NatureUI.h \ ObjectUI.h \ @@ -125,12 +129,8 @@ HEADERS += AbilityUI.h \ TilemapModel.h \ TileUI.h \ TimeUI.h \ - TypeUI.h \ - MapWarpUI.h \ - MapWildListUI.h \ - MapWildListEncounterUI.h \ - MapTrainerTeamMemberUI.h \ - TypechartWidgetItem.h + TypechartWidgetItem.h \ + TypeUI.h FORMS += gui/ability.ui \ gui/abilityeffect.ui \ @@ -164,7 +164,9 @@ FORMS += gui/ability.ui \ gui/store.ui \ gui/tile.ui \ gui/time.ui \ + gui/trainer.ui \ gui/type.ui + DISTFILES += ../INSTALL INSTALLS += target |