summaryrefslogtreecommitdiffstats
path: root/pokemodr/MapWildListUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-23 22:39:56 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-23 22:39:56 +0000
commit0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4 (patch)
tree61da8fe050b81a477c24fc481e5d6cb39f928e2f /pokemodr/MapWildListUI.cpp
parent793f2e539316e796968103617025320870f8c3ce (diff)
downloadsigen-0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4.tar.gz
sigen-0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4.tar.xz
sigen-0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4.zip
[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
Diffstat (limited to 'pokemodr/MapWildListUI.cpp')
-rw-r--r--pokemodr/MapWildListUI.cpp35
1 files changed, 3 insertions, 32 deletions
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<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)
- {
- 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<const Pokemod*>(original()->pokemod())->timeCount(); ++i)
{
@@ -69,15 +54,12 @@ void MapWildListUI::refreshGui()
void MapWildListUI::setGui()
{
varControl->setCurrentIndex(static_cast<MapWildList*>(modified())->control());
- varValue->setEnabled(static_cast<MapWildList*>(modified())->control() == MapWildList::Fishing);
- varValue->setCurrentIndex(varValue->findData(static_cast<MapWildList*>(modified())->value()));
+ varScript->setValue(static_cast<MapWildList*>(modified())->script());
for (int i = 0; i < varTimes->count(); ++i)
{
QListWidgetItem* widgetItem = varTimes->item(i);
widgetItem->setSelected(static_cast<MapWildList*>(modified())->time(widgetItem->data(Qt::UserRole).toInt()));
}
- boxScope->setChecked(static_cast<MapWildList*>(modified())->scope() == INT_MAX);
- varScope->setCurrentIndex(varScope->findData(static_cast<MapWildList*>(modified())->scope()));
}
void MapWildListUI::apply()
@@ -98,9 +80,9 @@ void MapWildListUI::on_varControl_activated(const int control)
static_cast<MapWildList*>(modified())->setControl(control);
}
-void MapWildListUI::on_varValue_activated(const int value)
+void MapWildListUI::on_varScript_valueChanged(const Script& script)
{
- static_cast<MapWildList*>(modified())->setValue(varValue->itemData(value).toInt());
+ static_cast<MapWildList*>(modified())->setScript(script);
}
void MapWildListUI::on_varTimes_itemSelectionChanged()
@@ -111,14 +93,3 @@ void MapWildListUI::on_varTimes_itemSelectionChanged()
static_cast<MapWildList*>(modified())->setTime(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected());
}
}
-
-void MapWildListUI::on_boxScope_toggled(const bool scopeUsed)
-{
- if (!scopeUsed)
- static_cast<MapWildList*>(modified())->setScope(INT_MAX);
-}
-
-void MapWildListUI::on_varScope_activated(const int scope)
-{
- static_cast<MapWildList*>(modified())->setScope(varScope->itemData(scope).toInt());
-}