Added New Settings
Added modifier option added success option: tens count twice Change-Id: Ia978daee5fe86a8f167d0bfc32458f844bb255bd Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -66,7 +66,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
||||
mDPicker.setValue(parseD(roll.getAsString(Database.KEY_D_TYPE)));
|
||||
mModPicker.setValue(parseMod(roll.getAsString(Database.KEY_MOD).replace("'", "")));
|
||||
} catch(NullPointerException e){
|
||||
mModPicker.setValue(parseMod("0"));
|
||||
mModPicker.setValue(parseMod("+0"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,13 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
||||
protected void onResume() {
|
||||
refresh();
|
||||
applyRollPresets(mDb.getGameRollCount(mGameId));
|
||||
|
||||
if(mSettings.getBoolean(Settings.KEY_ROLL_MOD, true)){
|
||||
mModPicker.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mModPicker.setVisibility(View.GONE);
|
||||
mModPicker.setValue(parseMod("+0"));
|
||||
}
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@@ -366,7 +373,8 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
||||
|
||||
resultsString.append(getString(R.string.total)+ total);
|
||||
|
||||
resultsString.append(getString(R.string.total_plus_mod)+ (total + Integer.parseInt(mModValues[mModPicker.getValue()].replace("+", ""))));
|
||||
if(mSettings.getBoolean(Settings.KEY_ROLL_MOD, true))
|
||||
resultsString.append(getString(R.string.total_plus_mod)+ (total + Integer.parseInt(mModValues[mModPicker.getValue()].replace("+", ""))));
|
||||
|
||||
if(mSettings.getBoolean(Settings.KEY_CALC_SUCCESSES, true))
|
||||
resultsString.append(getString(R.string.sucesses)+ successes(roll));
|
||||
@@ -436,8 +444,9 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
||||
for (int i = 0; i < roll.length; i++) {
|
||||
if (roll[i] >= 7)
|
||||
intSuccesses++;
|
||||
if (roll[i] == 10)
|
||||
intSuccesses++;
|
||||
if(mSettings.getBoolean(Settings.KEY_TENS_COUNT_TWICE, true))
|
||||
if (roll[i] == 10)
|
||||
intSuccesses++;
|
||||
}
|
||||
return intSuccesses;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ public class Settings extends PreferenceActivity implements OnPreferenceClickLis
|
||||
|
||||
public static final String KEY_ROLL_AGAIN = "roll_again";
|
||||
public static final String KEY_CALC_SUCCESSES = "calc_successes";
|
||||
// public static final String KEY_ = "";
|
||||
// public static final String KEY_ = "";
|
||||
public static final String KEY_TENS_COUNT_TWICE = "tens_count_twice";
|
||||
public static final String KEY_ROLL_MOD = "roll_mod";
|
||||
// public static final String KEY_ = "";
|
||||
// public static final String KEY_ = "";
|
||||
// public static final String KEY_ = "";
|
||||
|
||||
Reference in New Issue
Block a user