Minor debugging
Added TODO's and scrollview's to the main activity
This commit is contained in:
parent
d6daf98b74
commit
8a781561e3
9 changed files with 291 additions and 264 deletions
|
@ -7,8 +7,8 @@ android {
|
||||||
applicationId 'com.kauron.dungeonmanager'
|
applicationId 'com.kauron.dungeonmanager'
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 21
|
targetSdkVersion 21
|
||||||
versionCode 1
|
versionCode 2
|
||||||
versionName "1.0"
|
versionName '0.2'
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class Introduction extends ActionBarActivity {
|
||||||
int classInt = classSpinner.getSelectedItemPosition();
|
int classInt = classSpinner.getSelectedItemPosition();
|
||||||
int raceInt = raceSpinner.getSelectedItemPosition();
|
int raceInt = raceSpinner.getSelectedItemPosition();
|
||||||
|
|
||||||
int pxInt = 0;
|
int pxInt = -1;
|
||||||
if (!level.getText().toString().isEmpty())
|
if (!level.getText().toString().isEmpty())
|
||||||
pxInt = Integer.parseInt(level.getText().toString());
|
pxInt = Integer.parseInt(level.getText().toString());
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ public class Introduction extends ActionBarActivity {
|
||||||
!nameString.isEmpty() &&
|
!nameString.isEmpty() &&
|
||||||
classInt != Player.NULL &&
|
classInt != Player.NULL &&
|
||||||
raceInt != Player.NULL &&
|
raceInt != Player.NULL &&
|
||||||
pxInt != 0 &&
|
pxInt != -1 &&
|
||||||
car != 0 &&
|
car != 0 &&
|
||||||
fue != 0 &&
|
fue != 0 &&
|
||||||
con != 0 &&
|
con != 0 &&
|
||||||
|
|
|
@ -117,6 +117,9 @@ public class MainActivity extends ActionBarActivity{
|
||||||
try {
|
try {
|
||||||
if (player.addPx(Integer.parseInt(input.getText().toString()))) {
|
if (player.addPx(Integer.parseInt(input.getText().toString()))) {
|
||||||
//levelUp
|
//levelUp
|
||||||
|
//TODO: update defenses
|
||||||
|
//TODO: add attack points when necessary
|
||||||
|
//TODO: update currentPg button
|
||||||
player.setMaxPgOnLevelUp();
|
player.setMaxPgOnLevelUp();
|
||||||
((TextView) findViewById(R.id.lvl)).setText(
|
((TextView) findViewById(R.id.lvl)).setText(
|
||||||
String.valueOf(player.getLevel())
|
String.valueOf(player.getLevel())
|
||||||
|
@ -133,6 +136,14 @@ public class MainActivity extends ActionBarActivity{
|
||||||
});
|
});
|
||||||
alert.show();
|
alert.show();
|
||||||
return true;
|
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);
|
return super.onOptionsItemSelected(item);
|
||||||
|
@ -471,4 +482,8 @@ public class MainActivity extends ActionBarActivity{
|
||||||
});
|
});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: show on screen the max pg's
|
||||||
|
|
||||||
|
//TODO: show the current px and progress bar
|
||||||
}
|
}
|
|
@ -11,12 +11,14 @@ public class Player {
|
||||||
"Sacerdote Rúnico", "Señor de la guerra"
|
"Sacerdote Rúnico", "Señor de la guerra"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
public static final int NULL = 0;
|
||||||
* Values for classes
|
|
||||||
*/
|
// /**
|
||||||
public static final int NULL = 0, ARDIENTE = 1, BRUJO = 2, BUSCADOR = 3, CLÉRIGO = 4,
|
// * Values for classes
|
||||||
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 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
|
* Values for level - px computation
|
||||||
|
@ -68,12 +70,12 @@ public class Player {
|
||||||
public static final int CA = 0, FORT = 1, REF = 2, VOL = 3;
|
public static final int CA = 0, FORT = 1, REF = 2, VOL = 3;
|
||||||
|
|
||||||
//TODO: develop abilities
|
//TODO: develop abilities
|
||||||
/**
|
// /**
|
||||||
* Values for abilities
|
// * Values for abilities
|
||||||
*/
|
// */
|
||||||
public static final int ACROBACIAS = 1, AGUANTE = 2, ARCANOS = 3, ATLETISMO = 4, DIPLOMACIA = 5,
|
// 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,
|
// 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;
|
// PERCEPCIÓN = 12, PERSPICACIA = 13, RECURSOS = 14, RELIGIÓN = 15, SANAR = 16, SIGILO = 17;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Names for the abilities
|
* Names for the abilities
|
||||||
|
@ -96,8 +98,9 @@ public class Player {
|
||||||
private int classInt, raceInt;
|
private int classInt, raceInt;
|
||||||
private String name;
|
private String name;
|
||||||
private int level;
|
private int level;
|
||||||
|
//TODO: use dice class
|
||||||
private int[] atk, def, abilities;
|
private int[] atk, def, abilities;
|
||||||
|
//TODO: implement fully operational powers displayed as cards
|
||||||
private Power[] powers;
|
private Power[] powers;
|
||||||
|
|
||||||
public Player(
|
public Player(
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class Power {
|
||||||
private boolean used;
|
private boolean used;
|
||||||
private int type;
|
private int type;
|
||||||
private String name;
|
private String name;
|
||||||
|
private int atk, def, damage;
|
||||||
|
|
||||||
|
|
||||||
public Power(String name, int type){
|
public Power(String name, int type){
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView
|
||||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
|
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:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_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
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -11,15 +23,11 @@
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:id="@+id/pgCurrent"
|
android:id="@+id/pgCurrent"
|
||||||
android:textSize="40sp"
|
android:textSize="40sp"
|
||||||
android:onClick="damage"
|
android:onClick="damage" />
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true" />
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBottom="@+id/pgCurrent"
|
|
||||||
android:onClick="selectPlayer"
|
android:onClick="selectPlayer"
|
||||||
android:id="@+id/scroll1">
|
android:id="@+id/scroll1">
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@ -83,15 +91,12 @@
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/scroll1"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:id="@+id/curativeEffortsContainer">
|
android:id="@+id/curativeEffortsContainer">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -106,7 +111,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@+id/curativeEffortsContainer"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -207,7 +211,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@+id/attackContainer"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -276,6 +279,5 @@
|
||||||
android:hint="@string/VOL" />
|
android:hint="@string/VOL" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
</RelativeLayout>
|
|
|
@ -56,6 +56,11 @@
|
||||||
android:orderInCategory="20"
|
android:orderInCategory="20"
|
||||||
app:showAsAction="never"
|
app:showAsAction="never"
|
||||||
android:icon="@drawable/ic_action_edit"/>
|
android:icon="@drawable/ic_action_edit"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_download"
|
||||||
|
android:title="@string/action_download"
|
||||||
|
android:orderInCategory="25"
|
||||||
|
app:showAsAction="never"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_reset"
|
android:id="@+id/action_reset"
|
||||||
android:title="@string/action_reset"
|
android:title="@string/action_reset"
|
||||||
|
|
|
@ -71,4 +71,5 @@
|
||||||
<string name="empty_field">Please input something</string>
|
<string name="empty_field">Please input something</string>
|
||||||
<string name="dialog_resolve_max_pg_title">Alert</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="dialog_resolve_max_pg_message">Couldn\'t compute your max PG based on your level</string>
|
||||||
|
<string name="action_download">Update app</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Reference in a new issue