From 0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 23 May 2008 22:39:56 +0000 Subject: [ADD] Added UI classes for GlobalScript [FIX] Script support is now in pokemodr git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@168 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/MapWildListUI.cpp | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'pokemodr/MapWildListUI.cpp') diff --git a/pokemodr/MapWildListUI.cpp b/pokemodr/MapWildListUI.cpp index e754abf0..c9e39b69 100644 --- a/pokemodr/MapWildListUI.cpp +++ b/pokemodr/MapWildListUI.cpp @@ -20,7 +20,6 @@ // Pokemod includes #include "../pokemod/Item.h" -#include "../pokemod/ItemEffect.h" #include "../pokemod/Pokemod.h" #include "../pokemod/MapWildList.h" #include "../pokemod/Time.h" @@ -43,20 +42,6 @@ void MapWildListUI::initGui() void MapWildListUI::refreshGui() { - varValue->clear(); - varScope->clear(); - for (int i = 0; i < static_cast(original()->pokemod())->itemCount(); ++i) - { - const Item* item = static_cast(original()->pokemod())->item(i); - for (int j = 0; j < item->effectCount(); ++j) - { - const ItemEffect* effect = item->effect(j); - if (effect->effect() == ItemEffect::E_Fish) - varValue->addItem(item->name(), effect->value2()); - else if (effect->effect() == ItemEffect::E_Scope) - varScope->addItem(item->name(), effect->value2()); - } - } varTimes->clear(); for (int i = 0; i < static_cast(original()->pokemod())->timeCount(); ++i) { @@ -69,15 +54,12 @@ void MapWildListUI::refreshGui() void MapWildListUI::setGui() { varControl->setCurrentIndex(static_cast(modified())->control()); - varValue->setEnabled(static_cast(modified())->control() == MapWildList::Fishing); - varValue->setCurrentIndex(varValue->findData(static_cast(modified())->value())); + varScript->setValue(static_cast(modified())->script()); for (int i = 0; i < varTimes->count(); ++i) { QListWidgetItem* widgetItem = varTimes->item(i); widgetItem->setSelected(static_cast(modified())->time(widgetItem->data(Qt::UserRole).toInt())); } - boxScope->setChecked(static_cast(modified())->scope() == INT_MAX); - varScope->setCurrentIndex(varScope->findData(static_cast(modified())->scope())); } void MapWildListUI::apply() @@ -98,9 +80,9 @@ void MapWildListUI::on_varControl_activated(const int control) static_cast(modified())->setControl(control); } -void MapWildListUI::on_varValue_activated(const int value) +void MapWildListUI::on_varScript_valueChanged(const Script& script) { - static_cast(modified())->setValue(varValue->itemData(value).toInt()); + static_cast(modified())->setScript(script); } void MapWildListUI::on_varTimes_itemSelectionChanged() @@ -111,14 +93,3 @@ void MapWildListUI::on_varTimes_itemSelectionChanged() static_cast(modified())->setTime(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected()); } } - -void MapWildListUI::on_boxScope_toggled(const bool scopeUsed) -{ - if (!scopeUsed) - static_cast(modified())->setScope(INT_MAX); -} - -void MapWildListUI::on_varScope_activated(const int scope) -{ - static_cast(modified())->setScope(varScope->itemData(scope).toInt()); -} -- cgit