diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 19:55:43 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 19:55:43 +0000 |
| commit | fdd0eec1d145fb8ac97b4cc9aaed5218214416ec (patch) | |
| tree | 2389a0d53fe3eaa644ccb220345995feec748823 /pokemod | |
| parent | 77124f3f105ea3837022d20a49028309a211c4b0 (diff) | |
| download | sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.tar.gz sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.tar.xz sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.zip | |
[FIX] Refactored out connections made within widgets
[FIX] Flag, Fractiona, and Point widgets fixed to only emit signals when actually changed
[FIX] Pokemod classes now emit signals
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@138 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod')
35 files changed, 245 insertions, 1 deletions
diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp index 168dcdae..c0215099 100644 --- a/pokemod/Ability.cpp +++ b/pokemod/Ability.cpp @@ -88,6 +88,7 @@ QDomElement Ability::save() const void Ability::setName(const QString& name) { m_name = name; + emit(changed()); } QString Ability::name() const diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp index 828e5ae3..ecac1af6 100644 --- a/pokemod/AbilityEffect.cpp +++ b/pokemod/AbilityEffect.cpp @@ -111,6 +111,7 @@ void AbilityEffect::setChance(const Fraction& chance) return; } m_chance = chance; + emit(changed()); } void AbilityEffect::setEffect(const int effect) @@ -124,6 +125,7 @@ void AbilityEffect::setEffect(const int effect) m_value1 = INT_MAX; m_value2 = INT_MAX; m_value3 = 0; + emit(changed()); } void AbilityEffect::setValue1(const int value1) @@ -184,6 +186,7 @@ void AbilityEffect::setValue1(const int value1) return; } m_value1 = value1; + emit(changed()); } void AbilityEffect::setValue2(const int value2) @@ -224,6 +227,7 @@ void AbilityEffect::setValue2(const int value2) return; } m_value2 = value2; + emit(changed()); } void AbilityEffect::setValue3(const int value3) @@ -256,6 +260,7 @@ void AbilityEffect::setValue3(const int value3) return; } m_value3 = value3; + emit(changed()); } void AbilityEffect::setTrigger(const int trigger) @@ -268,6 +273,7 @@ void AbilityEffect::setTrigger(const int trigger) m_trigger = trigger; m_triggerValue1 = INT_MAX; m_triggerValue2.set(1, 1); + emit(changed()); } void AbilityEffect::setTriggerValue1(const int triggerValue1) @@ -314,6 +320,7 @@ void AbilityEffect::setTriggerValue1(const int triggerValue1) return; } m_triggerValue1 = triggerValue1; + emit(changed()); } void AbilityEffect::setTriggerValue2(const Fraction& triggerValue2) @@ -324,6 +331,7 @@ void AbilityEffect::setTriggerValue2(const Fraction& triggerValue2) return; } m_triggerValue2 = triggerValue2; + emit(changed()); } Fraction AbilityEffect::chance() const diff --git a/pokemod/Author.cpp b/pokemod/Author.cpp index b15da387..f3424978 100644 --- a/pokemod/Author.cpp +++ b/pokemod/Author.cpp @@ -82,16 +82,19 @@ QDomElement Author::save() const void Author::setName(const QString& name) { m_name = name; + emit(changed()); } void Author::setEmail(const QString& email) { m_email = email; + emit(changed()); } void Author::setRole(const QString& role) { m_role = role; + emit(changed()); } QString Author::name() const diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp index 95c8cdd1..f4518f0d 100644 --- a/pokemod/Badge.cpp +++ b/pokemod/Badge.cpp @@ -89,6 +89,7 @@ QDomElement Badge::save() const void Badge::setName(const QString& name) { m_name = name; + emit(changed()); } void Badge::setFace(const QPixmap& face) @@ -96,6 +97,7 @@ void Badge::setFace(const QPixmap& face) if (face.size() != QSize(64, 64)) emit(error(size("face"))); m_face = face; + emit(changed()); } void Badge::setBadge(const QPixmap& badge) @@ -103,6 +105,7 @@ void Badge::setBadge(const QPixmap& badge) if (badge.size() != QSize(64, 64)) emit(error(size("badge"))); m_badge = badge; + emit(changed()); } void Badge::setObey(const int obey) @@ -113,6 +116,7 @@ void Badge::setObey(const int obey) return; } m_obey = obey; + emit(changed()); } void Badge::setStat(const int stat, const Fraction& multiplier) @@ -128,6 +132,7 @@ void Badge::setStat(const int stat, const Fraction& multiplier) return; } m_stat[stat] = multiplier; + emit(changed()); } void Badge::setHm(const int hm, const bool hmAllowed) @@ -138,6 +143,7 @@ void Badge::setHm(const int hm, const bool hmAllowed) return; } m_hm[hm] = hmAllowed; + emit(changed()); } QString Badge::name() const diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp index 47400c5e..686a63d9 100644 --- a/pokemod/CoinList.cpp +++ b/pokemod/CoinList.cpp @@ -108,6 +108,7 @@ QDomElement CoinList::save() const void CoinList::setName(const QString& name) { m_name = name; + emit(changed()); } void CoinList::setValue(const int value) @@ -121,6 +122,7 @@ void CoinList::setValue(const int value) if ((effect->effect() == ItemEffect::E_CoinCase) && (effect->value1() == value)) { m_value = value; + emit(changed()); return; } } diff --git a/pokemod/CoinListObject.cpp b/pokemod/CoinListObject.cpp index c9ae4423..3eb44e91 100644 --- a/pokemod/CoinListObject.cpp +++ b/pokemod/CoinListObject.cpp @@ -86,6 +86,7 @@ void CoinListObject::setType(const int type) } m_type = type; m_object = INT_MAX; + emit(changed()); } void CoinListObject::setObject(const int object) @@ -96,6 +97,7 @@ void CoinListObject::setObject(const int object) return; } m_object = object; + emit(changed()); } void CoinListObject::setAmount(const int amount) @@ -106,11 +108,13 @@ void CoinListObject::setAmount(const int amount) return; } m_amount = amount; + emit(changed()); } void CoinListObject::setCost(const int cost) { m_cost = cost; + emit(changed()); } int CoinListObject::type() const diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp index 43ba518a..15607831 100644 --- a/pokemod/Dialog.cpp +++ b/pokemod/Dialog.cpp @@ -637,6 +637,7 @@ QDomElement Dialog::save() const void Dialog::setDialog(const QString& dialog) { m_dialog = dialog; + emit(changed()); } QString Dialog::dialog() const @@ -652,6 +653,7 @@ void Dialog::insertCommand(const int position, const QString& command) return; } m_dialog.insert(position, command); + emit(changed()); } Dialog& Dialog::operator=(const Dialog& rhs) diff --git a/pokemod/EggGroup.cpp b/pokemod/EggGroup.cpp index 7726ea91..82691f2f 100644 --- a/pokemod/EggGroup.cpp +++ b/pokemod/EggGroup.cpp @@ -67,6 +67,7 @@ QDomElement EggGroup::save() const void EggGroup::setName(const QString& name) { m_name = name; + emit(changed()); } QString EggGroup::name() const diff --git a/pokemod/Item.cpp b/pokemod/Item.cpp index 44962f46..777f5856 100644 --- a/pokemod/Item.cpp +++ b/pokemod/Item.cpp @@ -102,11 +102,13 @@ QDomElement Item::save() const void Item::setName(const QString& name) { m_name = name; + emit(changed()); } void Item::setSellable(const bool sellable) { m_sellable = sellable; + emit(changed()); } void Item::setType(const int type) @@ -117,6 +119,7 @@ void Item::setType(const int type) return; } m_type = type; + emit(changed()); } void Item::setPrice(const int price) @@ -127,11 +130,13 @@ void Item::setPrice(const int price) return; } m_price = price; + emit(changed()); } void Item::setDescription(const QString& description) { m_description = description; + emit(changed()); } QString Item::name() const diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp index 30c60f4f..895e101b 100644 --- a/pokemod/ItemEffect.cpp +++ b/pokemod/ItemEffect.cpp @@ -145,16 +145,19 @@ void ItemEffect::setOverworld(const bool overworld) break; } m_overworld = overworld; + emit(changed()); } void ItemEffect::setBattle(const bool battle) { m_battle = battle; + emit(changed()); } void ItemEffect::setHeld(const bool held) { m_held = held; + emit(changed()); } void ItemEffect::setEffect(const int effect) @@ -203,6 +206,7 @@ void ItemEffect::setEffect(const int effect) m_value2 = INT_MAX; m_value3 = INT_MAX; m_value4.set(1, 1); + emit(changed()); } void ItemEffect::setValue1(const int value1) @@ -283,6 +287,7 @@ void ItemEffect::setValue1(const int value1) return; } m_value1 = value1; + emit(changed()); } void ItemEffect::setValue2(const int value2) @@ -397,6 +402,7 @@ void ItemEffect::setValue2(const int value2) return; } m_value2 = value2; + emit(changed()); } void ItemEffect::setValue3(const int value3) @@ -480,6 +486,7 @@ void ItemEffect::setValue3(const int value3) return; } m_value3 = value3; + emit(changed()); } void ItemEffect::setValue4(const Fraction& value4) @@ -535,6 +542,7 @@ void ItemEffect::setValue4(const Fraction& value4) break; } m_value4 = value4; + emit(changed()); } bool ItemEffect::overworld() const diff --git a/pokemod/ItemType.cpp b/pokemod/ItemType.cpp index f1440673..336ececd 100644 --- a/pokemod/ItemType.cpp +++ b/pokemod/ItemType.cpp @@ -80,11 +80,13 @@ QDomElement ItemType::save() const void ItemType::setName(const QString& name) { m_name = name; + emit(changed()); } void ItemType::setComputer(const int computer) { m_computer = computer; + emit(changed()); } void ItemType::setPlayer(const int player) @@ -95,6 +97,7 @@ void ItemType::setPlayer(const int player) return; } m_player = player; + emit(changed()); } void ItemType::setCount(const int count) @@ -105,6 +108,7 @@ void ItemType::setCount(const int count) return; } m_count = count; + emit(changed()); } QString ItemType::name() const diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index 7a3899f1..92cdb98e 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -153,6 +153,7 @@ QDomElement Map::save() const void Map::setName(const QString& name) { m_name = name; + emit(changed()); } void Map::setFlyWarp(const int warp) @@ -163,6 +164,7 @@ void Map::setFlyWarp(const int warp) return; } m_flyWarp = warp; + emit(changed()); } void Map::setType(const int type) @@ -173,6 +175,7 @@ void Map::setType(const int type) return; } m_type = type; + emit(changed()); } QString Map::name() const diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index 4b2fd649..6d29a89c 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -112,6 +112,7 @@ QDomElement MapEffect::save() const void MapEffect::setName(const QString& name) { m_name = name; + emit(changed()); } void MapEffect::setCoordinate(const Point& coordinate) @@ -122,11 +123,13 @@ void MapEffect::setCoordinate(const Point& coordinate) return; } m_coordinate = coordinate; + emit(changed()); } void MapEffect::setExistFlag(const Flag& existFlag) { m_existFlag = existFlag; + emit(changed()); } void MapEffect::setSkin(const QPixmap& skin) @@ -137,6 +140,7 @@ void MapEffect::setSkin(const QPixmap& skin) return; } m_skin = skin; + emit(changed()); } void MapEffect::setEffect(const int effect) @@ -149,6 +153,7 @@ void MapEffect::setEffect(const int effect) m_effect = effect; m_value1 = INT_MAX; m_value2 = INT_MAX; + emit(changed()); } void MapEffect::setValue1(const int value1) @@ -159,6 +164,7 @@ void MapEffect::setValue1(const int value1) return; } m_value1 = value1; + emit(changed()); } void MapEffect::setValue2(const int value2) @@ -192,6 +198,7 @@ void MapEffect::setValue2(const int value2) return; } m_value2 = value2; + emit(changed()); } void MapEffect::setDirection(const int direction) @@ -202,16 +209,19 @@ void MapEffect::setDirection(const int direction) return; } m_direction = direction; + emit(changed()); } void MapEffect::setIsGhost(const bool isGhost) { m_isGhost = isGhost; + emit(changed()); } void MapEffect::setCanMove(const bool canMove) { m_canMove = canMove; + emit(changed()); } void MapEffect::setDialog(const int dialog) @@ -222,6 +232,7 @@ void MapEffect::setDialog(const int dialog) return; } m_dialog = dialog; + emit(changed()); } QString MapEffect::name() const diff --git a/pokemod/MapTrainer.cpp b/pokemod/MapTrainer.cpp index 2da60aa2..ad0da7bc 100644 --- a/pokemod/MapTrainer.cpp +++ b/pokemod/MapTrainer.cpp @@ -119,6 +119,7 @@ QDomElement MapTrainer::save() const void MapTrainer::setName(const QString& name) { m_name = name; + emit(changed()); } void MapTrainer::setTrainerClass(const int trainerClass) @@ -129,6 +130,7 @@ void MapTrainer::setTrainerClass(const int trainerClass) return; } m_trainerClass = trainerClass; + emit(changed()); } void MapTrainer::setCoordinate(const Point& coordinate) @@ -139,11 +141,13 @@ void MapTrainer::setCoordinate(const Point& coordinate) return; } m_coordinate = coordinate; + emit(changed()); } void MapTrainer::setSight(const int sight) { m_sight = sight; + emit(changed()); } void MapTrainer::setDirection(const int direction) @@ -154,6 +158,7 @@ void MapTrainer::setDirection(const int direction) return; } m_direction = direction; + emit(changed()); } void MapTrainer::setNumberFight(const int numberFight) @@ -164,11 +169,13 @@ void MapTrainer::setNumberFight(const int numberFight) return; } m_numberFight = numberFight; + emit(changed()); } void MapTrainer::setAppearFlag(const Flag& appearFlag) { m_appearFlag = appearFlag; + emit(changed()); } void MapTrainer::setDialog(const int dialog) @@ -179,6 +186,7 @@ void MapTrainer::setDialog(const int dialog) return; } m_dialog = dialog; + emit(changed()); } void MapTrainer::setLeadTeamMember(const int leadMember) @@ -189,6 +197,7 @@ void MapTrainer::setLeadTeamMember(const int leadMember) return; } m_leadTeamMember = leadMember; + emit(changed()); } QString MapTrainer::name() const diff --git a/pokemod/MapTrainerTeamMember.cpp b/pokemod/MapTrainerTeamMember.cpp index 67c7109a..f95ae7e0 100644 --- a/pokemod/MapTrainerTeamMember.cpp +++ b/pokemod/MapTrainerTeamMember.cpp @@ -96,6 +96,7 @@ void MapTrainerTeamMember::setSpecies(const int species) return; } m_species = species; + emit(changed()); } void MapTrainerTeamMember::setLevel(const int level) @@ -106,6 +107,7 @@ void MapTrainerTeamMember::setLevel(const int level) return; } m_level = level; + emit(changed()); } void MapTrainerTeamMember::setItem(const int item, const bool state) @@ -118,10 +120,16 @@ void MapTrainerTeamMember::setItem(const int item, const bool state) if (state) { if (!m_item.contains(item)) + { m_item.append(item); + emit(changed()); + } } else + { m_item.removeAll(item); + emit(changed()); + } } void MapTrainerTeamMember::setNature(const int nature) @@ -132,6 +140,7 @@ void MapTrainerTeamMember::setNature(const int nature) return; } m_nature = nature; + emit(changed()); } int MapTrainerTeamMember::species() const diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp index 996dde94..279f7d3f 100644 --- a/pokemod/MapWarp.cpp +++ b/pokemod/MapWarp.cpp @@ -112,6 +112,7 @@ QDomElement MapWarp::save() const void MapWarp::setName(const QString& name) { m_name = name; + emit(changed()); } void MapWarp::setCoordinate(const Point& coordinate) @@ -122,6 +123,7 @@ void MapWarp::setCoordinate(const Point& coordinate) return; } m_coordinate = coordinate; + emit(changed()); } void MapWarp::setFrom(const int direction, const bool can) @@ -132,6 +134,7 @@ void MapWarp::setFrom(const int direction, const bool can) return; } m_from[direction] = can; + emit(changed()); } void MapWarp::setDirectionOut(const int directionOut) @@ -142,6 +145,7 @@ void MapWarp::setDirectionOut(const int directionOut) return; } m_directionOut = directionOut; + emit(changed()); } void MapWarp::setType(const int type) @@ -152,6 +156,7 @@ void MapWarp::setType(const int type) return; } m_type = type; + emit(changed()); } void MapWarp::setIsBiking(const int isBiking) @@ -162,6 +167,7 @@ void MapWarp::setIsBiking(const int isBiking) return; } m_isBiking = isBiking; + emit(changed()); } void MapWarp::setIsFlash(const int isFlash) @@ -172,6 +178,7 @@ void MapWarp::setIsFlash(const int isFlash) return; } m_isFlash = isFlash; + emit(changed()); } void MapWarp::setIsFoggy(const int isFoggy) @@ -182,6 +189,7 @@ void MapWarp::setIsFoggy(const int isFoggy) return; } m_isFoggy = isFoggy; + emit(changed()); } void MapWarp::setToMap(const int toMap) @@ -193,6 +201,7 @@ void MapWarp::setToMap(const int toMap) } m_toMap = toMap; m_toWarp = INT_MAX; + emit(changed()); } void MapWarp::setToWarp(const int toWarp) @@ -208,11 +217,13 @@ void MapWarp::setToWarp(const int toWarp) return; } m_toWarp = toWarp; + emit(changed()); } void MapWarp::setWorkingFlag(const Flag& workingFlag) { m_workingFlag = workingFlag; + emit(changed()); } void MapWarp::setDialog(const int dialog) @@ -223,6 +234,7 @@ void MapWarp::setDialog(const int dialog) return; } m_dialog = dialog; + emit(changed()); } QString MapWarp::name() const diff --git a/pokemod/MapWildList.cpp b/pokemod/MapWildList.cpp index 3c2f25f4..e9e7b71c 100644 --- a/pokemod/MapWildList.cpp +++ b/pokemod/MapWildList.cpp @@ -109,6 +109,7 @@ void MapWildList::setControl(const int control) } m_control = control; m_value = INT_MAX; + emit(changed()); } void MapWildList::setValue(const int value) @@ -127,6 +128,7 @@ void MapWildList::setValue(const int value) if ((effect->effect() == ItemEffect::E_Fish) && (effect->value2() == value)) { m_value = value; + emit(changed()); return; } } @@ -144,10 +146,16 @@ void MapWildList::setTime(const int time, const bool state) if (state) { if (!m_time.contains(time)) + { m_time.append(time); + emit(changed()); + } } else + { m_time.removeAll(time); + emit(changed()); + } } void MapWildList::setScope(const int scope) @@ -163,6 +171,7 @@ void MapWildList::setScope(const int scope) if ((effect->effect() == ItemEffect::E_Scope) && (effect->value2() == scope)) { m_scope = scope; + emit(changed()); return; } } @@ -170,7 +179,10 @@ void MapWildList::setScope(const int scope) emit(error(bounds("value"))); } else + { m_scope = scope; + emit(changed()); + } } int MapWildList::control() const diff --git a/pokemod/MapWildListEncounter.cpp b/pokemod/MapWildListEncounter.cpp index 60f102c5..5918df09 100644 --- a/pokemod/MapWildListEncounter.cpp +++ b/pokemod/MapWildListEncounter.cpp @@ -81,6 +81,7 @@ void MapWildListEncounter::setSpecies(const int species) return; } m_species = species; + emit(changed()); } void MapWildListEncounter::setLevel(const int level) @@ -91,6 +92,7 @@ void MapWildListEncounter::setLevel(const int level) return; } m_level = level; + emit(changed()); } void MapWildListEncounter::setWeight(const int weight) @@ -101,6 +103,7 @@ void MapWildListEncounter::setWeight(const int weight) return; } m_weight = weight; + emit(changed()); } int MapWildListEncounter::species() const diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp index 723fd5af..5567947d 100644 --- a/pokemod/Move.cpp +++ b/pokemod/Move.cpp @@ -137,6 +137,7 @@ QDomElement Move::save() const void Move::setName(const QString& name) { m_name = name; + emit(changed()); } void Move::setAccuracy(const Fraction& accuracy) @@ -147,11 +148,13 @@ void Move::setAccuracy(const Fraction& accuracy) return; } m_accuracy = accuracy; + emit(changed()); } void Move::setPower(const int power) { m_power = power; + emit(changed()); } void Move::setType(const int type) @@ -162,11 +165,13 @@ void Move::setType(const int type) return; } m_type = type; + emit(changed()); } void Move::setSpecial(const bool special) { m_special = special; + emit(changed()); } void Move::setPowerPoints(const int powerPoints) @@ -177,6 +182,7 @@ void Move::setPowerPoints(const int powerPoints) return; } m_powerPoints = powerPoints; + emit(changed()); } void Move::setTarget(const int target) @@ -187,6 +193,7 @@ void Move::setTarget(const int target) return; } m_target = target; + emit(changed()); } void Move::setNumTargets(const int numTargets) @@ -197,6 +204,7 @@ void Move::setNumTargets(const int numTargets) return; } m_numTargets = numTargets; + emit(changed()); } void Move::setTargetChoice(const int targetChoice) @@ -207,36 +215,43 @@ void Move::setTargetChoice(const int targetChoice) return; } m_targetChoice = targetChoice; + emit(changed()); } void Move::setIgnoreAccuracy(const bool ignoreAccuracy) { m_ignoreAccuracy = ignoreAccuracy; + emit(changed()); } void Move::setCanFlinch(const bool canFlinch) { m_canFlinch = canFlinch; + emit(changed()); } void Move::setCanRandom(const bool canRandom) { m_canRandom = canRandom; + emit(changed()); } void Move::setCanSnatch(const bool canSnatch) { m_canSnatch = canSnatch; + emit(changed()); } void Move::setSound(const bool sound) { m_sound = sound; + emit(changed()); } void Move::setDescription(const QString& description) { m_description = description; + emit(changed()); } QString Move::name() const diff --git a/pokemod/MoveEffect.cpp b/pokemod/MoveEffect.cpp index 37cb51fc..13d2b7a2 100644 --- a/pokemod/MoveEffect.cpp +++ b/pokemod/MoveEffect.cpp @@ -94,6 +94,7 @@ void MoveEffect::setChance(const Fraction& chance) return; } m_chance = chance; + emit(changed()); } void MoveEffect::setEffect(const int effect) @@ -108,6 +109,7 @@ void MoveEffect::setEffect(const int effect) m_value2 = INT_MAX; m_value3 = 0; m_value4.set(1, 1); + emit(changed()); } void MoveEffect::setValue1(const int value1) @@ -156,6 +158,7 @@ void MoveEffect::setValue1(const int value1) return; } m_value1 = value1; + emit(changed()); } void MoveEffect::setValue2(const int value2) @@ -174,6 +177,7 @@ void MoveEffect::setValue2(const int value2) return; } m_value2 = value2; + emit(changed()); } void MoveEffect::setValue3(const int value3) @@ -185,6 +189,7 @@ void MoveEffect::setValue3(const int value3) break; } m_value3 = value3; + emit(changed()); } void MoveEffect::setValue4(const Fraction& value4) @@ -195,6 +200,7 @@ void MoveEffect::setValue4(const Fraction& value4) return; } m_value4 = value4; + emit(changed()); } Fraction MoveEffect::chance() const diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp index 86a53deb..db571d00 100644 --- a/pokemod/Nature.cpp +++ b/pokemod/Nature.cpp @@ -75,6 +75,7 @@ QDomElement Nature::save() const void Nature::setName(const QString& name) { m_name = name; + emit(changed()); } void Nature::setStat(const int stat, const Fraction& multiplier) @@ -85,6 +86,7 @@ void Nature::setStat(const int stat, const Fraction& multiplier) return; } m_stat[stat] = multiplier; + emit(changed()); } void Nature::setWeight(const int weight) @@ -95,6 +97,7 @@ void Nature::setWeight(const int weight) return; } m_weight = weight; + emit(changed()); } QString Nature::name() const diff --git a/pokemod/Object.cpp b/pokemod/Object.cpp index 0fcb718a..b0e868a1 100644 --- a/pokemod/Object.cpp +++ b/pokemod/Object.cpp @@ -59,6 +59,7 @@ QString Object::className() const void Object::setId(const int id) { m_id = id; + emit(changed()); } QString Object::unused(const QString& variable) diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 83c25cb2..bdd3eda3 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -457,16 +457,19 @@ int Pokemod::maxCompatability(const Pokemod& pokemod) const void Pokemod::setTitle(const QString& title) { m_title = title; + emit(changed()); } void Pokemod::setVersion(const QString& version) { m_version = version; + emit(changed()); } void Pokemod::setDescription(const QString& description) { m_description = description; + emit(changed()); } void Pokemod::setStartMap(const int startMap) @@ -477,6 +480,7 @@ void Pokemod::setStartMap(const int startMap) return; } m_startMap = startMap; + emit(changed()); } void Pokemod::setStartWarp(const int startWarp) @@ -492,6 +496,7 @@ void Pokemod::setStartWarp(const int startWarp) return; } m_startWarp = startWarp; + emit(changed()); } void Pokemod::setWalkSkin(const QPixmap& walkSkin) @@ -502,6 +507,7 @@ void Pokemod::setWalkSkin(const QPixmap& walkSkin) return; } m_walkSkin = walkSkin; + emit(changed()); } void Pokemod::setBikeSkin(const QPixmap& bikeSkin) @@ -512,6 +518,7 @@ void Pokemod::setBikeSkin(const QPixmap& bikeSkin) return; } m_bikeSkin = bikeSkin; + emit(changed()); } void Pokemod::setSurfSkin(const QPixmap& surfSkin) @@ -522,6 +529,7 @@ void Pokemod::setSurfSkin(const QPixmap& surfSkin) return; } m_surfSkin = surfSkin; + emit(changed()); } void Pokemod::setFlySkin(const QPixmap& flySkin) @@ -532,6 +540,7 @@ void Pokemod::setFlySkin(const QPixmap& flySkin) return; } m_flySkin = flySkin; + emit(changed()); } void Pokemod::setFishSkin(const QPixmap& fishSkin) @@ -542,6 +551,7 @@ void Pokemod::setFishSkin(const QPixmap& fishSkin) return; } m_fishSkin = fishSkin; + emit(changed()); } void Pokemod::setSurfFishSkin(const QPixmap& surfFishSkin) @@ -552,21 +562,25 @@ void Pokemod::setSurfFishSkin(const QPixmap& surfFishSkin) return; } m_surfFishSkin = surfFishSkin; + emit(changed()); } void Pokemod::setSuperPCUname(const QString& username) { m_superPCUname = username; + emit(changed()); } void Pokemod::setSuperPCPasswd(const QString& password) { m_superPCPasswd = password; + emit(changed()); } void Pokemod::setTypeChart(const int attack, const int defense, const Fraction& multiplier) { m_typeChart.set(attack, defense, multiplier); + emit(changed()); } void Pokemod::setRules(const Rules& rules) diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index f466e42d..fcb63c91 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -163,6 +163,7 @@ QDomElement Rules::save() const void Rules::setGenderAllowed(const bool genderAllowed) { m_genderAllowed = genderAllowed; + emit(changed()); } void Rules::setBreedingAllowed(const bool breedingAllowed) @@ -173,31 +174,37 @@ void Rules::setBreedingAllowed(const bool breedingAllowed) return; } m_breedingAllowed = breedingAllowed; + emit(changed()); } void Rules::setHoldItems(const int holdItems) { m_holdItems = holdItems; + emit(changed()); } void Rules::setCriticalDomains(const bool criticalDomains) { m_criticalDomains = criticalDomains; + emit(changed()); } void Rules::setAbilityAllowed(const bool abilityAllowed) { m_abilityAllowed = abilityAllowed; + emit(changed()); } void Rules::setNatureAllowed(const bool natureAllowed) { m_natureAllowed = natureAllowed; + emit(changed()); } void Rules::setNumBoxes(const int numBoxes) { m_numBoxes = numBoxes; + emit(changed()); } void Rules::setBoxSize(const int boxSize) @@ -208,6 +215,7 @@ void Rules::setBoxSize(const int boxSize) return; } m_boxSize = boxSize; + emit(changed()); } void Rules::setMaxParty(const int maxParty) @@ -218,6 +226,7 @@ void Rules::setMaxParty(const int maxParty) return; } m_maxParty = maxParty; + emit(changed()); } void Rules::setMaxFight(const int maxFight) @@ -228,6 +237,7 @@ void Rules::setMaxFight(const int maxFight) return; } m_maxFight = maxFight; + emit(changed()); } void Rules::setMaxPlayers(const int maxPlayers) @@ -238,6 +248,7 @@ void Rules::setMaxPlayers(const int maxPlayers) return; } m_maxPlayers = maxPlayers; + emit(changed()); } void Rules::setMaxMoves(const int maxMoves) @@ -248,6 +259,7 @@ void Rules::setMaxMoves(const int maxMoves) return; } m_maxMoves = maxMoves; + emit(changed()); } void Rules::setMaxLevel(const int maxLevel) @@ -258,36 +270,42 @@ void Rules::setMaxLevel(const int maxLevel) return; } m_maxLevel = maxLevel; + emit(changed()); } void Rules::setMaxMoney(const int maxMoney) { m_maxMoney = maxMoney; + emit(changed()); } void Rules::setHardCash(const bool hardCash) { m_hardCash = hardCash; + emit(changed()); } void Rules::setAllowSwitchStyle(const bool allowSwitchStyle) { m_allowSwitchStyle = allowSwitchStyle; + emit(changed()); } void Rules::setSpecialSplit(const bool specialSplit) { m_specialSplit = specialSplit; + emit(changed()); } void Rules::setSpecialDVSplit(const bool specialDVSplit) { - if (specialDVSplit && m_specialSplit) + if (!specialDVSplit && m_specialSplit) { emit(error(bounds("specialDVSplit"))); return; } m_specialDVSplit = specialDVSplit; + emit(changed()); } void Rules::setMaxDVValue(const unsigned char maxDVValue) @@ -298,31 +316,37 @@ void Rules::setMaxDVValue(const unsigned char maxDVValue) return; } m_maxDVValue = maxDVValue; + emit(changed()); } void Rules::setHappiness(const bool happiness) { m_happiness = happiness; + emit(changed()); } void Rules::setHappyFaintLoss(const int happyFaintLoss) { m_happyFaintLoss = happyFaintLoss; + emit(changed()); } void Rules::setHappyLevelGain(const int happyLevelGain) { m_happyLevelGain = happyLevelGain; + emit(changed()); } void Rules::setHappySteps(const int happySteps) { m_happySteps = happySteps; + emit(changed()); } void Rules::setEffortValuesAllowed(const bool effortValuesAllowed) { m_effortValuesAllowed = effortValuesAllowed; + emit(changed()); } void Rules::setMaxTotalEV(const int maxTotalEV) @@ -333,6 +357,7 @@ void Rules::setMaxTotalEV(const int maxTotalEV) return; } m_maxTotalEV = maxTotalEV; + emit(changed()); } void Rules::setMaxEVPerStat(const int maxEVPerStat) @@ -343,6 +368,7 @@ void Rules::setMaxEVPerStat(const int maxEVPerStat) return; } m_maxEVPerStat = maxEVPerStat; + emit(changed()); } void Rules::setPokerusChance(const Fraction& pokerusChance) @@ -353,6 +379,7 @@ void Rules::setPokerusChance(const Fraction& pokerusChance) return; } m_pokerusChance = pokerusChance; + emit(changed()); } bool Rules::genderAllowed() const diff --git a/pokemod/Sound.cpp b/pokemod/Sound.cpp index e707bd6b..b4239027 100644 --- a/pokemod/Sound.cpp +++ b/pokemod/Sound.cpp @@ -72,11 +72,13 @@ QDomElement Sound::save() const void Sound::setName(const QString& name) { m_name = name; + emit(changed()); } void Sound::setData(const QByteArray& data) { m_data = data; + emit(changed()); } QString Sound::name() const diff --git a/pokemod/Species.cpp b/pokemod/Species.cpp index cb22829c..91ba0720 100644 --- a/pokemod/Species.cpp +++ b/pokemod/Species.cpp @@ -239,6 +239,7 @@ QDomElement Species::save() const void Species::setName(const QString& name) { m_name = name; + emit(changed()); } void Species::setBaseStat(const int stat, const int baseStat) @@ -249,6 +250,7 @@ void Species::setBaseStat(const int stat, const int baseStat) return; } m_baseStat[stat] = baseStat; + emit(changed()); } void Species::setEffortValue(const int stat, const int effortValue) @@ -269,6 +271,7 @@ void Species::setEffortValue(const int stat, const int effortValue) return; } m_effortValue[stat] = effortValue; + emit(changed()); } void Species::setGrowth(const int growth) @@ -279,11 +282,13 @@ void Species::setGrowth(const int growth) return; } m_growth = growth; + emit(changed()); } void Species::setExperienceValue(const int experienceValue) { m_experienceValue = experienceValue; + emit(changed()); } void Species::setCatchValue(const int catchValue) @@ -294,6 +299,7 @@ void Species::setCatchValue(const int catchValue) return; } m_catchValue = catchValue; + emit(changed()); } void Species::setRunChance(const Fraction& runChance) @@ -304,6 +310,7 @@ void Species::setRunChance(const Fraction& runChance) return; } m_runChance = runChance; + emit(changed()); } void Species::setFleeChance(const Fraction& fleeChance) @@ -314,6 +321,7 @@ void Species::setFleeChance(const Fraction& fleeChance) return; } m_fleeChance = fleeChance; + emit(changed()); } void Species::setItemChance(const Fraction& itemChance) @@ -324,21 +332,25 @@ void Species::setItemChance(const Fraction& itemChance) return; } m_itemChance = itemChance; + emit(changed()); } void Species::setPokedexNumber(const int pokedexNumber) { m_pokedexNumber = pokedexNumber; + emit(changed()); } void Species::setWeight(const int weight) { m_weight = weight; + emit(changed()); } void Species::setHeightFeet(const int feet) { m_heightFeet = feet; + emit(changed()); } void Species::setHeightInches(const int inches) @@ -349,11 +361,13 @@ void Species::setHeightInches(const int inches) return; } m_heightInches = inches; + emit(changed()); } void Species::setPokedexEntry(const QString& pokedexEntry) { m_pokedexEntry = pokedexEntry; + emit(changed()); } void Species::setFrontMaleSprite(const QPixmap& frontMaleSprite) @@ -369,6 +383,7 @@ void Species::setFrontMaleSprite(const QPixmap& frontMaleSprite) return; } m_frontMaleSprite = frontMaleSprite; + emit(changed()); } void Species::setBackMaleSprite(const QPixmap& backMaleSprite) @@ -384,6 +399,7 @@ void Species::setBackMaleSprite(const QPixmap& backMaleSprite) return; } m_backMaleSprite = backMaleSprite; + emit(changed()); } void Species::setFrontFemaleSprite(const QPixmap& frontFemaleSprite) @@ -404,6 +420,7 @@ void Species::setFrontFemaleSprite(const QPixmap& frontFemaleSprite) return; } m_frontFemaleSprite = frontFemaleSprite; + emit(changed()); } void Species::setBackFemaleSprite(const QPixmap& backFemaleSprite) @@ -424,6 +441,7 @@ void Species::setBackFemaleSprite(const QPixmap& backFemaleSprite) return; } m_backFemaleSprite = backFemaleSprite; + emit(changed()); } void Species::setListSprite(const QPixmap& listSprite) @@ -434,6 +452,7 @@ void Species::setListSprite(const QPixmap& listSprite) return; } m_listSprite = listSprite; + emit(changed()); } void Species::setGenderFactor(const Fraction& genderFactor) @@ -444,6 +463,7 @@ void Species::setGenderFactor(const Fraction& genderFactor) return; } m_genderFactor = genderFactor; + emit(changed()); } void Species::setEggSpecies(const int eggSpecies) @@ -454,16 +474,19 @@ void Species::setEggSpecies(const int eggSpecies) return; } m_eggSpecies = eggSpecies; + emit(changed()); } void Species::setEggSteps(const int eggSteps) { m_eggSteps = eggSteps; + emit(changed()); } void Species::setNidoranGroup(const int nidoranGroup) { m_nidoranGroup = nidoranGroup; + emit(changed()); } void Species::setType(const int type, const bool state) @@ -476,10 +499,16 @@ void Species::setType(const int type, const bool state) if (state) { if (!m_type.contains(type)) + { m_type.append(type); + emit(changed()); + } } else + { m_type.removeAll(type); + emit(changed()); + } } void Species::setEggGroup(const int eggGroup, const bool state) @@ -492,10 +521,16 @@ void Species::setEggGroup(const int eggGroup, const bool state) if (state) { if (!m_eggGroup.contains(eggGroup)) + { m_eggGroup.append(eggGroup); + emit(changed()); + } } else + { m_eggGroup.removeAll(eggGroup); + emit(changed()); + } } QString Species::name() const diff --git a/pokemod/SpeciesAbility.cpp b/pokemod/SpeciesAbility.cpp index 751b8e31..005684e9 100644 --- a/pokemod/SpeciesAbility.cpp +++ b/pokemod/SpeciesAbility.cpp @@ -76,6 +76,7 @@ void SpeciesAbility::setAbility(const int ability) return; } m_ability = ability; + emit(changed()); } void SpeciesAbility::setWeight(const int weight) @@ -86,6 +87,7 @@ void SpeciesAbility::setWeight(const int weight) return; } m_weight = weight; + emit(changed()); } int SpeciesAbility::ability() const diff --git a/pokemod/SpeciesEvolution.cpp b/pokemod/SpeciesEvolution.cpp index ba32cf3b..b57f3715 100644 --- a/pokemod/SpeciesEvolution.cpp +++ b/pokemod/SpeciesEvolution.cpp @@ -97,6 +97,7 @@ void SpeciesEvolution::setSpecies(const int species) return; } m_species = species; + emit(changed()); } void SpeciesEvolution::setStyle(const int style) @@ -107,6 +108,7 @@ void SpeciesEvolution::setStyle(const int style) return; } m_style = style; + emit(changed()); } void SpeciesEvolution::setValue1(const int value1) @@ -143,6 +145,7 @@ void SpeciesEvolution::setValue1(const int value1) return; } m_value1 = value1; + emit(changed()); } void SpeciesEvolution::setValue2(const int value2) @@ -167,6 +170,7 @@ void SpeciesEvolution::setValue2(const int value2) return; } m_value2 = value2; + emit(changed()); } void SpeciesEvolution::setValue3(const int value3) @@ -182,6 +186,7 @@ void SpeciesEvolution::setValue3(const int value3) return; } m_value3 = value3; + emit(changed()); } void SpeciesEvolution::setLevel(const int level) @@ -192,6 +197,7 @@ void SpeciesEvolution::setLevel(const int level) return; } m_level = level; + emit(changed()); } int SpeciesEvolution::species() const diff --git a/pokemod/SpeciesItem.cpp b/pokemod/SpeciesItem.cpp index 53b70f7d..261cc331 100644 --- a/pokemod/SpeciesItem.cpp +++ b/pokemod/SpeciesItem.cpp @@ -76,6 +76,7 @@ void SpeciesItem::setItem(const int item) return; } m_item = item; + emit(changed()); } void SpeciesItem::setWeight(const int weight) @@ -86,6 +87,7 @@ void SpeciesItem::setWeight(const int weight) return; } m_weight = weight; + emit(changed()); } int SpeciesItem::item() const diff --git a/pokemod/SpeciesMove.cpp b/pokemod/SpeciesMove.cpp index b057ba2a..d5042414 100644 --- a/pokemod/SpeciesMove.cpp +++ b/pokemod/SpeciesMove.cpp @@ -80,6 +80,7 @@ void SpeciesMove::setMove(const int move) return; } m_move = move; + emit(changed()); } void SpeciesMove::setLevel(const int level) @@ -90,6 +91,7 @@ void SpeciesMove::setLevel(const int level) return; } m_level = level; + emit(changed()); } void SpeciesMove::setWild(const int wild) @@ -100,6 +102,7 @@ void SpeciesMove::setWild(const int wild) return; } m_wild = wild; + emit(changed()); } int SpeciesMove::move() const diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp index 0358e473..e0a54159 100644 --- a/pokemod/Store.cpp +++ b/pokemod/Store.cpp @@ -73,6 +73,7 @@ QDomElement Store::save() const void Store::setName(const QString& name) { m_name = name; + emit(changed()); } void Store::setItem(const int item, const bool state) @@ -85,10 +86,16 @@ void Store::setItem(const int item, const bool state) if (state) { if (!m_item.contains(item)) + { m_item.append(item); + emit(changed()); + } } else + { m_item.removeAll(item); + emit(changed()); + } } QString Store::name() const diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 40f4d9b2..1ca60d40 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -100,6 +100,7 @@ QDomElement Tile::save() const void Tile::setName(const QString& name) { m_name = name; + emit(changed()); } void Tile::setSprite(const QPixmap& sprite) @@ -110,6 +111,7 @@ void Tile::setSprite(const QPixmap& sprite) return; } m_sprite = sprite; + emit(changed()); } void Tile::setFrom(const int direction, const bool state) @@ -120,6 +122,7 @@ void Tile::setFrom(const int direction, const bool state) return; } m_from[direction] = state; + emit(changed()); } void Tile::setWildChance(const Fraction& wildChance) @@ -130,6 +133,7 @@ void Tile::setWildChance(const Fraction& wildChance) return; } m_wildChance = wildChance; + emit(changed()); } void Tile::setHmType(const int hmType) @@ -146,6 +150,7 @@ void Tile::setHmType(const int hmType) } m_hmType = hmType; m_under = INT_MAX; + emit(changed()); } void Tile::setUnder(const int under) @@ -164,6 +169,7 @@ void Tile::setUnder(const int under) } } m_under = under; + emit(changed()); } void Tile::setForceType(const int forceType) @@ -174,6 +180,7 @@ void Tile::setForceType(const int forceType) return; } m_forceType = forceType; + emit(changed()); } void Tile::setForceDirection(const int forceDirection) @@ -192,6 +199,7 @@ void Tile::setForceDirection(const int forceDirection) } } m_forceDirection = forceDirection; + emit(changed()); } QString Tile::name() const diff --git a/pokemod/Time.cpp b/pokemod/Time.cpp index 06e13e30..90488e1f 100644 --- a/pokemod/Time.cpp +++ b/pokemod/Time.cpp @@ -75,6 +75,7 @@ QDomElement Time::save() const void Time::setName(const QString& name) { m_name = name; + emit(changed()); } void Time::setHour(const int hour) @@ -85,6 +86,7 @@ void Time::setHour(const int hour) return; } m_hour = hour; + emit(changed()); } void Time::setMinute(const int minute) @@ -95,6 +97,7 @@ void Time::setMinute(const int minute) return; } m_minute = minute; + emit(changed()); } QString Time::name() const diff --git a/pokemod/Trainer.cpp b/pokemod/Trainer.cpp index 230dcc17..fac920bf 100644 --- a/pokemod/Trainer.cpp +++ b/pokemod/Trainer.cpp @@ -78,6 +78,7 @@ QDomElement Trainer::save() const void Trainer::setName(const QString& name) { m_name = name; + emit(changed()); } void Trainer::setMoneyFactor(const int moneyFactor) @@ -88,6 +89,7 @@ void Trainer::setMoneyFactor(const int moneyFactor) return; } m_moneyFactor = moneyFactor; + emit(changed()); } void Trainer::setSkin(const QPixmap& skin) @@ -98,6 +100,7 @@ void Trainer::setSkin(const QPixmap& skin) return; } m_skin = skin; + emit(changed()); } // void Trainer::setAi(const QString& fileName) diff --git a/pokemod/Type.cpp b/pokemod/Type.cpp index c36b65be..ed1d4698 100644 --- a/pokemod/Type.cpp +++ b/pokemod/Type.cpp @@ -78,6 +78,7 @@ QDomElement Type::save() const void Type::setName(const QString& name) { m_name = name; + emit(changed()); } void Type::setStab(const Fraction& stab) @@ -88,6 +89,7 @@ void Type::setStab(const Fraction& stab) return; } m_stab = stab; + emit(changed()); } void Type::setStatusImmunity(const int status, const bool immune) @@ -98,6 +100,7 @@ void Type::setStatusImmunity(const int status, const bool immune) return; } m_statusImmunity[status] = immune; + emit(changed()); } void Type::setWeatherImmunity(const int weather, const bool immune) @@ -108,6 +111,7 @@ void Type::setWeatherImmunity(const int weather, const bool immune) return; } m_weatherImmunity[weather] = immune; + emit(changed()); } QString Type::name() const |
