1
0
Fork 0

Minor debugging

Added TODO's and scrollview's to the main activity
This commit is contained in:
Carlos Galindo 2015-02-25 21:55:20 +01:00
parent d6daf98b74
commit 8a781561e3
9 changed files with 291 additions and 264 deletions

View file

@ -7,8 +7,8 @@ android {
applicationId 'com.kauron.dungeonmanager'
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
versionCode 2
versionName '0.2'
}
buildTypes {
release {

View file

@ -91,7 +91,7 @@ public class Introduction extends ActionBarActivity {
int classInt = classSpinner.getSelectedItemPosition();
int raceInt = raceSpinner.getSelectedItemPosition();
int pxInt = 0;
int pxInt = -1;
if (!level.getText().toString().isEmpty())
pxInt = Integer.parseInt(level.getText().toString());
@ -114,7 +114,7 @@ public class Introduction extends ActionBarActivity {
!nameString.isEmpty() &&
classInt != Player.NULL &&
raceInt != Player.NULL &&
pxInt != 0 &&
pxInt != -1 &&
car != 0 &&
fue != 0 &&
con != 0 &&

View file

@ -117,6 +117,9 @@ public class MainActivity extends ActionBarActivity{
try {
if (player.addPx(Integer.parseInt(input.getText().toString()))) {
//levelUp
//TODO: update defenses
//TODO: add attack points when necessary
//TODO: update currentPg button
player.setMaxPgOnLevelUp();
((TextView) findViewById(R.id.lvl)).setText(
String.valueOf(player.getLevel())
@ -133,6 +136,14 @@ public class MainActivity extends ActionBarActivity{
});
alert.show();
return true;
} else if (id == R.id.action_download) {
//TODO: create self-updater
Toast.makeText(
getApplicationContext(),
"This function is not ready yet",
Toast.LENGTH_LONG
).show();
return true;
}
return super.onOptionsItemSelected(item);
@ -471,4 +482,8 @@ public class MainActivity extends ActionBarActivity{
});
dialog.show();
}
//TODO: show on screen the max pg's
//TODO: show the current px and progress bar
}

View file

@ -11,12 +11,14 @@ public class Player {
"Sacerdote Rúnico", "Señor de la guerra"
};
/**
* Values for classes
*/
public static final int NULL = 0, ARDIENTE = 1, BRUJO = 2, BUSCADOR = 3, CLÉRIGO = 4,
EXPLORADOR = 5, GUERRERO = 6, MAGO = 7, MENTE_DE_BATALLA = 8, MONJE = 9, PALADÍN = 10,
PÍCARO = 11, PSIÓNICO = 12, SACERDOTE_RÚNICO = 13, SEÑOR_DE_LA_GUERRA = 14;
public static final int NULL = 0;
// /**
// * Values for classes
// */
// public static final int ARDIENTE = 1, BRUJO = 2, BUSCADOR = 3, CLÉRIGO = 4,
// EXPLORADOR = 5, GUERRERO = 6, MAGO = 7, MENTE_DE_BATALLA = 8, MONJE = 9, PALADÍN = 10,
// PÍCARO = 11, PSIÓNICO = 12, SACERDOTE_RÚNICO = 13, SEÑOR_DE_LA_GUERRA = 14;
/**
* Values for level - px computation
@ -68,12 +70,12 @@ public class Player {
public static final int CA = 0, FORT = 1, REF = 2, VOL = 3;
//TODO: develop abilities
/**
* Values for abilities
*/
public static final int ACROBACIAS = 1, AGUANTE = 2, ARCANOS = 3, ATLETISMO = 4, DIPLOMACIA = 5,
DUNGEONS = 6, ENGAÑAR = 7, HISTORIA = 8, HURTO = 9, INTIMIDAR = 10, NATURALEZA = 11,
PERCEPCIÓN = 12, PERSPICACIA = 13, RECURSOS = 14, RELIGIÓN = 15, SANAR = 16, SIGILO = 17;
// /**
// * Values for abilities
// */
// public static final int ACROBACIAS = 1, AGUANTE = 2, ARCANOS = 3, ATLETISMO = 4, DIPLOMACIA = 5,
// DUNGEONS = 6, ENGAÑAR = 7, HISTORIA = 8, HURTO = 9, INTIMIDAR = 10, NATURALEZA = 11,
// PERCEPCIÓN = 12, PERSPICACIA = 13, RECURSOS = 14, RELIGIÓN = 15, SANAR = 16, SIGILO = 17;
/**
* Names for the abilities
@ -96,8 +98,9 @@ public class Player {
private int classInt, raceInt;
private String name;
private int level;
//TODO: use dice class
private int[] atk, def, abilities;
//TODO: implement fully operational powers displayed as cards
private Power[] powers;
public Player(

View file

@ -6,6 +6,7 @@ public class Power {
private boolean used;
private int type;
private String name;
private int atk, def, damage;
public Power(String name, int type){

View file

@ -1,9 +1,21 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
@ -11,15 +23,11 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/pgCurrent"
android:textSize="40sp"
android:onClick="damage"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
android:onClick="damage" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/pgCurrent"
android:onClick="selectPlayer"
android:id="@+id/scroll1">
<RelativeLayout
@ -83,15 +91,12 @@
android:layout_marginLeft="10dp" />
</RelativeLayout>
</HorizontalScrollView>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/scroll1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/curativeEffortsContainer">
<TextView
@ -106,7 +111,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_below="@+id/curativeEffortsContainer"
android:orientation="vertical">
<TextView
@ -207,7 +211,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_below="@+id/attackContainer"
android:orientation="vertical">
<TextView
@ -276,6 +279,5 @@
android:hint="@string/VOL" />
</GridLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>

View file

@ -56,6 +56,11 @@
android:orderInCategory="20"
app:showAsAction="never"
android:icon="@drawable/ic_action_edit"/>
<item
android:id="@+id/action_download"
android:title="@string/action_download"
android:orderInCategory="25"
app:showAsAction="never"/>
<item
android:id="@+id/action_reset"
android:title="@string/action_reset"

View file

@ -71,4 +71,5 @@
<string name="empty_field">Please input something</string>
<string name="dialog_resolve_max_pg_title">Alert</string>
<string name="dialog_resolve_max_pg_message">Couldn\'t compute your max PG based on your level</string>
<string name="action_download">Update app</string>
</resources>