From fdd0eec1d145fb8ac97b4cc9aaed5218214416ec Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 May 2008 19:55:43 +0000 Subject: [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 --- pokemod/Rules.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'pokemod/Rules.cpp') 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 -- cgit