fixed inital 10s count twice bug
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.TwentyCode.android.ExaltedDice"
|
package="com.TwentyCode.android.ExaltedDice"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="92"
|
android:versionCode="95"
|
||||||
android:versionName="a83d85b" >
|
android:versionName="3ca0642" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="7" />
|
<uses-sdk android:minSdkVersion="7" />
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.TwentyCode.android.ExaltedDice;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@@ -67,6 +68,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* @param id of the roll
|
* @param id of the roll
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
private void applyRollPresets(long id) {
|
private void applyRollPresets(long id) {
|
||||||
ContentValues roll = mDb.getGameHistoryInfo(mGameName, (int) (id));
|
ContentValues roll = mDb.getGameHistoryInfo(mGameName, (int) (id));
|
||||||
try{
|
try{
|
||||||
@@ -110,6 +112,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* Initializes native number pickers api > 11
|
* Initializes native number pickers api > 11
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
private void initPickers() {
|
private void initPickers() {
|
||||||
mDPicker = (NumberPicker) findViewById(R.id.d_Picker);
|
mDPicker = (NumberPicker) findViewById(R.id.d_Picker);
|
||||||
mDPicker.setMinValue(0);
|
mDPicker.setMinValue(0);
|
||||||
@@ -163,7 +166,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
*
|
*
|
||||||
* @author ricky barrette 3-27-2010
|
* @author ricky barrette 3-27-2010
|
||||||
*/
|
*/
|
||||||
@Override
|
@SuppressLint("NewApi") @Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
|
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -303,6 +306,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* resorts application state after rotation
|
* resorts application state after rotation
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
@@ -336,6 +340,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* saves application state before rotation
|
* saves application state before rotation
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle savedInstanceState) {
|
public void onSaveInstanceState(Bundle savedInstanceState) {
|
||||||
if(isCompat){
|
if(isCompat){
|
||||||
@@ -403,6 +408,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* @param stringExtra
|
* @param stringExtra
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
private void setGameMode(String mode) {
|
private void setGameMode(String mode) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -476,6 +482,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* @return String resultsString
|
* @return String resultsString
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
public ContentValues results(int times) {
|
public ContentValues results(int times) {
|
||||||
Log.i(TAG, "results()");
|
Log.i(TAG, "results()");
|
||||||
ContentValues rolled = new ContentValues();
|
ContentValues rolled = new ContentValues();
|
||||||
@@ -522,6 +529,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
mRollProgress.setVisibility(View.VISIBLE);
|
mRollProgress.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
new Thread( new Runnable() {
|
new Thread( new Runnable() {
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void run(){
|
public void run(){
|
||||||
// vibrate for 50 milliseconds
|
// vibrate for 50 milliseconds
|
||||||
@@ -559,6 +567,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
* @return int[] roll
|
* @return int[] roll
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
public int[] rollGen(int times) {
|
public int[] rollGen(int times) {
|
||||||
Log.i(TAG, "rollGen()" + times);
|
Log.i(TAG, "rollGen()" + times);
|
||||||
int[] roll = new int[times];
|
int[] roll = new int[times];
|
||||||
@@ -586,7 +595,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
|
|||||||
for (int i = 0; i < roll.length; i++) {
|
for (int i = 0; i < roll.length; i++) {
|
||||||
if (roll[i] >= Integer.parseInt(mSettings.getString(Settings.KEY_SUCCESS_AFTER, "7")))
|
if (roll[i] >= Integer.parseInt(mSettings.getString(Settings.KEY_SUCCESS_AFTER, "7")))
|
||||||
intSuccesses++;
|
intSuccesses++;
|
||||||
if(mSettings.getBoolean(Settings.KEY_TENS_COUNT_TWICE, true))
|
if(mSettings.getBoolean(Settings.KEY_TENS_COUNT_TWICE, false))
|
||||||
if (roll[i] == 10)
|
if (roll[i] == 10)
|
||||||
intSuccesses++;
|
intSuccesses++;
|
||||||
if(mSettings.getBoolean(Settings.KEY_ONES_SUBRACT, false))
|
if(mSettings.getBoolean(Settings.KEY_ONES_SUBRACT, false))
|
||||||
|
|||||||
Reference in New Issue
Block a user