diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 19:17:53 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 19:17:53 +0000 |
commit | 793f2e539316e796968103617025320870f8c3ce (patch) | |
tree | f702d6498d3c0841b05a07bc129d34a12b09625e | |
parent | c07a81f2656d1168e7124f0b7281a4e38128926b (diff) | |
download | sigen-793f2e539316e796968103617025320870f8c3ce.tar.gz sigen-793f2e539316e796968103617025320870f8c3ce.tar.xz sigen-793f2e539316e796968103617025320870f8c3ce.zip |
[DEL] Cleaned out unneeded files
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@167 6ecfd1a5-f3ed-3746-8530-beee90d26b22
57 files changed, 12 insertions, 3988 deletions
diff --git a/pokemodr/AbilityEffectUI.cpp b/pokemodr/AbilityEffectUI.cpp deleted file mode 100644 index b6ce3eeb..00000000 --- a/pokemodr/AbilityEffectUI.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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 "AbilityEffectUI.h" - -// Pokemod includes -#include "../pokemod/Ability.h" -#include "../pokemod/AbilityEffect.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Rules.h" -#include "../pokemod/Type.h" - -AbilityEffectUI::AbilityEffectUI(AbilityEffect* effect, QWidget* parent) : - ObjectUI(parent), - m_lastEffect(-1), - m_lastTrigger(-1) -{ - setupUi(this); - setObjects(effect, new AbilityEffect(*effect)); -} - -AbilityEffectUI::~AbilityEffectUI() -{ -} - -void AbilityEffectUI::initGui() -{ - varEffect->addItems(AbilityEffect::EffectStr); - varTrigger->addItems(AbilityEffect::TriggerStr); -} - -void AbilityEffectUI::refreshGui() -{ -} - -void AbilityEffectUI::setGui() -{ - const bool resetEffects = (static_cast<AbilityEffect*>(modified())->effect() != m_lastEffect); - const bool resetTrigger = (static_cast<AbilityEffect*>(modified())->trigger() != m_lastTrigger); - const bool isSplit = static_cast<const Pokemod*>(original()->pokemod())->rules()->specialSplit(); - varChance->setValue(static_cast<AbilityEffect*>(modified())->chance()); - varEffect->setCurrentIndex(static_cast<AbilityEffect*>(modified())->effect()); - m_lastEffect = static_cast<AbilityEffect*>(modified())->effect(); - if (resetEffects) - { - varValue1->clear(); - varValue1->setEnabled(true); - varValue2->clear(); - varValue2->setEnabled(true); - varValue3->setEnabled(true); - switch (m_lastEffect) - { - case AbilityEffect::E_Stats: - for (int i = Pokemod::ST_No_HP_Start; i < Pokemod::ST_End_Battle; ++i) - { - if ((Pokemod::ST_SpecialDefense == i) && !isSplit) - continue; - varValue1->addItem((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[i], varValue1->count()); - } - break; - case AbilityEffect::E_Status: - varValue1->addItems(Pokemod::StatusStr); - for (int i = 0; i < Pokemod::STS_End; ++i) - varValue1->setItemData(i, i); - break; - case AbilityEffect::E_Ability: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->abilityCount(); ++i) - { - const Ability* ability = static_cast<const Pokemod*>(original()->pokemod())->ability(i); - varValue1->addItem(ability->name(), ability->id()); - } - break; - case AbilityEffect::E_AccuracyPowerTrade: - varValue1->addItems(AbilityEffect::PowerAccuracyStr); - for (int i = 0; i < AbilityEffect::PA_End; ++i) - varValue1->setItemData(i, i); - break; - case AbilityEffect::E_ItemEffect: - varValue1->addItems(AbilityEffect::ItemStr); - for (int i = 0; i < AbilityEffect::IT_End; ++i) - varValue1->setItemData(i, i); - break; - case AbilityEffect::E_Type: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->typeCount(); ++i) - { - const Type* type = static_cast<const Pokemod*>(original()->pokemod())->type(i); - varValue1->addItem(type->name(), type->id()); - } - break; - case AbilityEffect::E_Weather: - varValue1->addItems(Pokemod::WeatherStr); - for (int i = 0; i < Pokemod::W_End_All; ++i) - varValue1->setItemData(i, i); - break; - default: - varValue1->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case AbilityEffect::E_Stats: - varValue2->addItems(Pokemod::BattleMemberStr); - for (int i = 0; i < Pokemod::BM_End; ++i) - varValue2->setItemData(i, i); - break; - case AbilityEffect::E_Status: - case AbilityEffect::E_Weather: - varValue2->addItems(AbilityEffect::CauseStr); - for (int i = 0; i < AbilityEffect::C_End; ++i) - varValue2->setItemData(i, i); - break; - case AbilityEffect::E_Ability: - varValue2->addItems(AbilityEffect::TriggerStr); - for (int i = 0; i < AbilityEffect::T_End; ++i) - varValue2->setItemData(i, i); - break; - case AbilityEffect::E_Type: - varValue2->addItems(AbilityEffect::BoostStr); - for (int i = 0; i < AbilityEffect::B_End; ++i) - varValue2->setItemData(i, i); - break; - default: - varValue2->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case AbilityEffect::E_DamageToHP: - case AbilityEffect::E_PreventDamage: - case AbilityEffect::E_AutoHeal: - case AbilityEffect::E_DealDamage: - case AbilityEffect::E_Wilds: - case AbilityEffect::E_AccuracyPowerTrade: - case AbilityEffect::E_Type: - case AbilityEffect::E_FastHatch: - varValue3->setRange(0, 100); - break; - case AbilityEffect::E_Stats: - varValue3->setRange(-12, 12); - break; - default: - varValue3->setEnabled(false); - break; - } - } - varValue1->setCurrentIndex(varValue1->findData(static_cast<AbilityEffect*>(modified())->value1())); - varValue2->setCurrentIndex(varValue2->findData(static_cast<AbilityEffect*>(modified())->value2())); - varValue3->setValue(static_cast<AbilityEffect*>(modified())->value3()); - varTrigger->setCurrentIndex(static_cast<AbilityEffect*>(modified())->trigger()); - m_lastTrigger = static_cast<AbilityEffect*>(modified())->trigger(); - if (resetTrigger) - { - varTriggerValue1->clear(); - varTriggerValue1->setEnabled(true); - varTriggerValue2->setEnabled(true); - switch (m_lastTrigger) - { - case AbilityEffect::T_Weather: - varTriggerValue1->addItems(Pokemod::WeatherStr); - for (int i = 0; i < Pokemod::W_End_All; ++i) - varTriggerValue1->setItemData(i, i); - break; - case AbilityEffect::T_Type: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->typeCount(); ++i) - { - const Type* type = static_cast<const Pokemod*>(original()->pokemod())->type(i); - varTriggerValue1->addItem(type->name(), type->id()); - } - break; - case AbilityEffect::T_HPBoundary: - varTriggerValue1->addItems(AbilityEffect::SideStr); - for (int i = 0; i < AbilityEffect::S_End; ++i) - varTriggerValue1->setItemData(i, i); - break; - case AbilityEffect::T_StatChange: - for (int i = Pokemod::ST_No_HP_Start; i < Pokemod::ST_End_Battle; ++i) - { - if ((Pokemod::ST_SpecialDefense == i) && !isSplit) - continue; - varTriggerValue1->addItem((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[i], varValue1->count()); - } - break; - case AbilityEffect::T_Status: - varTriggerValue1->addItems(Pokemod::StatusStr); - for (int i = 0; i < Pokemod::STS_End; ++i) - varTriggerValue1->setItemData(i, i); - break; - default: - varTriggerValue1->setEnabled(false); - break; - } - varTriggerValue2->setEnabled(m_lastTrigger == AbilityEffect::T_HPBoundary); - } - varTriggerValue1->setCurrentIndex(varTriggerValue1->findData(static_cast<AbilityEffect*>(modified())->triggerValue1())); - varTriggerValue2->setValue(static_cast<AbilityEffect*>(modified())->triggerValue2()); -} - -void AbilityEffectUI::apply() -{ - *static_cast<AbilityEffect*>(original()) = *static_cast<AbilityEffect*>(modified()); - emit(changed(false)); -} - -void AbilityEffectUI::discard() -{ - *static_cast<AbilityEffect*>(modified()) = *static_cast<AbilityEffect*>(original()); - setGui(); - emit(changed(false)); -} - -void AbilityEffectUI::on_varChance_valueChanged(const Fraction& chance) -{ - static_cast<AbilityEffect*>(modified())->setChance(chance); -} - -void AbilityEffectUI::on_varEffect_activated(const int effect) -{ - static_cast<AbilityEffect*>(modified())->setEffect(effect); -} - -void AbilityEffectUI::on_varValue1_activated(const int value1) -{ - static_cast<AbilityEffect*>(modified())->setValue1(varValue1->itemData(value1).toInt()); -} - -void AbilityEffectUI::on_varValue2_activated(const int value2) -{ - static_cast<AbilityEffect*>(modified())->setValue2(varValue2->itemData(value2).toInt()); -} - -void AbilityEffectUI::on_varValue3_valueChanged(const int value3) -{ - static_cast<AbilityEffect*>(modified())->setValue3(value3); -} - -void AbilityEffectUI::on_varTrigger_activated(const int trigger) -{ - static_cast<AbilityEffect*>(modified())->setTrigger(trigger); -} - -void AbilityEffectUI::on_varTriggerValue1_activated(const int triggerValue1) -{ - static_cast<AbilityEffect*>(modified())->setTriggerValue1(varTriggerValue1->itemData(triggerValue1).toInt()); -} - -void AbilityEffectUI::on_varTriggerValue2_valueChanged(const Fraction& triggerValue2) -{ - static_cast<AbilityEffect*>(modified())->setTriggerValue2(triggerValue2); -} diff --git a/pokemodr/AbilityEffectUI.h b/pokemodr/AbilityEffectUI.h deleted file mode 100644 index 25ebaea9..00000000 --- a/pokemodr/AbilityEffectUI.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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_ABILITYEFFECTUI__ -#define __POKEMODR_ABILITYEFFECTUI__ - -// PokeModr includes -#include "ObjectUI.h" - -// Form include -#include "ui_abilityeffect.h" - -// Forward declarations -class AbilityEffect; - -class AbilityEffectUI : public ObjectUI, private Ui::formAbilityEffect -{ - Q_OBJECT - - public: - AbilityEffectUI(AbilityEffect* effect, QWidget* parent); - ~AbilityEffectUI(); - public slots: - void apply(); - void discard(); - protected slots: - void on_varChance_valueChanged(const Fraction& chance); - void on_varEffect_activated(const int effect); - void on_varValue1_activated(const int value1); - void on_varValue2_activated(const int value2); - void on_varValue3_valueChanged(const int value3); - void on_varTrigger_activated(const int trigger); - void on_varTriggerValue1_activated(const int triggerValue1); - void on_varTriggerValue2_valueChanged(const Fraction& triggerValue2); - private slots: - void initGui(); - void refreshGui(); - void setGui(); - private: - int m_lastEffect; - int m_lastTrigger; -}; - -#endif diff --git a/pokemodr/DialogUI.cpp b/pokemodr/DialogUI.cpp deleted file mode 100644 index 79cce899..00000000 --- a/pokemodr/DialogUI.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* - * 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 "DialogUI.h" - -// Command includes -#include "commands/FlipFlagCommand.h" -#include "commands/SetFlagCommand.h" -#include "commands/UnsetFlagCommand.h" -#include "commands/RandomizeFlagCommand.h" -#include "commands/TestFlagCommand.h" -#include "commands/JumpCommand.h" -#include "commands/YesNoCommand.h" -#include "commands/ItemShopCommand.h" -#include "commands/GiveItemCommand.h" - -// Pokemod includes -#include "../pokemod/Dialog.h" -#include "../pokemod/Pokemod.h" - -// KDE includes -#include <KDialog> - -DialogUI::DialogUI(Dialog* dialog, QWidget* parent) : - ObjectUI(parent) -{ - setupUi(this); - setObjects(dialog, new Dialog(*dialog)); -} - -DialogUI::~DialogUI() -{ -} - -void DialogUI::initGui() -{ - varCommand->addItems(Dialog::CommandStr); -} - -void DialogUI::setGui() -{ - varDialog->setPlainText(static_cast<Dialog*>(modified())->dialog()); -} - -void DialogUI::apply() -{ - *static_cast<Dialog*>(original()) = *static_cast<Dialog*>(modified()); - emit(changed(false)); -} - -void DialogUI::discard() -{ - *static_cast<Dialog*>(modified()) = *static_cast<Dialog*>(original()); - setGui(); - emit(changed(false)); -} - -void DialogUI::on_varDialog_textChanged() -{ - QTextCursor cursor = varDialog->textCursor(); - static_cast<Dialog*>(modified())->setDialog(varDialog->toPlainText()); - varDialog->setTextCursor(cursor); -} - -void DialogUI::on_varCommand_activated(const int command) -{ - CommandWidget* commandWidget = NULL; - const Pokemod* pokemod = static_cast<const Pokemod*>(original()->pokemod()); - switch (command) - { - case Dialog::FlipFlag: - 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: - commandWidget = new TestFlagCommand(pokemod, command); - break; - case Dialog::Jump: - commandWidget = new JumpCommand(pokemod, command); - break; - case Dialog::YesNo: - commandWidget = new YesNoCommand(pokemod, command); - break; - case Dialog::ItemShop: - commandWidget = new ItemShopCommand(pokemod, command); - break; - case Dialog::GiveItem: - commandWidget = new GiveItemCommand(pokemod, command); - break; - case Dialog::TakeItem: -// commandWidget = new TakeItemCommand(pokemod, command); - break; - case Dialog::CheckItem: -// commandWidget = new CheckItemCommand(pokemod, command); - break; - case Dialog::CoinList: -// commandWidget = new CoinListCommand(pokemod, command); - break; - case Dialog::TeachMove: -// commandWidget = new TeachMoveCommand(pokemod, command); - break; - case Dialog::CheckMove: -// commandWidget = new CheckMoveCommand(pokemod, command); - break; - case Dialog::DeleteMove: -// commandWidget = new DeleteMoveCommand(pokemod, command); - break; - case Dialog::GiveSpecies: -// commandWidget = new GivePokemonCommand(pokemod, command); - break; - case Dialog::TakeSpecies: -// commandWidget = new TakePokemonCommand(pokemod, command); - break; - case Dialog::ShowSpecies: -// commandWidget = new ShowPokemonCommand(pokemod, command); - break; - case Dialog::ViewSpecies: -// commandWidget = new ViewPokemonCommand(pokemod, command); - break; - case Dialog::GiveMoney: -// commandWidget = new GiveMoneyCommand(pokemod, command); - break; - case Dialog::TakeMoney: -// commandWidget = new TakeMoneyCommand(pokemod, command); - break; - case Dialog::MoveEffect: -// commandWidget = new MoveEffectCommand(pokemod, command); - break; - case Dialog::TurnEffect: -// commandWidget = new TurnEffectCommand(pokemod, command); - break; - case Dialog::CheckDirection: -// commandWidget = new CheckDirectionCommand(pokemod, command); - break; - case Dialog::CheckRoster: -// commandWidget = new CheckRosterCommand(pokemod, command); - break; - case Dialog::CheckLevels: -// commandWidget = new CheckLevelsCommand(pokemod, command); - break; - case Dialog::CheckSpecies: -// commandWidget = new CheckSpeciesCommand(pokemod, command); - break; - case Dialog::CheckHeldItems: -// commandWidget = new CheckHeldItemsCommand(pokemod, command); - break; - case Dialog::CheckMoney: -// commandWidget = new CheckMoneyCommand(pokemod, command); - break; - case Dialog::Trade: -// commandWidget = new TradeCommand(pokemod, command); - break; - case Dialog::Daycare: -// commandWidget = new DaycareCommand(pokemod, command); - break; - case Dialog::Battle: -// commandWidget = new BattleCommand(pokemod, command); - break; - case Dialog::Badge: -// commandWidget = new BadgeCommand(pokemod, command); - break; - case Dialog::Warp: -// commandWidget = new WarpCommand(pokemod, command); - break; - case Dialog::Name: -// commandWidget = new NameCommand(pokemod, command); - break; - case Dialog::Music: -// commandWidget = new MusicCommand(pokemod, command); - break; - case Dialog::SoundEffect: -// commandWidget = new SoundEffectCommand(pokemod, command); - break; - case Dialog::Timer: -// commandWidget = new TimerCommand(pokemod, command); - break; - case Dialog::MapSign: -// commandWidget = new MapSignCommand(pokemod, command); - break; - case Dialog::WildScope: -// commandWidget = new WildScopeCommand(pokemod, command); - break; - case Dialog::Safari: -// commandWidget = new SafariCommand(pokemod, command); - break; - case Dialog::HealParty: -// commandWidget = new HealPartyCommand(pokemod, command); - break; - case Dialog::Refresh: -// commandWidget = new RefreshCommand(pokemod, command); - break; - case Dialog::Clear: -// commandWidget = new ClearCommand(pokemod, command); - break; - case Dialog::Pause: -// commandWidget = new PauseCommand(pokemod, command); - break; - case Dialog::NewLine: -// commandWidget = new NewLineCommand(pokemod, command); - break; - case Dialog::Exit: -// commandWidget = new ExitCommand(pokemod, command); - break; - case Dialog::Menu: -// commandWidget = new MenuCommand(pokemod, command); - break; - } - if (commandWidget) - { - KDialog* dialog = new KDialog(this); - dialog->setCaption(Dialog::CommandStr[command]); - dialog->setMainWidget(commandWidget); - dialog->setButtons(KDialog::Ok | KDialog::Cancel); - connect(dialog, SIGNAL(okClicked()), commandWidget, SLOT(accepted())); - connect(commandWidget, SIGNAL(command(const QString&)), varDialog, SLOT(insertPlainText(const QString&))); - dialog->exec(); - } -} diff --git a/pokemodr/DialogUI.h b/pokemodr/DialogUI.h deleted file mode 100644 index 5858c00f..00000000 --- a/pokemodr/DialogUI.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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_DIALOGUI__ -#define __POKEMODR_DIALOGUI__ - -// PokeModr includes -#include "ObjectUI.h" - -// Form include -#include "ui_dialog.h" - -// Forward declarations -class Dialog; - -class DialogUI : public ObjectUI, private Ui::formDialog -{ - Q_OBJECT - - public: - DialogUI(Dialog* dialog, QWidget* parent); - ~DialogUI(); - public slots: - void apply(); - void discard(); - protected slots: - void on_varDialog_textChanged(); - void on_varCommand_activated(const int command); - private slots: - void initGui(); - void setGui(); -}; - -#endif diff --git a/pokemodr/ItemEffectUI.cpp b/pokemodr/ItemEffectUI.cpp deleted file mode 100644 index f60f3567..00000000 --- a/pokemodr/ItemEffectUI.cpp +++ /dev/null @@ -1,430 +0,0 @@ -/* - * 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 "ItemEffectUI.h" - -// Pokemod includes -#include "../pokemod/Item.h" -#include "../pokemod/ItemEffect.h" -#include "../pokemod/MapWildList.h" -#include "../pokemod/Move.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Rules.h" -#include "../pokemod/Time.h" -#include "../pokemod/Type.h" - -ItemEffectUI::ItemEffectUI(ItemEffect* effect, QWidget* parent) : - ObjectUI(parent), - m_lastEffect(-1), - m_lastValue2(-1), - m_lastValue4(-1) -{ - setupUi(this); - setObjects(effect, new ItemEffect(*effect)); -} - -ItemEffectUI::~ ItemEffectUI() -{ -} - -void ItemEffectUI::initGui() -{ - varEffect->addItems(ItemEffect::EffectStr); -} - -void ItemEffectUI::setGui() -{ - const bool resetEffect = (static_cast<ItemEffect*>(modified())->effect() != m_lastEffect); - const bool resetValue2 = ((static_cast<ItemEffect*>(modified())->value2() != m_lastValue2) || m_lastEffect); - const bool resetValue4 = ((static_cast<ItemEffect*>(modified())->value4() != m_lastValue4) || m_lastEffect); - const bool isSplit = static_cast<const Pokemod*>(original()->pokemod())->rules()->specialSplit(); - varOverworld->setChecked(static_cast<ItemEffect*>(modified())->overworld() ? Qt::Checked : Qt::Unchecked); - varBattle->setChecked(static_cast<ItemEffect*>(modified())->battle() ? Qt::Checked : Qt::Unchecked); - varHeld->setChecked(static_cast<ItemEffect*>(modified())->held() ? Qt::Checked : Qt::Unchecked); - varEffect->setCurrentIndex(static_cast<ItemEffect*>(modified())->effect()); - m_lastEffect = static_cast<ItemEffect*>(modified())->effect(); - if (resetEffect) - { - switch (m_lastEffect) - { - case ItemEffect::E_Revive: - case ItemEffect::E_LevelBoost: - case ItemEffect::E_StatBoost: - case ItemEffect::E_PPBoost: - case ItemEffect::E_Fish: - case ItemEffect::E_Repel: - case ItemEffect::E_Escape: - case ItemEffect::E_TM: - case ItemEffect::E_HM: - case ItemEffect::E_Map: - case ItemEffect::E_Itemfinder: - case ItemEffect::E_Bike: - case ItemEffect::E_Scope: - case ItemEffect::E_Coin: - case ItemEffect::E_CoinCase: - case ItemEffect::E_Acorn: - case ItemEffect::E_Evolution: - case ItemEffect::E_Flinch: - case ItemEffect::E_First: - case ItemEffect::E_KeepAlive: - case ItemEffect::E_ModifyStatBattle: - case ItemEffect::E_ShieldBattle: - case ItemEffect::E_RunBattle: - case ItemEffect::E_TypeBoost: - case ItemEffect::E_ExpShare: - case ItemEffect::E_Ball: - case ItemEffect::E_Berry: - varOverworld->setEnabled(false); - break; - default: - varOverworld->setEnabled(true); - break; - } - varValue1->setEnabled(true); - varValue2->clear(); - varValue2->setEnabled(true); - varValue3->clear(); - varValue3->setEnabled(true); - varValue4->setEnabled(true); - varValue4->setBehavior(((ItemEffect::E_TypeBoost == m_lastEffect) || (ItemEffect::E_PPBoost == m_lastEffect)) ? -1 : 1); - varValue5->setEnabled(true); - switch (m_lastEffect) - { - case ItemEffect::E_HPCure: - case ItemEffect::E_Revive: - // Value 4 dependent - case ItemEffect::E_Ball: - // Value 2 dependent - break; - case ItemEffect::E_LevelBoost: - case ItemEffect::E_ShieldBattle: - case ItemEffect::E_PPBoost: - case ItemEffect::E_Repel: - varValue1->setRange(1, INT_MAX); - break; - case ItemEffect::E_StatBoost: - case ItemEffect::E_Acorn: - varValue1->setRange(0, 65535); - break; - case ItemEffect::E_ModifyStatBattle: - varValue1->setRange(-12, 12); - break; - case ItemEffect::E_Fish: - case ItemEffect::E_Coin: - case ItemEffect::E_CoinCase: - varValue1->setRange(0, INT_MAX); - break; - default: - varValue1->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case ItemEffect::E_HPCure: - case ItemEffect::E_Revive: - varValue2->addItems(ItemEffect::RelativeStr); - for (int i = 0; i < ItemEffect::R_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_CureStatus: - varValue2->addItems(Pokemod::StatusStr); - for (int i = 0; i < Pokemod::STS_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_ModifyStatBattle: - for (int i = 0; i < Pokemod::ST_End_Battle; ++i) - { - if (!isSplit && (Pokemod::ST_SpecialDefense == i)) - continue; - varValue2->addItem((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[i], i); - } - break; - case ItemEffect::E_ShieldBattle: - varValue2->addItems(ItemEffect::SpecialPhysicalStr); - for (int i = 0; i < ItemEffect::SP_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_TypeBoost: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->typeCount(); ++i) - { - const Type* type = static_cast<const Pokemod*>(original()->pokemod())->type(i); - varValue2->addItem(type->name(), type->id()); - } - break; - case ItemEffect::E_PPRestore: - varValue2->addItems(ItemEffect::AmountStr); - for (int i = 0; i < ItemEffect::A_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_Repel: - varValue2->addItems(ItemEffect::RepelStr); - for (int i = 0; i < ItemEffect::RP_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_Escape: - varValue2->addItems(ItemEffect::EscapeStr); - for (int i = 0; i < ItemEffect::ES_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_TM: - case ItemEffect::E_HM: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->moveCount(); ++i) - { - const Move* move = static_cast<const Pokemod*>(original()->pokemod())->move(i); - varValue2->addItem(move->name(), move->id()); - } - break; - case ItemEffect::E_Ball: - varValue2->addItems(ItemEffect::BallTypeStr); - for (int i = 0; i < ItemEffect::B_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_Berry: - varValue2->addItems(ItemEffect::BerryTypeStr); - for (int i = 0; i < ItemEffect::B2_End; ++i) - varValue2->setItemData(i, i); - break; - case ItemEffect::E_Acorn: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->itemCount(); ++i) - { - const Item* item = static_cast<const Pokemod*>(original()->pokemod())->item(i); - varValue2->addItem(item->name(), item->id()); - } - break; - default: - varValue2->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case ItemEffect::E_StatBoost: - for (int i = 0; i < (isSplit ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY); ++i) - varValue3->addItem((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[i], i); - break; - case ItemEffect::E_Ball: - // Value 2 dependent - case ItemEffect::E_Berry: - // Value 2 dependent - break; - default: - varValue3->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case ItemEffect::E_CureStatus: - case ItemEffect::E_LevelBoost: - case ItemEffect::E_StatBoost: - case ItemEffect::E_ModifyStatBattle: - case ItemEffect::E_Fish: - case ItemEffect::E_Escape: - case ItemEffect::E_TM: - case ItemEffect::E_HM: - case ItemEffect::E_Map: - case ItemEffect::E_Itemfinder: - case ItemEffect::E_Bike: - case ItemEffect::E_Scope: - case ItemEffect::E_Coin: - case ItemEffect::E_CoinCase: - case ItemEffect::E_Acorn: - case ItemEffect::E_Evolution: - varValue4->setEnabled(false); - break; - case ItemEffect::E_Ball: - if (m_lastValue2 == ItemEffect::B_Master) - varValue4->setEnabled(false); - break; - case ItemEffect::E_Berry: - if (m_lastValue2 != ItemEffect::B2_HPCure) - varValue4->setEnabled(false); - break; - } - switch (m_lastEffect) - { - case ItemEffect::E_StatBoost: - varValue5->setRange(6, 65535); - break; - case ItemEffect::E_Scope: - case ItemEffect::E_Coin: - case ItemEffect::E_CoinCase: - varValue5->setRange(0, INT_MAX); - break; - default: - varValue5->setEnabled(false); - break; - } - } - varValue2->setCurrentIndex(varValue2->findData(static_cast<ItemEffect*>(modified())->value2())); - m_lastValue2 = static_cast<ItemEffect*>(modified())->value2(); - if (resetValue2) - { - if (m_lastEffect == ItemEffect::E_Ball) - { - switch (m_lastValue2) - { - case ItemEffect::B_Regular: - varValue1->setRange(0, 255); - break; - case ItemEffect::B_Level: - varValue1->setRange(0, static_cast<const Pokemod*>(original()->pokemod())->rules()->maxLevel()); - break; - case ItemEffect::B_Master: - case ItemEffect::B_Love: - case ItemEffect::B_Area: - case ItemEffect::B_Time: - case ItemEffect::B_Battle: - case ItemEffect::B_Friend: - case ItemEffect::B_Stat: - case ItemEffect::B_Type: - case ItemEffect::B_Weight: - break; - default: - varValue1->setEnabled(false); - break; - } - switch (m_lastValue2) - { - case ItemEffect::B_Level: - case ItemEffect::B_Friend: - case ItemEffect::B_Weight: - // TODO: ??? - break; - case ItemEffect::B_Area: - varValue3->addItems(MapWildList::ControlStr); - for (int i = 0; i < MapWildList::End; ++i) - varValue3->setItemData(i, i); - break; - case ItemEffect::B_Time: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->timeCount(); ++i) - { - const Time* time = static_cast<const Pokemod*>(original()->pokemod())->time(i); - varValue3->addItem(time->name(), time->id()); - } - break; - case ItemEffect::B_Stat: - for (int i = 0; i < (isSplit ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY); ++i) - varValue3->addItem((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[i], i); - break; - case ItemEffect::B_Type: - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->typeCount(); ++i) - { - const Type* type = static_cast<const Pokemod*>(original()->pokemod())->type(i); - varValue3->addItem(type->name(), type->id()); - } - break; - case ItemEffect::B_Regular: - case ItemEffect::B_Master: - case ItemEffect::B_Love: - case ItemEffect::B_Battle: - varValue3->setEnabled(false); - break; - } - } - else if (m_lastEffect == ItemEffect::E_Berry) - { - switch (m_lastValue2) - { - case ItemEffect::B2_HPCure: - varValue3->addItems(Pokemod::RelativeStr); - for (int i = 0; i < Pokemod::REL_End; ++i) - varValue3->setItemData(i, i); - break; - case ItemEffect::B2_StatusCure: - varValue3->addItems(Pokemod::StatusStr); - for (int i = 0; i < Pokemod::STS_End; ++i) - varValue3->setItemData(i, i); - break; - default: - varValue3->setEnabled(false); - break; - } - } - } - varValue4->setValue(static_cast<ItemEffect*>(modified())->value4()); - m_lastValue4 = static_cast<ItemEffect*>(modified())->value4(); - if (resetValue4) - { - if ((m_lastValue4 == ItemEffect::E_HPCure) || (m_lastValue4 == ItemEffect::E_Revive)) - { - if (m_lastValue4 == ItemEffect::R_Absolute) - varValue1->setRange(1, INT_MAX); - else - varValue1->setEnabled(false); - } - } - varValue1->setValue(static_cast<ItemEffect*>(modified())->value1()); - varValue3->setCurrentIndex(varValue3->findData(static_cast<ItemEffect*>(modified())->value3())); -} - -void ItemEffectUI::apply() -{ - *static_cast<ItemEffect*>(original()) = *static_cast<ItemEffect*>(modified()); - emit(changed(false)); -} - -void ItemEffectUI::discard() -{ - *static_cast<ItemEffect*>(modified()) = *static_cast<ItemEffect*>(original()); - setGui(); - emit(changed(false)); -} - -void ItemEffectUI::on_varOverworld_toggled(const bool overworld) -{ - static_cast<ItemEffect*>(modified())->setOverworld(overworld); -} - -void ItemEffectUI::on_varBattle_toggled(const bool battle) -{ - static_cast<ItemEffect*>(modified())->setBattle(battle); -} - -void ItemEffectUI::on_varHeld_toggled(const bool held) -{ - static_cast<ItemEffect*>(modified())->setHeld(held); -} - -void ItemEffectUI::on_varEffect_activated(const int effect) -{ - static_cast<ItemEffect*>(modified())->setEffect(effect); -} - -void ItemEffectUI::on_varValue1_valueChanged(const int value1) -{ - static_cast<ItemEffect*>(modified())->setValue1(value1); -} - -void ItemEffectUI::on_varValue2_activated(const int value2) -{ - static_cast<ItemEffect*>(modified())->setValue2(varValue2->itemData(value2).toInt()); -} - -void ItemEffectUI::on_varValue3_activated(const int value3) -{ - static_cast<ItemEffect*>(modified())->setValue3(varValue3->itemData(value3).toInt()); -} - -void ItemEffectUI::on_varValue4_valueChanged(const Fraction& value4) -{ - static_cast<ItemEffect*>(modified())->setValue4(value4); -} - -void ItemEffectUI::on_varValue5_valueChanged(const int value5) -{ - static_cast<ItemEffect*>(modified())->setValue5(value5); -} diff --git a/pokemodr/ItemEffectUI.h b/pokemodr/ItemEffectUI.h deleted file mode 100644 index 5765af0d..00000000 --- a/pokemodr/ItemEffectUI.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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_ITEMEFFECTUI__ -#define __POKEMODR_ITEMEFFECTUI__ - -// PokeModr includes -#include "ObjectUI.h" - -// Form include -#include "ui_itemeffect.h" - -// Forward declarations -class ItemEffect; - -class ItemEffectUI : public ObjectUI, private Ui::formItemEffect -{ - Q_OBJECT - - public: - ItemEffectUI(ItemEffect* effect, QWidget* parent); - ~ItemEffectUI(); - public slots: - void apply(); - void discard(); - protected slots: - void on_varOverworld_toggled(const bool overworld); - void on_varBattle_toggled(const bool battle); - void on_varHeld_toggled(const bool held); - void on_varEffect_activated(const int effect); - void on_varValue1_valueChanged(const int value1); - void on_varValue2_activated(const int value2); - void on_varValue3_activated(const int value3); - void on_varValue4_valueChanged(const Fraction& value4); - void on_varValue5_valueChanged(const int value5); - private slots: - void initGui(); - void setGui(); - private: - int m_lastEffect; - int m_lastValue2; - int m_lastValue4; -}; - -#endif diff --git a/pokemodr/SpeciesEvolutionUI.cpp b/pokemodr/SpeciesEvolutionUI.cpp deleted file mode 100644 index fd6c7e22..00000000 --- a/pokemodr/SpeciesEvolutionUI.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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 "SpeciesEvolutionUI.h" - -// Pokemod includes -#include "../pokemod/Item.h" -#include "../pokemod/ItemEffect.h" -#include "../pokemod/Pokemod.h" -#include "../pokemod/Rules.h" -#include "../pokemod/Species.h" -#include "../pokemod/SpeciesEvolution.h" - -SpeciesEvolutionUI::SpeciesEvolutionUI(SpeciesEvolution* evolution, QWidget* parent) : - ObjectUI(parent), - m_lastStyle(-1) -{ - setupUi(this); - setObjects(evolution, new SpeciesEvolution(*evolution)); -} - -SpeciesEvolutionUI::~SpeciesEvolutionUI() -{ -} - -void SpeciesEvolutionUI::initGui() -{ - varStyle->addItems(SpeciesEvolution::StyleStr); -} - -void SpeciesEvolutionUI::refreshGui() -{ - varSpecies->clear(); - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->speciesCount(); ++i) - { - const Species* species = static_cast<const Pokemod*>(original()->pokemod())->species(i); - varSpecies->addItem(species->name(), species->id()); - } -} - -void SpeciesEvolutionUI::setGui() -{ - const bool styleChanged = (static_cast<SpeciesEvolution*>(modified())->style() != m_lastStyle); - varSpecies->setCurrentIndex(varSpecies->findData(static_cast<SpeciesEvolution*>(modified())->species())); - varStyle->setCurrentIndex(static_cast<SpeciesEvolution*>(modified())->style()); - m_lastStyle = static_cast<SpeciesEvolution*>(modified())->style(); - if (styleChanged) - { - varValue1->clear(); - varValue1->setEnabled(false); - varValue2->clear(); - varValue2->setEnabled(false); - varValue3->setEnabled(false); - switch (static_cast<SpeciesEvolution*>(modified())->style()) - { - case SpeciesEvolution::S_Level: - case SpeciesEvolution::S_Happiness: - case SpeciesEvolution::S_Stat: - case SpeciesEvolution::S_Personality: - varValue1->setEnabled(true); - varValue1->addItems(Pokemod::RelativeStr); - break; - case SpeciesEvolution::S_Item: - case SpeciesEvolution::S_TradeItem: - varValue1->setEnabled(true); - for (int i = 0; i < static_cast<const Pokemod*>(original()->pokemod())->itemCount(); ++i) - { - const Item* item = static_cast<const Pokemod*>(original()->pokemod())->item(i); - for (int j = 0; j < item->effectCount(); ++j) - { - if (item->effect(i)->effect() == ItemEffect::E_Evolution) - varValue1->addItem(item->name(), item->id()); - } - } - break; - } - const bool isSplit = static_cast<const Pokemod*>(original()->pokemod())->rules()->specialSplit(); - switch (static_cast<SpeciesEvolution*>(modified())->style()) - { - case SpeciesEvolution::S_Stat: - varValue2->setEnabled(true); - varValue2->addItems((isSplit ? Pokemod::StatGSCStr : Pokemod::StatRBYStr).mid(0, isSplit ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY)); - break; - case SpeciesEvolution::S_Item: - varValue2->setEnabled(true); - varValue2->addItems(SpeciesEvolution::GiveHoldStr); - break; - } - switch (static_cast<SpeciesEvolution*>(modified())->style()) - { - case SpeciesEvolution::S_Happiness: - case SpeciesEvolution::S_Stat: - case SpeciesEvolution::S_Item: - case SpeciesEvolution::S_Personality: - varValue3->setEnabled(true); - break; - } - } - if ((static_cast<SpeciesEvolution*>(modified())->style() == SpeciesEvolution::S_Item) ||(static_cast<SpeciesEvolution*>(modified())->style() == SpeciesEvolution::S_TradeItem)) - varValue1->setCurrentIndex(varValue1->findData(static_cast<SpeciesEvolution*>(modified())->value1())); - else - varValue1->setCurrentIndex(static_cast<SpeciesEvolution*>(modified())->value1()); - varValue2->setCurrentIndex(static_cast<SpeciesEvolution*>(modified())->value2()); - varValue3->setValue(static_cast<SpeciesEvolution*>(modified())->value3()); - varLevel->setValue(static_cast<SpeciesEvolution*>(modified())->level()); -} - -void SpeciesEvolutionUI::apply() -{ - *static_cast<SpeciesEvolution*>(original()) = *static_cast<SpeciesEvolution*>(modified()); - emit(changed(false)); -} - -void SpeciesEvolutionUI::discard() -{ - *static_cast<SpeciesEvolution*>(modified()) = *static_cast<SpeciesEvolution*>(original()); - setGui(); - emit(changed(false)); -} - -void SpeciesEvolutionUI::on_varSpecies_activated(const int species) -{ - static_cast<SpeciesEvolution*>(modified())->setSpecies(varSpecies->itemData(species).toInt()); -} - -void SpeciesEvolutionUI::on_varStyle_activated(const int style) -{ - static_cast<SpeciesEvolution*>(modified())->setStyle(style); -} - -void SpeciesEvolutionUI::on_varValue1_activated(const int value1) -{ - if ((static_cast<SpeciesEvolution*>(modified())->style() == SpeciesEvolution::S_Item) ||(static_cast<SpeciesEvolution*>(modified())->style() == SpeciesEvolution::S_TradeItem)) - static_cast<SpeciesEvolution*>(modified())->setValue1(varValue1->itemData(value1).toInt()); - else - static_cast<SpeciesEvolution*>(modified())->setValue1(value1); -} - -void SpeciesEvolutionUI::on_varValue2_activated(const int value2) -{ - static_cast<SpeciesEvolution*>(modified())->setValue2(value2); -} - -void SpeciesEvolutionUI::on_varValue3_valueChanged(const int value3) -{ - static_cast<SpeciesEvolution*>(modified())->setValue3(value3); -} - -void SpeciesEvolutionUI::on_varLevel_valueChanged(const int level) -{ - static_cast<SpeciesEvolution*>(modified())->setLevel(level); -} diff --git a/pokemodr/SpeciesEvolutionUI.h b/pokemodr/SpeciesEvolutionUI.h deleted file mode 100644 index d38a6f16..00000000 --- a/pokemodr/SpeciesEvolutionUI.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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_SPECIESEVOLUTIONUI__ -#define __POKEMODR_SPECIESEVOLUTIONUI__ - -// PokeModr includes -#include "ObjectUI.h" - -// Form include -#include "ui_speciesevolution.h" - -// Forward declarations -class SpeciesEvolution; - -class SpeciesEvolutionUI : public ObjectUI, private Ui::formSpeciesEvolution -{ - Q_OBJECT - - public: - SpeciesEvolutionUI(SpeciesEvolution* evolution, QWidget* parent); - ~SpeciesEvolutionUI(); - public slots: - void apply(); - void discard(); - protected slots: - void on_varSpecies_activated(const int species); - void on_varStyle_activated(const int style); - void on_varValue1_activated(const int value1); - void on_varValue2_activated(const int value2); - void on_varValue3_valueChanged(const int value3); - void on_varLevel_valueChanged(const int level); - private slots: - void initGui(); - void refreshGui(); - void setGui(); - private: - int m_lastStyle; -}; - -#endif diff --git a/pokemodr/commands/CommandWidget.cpp b/pokemodr/commands/CommandWidget.cpp deleted file mode 100644 index 8bd3b0c6..00000000 --- a/pokemodr/commands/CommandWidget.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 "CommandWidget.h" - -CommandWidget::CommandWidget(const Pokemod* pokemod, const int command) : - QWidget(NULL), - m_pokemod(pokemod), - m_command(command) -{ -} - -CommandWidget::~CommandWidget() -{ -} - -void CommandWidget::accepted() const -{ - emit(command(commandString())); -} diff --git a/pokemodr/commands/CommandWidget.h b/pokemodr/commands/CommandWidget.h deleted file mode 100644 index 7a14dd58..00000000 --- a/pokemodr/commands/CommandWidget.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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_COMMANDWIDGET__ -#define __POKEMODR_COMMANDWIDGET__ - -// Qt includes -#include <QWidget> - -// Forward declarations -class Pokemod; - -class CommandWidget : public QWidget -{ - Q_OBJECT - - public: - CommandWidget(const Pokemod* pokemod, const int command); - virtual ~CommandWidget(); - signals: - void command(const QString&) const; - public slots: - void accepted() const; - protected: - virtual QString commandString() const = 0; - - const Pokemod* m_pokemod; - const int m_command; -}; - -#endif diff --git a/pokemodr/commands/FlipFlagCommand.cpp b/pokemodr/commands/FlipFlagCommand.cpp deleted file mode 100644 index c82f8e08..00000000 --- a/pokemodr/commands/FlipFlagCommand.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 "FlipFlagCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" - -FlipFlagCommand::FlipFlagCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); -} - -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 deleted file mode 100644 index f80939c9..00000000 --- a/pokemodr/commands/FlipFlagCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_FLIPFLAGCOMMAND__ -#define __POKEMODR_FLIPFLAGCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_flipflag.h" - -class FlipFlagCommand : public CommandWidget, private Ui::formFlipFlag -{ - Q_OBJECT - - public: - FlipFlagCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/GiveItemCommand.cpp b/pokemodr/commands/GiveItemCommand.cpp deleted file mode 100644 index 93c1b31d..00000000 --- a/pokemodr/commands/GiveItemCommand.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 "GiveItemCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Item.h" -#include "../../pokemod/Pokemod.h" - -GiveItemCommand::GiveItemCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); - varJump->addItem("Call"); - varJump->addItem("Goto"); - for (int i = 0; i < m_pokemod->itemCount(); ++i) - { - const Item* item = m_pokemod->item(i); - varItem->addItem(item->name(), item->id()); - } - for (int i = 0; i < m_pokemod->dialogCount(); ++i) - { - const Dialog* dialog = m_pokemod->dialog(i); - varTaken->addItem(dialog->dialog().mid(0, 25), dialog->id()); - varKept->addItem(dialog->dialog().mid(0, 25), dialog->id()); - } -} - -QString GiveItemCommand::commandString() const -{ - return QString("@%1#%2#%3#%4#%5@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varItem->itemData(varItem->currentIndex()).toInt()).arg(varTaken->itemData(varTaken->currentIndex()).toInt()).arg(varKept->itemData(varKept->currentIndex()).toInt()); -} diff --git a/pokemodr/commands/GiveItemCommand.h b/pokemodr/commands/GiveItemCommand.h deleted file mode 100644 index 633f673d..00000000 --- a/pokemodr/commands/GiveItemCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_GIVEITEMCOMMAND__ -#define __POKEMODR_GIVEITEMCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_giveitem.h" - -class GiveItemCommand : public CommandWidget, private Ui::formGiveItem -{ - Q_OBJECT - - public: - GiveItemCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/ItemShopCommand.cpp b/pokemodr/commands/ItemShopCommand.cpp deleted file mode 100644 index 938077e1..00000000 --- a/pokemodr/commands/ItemShopCommand.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 "ItemShopCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Pokemod.h" -#include "../../pokemod/Store.h" - -ItemShopCommand::ItemShopCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); - for (int i = 0; i < m_pokemod->storeCount(); ++i) - { - const Store* store = m_pokemod->store(i); - varItemShop->addItem(store->name(), store->id()); - } -} - -QString ItemShopCommand::commandString() const -{ - return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varItemShop->itemData(varItemShop->currentIndex()).toInt()); -} diff --git a/pokemodr/commands/ItemShopCommand.h b/pokemodr/commands/ItemShopCommand.h deleted file mode 100644 index 2da03599..00000000 --- a/pokemodr/commands/ItemShopCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_ITEMSHOPCOMMAND__ -#define __POKEMODR_ITEMSHOPCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_itemshop.h" - -class ItemShopCommand : public CommandWidget, private Ui::formItemShop -{ - Q_OBJECT - - public: - ItemShopCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/JumpCommand.cpp b/pokemodr/commands/JumpCommand.cpp deleted file mode 100644 index aa9df52d..00000000 --- a/pokemodr/commands/JumpCommand.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 "JumpCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Pokemod.h" - -JumpCommand::JumpCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); - varJump->addItem("Call"); - varJump->addItem("Goto"); - for (int i = 0; i < m_pokemod->dialogCount(); ++i) - { - const Dialog* dialog = m_pokemod->dialog(i); - varDialog->addItem(dialog->dialog().mid(0, 25), dialog->id()); - } -} - -QString JumpCommand::commandString() const -{ - return QString("@%1#%2#%3@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varDialog->itemData(varDialog->currentIndex()).toInt()); -} diff --git a/pokemodr/commands/JumpCommand.h b/pokemodr/commands/JumpCommand.h deleted file mode 100644 index 8bddac20..00000000 --- a/pokemodr/commands/JumpCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_JUMPCOMMAND__ -#define __POKEMODR_JUMPCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_jump.h" - -class JumpCommand : public CommandWidget, private Ui::formJump -{ - Q_OBJECT - - public: - JumpCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/RandomizeFlagCommand.cpp b/pokemodr/commands/RandomizeFlagCommand.cpp deleted file mode 100644 index 224111e9..00000000 --- a/pokemodr/commands/RandomizeFlagCommand.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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" - -RandomizeFlagCommand::RandomizeFlagCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); -} - -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 deleted file mode 100644 index fa713ee8..00000000 --- a/pokemodr/commands/RandomizeFlagCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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" - -// Form include -#include "ui_randomizeflag.h" - -class RandomizeFlagCommand : public CommandWidget, private Ui::formRandomizeFlag -{ - Q_OBJECT - - public: - RandomizeFlagCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/SetFlagCommand.cpp b/pokemodr/commands/SetFlagCommand.cpp deleted file mode 100644 index 4600035c..00000000 --- a/pokemodr/commands/SetFlagCommand.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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" - -SetFlagCommand::SetFlagCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); -} - -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 deleted file mode 100644 index a3d16415..00000000 --- a/pokemodr/commands/SetFlagCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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" - -// Form include -#include "ui_setflag.h" - -class SetFlagCommand : public CommandWidget, private Ui::formSetFlag -{ - Q_OBJECT - - public: - SetFlagCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/TestFlagCommand.cpp b/pokemodr/commands/TestFlagCommand.cpp deleted file mode 100644 index 2cac0588..00000000 --- a/pokemodr/commands/TestFlagCommand.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 "TestFlagCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Pokemod.h" - -TestFlagCommand::TestFlagCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); - varJump->addItem("Call"); - varJump->addItem("Goto"); - for (int i = 0; i < m_pokemod->dialogCount(); ++i) - { - const Dialog* dialog = m_pokemod->dialog(i); - varSet->addItem(dialog->dialog().mid(0, 25), dialog->id()); - varUnset->addItem(dialog->dialog().mid(0, 25), dialog->id()); - } -} - -QString TestFlagCommand::commandString() const -{ - return QString("@%1#%2#%3#%4#%5@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varFlag->value()).arg(varSet->itemData(varSet->currentIndex()).toInt()).arg(varUnset->itemData(varUnset->currentIndex()).toInt()); -} diff --git a/pokemodr/commands/TestFlagCommand.h b/pokemodr/commands/TestFlagCommand.h deleted file mode 100644 index 5d11ef12..00000000 --- a/pokemodr/commands/TestFlagCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_TESTFLAGCOMMAND__ -#define __POKEMODR_TESTFLAGCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_testflag.h" - -class TestFlagCommand : public CommandWidget, private Ui::formTestFlag -{ - Q_OBJECT - - public: - TestFlagCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/UnsetFlagCommand.cpp b/pokemodr/commands/UnsetFlagCommand.cpp deleted file mode 100644 index 723d1cfa..00000000 --- a/pokemodr/commands/UnsetFlagCommand.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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" - -UnsetFlagCommand::UnsetFlagCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); -} - -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 deleted file mode 100644 index a10437f4..00000000 --- a/pokemodr/commands/UnsetFlagCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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" - -// Form include -#include "ui_unsetflag.h" - -class UnsetFlagCommand : public CommandWidget, private Ui::formUnsetFlag -{ - Q_OBJECT - - public: - UnsetFlagCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/commands/YesNoCommand.cpp b/pokemodr/commands/YesNoCommand.cpp deleted file mode 100644 index bda5f502..00000000 --- a/pokemodr/commands/YesNoCommand.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 "YesNoCommand.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Pokemod.h" - -YesNoCommand::YesNoCommand(const Pokemod* pokemod, const int command) : - CommandWidget(pokemod, command) -{ - setupUi(this); - varJump->addItem("Call"); - varJump->addItem("Goto"); - for (int i = 0; i < m_pokemod->dialogCount(); ++i) - { - const Dialog* dialog = m_pokemod->dialog(i); - varYes->addItem(dialog->dialog().mid(0, 25), dialog->id()); - varNo->addItem(dialog->dialog().mid(0, 25), dialog->id()); - } -} - -QString YesNoCommand::commandString() const -{ - return QString("@%1#%2#%3@").arg(Dialog::CommandAbbrStr[m_command]).arg(varJump->currentIndex()).arg(varYes->itemData(varYes->currentIndex()).toInt()).arg(varNo->itemData(varNo->currentIndex()).toInt()); -} diff --git a/pokemodr/commands/YesNoCommand.h b/pokemodr/commands/YesNoCommand.h deleted file mode 100644 index 4a6efd25..00000000 --- a/pokemodr/commands/YesNoCommand.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_YESNOCOMMAND__ -#define __POKEMODR_YESNOCOMMAND__ - -// Command includes -#include "CommandWidget.h" - -// Form include -#include "ui_yesno.h" - -class YesNoCommand : public CommandWidget, private Ui::formYesNo -{ - Q_OBJECT - - public: - YesNoCommand(const Pokemod* pokemod, const int command); - - QString commandString() const; -}; - -#endif diff --git a/pokemodr/gui/abilityeffect.ui b/pokemodr/gui/abilityeffect.ui deleted file mode 100644 index f4143fd1..00000000 --- a/pokemodr/gui/abilityeffect.ui +++ /dev/null @@ -1,157 +0,0 @@ -<ui version="4.0" > - <class>formAbilityEffect</class> - <widget class="QWidget" name="formAbilityEffect" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxChance" > - <property name="title" > - <string>Chance</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="FractionWidget" name="varChance" > - <property name="toolTip" > - <string>The chance that the effect happens</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxEffect" > - <property name="title" > - <string>Effect</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KComboBox" name="varEffect" > - <property name="toolTip" > - <string>Effect the ability has</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue1" > - <property name="title" > - <string>Value 1</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue1" > - <property name="toolTip" > - <string>Value 1</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue2" > - <property name="title" > - <string>Value 2</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue2" > - <property name="toolTip" > - <string>Value 2</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue3" > - <property name="title" > - <string>Value 3</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varValue3" > - <property name="toolTip" > - <string>Value 3</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxTrigger" > - <property name="title" > - <string>Trigger</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KComboBox" name="varTrigger" > - <property name="toolTip" > - <string>What triggers the effect to happen</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxTriggerValue1" > - <property name="title" > - <string>Value 1</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varTriggerValue1" > - <property name="toolTip" > - <string>Trigger value 1</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxTriggerValue2" > - <property name="title" > - <string>Value 2</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="FractionWidget" name="varTriggerValue2" > - <property name="toolTip" > - <string>Trigger Value 2</string> - </property> - </widget> - </item> - </layout> - </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> - </customwidget> - <customwidget> - <class>FractionWidget</class> - <extends>QWidget</extends> - <header>../FractionWidget.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/commands/flipflag.ui b/pokemodr/gui/commands/flipflag.ui deleted file mode 100644 index 9d6b7581..00000000 --- a/pokemodr/gui/commands/flipflag.ui +++ /dev/null @@ -1,35 +0,0 @@ -<ui version="4.0" > - <class>formFlipFlag</class> - <widget class="QWidget" name="formFlipFlag" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxFlag" > - <property name="title" > - <string>Flag to flip</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag to flip</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </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/commands/giveitem.ui b/pokemodr/gui/commands/giveitem.ui deleted file mode 100644 index 4756c8f3..00000000 --- a/pokemodr/gui/commands/giveitem.ui +++ /dev/null @@ -1,80 +0,0 @@ -<ui version="4.0" > - <class>formGiveItem</class> - <widget class="QWidget" name="formGiveItem" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxJump" > - <property name="title" > - <string>Jump Action</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KComboBox" name="varJump" > - <property name="toolTip" > - <string>How the dialog jumped to is treated</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxItem" > - <property name="title" > - <string>Item</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="KComboBox" name="varItem" > - <property name="toolTip" > - <string>The item to give the user</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxTaken" > - <property name="title" > - <string>Dialog if Taken</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_4" > - <item> - <widget class="KComboBox" name="varTaken" > - <property name="toolTip" > - <string>The dialog to jump to if the user took the item</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxKept" > - <property name="title" > - <string>Dialog if Kept</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3" > - <item> - <widget class="KComboBox" name="varKept" > - <property name="toolTip" > - <string>The dialog to jump to if the item cannot be given to the user</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/commands/itemshop.ui b/pokemodr/gui/commands/itemshop.ui deleted file mode 100644 index 8e4e0c47..00000000 --- a/pokemodr/gui/commands/itemshop.ui +++ /dev/null @@ -1,28 +0,0 @@ -<ui version="4.0" > - <class>formItemShop</class> - <widget class="QWidget" name="formItemShop" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxItemShop" > - <property name="title" > - <string>Item Shop</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KComboBox" name="varItemShop" /> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/commands/jump.ui b/pokemodr/gui/commands/jump.ui deleted file mode 100644 index 39dcecaa..00000000 --- a/pokemodr/gui/commands/jump.ui +++ /dev/null @@ -1,48 +0,0 @@ -<ui version="4.0" > - <class>formJump</class> - <widget class="QWidget" name="formJump" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxJump" > - <property name="title" > - <string>Jump Action</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KComboBox" name="varJump" > - <property name="toolTip" > - <string>How the dialog jumped to is treated</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxDialog" > - <property name="title" > - <string>Dialog</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="KComboBox" name="varDialog" > - <property name="toolTip" > - <string>The dialog to jump to</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/commands/randomizeflag.ui b/pokemodr/gui/commands/randomizeflag.ui deleted file mode 100644 index 704c7abb..00000000 --- a/pokemodr/gui/commands/randomizeflag.ui +++ /dev/null @@ -1,35 +0,0 @@ -<ui version="4.0" > - <class>formRandomizeFlag</class> - <widget class="QWidget" name="formRandomizeFlag" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxFlag" > - <property name="title" > - <string>Flag to randomize</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag to randomize</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </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/commands/setflag.ui b/pokemodr/gui/commands/setflag.ui deleted file mode 100644 index bec6a482..00000000 --- a/pokemodr/gui/commands/setflag.ui +++ /dev/null @@ -1,35 +0,0 @@ -<ui version="4.0" > - <class>formSetFlag</class> - <widget class="QWidget" name="formSetFlag" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxFlag" > - <property name="title" > - <string>Flag to set</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag to set</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </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/commands/testflag.ui b/pokemodr/gui/commands/testflag.ui deleted file mode 100644 index 27812ed3..00000000 --- a/pokemodr/gui/commands/testflag.ui +++ /dev/null @@ -1,88 +0,0 @@ -<ui version="4.0" > - <class>formTestFlag</class> - <widget class="QWidget" name="formTestFlag" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxJump" > - <property name="title" > - <string>Jump Action</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KComboBox" name="varJump" > - <property name="toolTip" > - <string>How the dialog jumped to is treated</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxFlag" > - <property name="title" > - <string>Flag</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag to test</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxSet" > - <property name="title" > - <string>Dialog if Set</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_4" > - <item> - <widget class="KComboBox" name="varSet" > - <property name="toolTip" > - <string>The dialog to jump to if the flag is set</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxUnset" > - <property name="title" > - <string>Dialog if Unset</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3" > - <item> - <widget class="KComboBox" name="varUnset" > - <property name="toolTip" > - <string>The dialog to jump to if the flag is unset</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> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/commands/unsetflag.ui b/pokemodr/gui/commands/unsetflag.ui deleted file mode 100644 index f71c8e04..00000000 --- a/pokemodr/gui/commands/unsetflag.ui +++ /dev/null @@ -1,35 +0,0 @@ -<ui version="4.0" > - <class>formUnsetFlag</class> - <widget class="QWidget" name="formUnsetFlag" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxFlag" > - <property name="title" > - <string>Flag to unset</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KIntNumInput" name="varFlag" > - <property name="toolTip" > - <string>The flag to unset</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </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/commands/yesno.ui b/pokemodr/gui/commands/yesno.ui deleted file mode 100644 index 5cc6c078..00000000 --- a/pokemodr/gui/commands/yesno.ui +++ /dev/null @@ -1,64 +0,0 @@ -<ui version="4.0" > - <class>formYesNo</class> - <widget class="QWidget" name="formYesNo" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QGroupBox" name="boxJump" > - <property name="title" > - <string>Jump Action</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="KComboBox" name="varJump" > - <property name="toolTip" > - <string>How the dialog jumped to is treated</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxYes" > - <property name="title" > - <string>Dialog if Yes</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_4" > - <item> - <widget class="KComboBox" name="varYes" > - <property name="toolTip" > - <string>The dialog to jump to if the user answers yes</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxNo" > - <property name="title" > - <string>Dialog if No</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3" > - <item> - <widget class="KComboBox" name="varNo" > - <property name="toolTip" > - <string>The dialog to jump to if the user answers no</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/dialog.ui b/pokemodr/gui/dialog.ui deleted file mode 100644 index 4d43ed9a..00000000 --- a/pokemodr/gui/dialog.ui +++ /dev/null @@ -1,56 +0,0 @@ -<ui version="4.0" > - <class>formDialog</class> - <widget class="QWidget" name="formDialog" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxDialog" > - <property name="title" > - <string>Dialog</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KTextEdit" name="varDialog" > - <property name="toolTip" > - <string>Dialog text and commands</string> - </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxCommand" > - <property name="title" > - <string>Command</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varCommand" > - <property name="toolTip" > - <string>Insert a command into the dialog</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KComboBox</class> - <extends>QComboBox</extends> - <header>kcombobox.h</header> - </customwidget> - <customwidget> - <class>KTextEdit</class> - <extends>QTextEdit</extends> - <header>ktextedit.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/itemeffect.ui b/pokemodr/gui/itemeffect.ui deleted file mode 100644 index 6bd1ac80..00000000 --- a/pokemodr/gui/itemeffect.ui +++ /dev/null @@ -1,167 +0,0 @@ -<ui version="4.0" > - <class>formItemEffect</class> - <widget class="QWidget" name="formItemEffect" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxFlags" > - <property name="title" > - <string>Flags</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QCheckBox" name="varOverworld" > - <property name="toolTip" > - <string>If checked, effect only works in the overworld</string> - </property> - <property name="text" > - <string>Overworld</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="varBattle" > - <property name="toolTip" > - <string>If checked, effect only works in battle</string> - </property> - <property name="text" > - <string>Battle</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="varHeld" > - <property name="toolTip" > - <string>If checked, effect only works when item is being held</string> - </property> - <property name="text" > - <string>Held</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxEffect" > - <property name="title" > - <string>Effect</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KComboBox" name="varEffect" > - <property name="toolTip" > - <string>Effect</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue1" > - <property name="title" > - <string>Value 1</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varValue1" > - <property name="toolTip" > - <string>Value 1</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue2" > - <property name="title" > - <string>Value 2</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue2" > - <property name="toolTip" > - <string>Value 2</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue3" > - <property name="title" > - <string>Value 3</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue3" > - <property name="toolTip" > - <string>Value 3</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue4" > - <property name="title" > - <string>Value 4</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="FractionWidget" name="varValue4" > - <property name="toolTip" > - <string>Value 4</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue5" > - <property name="title" > - <string>Value 5</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varValue5" > - <property name="toolTip" > - <string>Value 5</string> - </property> - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </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> - </customwidget> - <customwidget> - <class>FractionWidget</class> - <extends>QWidget</extends> - <header>../FractionWidget.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/moveeffect.ui b/pokemodr/gui/moveeffect.ui deleted file mode 100644 index 44aa4f27..00000000 --- a/pokemodr/gui/moveeffect.ui +++ /dev/null @@ -1,117 +0,0 @@ -<ui version="4.0" > - <class>formMoveEffect</class> - <widget class="QWidget" name="formMoveEffect" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxChance" > - <property name="title" > - <string>Chance</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QWidget" name="varChance" > - <property name="toolTip" > - <string>The chance the effect occurs</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxEffect" > - <property name="title" > - <string>Effect</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KCombobox" name="varEffect" > - <property name="toolTip" > - <string>The effect</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue1" > - <property name="title" > - <string>Value 1</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KCombobox" name="varValue1" > - <property name="toolTip" > - <string>Value 1 of the effect</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue2" > - <property name="title" > - <string>Value 2</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KCombobox" name="varValue2" > - <property name="toolTip" > - <string>Value 2 of the effect</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue3" > - <property name="title" > - <string>Value 3</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varValue3" > - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue4" > - <property name="title" > - <string>Value 4</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QWidget" name="varValue4" > - <property name="toolTip" > - <string>Value 4</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>KIntNumInput</class> - <extends>QWidget</extends> - <header>knuminput.h</header> - </customwidget> - <customwidget> - <class>KCombobox</class> - <extends>QWidget</extends> - <header>kcombobox.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/gui/speciesevolution.ui b/pokemodr/gui/speciesevolution.ui deleted file mode 100644 index 0a9a528e..00000000 --- a/pokemodr/gui/speciesevolution.ui +++ /dev/null @@ -1,120 +0,0 @@ -<ui version="4.0" > - <class>formSpeciesEvolution</class> - <widget class="QWidget" name="formSpeciesEvolution" > - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxSpecies" > - <property name="title" > - <string>Species</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varSpecies" > - <property name="toolTip" > - <string>Species evolved into</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxStyle" > - <property name="title" > - <string>Style</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KComboBox" name="varStyle" > - <property name="toolTip" > - <string>How the evolution is triggered</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue1" > - <property name="title" > - <string>Value 1</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue1" > - <property name="toolTip" > - <string>Value 1</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue2" > - <property name="title" > - <string>Value 2</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varValue2" > - <property name="toolTip" > - <string>Value 2</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxValue3" > - <property name="title" > - <string>Value 3</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varValue3" > - <property name="minimum" > - <number>0</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="boxLevel" > - <property name="title" > - <string>Level</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KIntNumInput" name="varLevel" > - <property name="toolTip" > - <string>Minimum level necessary</string> - </property> - <property name="minimum" > - <number>0</number> - </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> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/pokemodr/models/AbilityEffectModel.cpp b/pokemodr/models/AbilityEffectModel.cpp deleted file mode 100644 index 0c6fc661..00000000 --- a/pokemodr/models/AbilityEffectModel.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 "AbilityEffectModel.h" - -// PokeModr includes -#include "../AbilityEffectUI.h" - -// Pokemod includes -#include "../../pokemod/Ability.h" -#include "../../pokemod/AbilityEffect.h" - -// Qt includes -#include <QFile> - -AbilityEffectModel::AbilityEffectModel(BaseModel* parent, AbilityEffect* effect) : - ObjectModel(parent, effect) -{ -} - -AbilityEffectModel::~AbilityEffectModel() -{ -} - -QVariant AbilityEffectModel::data(int role) const -{ - if (role == Qt::DisplayRole) - { - if (static_cast<AbilityEffect*>(m_object)->effect() < AbilityEffect::E_End) - return AbilityEffect::EffectStr[static_cast<AbilityEffect*>(m_object)->effect()]; - return ""; - } - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - QWidget* widget = new AbilityEffectUI(static_cast<AbilityEffect*>(m_object), NULL); - return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool AbilityEffectModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} diff --git a/pokemodr/models/AbilityEffectModel.h b/pokemodr/models/AbilityEffectModel.h deleted file mode 100644 index 9f5070dc..00000000 --- a/pokemodr/models/AbilityEffectModel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_ABILITYEFFECTMODEL__ -#define __POKEMODR_ABILITYEFFECTMODEL__ - -// Model includes -#include "ObjectModel.h" - -// Forward declarations -class AbilityEffect; - -class AbilityEffectModel : public ObjectModel -{ - public: - AbilityEffectModel(BaseModel* parent, AbilityEffect* effect); - ~AbilityEffectModel(); - - QVariant data(int role = Qt::DisplayRole) const; - - bool setData(const QVariant& value, int role = Qt::EditRole); -}; - -#endif diff --git a/pokemodr/models/DialogGroupModel.cpp b/pokemodr/models/DialogGroupModel.cpp deleted file mode 100644 index 1eeeb4be..00000000 --- a/pokemodr/models/DialogGroupModel.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 "DialogGroupModel.h" - -// Model includes -#include "DialogModel.h" - -// Pokemod includes -#include "../../pokemod/Pokemod.h" - -DialogGroupModel::DialogGroupModel(BaseModel* parent, Pokemod* pokemod) : - GroupModel(parent, pokemod, "Dialogs") -{ - setupData(); -} - -DialogGroupModel::~DialogGroupModel() -{ -} - -bool DialogGroupModel::insertRows(const int rows) -{ - for (int i = 0; i < rows; ++i) - m_objects.append(new DialogModel(this, static_cast<Pokemod*>(m_object)->newDialog())); - return true; -} - -bool DialogGroupModel::removeRows(const int position, const int rows) -{ - for (int i = 0; i < rows; ++i) - { - static_cast<Pokemod*>(m_object)->deleteDialog(position); - delete m_objects[position]; - m_objects.removeAt(position); - } - return true; -} - -void DialogGroupModel::setupData() -{ - Pokemod* pokemod = static_cast<Pokemod*>(m_object); - for (int i = 0; i < pokemod->dialogCount(); ++i) - m_objects.append(new DialogModel(this, pokemod->dialog(i))); -} diff --git a/pokemodr/models/DialogGroupModel.h b/pokemodr/models/DialogGroupModel.h deleted file mode 100644 index 0e338f48..00000000 --- a/pokemodr/models/DialogGroupModel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_DIALOGGROUPMODEL__ -#define __POKEMODR_DIALOGGROUPMODEL__ - -// Model includes -#include "GroupModel.h" - -// Forward declarations -class Pokemod; - -class DialogGroupModel : public GroupModel -{ - public: - DialogGroupModel(BaseModel* parent, Pokemod* pokemod); - ~DialogGroupModel(); - - bool insertRows(const int rows); - - bool removeRows(const int position, const int rows); - protected: - void setupData(); -}; - -#endif diff --git a/pokemodr/models/DialogModel.cpp b/pokemodr/models/DialogModel.cpp deleted file mode 100644 index c5b3370e..00000000 --- a/pokemodr/models/DialogModel.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 "DialogModel.h" - -// PokeModr includes -#include "../DialogUI.h" - -// Pokemod includes -#include "../../pokemod/Dialog.h" -#include "../../pokemod/Pokemod.h" - -// Qt includes -#include <QFile> - -DialogModel::DialogModel(BaseModel* parent, Dialog* dialog) : - ObjectModel(parent, dialog) -{ -} - -DialogModel::~DialogModel() -{ -} - -QVariant DialogModel::data(int role) const -{ - if (role == Qt::DisplayRole) - return static_cast<Dialog*>(m_object)->dialog(); - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - QWidget* widget = new DialogUI(static_cast<Dialog*>(m_object), NULL); - return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool DialogModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} diff --git a/pokemodr/models/DialogModel.h b/pokemodr/models/DialogModel.h deleted file mode 100644 index d64c9724..00000000 --- a/pokemodr/models/DialogModel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_DIALOGMODEL__ -#define __POKEMODR_DIALOGMODEL__ - -// Model includes -#include "ObjectModel.h" - -// Forward declarations -class Dialog; - -class DialogModel : public ObjectModel -{ - public: - DialogModel(BaseModel* parent, Dialog* dialog); - ~DialogModel(); - - QVariant data(int role = Qt::DisplayRole) const; - - bool setData(const QVariant& value, int role = Qt::EditRole); -}; - -#endif diff --git a/pokemodr/models/ItemEffectModel.cpp b/pokemodr/models/ItemEffectModel.cpp deleted file mode 100644 index 841768e8..00000000 --- a/pokemodr/models/ItemEffectModel.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 "ItemEffectModel.h" - -// PokeModr includes -#include "../ItemEffectUI.h" - -// Pokemod includes -#include "../../pokemod/Item.h" -#include "../../pokemod/ItemEffect.h" - -// Qt includes -#include <QFile> - -ItemEffectModel::ItemEffectModel(BaseModel* parent, ItemEffect* effect) : - ObjectModel(parent, effect) -{ -} - -ItemEffectModel::~ItemEffectModel() -{ -} - -QVariant ItemEffectModel::data(int role) const -{ - if (role == Qt::DisplayRole) - { - if (static_cast<ItemEffect*>(m_object)->effect() < ItemEffect::E_End) - return ItemEffect::EffectStr[static_cast<ItemEffect*>(m_object)->effect()]; - return ""; - } - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - QWidget* widget = new ItemEffectUI(static_cast<ItemEffect*>(m_object), NULL); - return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool ItemEffectModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} diff --git a/pokemodr/models/ItemEffectModel.h b/pokemodr/models/ItemEffectModel.h deleted file mode 100644 index 53116f88..00000000 --- a/pokemodr/models/ItemEffectModel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_ITEMEFFECTMODEL__ -#define __POKEMODR_ITEMEFFECTMODEL__ - -// Model includes -#include "ObjectModel.h" - -// Forward declarations -class ItemEffect; - -class ItemEffectModel : public ObjectModel -{ - public: - ItemEffectModel(BaseModel* parent, ItemEffect* effect); - ~ItemEffectModel(); - - QVariant data(int role = Qt::DisplayRole) const; - - bool setData(const QVariant& value, int role = Qt::EditRole); -}; - -#endif diff --git a/pokemodr/models/MoveEffectModel.cpp b/pokemodr/models/MoveEffectModel.cpp deleted file mode 100644 index fcb0fb00..00000000 --- a/pokemodr/models/MoveEffectModel.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 "MoveEffectModel.h" - -// PokeModr includes -// #include "../MoveEffectUI.h" - -// Pokemod includes -#include "../../pokemod/Move.h" -#include "../../pokemod/MoveEffect.h" - -// Qt includes -#include <QFile> - -MoveEffectModel::MoveEffectModel(BaseModel* parent, MoveEffect* effect) : - ObjectModel(parent, effect) -{ -} - -MoveEffectModel::~MoveEffectModel() -{ -} - -QVariant MoveEffectModel::data(int role) const -{ - if (role == Qt::DisplayRole) - { - if (static_cast<MoveEffect*>(m_object)->effect() < MoveEffect::E_End_Overworld) - return MoveEffect::EffectStr[static_cast<MoveEffect*>(m_object)->effect()]; - return ""; - } - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - // TODO: MoveEffectUI -// QWidget* widget = new MoveEffectUI(static_cast<MoveEffect*>(m_object), NULL); -// return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool MoveEffectModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} diff --git a/pokemodr/models/MoveEffectModel.h b/pokemodr/models/MoveEffectModel.h deleted file mode 100644 index ef20671a..00000000 --- a/pokemodr/models/MoveEffectModel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_MOVEEFFECTMODEL__ -#define __POKEMODR_MOVEEFFECTMODEL__ - -// Model includes -#include "ObjectModel.h" - -// Forward declarations -class MoveEffect; - -class MoveEffectModel : public ObjectModel -{ - public: - MoveEffectModel(BaseModel* parent, MoveEffect* effect); - ~MoveEffectModel(); - - QVariant data(int role = Qt::DisplayRole) const; - - bool setData(const QVariant& value, int role = Qt::EditRole); -}; - -#endif diff --git a/pokemodr/models/SpeciesEvolutionGroupModel.cpp b/pokemodr/models/SpeciesEvolutionGroupModel.cpp deleted file mode 100644 index f129891d..00000000 --- a/pokemodr/models/SpeciesEvolutionGroupModel.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 "SpeciesEvolutionGroupModel.h" - -// Model includes -#include "SpeciesEvolutionModel.h" - -// Pokemod includes -#include "../../pokemod/Species.h" - -SpeciesEvolutionGroupModel::SpeciesEvolutionGroupModel(BaseModel* parent, Species* species) : - GroupModel(parent, species, "Evolutions") -{ - setupData(); -} - -SpeciesEvolutionGroupModel::~SpeciesEvolutionGroupModel() -{ -} - -bool SpeciesEvolutionGroupModel::insertRows(const int rows) -{ - for (int i = 0; i < rows; ++i) - m_objects.append(new SpeciesEvolutionModel(this, static_cast<Species*>(m_object)->newEvolution())); - return true; -} - -bool SpeciesEvolutionGroupModel::removeRows(const int position, const int rows) -{ - for (int i = 0; i < rows; ++i) - { - static_cast<Species*>(m_object)->deleteEvolution(position); - delete m_objects[position]; - m_objects.removeAt(position); - } - return true; -} - -void SpeciesEvolutionGroupModel::setupData() -{ - Species* species = static_cast<Species*>(m_object); - for (int i = 0; i < species->evolutionCount(); ++i) - m_objects.append(new SpeciesEvolutionModel(this, species->evolution(i))); -} diff --git a/pokemodr/models/SpeciesEvolutionGroupModel.h b/pokemodr/models/SpeciesEvolutionGroupModel.h deleted file mode 100644 index fec293e2..00000000 --- a/pokemodr/models/SpeciesEvolutionGroupModel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_SPECIESEVOLUTIONGROUPMODEL__ -#define __POKEMODR_SPECIESEVOLUTIONGROUPMODEL__ - -// Model includes -#include "GroupModel.h" - -// Forward declarations -class Species; - -class SpeciesEvolutionGroupModel : public GroupModel -{ - public: - SpeciesEvolutionGroupModel(BaseModel* parent, Species* species); - ~SpeciesEvolutionGroupModel(); - - bool insertRows(const int rows); - - bool removeRows(const int position, const int rows); - protected: - void setupData(); -}; - -#endif diff --git a/pokemodr/models/SpeciesEvolutionModel.cpp b/pokemodr/models/SpeciesEvolutionModel.cpp deleted file mode 100644 index a31e0d31..00000000 --- a/pokemodr/models/SpeciesEvolutionModel.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 "SpeciesEvolutionModel.h" - -// PokeModr includes -#include "../SpeciesEvolutionUI.h" - -// Pokemod includes -#include "../../pokemod/Species.h" -#include "../../pokemod/SpeciesEvolution.h" - -// Qt includes -#include <QFile> - -SpeciesEvolutionModel::SpeciesEvolutionModel(BaseModel* parent, SpeciesEvolution* evolution) : - ObjectModel(parent, evolution) -{ -} - -SpeciesEvolutionModel::~SpeciesEvolutionModel() -{ -} - -QVariant SpeciesEvolutionModel::data(int role) const -{ - if (role == Qt::DisplayRole) - { - const Species* species = static_cast<const Pokemod*>(m_object->pokemod())->species(static_cast<SpeciesEvolution*>(m_object)->species()); - if (species) - return species->name(); - return ""; - } - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - QWidget* widget = new SpeciesEvolutionUI(static_cast<SpeciesEvolution*>(m_object), NULL); - return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool SpeciesEvolutionModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} diff --git a/pokemodr/models/SpeciesEvolutionModel.h b/pokemodr/models/SpeciesEvolutionModel.h deleted file mode 100644 index ea66d402..00000000 --- a/pokemodr/models/SpeciesEvolutionModel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_SPECIESEVOLUTIONMODEL__ -#define __POKEMODR_SPECIESEVOLUTIONMODEL__ - -// Model includes -#include "ObjectModel.h" - -// Forward declarations -class SpeciesEvolution; - -class SpeciesEvolutionModel : public ObjectModel -{ - public: - SpeciesEvolutionModel(BaseModel* parent, SpeciesEvolution* evolution); - ~SpeciesEvolutionModel(); - - QVariant data(int role = Qt::DisplayRole) const; - - bool setData(const QVariant& value, int role = Qt::EditRole); -}; - -#endif diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 43df0606..d7366f94 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -40,6 +40,7 @@ SOURCES += AbilityUI.cpp \ FileDialog.cpp \ FlagWidget.cpp \ FractionWidget.cpp \ + GlobalScriptUI.cpp \ ItemUI.cpp \ ItemTypeUI.cpp \ MapUI.cpp \ @@ -59,11 +60,10 @@ SOURCES += AbilityUI.cpp \ PokeModr.cpp \ PokeModrUI.cpp \ RulesUI.cpp \ - ScriptUI.cpp \ + ScriptWidget.cpp \ SoundUI.cpp \ SpeciesUI.cpp \ SpeciesAbilityUI.cpp \ - SpeciesEvolutionUI.cpp \ SpeciesItemUI.cpp \ SpeciesMoveUI.cpp \ StoreUI.cpp \ @@ -86,6 +86,8 @@ SOURCES += AbilityUI.cpp \ models/CoinListObjectModel.cpp \ models/EggGroupGroupModel.cpp \ models/EggGroupModel.cpp \ + models/GlobalScriptGroupModel.cpp \ + models/GlobalScriptModel.cpp \ models/GroupModel.cpp \ models/GroupObjectModel.cpp \ models/ItemGroupModel.cpp \ @@ -112,16 +114,12 @@ SOURCES += AbilityUI.cpp \ models/PokemodModel.cpp \ models/RootModel.cpp \ models/RulesModel.cpp \ - models/ScriptGroupModel.cpp \ - models/ScriptModel.cpp \ models/SoundGroupModel.cpp \ models/SoundModel.cpp \ models/SpeciesGroupModel.cpp \ models/SpeciesModel.cpp \ models/SpeciesAbilityGroupModel.cpp \ models/SpeciesAbilityModel.cpp \ - models/SpeciesEvolutionGroupModel.cpp \ - models/SpeciesEvolutionModel.cpp \ models/SpeciesItemGroupModel.cpp \ models/SpeciesItemModel.cpp \ models/SpeciesMoveGroupModel.cpp \ @@ -135,17 +133,7 @@ SOURCES += AbilityUI.cpp \ models/TrainerGroupModel.cpp \ models/TrainerModel.cpp \ models/TypeGroupModel.cpp \ - models/TypeModel.cpp \ - commands/CommandWidget.cpp \ - commands/FlipFlagCommand.cpp \ - commands/SetFlagCommand.cpp \ - commands/UnsetFlagCommand.cpp \ - commands/RandomizeFlagCommand.cpp \ - commands/TestFlagCommand.cpp \ - commands/JumpCommand.cpp \ - commands/YesNoCommand.cpp \ - commands/ItemShopCommand.cpp \ - commands/GiveItemCommand.cpp + models/TypeModel.cpp HEADERS += AbilityUI.h \ AuthorUI.h \ @@ -156,6 +144,7 @@ HEADERS += AbilityUI.h \ FileDialog.h \ FlagWidget.h \ FractionWidget.h \ + GlobalScriptUI.h \ ItemUI.h \ ItemTypeUI.h \ MapUI.h \ @@ -175,11 +164,10 @@ HEADERS += AbilityUI.h \ PokeModr.h \ PokeModrUI.h \ RulesUI.h \ - ScriptUI.h \ + ScriptWidget.h \ SoundUI.h \ SpeciesUI.h \ SpeciesAbilityUI.h \ - SpeciesEvolutionUI.h \ SpeciesItemUI.h \ SpeciesMoveUI.h \ StoreUI.h \ @@ -203,6 +191,8 @@ HEADERS += AbilityUI.h \ models/CoinListObjectModel.h \ models/EggGroupGroupModel.h \ models/EggGroupModel.h \ + models/GlobalScriptGroupModel.h \ + models/GlobalScriptModel.h \ models/GroupModel.h \ models/GroupObjectModel.h \ models/ItemGroupModel.h \ @@ -230,16 +220,12 @@ HEADERS += AbilityUI.h \ models/PokemodModel.h \ models/RootModel.h \ models/RulesModel.h \ - models/ScriptGroupModel.h \ - models/ScriptModel.h \ models/SoundGroupModel.h \ models/SoundModel.h \ models/SpeciesGroupModel.h \ models/SpeciesModel.h \ models/SpeciesAbilityGroupModel.h \ models/SpeciesAbilityModel.h \ - models/SpeciesEvolutionGroupModel.h \ - models/SpeciesEvolutionModel.h \ models/SpeciesItemGroupModel.h \ models/SpeciesItemModel.h \ models/SpeciesMoveGroupModel.h \ @@ -253,17 +239,7 @@ HEADERS += AbilityUI.h \ models/TrainerGroupModel.h \ models/TrainerModel.h \ models/TypeGroupModel.h \ - models/TypeModel.h \ - commands/CommandWidget.h \ - commands/FlipFlagCommand.h \ - commands/SetFlagCommand.h \ - commands/UnsetFlagCommand.h \ - commands/RandomizeFlagCommand.h \ - commands/TestFlagCommand.h \ - commands/JumpCommand.h \ - commands/YesNoCommand.h \ - commands/ItemShopCommand.h \ - commands/GiveItemCommand.h + models/TypeModel.h FORMS += gui/ability.ui \ gui/author.ui \ @@ -289,26 +265,17 @@ FORMS += gui/ability.ui \ gui/pokemod.ui \ gui/pokemodr.ui \ gui/rules.ui \ + gui/script.ui \ gui/sound.ui \ gui/species.ui \ gui/speciesability.ui \ - gui/speciesevolution.ui \ gui/speciesitem.ui \ gui/speciesmove.ui \ gui/store.ui \ gui/tile.ui \ gui/time.ui \ gui/trainer.ui \ - gui/type.ui \ - gui/commands/flipflag.ui \ - gui/commands/setflag.ui \ - gui/commands/unsetflag.ui \ - gui/commands/randomizeflag.ui \ - gui/commands/testflag.ui \ - gui/commands/jump.ui \ - gui/commands/yesno.ui \ - gui/commands/itemshop.ui \ - gui/commands/giveitem.ui + gui/type.ui LATEX += pokemodr.tex |