diff --git a/ExaltedDice/res/xml/settings.xml b/ExaltedDice/res/xml/settings.xml index e681892..58b7f87 100644 --- a/ExaltedDice/res/xml/settings.xml +++ b/ExaltedDice/res/xml/settings.xml @@ -6,11 +6,6 @@ android:key="roll_again" android:summary="@string/roll_again_summary" android:title="@string/roll_again" /> - - parent, View view, int position, long id) { - startActivity(new Intent(this, ExaltedDice.class).putExtra(ExaltedDice.KEY_GAME_NAME, mDb.getGameName(id +1)).putExtra(ExaltedDice.KEY_GAME_ID, id+1)); + startActivity(new Intent(this, ExaltedDice.class) + .putExtra(ExaltedDice.KEY_GAME_NAME, mDb.getGameName(id +1)) + .putExtra(ExaltedDice.KEY_GAME_ID, id+1) + .putExtra(ExaltedDice.KEY_GAME_MODE, mDb.getGameOptions(id+1).getAsString(Database.KEY_MODE))); } /** diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/RollHistoryDatabaseAdapter.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/RollHistoryDatabaseAdapter.java index 4db84ca..c157195 100644 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/RollHistoryDatabaseAdapter.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/RollHistoryDatabaseAdapter.java @@ -28,6 +28,7 @@ public class RollHistoryDatabaseAdapter extends BaseAdapter { private LayoutInflater mInflater; private int mCount; private SharedPreferences mSettings; + private boolean isRollModEnabled = true; /** * Creates a new RollHistoryDatabaseAdapter @@ -92,7 +93,11 @@ public class RollHistoryDatabaseAdapter extends BaseAdapter { } ContentValues roll = getItem(position); - holder.mRoll.setText("Rolled: "+roll.getAsInteger(Database.KEY_NUMBER) + " "+roll.getAsString(Database.KEY_D_TYPE) +" "+ roll.getAsString(Database.KEY_MOD).replace("'", "")); + holder.mRoll.setText("Rolled: "+roll.getAsInteger(Database.KEY_NUMBER) + " "+roll.getAsString(Database.KEY_D_TYPE)); + + if(isRollModEnabled) + holder.mRoll.append(" "+ roll.getAsString(Database.KEY_MOD).replace("'", "")); + holder.mStats.setText(roll.getAsString(Database.KEY_LOG)); holder.mRolled.setText(roll.getAsString(Database.KEY_ROLLED)); @@ -129,4 +134,13 @@ public class RollHistoryDatabaseAdapter extends BaseAdapter { TextView mRolled; } + /** + * Sets the enabled state for displaying the roll mod + * @param isEnabled + * @author ricky barrette + */ + public void setRollModEnabled(boolean isEnabled) { + isRollModEnabled = isEnabled; + } + } \ No newline at end of file diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java index 77313de..afde372 100644 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Settings.java @@ -31,9 +31,7 @@ public class Settings extends PreferenceActivity implements OnPreferenceClickLis private static final CharSequence EMAIL = "email"; public static final String KEY_ROLL_AGAIN = "roll_again"; - public static final String KEY_CALC_SUCCESSES = "calc_successes"; 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_COLOR = "color"; // public static final String KEY_ = ""; // public static final String KEY_ = "";