From 64921d730454dd503927ba7b06140a2ea7396660 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Fri, 4 May 2012 11:52:48 -0400 Subject: [PATCH] Success After X added a prefrence for the user to select what are counted as successes closes #37 Signed-off-by: Ricky Barrette --- ExaltedDice/res/values/strings.xml | 3 +++ ExaltedDice/res/values/successes.xml | 16 ++++++++++++++++ ExaltedDice/res/xml/settings.xml | 8 ++++++++ .../android/ExaltedDice/ExaltedDice.java | 4 +--- .../TwentyCode/android/ExaltedDice/Settings.java | 2 +- 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 ExaltedDice/res/values/successes.xml diff --git a/ExaltedDice/res/values/strings.xml b/ExaltedDice/res/values/strings.xml index c57d1bd..dfb3850 100755 --- a/ExaltedDice/res/values/strings.xml +++ b/ExaltedDice/res/values/strings.xml @@ -37,5 +37,8 @@ Game Mode Ones Subtract Ones count as -1 to your successes + Success After + Choose what are counted as successes, starting at the selected value. + 7 \ No newline at end of file diff --git a/ExaltedDice/res/values/successes.xml b/ExaltedDice/res/values/successes.xml new file mode 100644 index 0000000..704f83c --- /dev/null +++ b/ExaltedDice/res/values/successes.xml @@ -0,0 +1,16 @@ + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + + + \ No newline at end of file diff --git a/ExaltedDice/res/xml/settings.xml b/ExaltedDice/res/xml/settings.xml index 078867e..a36f42b 100644 --- a/ExaltedDice/res/xml/settings.xml +++ b/ExaltedDice/res/xml/settings.xml @@ -25,6 +25,14 @@ android:summary="@string/ones_subtract_msg" android:title="@string/ones_subtract" /> + + = 7) + if (roll[i] >= Integer.parseInt(mSettings.getString(Settings.KEY_SUCCESS_AFTER, "7"))) intSuccesses++; if(mSettings.getBoolean(Settings.KEY_TENS_COUNT_TWICE, true)) if (roll[i] == 10) @@ -592,8 +592,6 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic if(mSettings.getBoolean(Settings.KEY_ONES_SUBRACT, false)) if (roll[i] == 1) intSuccesses--; - - } return intSuccesses; } diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java index b2d4d17..4b3b2e1 100644 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java @@ -34,7 +34,7 @@ public class Settings extends PreferenceActivity implements OnPreferenceClickLis public static final String KEY_TENS_COUNT_TWICE = "tens_count_twice"; public static final String KEY_COLOR = "color"; public static final String KEY_ONES_SUBRACT = "ones_subtract"; -// public static final String KEY_ = ""; + public static final String KEY_SUCCESS_AFTER = "success_after"; // public static final String KEY_ = ""; // public static final String KEY_ = "";