diff options
-rw-r--r-- | sigmod/Rules.cpp | 8 | ||||
-rw-r--r-- | sigmodr/doc/editing-rules.docbook | 8 | ||||
-rw-r--r-- | sigmodr/widgets/RulesUI.cpp | 18 | ||||
-rw-r--r-- | sigmodr/widgets/gui/rules.ui | 18 |
4 files changed, 34 insertions, 18 deletions
diff --git a/sigmod/Rules.cpp b/sigmod/Rules.cpp index 5acf0dfc..a4ef157a 100644 --- a/sigmod/Rules.cpp +++ b/sigmod/Rules.cpp @@ -197,10 +197,10 @@ CHECK_BEGIN(Rules, bool, breedingAllowed) } CHECK_END() CHECK(Rules, bool, criticalDomains) -CHECK_BOUNDS(Rules, int, numBoxes, 0, INT_MAX) +CHECK_BOUNDS(Rules, int, numBoxes, -1, INT_MAX) CHECK_BEGIN(Rules, int, boxSize) if (m_numBoxes) - TBOUNDS(boxSize, 1, INT_MAX); + TBOUNDS(boxSize, 0, INT_MAX); CHECK_END() CHECK_BOUNDS(Rules, int, maxParty, 1, INT_MAX) CHECK_BOUNDS(Rules, int, maxFight, 1, m_maxParty) @@ -222,11 +222,11 @@ CHECK_BEGIN(Rules, bool, specialDVSplit) } CHECK_END() CHECK_BEGIN(Rules, int, maxTotalEV) - TBOUNDS(maxTotalEV, 0, INT_MAX); + TBOUNDS(maxTotalEV, -1, INT_MAX); CHECK_END() CHECK_BEGIN(Rules, int, maxEVPerStat) if (m_maxTotalEV) - TBOUNDS(maxEVPerStat, 1, m_maxTotalEV); + TBOUNDS(maxEVPerStat, 0, m_maxTotalEV); CHECK_END() Rules& Rules::operator=(const Rules& rhs) diff --git a/sigmodr/doc/editing-rules.docbook b/sigmodr/doc/editing-rules.docbook index 7ccee0ac..7e68bd80 100644 --- a/sigmodr/doc/editing-rules.docbook +++ b/sigmodr/doc/editing-rules.docbook @@ -103,7 +103,7 @@ value</glossterm>s</term> <para>This value sets a limit on the number of effort values a single creature can have at once distributed over all of its stats. Without effort values, <glossterm linkend="gloss-stat-experience">stat experience</glossterm> will be -used instead.</para> +used instead. It may be set to “unlimited”.</para> </listitem> </varlistentry> @@ -111,7 +111,7 @@ used instead.</para> <term>Max effort values per stat</term> <listitem> <para>This value sets a limit on the number of effort values that may go -towards a single stat.</para> +towards a single stat. It may be set to “unlimited”.</para> </listitem> </varlistentry> @@ -120,7 +120,7 @@ towards a single stat.</para> <listitem> <para>This value represents how many storage boxes for creatures there are in the game. Other than the player's team, this is the only place where -specific creatures are stored.</para> +specific creatures are stored. It may be set to “unlimited”.</para> </listitem> </varlistentry> @@ -128,7 +128,7 @@ specific creatures are stored.</para> <term>Box size</term> <listitem> <para>This value represents how many creatures can be stored in each storage -box.</para> +box. It may be set to “unlimited”.</para> </listitem> </varlistentry> diff --git a/sigmodr/widgets/RulesUI.cpp b/sigmodr/widgets/RulesUI.cpp index bf1570c6..9c98407b 100644 --- a/sigmodr/widgets/RulesUI.cpp +++ b/sigmodr/widgets/RulesUI.cpp @@ -108,8 +108,8 @@ QWidget* RulesUI::Private::makeWidgets(ObjectUI* widget) ui_breeding->setEnabled(m_rules->genderAllowed()); ui_splitSpecialDV->setEnabled(m_rules->specialSplit()); ui_maxEVPerStat->setMaximum(m_rules->maxTotalEV()); - ui_maxEVPerStat->setEnabled(0 < m_rules->maxTotalEV()); - ui_boxSize->setEnabled(0 < m_rules->numBoxes()); + ui_maxEVPerStat->setEnabled(m_rules->maxTotalEV()); + ui_boxSize->setEnabled(m_rules->numBoxes()); ui_maxFight->setMaximum(m_rules->maxFight()); ui_maxFight->setEnabled(0 < m_rules->maxFight()); return form; @@ -170,7 +170,17 @@ void RulesUI::Private::maxEVChanged(const int maxEV) { m_rules->setMaxTotalEV(maxEV); ui_maxEVPerStat->setMaximum(maxEV); - ui_maxEVPerStat->setEnabled(0 < maxEV); + ui_maxEVPerStat->setEnabled(maxEV); + if (maxEV < 0) + { + ui_maxEVPerStat->setMinimum(0); + ui_maxEVPerStat->setSpecialValueText(k18n("No limit")); + } + else + { + ui_maxEVPerStat->setMinimum(1); + ui_maxEVPerStat->setSpecialValueText(QString()); + } } void RulesUI::Private::maxEVPerStatChanged(const int maxEVPerStat) @@ -181,7 +191,7 @@ void RulesUI::Private::maxEVPerStatChanged(const int maxEVPerStat) void RulesUI::Private::boxesChanged(const int boxes) { m_rules->setNumBoxes(boxes); - ui_boxSize->setEnabled(0 < boxes); + ui_boxSize->setEnabled(boxes); } void RulesUI::Private::boxSizeChanged(const int boxSize) diff --git a/sigmodr/widgets/gui/rules.ui b/sigmodr/widgets/gui/rules.ui index cc85057d..61bea9f9 100644 --- a/sigmodr/widgets/gui/rules.ui +++ b/sigmodr/widgets/gui/rules.ui @@ -199,10 +199,10 @@ <string>The maximum amount of effort values allowed</string> </property> <property name="minimum"> - <number>0</number> + <number>-1</number> </property> <property name="specialValueText"> - <string>No effort values</string> + <string>No limit</string> </property> </widget> </item> @@ -239,7 +239,10 @@ <string>The maximum amount of effort values allowed for a single stat</string> </property> <property name="minimum"> - <number>1</number> + <number>0</number> + </property> + <property name="specialValueText"> + <string>No limit</string> </property> </widget> </item> @@ -270,10 +273,10 @@ <string>How many boxes on the computer will be available</string> </property> <property name="minimum"> - <number>0</number> + <number>-1</number> </property> <property name="specialValueText"> - <string>No boxes</string> + <string>No limit</string> </property> </widget> </item> @@ -310,7 +313,10 @@ <string>How large each box is</string> </property> <property name="minimum"> - <number>1</number> + <number>0</number> + </property> + <property name="specialValueText"> + <string>No limit</string> </property> </widget> </item> |