1
0
Fork 0

Refactored the naming to proper English

This commit is contained in:
Carlos Galindo 2015-04-29 13:58:38 +02:00
parent 3fc3dbdd37
commit cc86ecc276
45 changed files with 626 additions and 920 deletions

View file

@ -1,6 +1,7 @@
<component name="ProjectDictionaryState"> <component name="ProjectDictionaryState">
<dictionary name="Carlos"> <dictionary name="Carlos">
<words> <words>
<w>dungeoneering</w>
<w>snackbar</w> <w>snackbar</w>
</words> </words>
</dictionary> </dictionary>

View file

@ -13,7 +13,7 @@
<ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" /> <ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View file

@ -2,34 +2,29 @@ package com.kauron.dungeonmanager;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources;
import java.io.Serializable; import java.io.Serializable;
class Player implements Serializable { class Player implements Serializable {
public static final String NAME = "playerName", CLASS = "classInt", RACE = "raceInt", PX = "px"; public static final String NAME = "playerName", CLASS = "classInt", RACE = "raceInt", XP = "px";
/** /**
* Names for the classes * Names for the classes
*/ */
public static final String[] CLASS_STRINGS = { public static String[] CLASS_STRINGS;
"Clase", "Ardiente", "Brujo", "Buscador", "Clérigo", "Explorador",
"Guerrero", "Mago", "Mente de Batalla", "Monje", "Paladín", "Pícaro", "Psiónico", // "Clase", "Ardiente", "Brujo", "Buscador", "Clérigo", "Explorador",
"Sacerdote Rúnico", "Señor de la guerra" // "Guerrero", "Mago", "Mente de Batalla", "Monje", "Paladín", "Pícaro", "Psiónico",
}; // "Sacerdote Rúnico", "Señor de la guerra"
public static final int NULL = 0; 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 * Values for level - xp computation
*/ */
public static final int[] LEVEL_PX = new int[]{ public static final int[] LEVEL_XP = new int[]{
0, 1000, 2250, 3750, 5500, 7500, 10000, 13000, 16500, 20500, 26000, 0, 1000, 2250, 3750, 5500, 7500, 10000, 13000, 16500, 20500, 26000,
32000, 39000, 47000, 57000, 69000, 83000, 99000, 119000, 143000, 175000, 32000, 39000, 47000, 57000, 69000, 83000, 99000, 119000, 143000, 175000,
210000, 255000, 310000, 375000, 450000, 550000, 675000, 825000, 1000000 210000, 255000, 310000, 375000, 450000, 550000, 675000, 825000, 1000000
@ -39,13 +34,13 @@ class Player implements Serializable {
* Values for each class' characteristics * Values for each class' characteristics
*/ */
public static final int[][] CLASS_STATS = new int[][] { public static final int[][] CLASS_STATS = new int[][] {
//pg on level up //hp on level up
{0, 5, 5, 5, 5, 5, 6, 4, 6, 5, 6, 5, 4, 5, 5}, {0, 5, 5, 5, 5, 5, 6, 4, 6, 5, 6, 5, 4, 5, 5},
//defenses bonus: fort, ref, vol //defenses bonus: fort, ref, will
{0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 0, 1}, {0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 0, 1},
{0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 0, 0, 0}, {0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 0, 0, 0},
{0, 1, 1, 1, 2, 0, 0, 2, 2, 1, 1, 0, 2, 2, 1}, {0, 1, 1, 1, 2, 0, 0, 2, 2, 1, 1, 0, 2, 2, 1},
//initial pg bonus //initial hp bonus
{0,12,12,12,12,12,15,10,15,12,15,12,12,12,12}, {0,12,12,12,12,12,15,10,15,12,15,12,12,12,12},
//daily curative efforts //daily curative efforts
{0, 7, 6, 7, 7, 6, 9, 6, 9, 7,10, 6, 6, 7, 7} {0, 7, 6, 7, 7, 6, 9, 6, 9, 7,10, 6, 6, 7, 7}
@ -54,58 +49,51 @@ class Player implements Serializable {
/** /**
* Identifiers for each class characteristic * Identifiers for each class characteristic
*/ */
public static final int PG_ON_LEVEL_UP = 0, DEF_FORT = 1, DEF_REF = 2, DEF_VOL = 3, public static final int HP_ON_LEVEL_UP = 0, DEF_FORT = 1, DEF_REF = 2, DEF_WILL = 3,
INITIAL_PG = 4, DAILY_CURATIVE_EFFORTS = 5; INITIAL_HP = 4, DAILY_SURGES = 5;
/** /**
* Names for the races * Names for the races
*/ */
public static final String[] RACE_STRINGS = new String[] { public static String[] RACE_STRINGS;
"Raza", "Dracónido", "Eladrín", "Elfo", "Enano", "Gitzherai", "Humano", "Mediano",
"Mente del Fragmento", "Minotauro", "Salvaje", "Semielfo", "Tiflin" // "Raza", "Dracónido", "Eladrín", "Elfo", "Enano", "Gitzherai", "Humano", "Mediano",
}; // "Mente del Fragmento", "Minotauro", "Salvaje", "Semielfo", "Tiflin"
/** /**
* Values for attack * Values for attack
*/ */
public static final int FUE = 0, CON = 1, DES = 2, INT = 3, SAB = 4, CAR = 5; public static final int STR = 0, CON = 1, DEX = 2, INT = 3, WIS = 4, CHA = 5;
/** /**
* Values for defenses * Values for defenses
*/ */
public static final int CA = 0, FORT = 1, REF = 2, VOL = 3; public static final int AC = 0, FORT = 1, REF = 2, WILL = 3;
//TODO: develop abilities like attacks, with a popup //TODO: develop abilities like attacks, with a popup
//could be introduced by the player in a introduction screen, with ticks for train and bonuses //could be introduced by the player in a introduction screen, with ticks for train and bonuses
// /**
// * 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 * Names for the abilities
*/ */
public static final String[] ABILITY_STRING = new String[] { public static String[] ABILITY_STRING = new String[] {
"Habilidades", "Acrobacias", "Aguante", "Arcanos", "Atletismo", "Diplomacia", "Dungeons", "Engañar", "Habilidades", "Acrobacias", "Aguante", "Arcanos", "Atletismo", "Diplomacia", "Dungeons", "Engañar",
"Historia", "Hurto", "Intimidar", "Naturaleza", "Percepción", "Perspicacia", "Recursos", "Historia", "Hurto", "Intimidar", "Naturaleza", "Percepción", "Perspicacia", "Recursos",
"Religión", "Sanar", "Sigilo" "Religión", "Sanar", "Sigilo"
}; };
public static final int[] ABILITY_BOOST = new int[] { public static final int[] ABILITY_BOOST = new int[] {
-1, DES, CON, INT, FUE, CAR, SAB, CAR, INT, CAR, DES, SAB, SAB, SAB, CAR, INT, SAB, DES -1, DEX, CON, INT, STR, CHA, WIS, CHA, INT, CHA, DEX, WIS, WIS, WIS, CHA, INT, WIS, DEX
}; };
/** /**
* Values for the current living state * Values for the current living state
*/ */
public static final int OK = 1, MALHERIDO = 2, DEBILITADO = 3, MUERTO = 4, SAME = 5, public static final int OK = 1, BLOODIED = 2, DYING = 3, DEAD = 4, SAME = 5,
USE_CURATIVE_EFFORT = -1, CURED = 1, NOT_CURED = 0, MAXED = -1; USE_CURATIVE_EFFORT = -1, CURED = 1, NOT_CURED = 0, MAXED = -1;
private int pg, maxPg, px; private int hp, maxHp, xp;
private int state, lastState; private int state, lastState;
private int curativeEfforts, maxCurativeEfforts; private int surges, maxSurges;
private int classInt, raceInt; private int classInt, raceInt;
private String name; private String name;
private int level; private int level;
@ -118,7 +106,7 @@ class Player implements Serializable {
*/ */
Player (SharedPreferences p) { Player (SharedPreferences p) {
this.name = p.getString(NAME, "Player"); this.name = p.getString(NAME, "Player");
this.px = p.getInt(PX, 0); this.xp = p.getInt(XP, 0);
setLevel(); setLevel();
this.raceInt = p.getInt(RACE, 0); this.raceInt = p.getInt(RACE, 0);
this.classInt = p.getInt(CLASS, 0); this.classInt = p.getInt(CLASS, 0);
@ -132,66 +120,73 @@ class Player implements Serializable {
p.getInt("car", 10)} p.getInt("car", 10)}
); );
setState(); setState();
this.pg = p.getInt( "pg" , maxPg); this.hp = p.getInt( "pg" , maxHp);
this.curativeEfforts = p.getInt( "curativeEfforts" , maxCurativeEfforts ); this.surges = p.getInt( "curativeEfforts" , maxSurges);
} }
int getPx() {return px;} public static void setStrings ( Resources res ) {
void setPx (int px) {this.px = px; setLevel();} CLASS_STRINGS = res.getStringArray(R.array.classes);
boolean addPx(int px) { RACE_STRINGS = res.getStringArray(R.array.races);
ABILITY_STRING = res.getStringArray(R.array.abilities);
}
int getXp() {return xp;}
void setXp(int xp) {this.xp = xp; setLevel();}
boolean addPx(int xp) {
int lastLevel = level; int lastLevel = level;
setPx(this.px + px); setXp(this.xp + xp);
return lastLevel < level; return lastLevel < level;
} }
int getMaxCurativeEfforts() {return maxCurativeEfforts;} int getMaxSurges() {return maxSurges;}
void setMaxCurativeEfforts(int maxCurativeEfforts) {this.maxCurativeEfforts = maxCurativeEfforts;} void setMaxSurges(int maxSurges) {this.maxSurges = maxSurges;}
int getCurativeEfforts() {return curativeEfforts;} int getSurges() {return surges;}
void setCurativeEffort(int curativeEfforts) {this.curativeEfforts = curativeEfforts;} void setCurativeEffort(int surges) {this.surges = surges;}
int getLevel() {return level;} int getLevel() {return level;}
void setLevel() { void setLevel() {
for (int i = 0; i < LEVEL_PX.length; i++) for (int i = 0; i < LEVEL_XP.length; i++)
if(px < LEVEL_PX[i]) {level = i; return;} if(xp < LEVEL_XP[i]) {level = i; return;}
level = LEVEL_PX.length; level = LEVEL_XP.length;
} }
int getMaxPg() {return maxPg;} int getMaxHp() {return maxHp;}
void setMaxPg(int maxPg) { void setMaxHp(int maxHp) {
if(this.maxPg == 0) if(this.maxHp == 0)
this.pg = maxPg; this.hp = maxHp;
this.maxPg = maxPg; this.maxHp = maxHp;
} }
int getPg() {return pg;} int getHp() {return hp;}
void setPg(int pg) {this.pg = pg; setState();} void setHp(int hp) {this.hp = hp; setState();}
void losePg(int damage) { void losePg(int damage) {
pg -= damage; hp -= damage;
setState(); setState();
} }
int recoverPg(int recovered, boolean uses) { int recoverPg(int recovered, boolean uses) {
if(recovered == USE_CURATIVE_EFFORT){ if(recovered == USE_CURATIVE_EFFORT){
if(uses && curativeEfforts <= 0) return NOT_CURED; if(uses && surges <= 0) return NOT_CURED;
else { else {
if(uses && pg < maxPg) curativeEfforts--; if(uses && hp < maxHp) surges--;
if (pg < 0) { if (hp < 0) {
pg = 0; hp = 0;
} else { } else {
pg += maxPg / 4; hp += maxHp / 4;
} }
} }
} else { } else {
if (pg < 0) { if (hp < 0) {
pg = 0; hp = 0;
} else { } else {
pg += recovered; hp += recovered;
} }
} }
setState(); setState();
if (pg > maxPg) {pg = maxPg; return MAXED;} if (hp > maxHp) {
hp = maxHp; return MAXED;}
return CURED; return CURED;
} }
@ -200,9 +195,9 @@ class Player implements Serializable {
int getState() {return state;} int getState() {return state;}
private void setState() { private void setState() {
lastState = state; lastState = state;
if (pg <= maxPg / -2) state = MUERTO; if (hp <= maxHp / -2) state = DEAD;
else if (pg <= 0) state = DEBILITADO; else if (hp <= 0) state = DYING;
else if(pg <= maxPg / 2) state = MALHERIDO; else if(hp <= maxHp / 2) state = BLOODIED;
else state = OK; else state = OK;
} }
@ -212,51 +207,51 @@ class Player implements Serializable {
private void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();} private void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();}
int getFue() {return atk[FUE];} int getFue() {return atk[STR];}
int getCon() {return atk[CON];} int getCon() {return atk[CON];}
int getSab() {return atk[SAB];} int getSab() {return atk[WIS];}
int getCar() {return atk[CAR];} int getCar() {return atk[CHA];}
int getDes() {return atk[DES];} int getDes() {return atk[DEX];}
int getInt() {return atk[INT];} int getInt() {return atk[INT];}
int getCa() {return def[CA];} int getCa() {return def[AC];}
int getFort() {return def[FORT];} int getFort() {return def[FORT];}
int getRef() {return def[REF];} int getRef() {return def[REF];}
int getVol() {return def[VOL];} int getVol() {return def[WILL];}
private void setClass() { private void setClass() {
maxPg = atk[CON] + CLASS_STATS[INITIAL_PG][classInt] maxHp = atk[CON] + CLASS_STATS[INITIAL_HP][classInt]
+ ( level - 1 ) * CLASS_STATS[PG_ON_LEVEL_UP][classInt]; + ( level - 1 ) * CLASS_STATS[HP_ON_LEVEL_UP][classInt];
maxCurativeEfforts = maxSurges =
Player.getModifier(atk[CON]) + CLASS_STATS[DAILY_CURATIVE_EFFORTS][classInt]; Player.getModifier(atk[CON]) + CLASS_STATS[DAILY_SURGES][classInt];
//TODO: implement armor! //TODO: implement armor!
def[CA] = 10 + level / 2 + Math.max(0, Player.getModifier(Math.max(atk[DES], atk[INT]))); def[AC] = 10 + level / 2 + Math.max(0, Player.getModifier(Math.max(atk[DEX], atk[INT])));
def[FORT] = 10 + level / 2 + Player.getModifier(Math.max(atk[CON], atk[FUE])) + def[FORT] = 10 + level / 2 + Player.getModifier(Math.max(atk[CON], atk[STR])) +
CLASS_STATS[DEF_FORT][classInt]; CLASS_STATS[DEF_FORT][classInt];
def[REF] = 10 + level / 2 + Player.getModifier(Math.max(atk[DES], atk[INT])) + def[REF] = 10 + level / 2 + Player.getModifier(Math.max(atk[DEX], atk[INT])) +
CLASS_STATS[DEF_REF][classInt]; CLASS_STATS[DEF_REF][classInt];
def[VOL] = 10 + level / 2 + Player.getModifier(Math.max(atk[CAR], atk[SAB])) + def[WILL] = 10 + level / 2 + Player.getModifier(Math.max(atk[CHA], atk[WIS])) +
CLASS_STATS[DEF_VOL][classInt]; CLASS_STATS[DEF_WILL][classInt];
} }
static int getModifier(int i) { static int getModifier(int i) {
return i / 2 - 5; return i / 2 - 5;
} }
int getStatusColor(Context context) { int getStatusColor(Resources res) {
if (pg > maxPg / 2) if (hp > maxHp / 2)
return context.getResources().getColor(R.color.green); return res.getColor(R.color.green);
else if (pg > 0) else if (hp > 0)
return context.getResources().getColor(R.color.yellow); return res.getColor(R.color.yellow);
else if (pg > - maxPg / 2) else if (hp > -maxHp / 2)
return context.getResources().getColor(R.color.red); return res.getColor(R.color.red);
else else
return context.getResources().getColor(R.color.black); return res.getColor(R.color.black);
} }
void rest (boolean isLong) { void rest (boolean isLong) {
if ( isLong ) { if ( isLong ) {
pg = maxPg; hp = maxHp;
curativeEfforts = maxCurativeEfforts; surges = maxSurges;
} }
//TODO: here implement action points! //TODO: here implement action points!
} }

View file

@ -1,8 +1,6 @@
package com.kauron.dungeonmanager; package com.kauron.dungeonmanager;
import android.content.Context; import android.content.Context;
import android.graphics.AvoidXfermode;
import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -28,23 +26,23 @@ class PlayerAdapter extends ArrayAdapter<Player> {
if ( player != null ) { if ( player != null ) {
((TextView) mView.findViewById(R.id.name)).setText(player.getName()); ((TextView) mView.findViewById(R.id.name)).setText(player.getName());
((TextView) mView.findViewById(R.id.other)).setText(player.getClassName() + " " + player.getRaceName()); ((TextView) mView.findViewById(R.id.class_and_race)).setText(player.getClassName() + " " + player.getRaceName());
((TextView) mView.findViewById(R.id.level)) ((TextView) mView.findViewById(R.id.levelText))
.setText( .setText(
getContext().getResources().getString(R.string.level) + " " + player.getLevel() getContext().getResources().getString(R.string.level) + " " + player.getLevel()
); );
int pg = player.getPg(); int hp = player.getHp();
int maxPg = player.getMaxPg(); int maxHp = player.getMaxHp();
ProgressBar neg = (ProgressBar) mView.findViewById(R.id.negPgBar); ProgressBar neg = (ProgressBar) mView.findViewById(R.id.negative_hp_bar);
ProgressBar pos = (ProgressBar) mView.findViewById(R.id.pgBar); ProgressBar pos = (ProgressBar) mView.findViewById(R.id.positive_hp_bar);
neg.setMax(maxPg / 2); neg.setMax(maxHp / 2);
pos.setMax(maxPg); pos.setMax(maxHp);
neg.setProgress(pg < 0 ? -pg : 0); neg.setProgress(hp < 0 ? -hp : 0);
pos.setProgress(pg > 0 ? pg : 0); pos.setProgress(hp > 0 ? hp : 0);
int color = player.getStatusColor(getContext()); int color = player.getStatusColor(getContext().getResources());
neg.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); neg.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
pos.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); pos.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
} }

View file

@ -11,8 +11,8 @@ public class PlayerDBHandler extends SQLiteOpenHelper {
public static final String TABLE_PLAYERS = "players"; public static final String TABLE_PLAYERS = "players";
public static final String C_ID="_id", C_NAME="name", C_CLASS="class", C_RACE="race"; public static final String C_ID="_id", C_NAME="name", C_CLASS="class", C_RACE="race";
public static final String C_PG="pg", C_PG_MAX="pgMax", C_SURGES="surges", C_SURGES_MAX="surgesMax"; public static final String C_HP ="hp", C_HP_MAX ="hpMax", C_SURGES="surges", C_SURGES_MAX="surgesMax";
public static final String C_PX = "px", C_ATK = "atk", C_ABILITY = "ability", C_POWER_ID="powerID"; public static final String C_XP = "px", C_ATK = "atk", C_ABILITY = "ability", C_POWER_ID="powerID";
//TODO: complete class and implement database to save the players instead of sharedprefs //TODO: complete class and implement database to save the players instead of sharedprefs
//TODO: not using it at the moment //TODO: not using it at the moment

View file

@ -18,7 +18,7 @@ import com.nispok.snackbar.SnackbarManager;
public class PlayerEditor extends ActionBarActivity { public class PlayerEditor extends ActionBarActivity {
private EditText name, level; private EditText name, level;
private EditText fue, con, des, sab, intel, car; private EditText str, con, dex, wis, intel, cha;
private Spinner classSpinner, raceSpinner; private Spinner classSpinner, raceSpinner;
@Override @Override
@ -30,15 +30,15 @@ public class PlayerEditor extends ActionBarActivity {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true); getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
name = (EditText) findViewById(R.id.editNameIntro); name = (EditText) findViewById(R.id.namePlayerEdit);
name.requestFocus(); name.requestFocus();
level = (EditText) findViewById(R.id.editPxIntro); level = (EditText) findViewById(R.id.xpEdit);
fue = (EditText) findViewById(R.id.FUE); str = (EditText) findViewById(R.id.STR);
con = (EditText) findViewById(R.id.CON); con = (EditText) findViewById(R.id.CON);
des = (EditText) findViewById(R.id.DES); dex = (EditText) findViewById(R.id.DEX);
sab = (EditText) findViewById(R.id.SAB); wis = (EditText) findViewById(R.id.WIS);
intel = (EditText) findViewById(R.id.INT); intel = (EditText) findViewById(R.id.INT);
car = (EditText) findViewById(R.id.CAR); cha = (EditText) findViewById(R.id.CHA);
classSpinner = (Spinner) findViewById(R.id.classSpinner); classSpinner = (Spinner) findViewById(R.id.classSpinner);
classSpinner.setAdapter( classSpinner.setAdapter(
@ -108,20 +108,19 @@ public class PlayerEditor extends ActionBarActivity {
pxInt = Integer.parseInt(level.getText().toString()); pxInt = Integer.parseInt(level.getText().toString());
int fue = 0, con = 0, des = 0, intel = 0, sab = 0, car = 0; int fue = 0, con = 0, des = 0, intel = 0, sab = 0, car = 0;
if (!this.car.getText().toString().isEmpty()) if (!this.cha.getText().toString().isEmpty())
car = Integer.parseInt(this.car.getText().toString()); car = Integer.parseInt(this.cha.getText().toString());
if (!this.fue.getText().toString().isEmpty()) if (!this.str.getText().toString().isEmpty())
fue = Integer.parseInt(this.fue.getText().toString()); fue = Integer.parseInt(this.str.getText().toString());
if (!this.con.getText().toString().isEmpty()) if (!this.con.getText().toString().isEmpty())
con = Integer.parseInt(this.con.getText().toString()); con = Integer.parseInt(this.con.getText().toString());
if (!this.des.getText().toString().isEmpty()) if (!this.dex.getText().toString().isEmpty())
des = Integer.parseInt(this.des.getText().toString()); des = Integer.parseInt(this.dex.getText().toString());
if (!this.intel.getText().toString().isEmpty()) if (!this.intel.getText().toString().isEmpty())
intel = Integer.parseInt(this.intel.getText().toString()); intel = Integer.parseInt(this.intel.getText().toString());
if (!this.sab.getText().toString().isEmpty()) if (!this.wis.getText().toString().isEmpty())
sab = Integer.parseInt(this.sab.getText().toString()); sab = Integer.parseInt(this.wis.getText().toString());
// if(first) {
if ( if (
!nameString.isEmpty() && !nameString.isEmpty() &&
classInt != Player.NULL && classInt != Player.NULL &&
@ -159,23 +158,9 @@ public class PlayerEditor extends ActionBarActivity {
//TEMP //TEMP
ed.putBoolean("new", true); ed.putBoolean("new", true);
ed.apply(); ed.apply();
return true;
} else { } else {
return false; return false;
} }
// } else {
// if (!nameString.isEmpty()) ed.putString("playerName", nameString);
// if (classInt != Player.NULL) ed.putInt("classInt", classInt);
// if (raceInt != Player.NULL) ed.putInt("raceInt", raceInt);
// if (pxInt != -1) ed.putInt("px", pxInt);
//
// if (fue != 0) ed.putInt("fue", fue);
// if (car != 0) ed.putInt("car", car);
// if (intel != 0) ed.putInt("int", intel);
// if (sab != 0) ed.putInt("sab", sab);
// if (con != 0) ed.putInt("con", con);
// if (des != 0) ed.putInt("des", des);
// }
return true;
} }
} }

View file

@ -2,20 +2,22 @@ package com.kauron.dungeonmanager;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color; import android.content.res.Resources;
import java.io.Serializable; import java.io.Serializable;
class Power implements Serializable{ class Power implements Serializable{
/**frequencies*/ /**frequencies*/
public static final int OPORTUNIDAD = 1, A_VOLUNTAD = 2, ENCUENTRO = 3, DIARIO = 4; public static final int AT_WILL = 2, ENCOUNTER = 3, DAILY = 4;
public static final String[] FREQ = {"Nada", "Oportunidad", "A voluntad", "Encuentro", "Diario"}; /*{"Nada", "A voluntad", "Encuentro", "Diario"}*/
/**actions*/ /**actions*/
public static final int ESTANDAR = 1, MOVIMIENTO = 2, MENOR = 3, GRATUITA = 4; public static final int STANDARD = 1, MOVEMENT = 2, MINOR = 3, FREE = 4;
public static final String[] ACTIONS = {"Nada", "Estándar", "Movimiento", "Menor", "Gratuita"}; /*{"Nada", "Estándar", "Movimiento", "Menor", "Gratuita"}*/
/**distances*/ /**distances*/
public static final int CUERPO_A_CUERPO = 1, A_DISTANCIA = 2, EXPLOSION = 3, ESTALLIDO = 4; public static final int MELEE = 1, RANGED = 2, EXPLOSION = 3, AREA = 4, CLOSE = 5, AURA = 6;
public static final String[] DISTANCES = {"Nada", "Cuerpo a cuerpo", "A distancia", "Explosión", "Estallido"}; /* {"Nada", "Cuerpo a cuerpo", "A distancia", "Explosión", "Estallido"};*/
public static String[] RANGES, ACTIONS, FREQ, ATK, DEF, ATTACK, DEFENSE;
/**dies /**dies
* They are represented by its max size * They are represented by its max size
* 0 corresponds to [A], the weapon * 0 corresponds to [A], the weapon
@ -45,11 +47,21 @@ class Power implements Serializable{
this.action = p.getInt("i4", 0); this.action = p.getInt("i4", 0);
} }
static void setStrings(Resources res) {
FREQ = res.getStringArray(R.array.frequencies);
ACTIONS = res.getStringArray(R.array.actions);
RANGES = res.getStringArray(R.array.ranges);
ATK = res.getStringArray(R.array.atk);
DEF = res.getStringArray(R.array.def);
ATTACK = res.getStringArray(R.array.attack);
DEFENSE = res.getStringArray(R.array.defense);
}
String getKeywords() {return keywords;} String getKeywords() {return keywords;}
String getTypeString() {return ACTIONS[action];} String getTypeString() {return ACTIONS[action];}
String getFrequencyString() {return FREQ[freq];} String getFrequencyString() {return FREQ[freq];}
String getRangeString() {return DISTANCES[range];} String getRangeString() {return RANGES[range];}
int getAtk() {return atk;} int getAtk() {return atk;}
int getDef() {return def;} int getDef() {return def;}
@ -67,7 +79,7 @@ class Power implements Serializable{
boolean use(){ boolean use(){
if (!used) { if (!used) {
if (freq >= ENCUENTRO) used = true; if (freq >= ENCOUNTER) used = true;
return true; return true;
} else {return false;} } else {return false;}
} }
@ -80,9 +92,9 @@ class Power implements Serializable{
int getFreqColor(Context context) { int getFreqColor(Context context) {
switch (freq) { switch (freq) {
case DIARIO: case DAILY:
return context.getResources().getColor(R.color.daily); return context.getResources().getColor(R.color.daily);
case ENCUENTRO: case ENCOUNTER:
return context.getResources().getColor(R.color.encounter); return context.getResources().getColor(R.color.encounter);
default: default:
return context.getResources().getColor(R.color.at_will); return context.getResources().getColor(R.color.at_will);

View file

@ -1,43 +1,30 @@
package com.kauron.dungeonmanager; package com.kauron.dungeonmanager;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.listeners.ActionClickListener;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
class AttackAdapter extends ArrayAdapter<Power> { class PowerAdapter extends ArrayAdapter<Power> {
AttackAdapter(Context context, ArrayList<Power> powers) { PowerAdapter(Context context, ArrayList<Power> powers) {
super(context, R.layout.attack_row, powers); super(context, R.layout.power_row, powers);
} }
@Override @Override
public View getView(final int position, final View convertView, ViewGroup parent) { public View getView(final int position, final View convertView, ViewGroup parent) {
LayoutInflater mInflater = LayoutInflater.from(getContext()); LayoutInflater mInflater = LayoutInflater.from(getContext());
View mView = mInflater.inflate(R.layout.attack_row, parent, false); View mView = mInflater.inflate(R.layout.power_row, parent, false);
final Power attack = getItem(position); final Power attack = getItem(position);
if ( attack != null ) { if ( attack != null ) {
((TextView) mView.findViewById(R.id.name)).setText(attack.getName()); ((TextView) mView.findViewById(R.id.name)).setText(attack.getName());
((TextView) mView.findViewById(R.id.keywords)).setText(attack.getKeywords()); ((TextView) mView.findViewById(R.id.keywords)).setText(attack.getKeywords());
((TextView) mView.findViewById(R.id.frequency)).setText(attack.getFrequencyString()); ((TextView) mView.findViewById(R.id.frequency)).setText(attack.getFrequencyString());
((TextView) mView.findViewById(R.id.extra)).setText(attack.getRangeString() + " " + attack.getDistance()); ((TextView) mView.findViewById(R.id.range_and_distance)).setText(attack.getRangeString() + " " + attack.getDistance());
mView.setBackgroundColor(attack.getFreqColor(getContext())); mView.setBackgroundColor(attack.getFreqColor(getContext()));
if (attack.isUsed()) if (attack.isUsed())
mView.getBackground().setAlpha(0); mView.getBackground().setAlpha(0);

View file

@ -2,7 +2,6 @@ package com.kauron.dungeonmanager;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
@ -14,8 +13,6 @@ import android.widget.Spinner;
public class PowerEditor extends ActionBarActivity { public class PowerEditor extends ActionBarActivity {
public static final String NAME="name", FREQ="freq", KEYWORDS="keywords", RANGE="range", DISTANCE="distance";
private EditText [] edits = new EditText[5]; private EditText [] edits = new EditText[5];
private Spinner [] spinners = new Spinner[5]; private Spinner [] spinners = new Spinner[5];
@ -53,7 +50,7 @@ public class PowerEditor extends ActionBarActivity {
new ArrayAdapter<>( new ArrayAdapter<>(
this, this,
android.R.layout.simple_spinner_dropdown_item, android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.freq_array) Power.FREQ
) )
); );
spinners[1] = (Spinner) findViewById(R.id.rangeSpinner); spinners[1] = (Spinner) findViewById(R.id.rangeSpinner);
@ -61,7 +58,7 @@ public class PowerEditor extends ActionBarActivity {
new ArrayAdapter<>( new ArrayAdapter<>(
this, this,
android.R.layout.simple_spinner_dropdown_item, android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.ranges_array) Power.RANGES
) )
); );
spinners[2] = (Spinner) findViewById(R.id.atkSpinner); spinners[2] = (Spinner) findViewById(R.id.atkSpinner);
@ -69,7 +66,7 @@ public class PowerEditor extends ActionBarActivity {
new ArrayAdapter<>( new ArrayAdapter<>(
this, this,
android.R.layout.simple_spinner_dropdown_item, android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.atk_array) Power.ATK
) )
); );
spinners[3] = (Spinner) findViewById(R.id.defSpinner); spinners[3] = (Spinner) findViewById(R.id.defSpinner);
@ -77,26 +74,26 @@ public class PowerEditor extends ActionBarActivity {
new ArrayAdapter<>( new ArrayAdapter<>(
this, this,
android.R.layout.simple_spinner_dropdown_item, android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.def_array) Power.DEF
) )
); );
spinners[4] = (Spinner) findViewById(R.id.actionTypeSpinner); spinners[4] = (Spinner) findViewById(R.id.actionSpinner);
spinners[4].setAdapter( spinners[4].setAdapter(
new ArrayAdapter<>( new ArrayAdapter<>(
this, this,
android.R.layout.simple_spinner_dropdown_item, android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.actions_array) Power.ACTIONS
) )
); );
background = spinners[0].getBackground(); background = spinners[0].getBackground();
if (power != -1) { if (power != -1) {
SharedPreferences pp = getSharedPreferences(p.getString("power" + power, ""), MODE_PRIVATE); SharedPreferences powerPrefs = getSharedPreferences(p.getString("power" + power, ""), MODE_PRIVATE);
for ( int i = 0; i < spinners.length; i++ ) for ( int i = 0; i < spinners.length; i++ )
spinners[i].setSelection(pp.getInt("i" + i, 0)); spinners[i].setSelection(powerPrefs.getInt("i" + i, 0));
for ( int i = 0; i < edits.length; i++ ) for ( int i = 0; i < edits.length; i++ )
edits[i].setText(pp.getString("s" + i, "")); edits[i].setText(powerPrefs.getString("s" + i, ""));
originalName = edits[0].getText().toString(); originalName = edits[0].getText().toString();
} }

View file

@ -40,16 +40,15 @@ public class ShowPlayer extends ActionBarActivity {
public Player player; public Player player;
private boolean undo; private boolean undo;
//TODO: fix undo (show snackbar with button in each case, without timing).
private int undoObject, undoPreviousValue; private int undoObject, undoPreviousValue;
private ProgressBar posPgBar, negPgBar, xpBar, curativeEffortsBar; private ProgressBar posHpBar, negHpBar, xpBar, surgesBar;
private TextView currentPg, currentXp, currentCurativeEfforts, level; private TextView hpText, xpText, surgesText, levelText;
private SharedPreferences p; private SharedPreferences p;
private Toolbar toolbar; private Toolbar toolbar;
private ListView attackList; private ListView powerList;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -71,18 +70,18 @@ public class ShowPlayer extends ActionBarActivity {
//Performing all the findViewById commands //Performing all the findViewById commands
xpBar = (ProgressBar) findViewById(R.id.xpBar); xpBar = (ProgressBar) findViewById(R.id.xpBar);
curativeEffortsBar = (ProgressBar) findViewById(R.id.curativeEffortsBar); surgesBar = (ProgressBar) findViewById(R.id.surgesBar);
posPgBar = (ProgressBar) findViewById(R.id.pgBar); posHpBar = (ProgressBar) findViewById(R.id.positive_hp_bar);
negPgBar = (ProgressBar) findViewById(R.id.negPgBar); negHpBar = (ProgressBar) findViewById(R.id.negative_hp_bar);
currentPg = (TextView) findViewById(R.id.currentPg); hpText = (TextView) findViewById(R.id.hpText);
currentXp = (TextView) findViewById(R.id.currentXp); xpText = (TextView) findViewById(R.id.xpText);
currentCurativeEfforts = (TextView) findViewById(R.id.currentCurativeEfforts); surgesText = (TextView) findViewById(R.id.surgesText);
level = (TextView) findViewById(R.id.level); levelText = (TextView) findViewById(R.id.levelText);
xpBar.getProgressDrawable() xpBar.getProgressDrawable()
.setColorFilter(getResources().getColor(R.color.px_bar), PorterDuff.Mode.SRC_IN); .setColorFilter(getResources().getColor(R.color.px_bar), PorterDuff.Mode.SRC_IN);
curativeEffortsBar.getProgressDrawable() surgesBar.getProgressDrawable()
.setColorFilter(getResources().getColor(R.color.surges_bar), PorterDuff.Mode.SRC_IN); .setColorFilter(getResources().getColor(R.color.surges_bar), PorterDuff.Mode.SRC_IN);
undo = false; undo = false;
@ -100,7 +99,7 @@ public class ShowPlayer extends ActionBarActivity {
@Override @Override
public boolean onPrepareOptionsMenu (Menu menu) { public boolean onPrepareOptionsMenu (Menu menu) {
MenuItem menuHeal = menu.findItem(R.id.action_cure); MenuItem menuHeal = menu.findItem(R.id.action_cure);
boolean maxed = player.getPg() == player.getMaxPg(); boolean maxed = player.getHp() == player.getMaxHp();
menuHeal.setEnabled(!maxed); menuHeal.setEnabled(!maxed);
if (maxed) if (maxed)
menuHeal.getIcon().setAlpha(128); menuHeal.getIcon().setAlpha(128);
@ -112,10 +111,10 @@ public class ShowPlayer extends ActionBarActivity {
private void addPx(EditText input) { private void addPx(EditText input) {
try { try {
if (player.addPx(Integer.parseInt(input.getText().toString()))) levelUp(); if (player.addPx(Integer.parseInt(input.getText().toString()))) levelUp();
p.edit().putInt("px", player.getPx()).apply(); p.edit().putInt("px", player.getXp()).apply();
pxUpdate(); xpUpdate();
ceUpdate(); surgeUpdate();
pgUpdate(); hpUpdate();
} catch (Exception e) { } catch (Exception e) {
Toast.makeText(getApplicationContext(), "There was an error leveling up", Toast.LENGTH_LONG).show(); Toast.makeText(getApplicationContext(), "There was an error leveling up", Toast.LENGTH_LONG).show();
} }
@ -130,7 +129,7 @@ public class ShowPlayer extends ActionBarActivity {
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
if (id == R.id.action_cure) { if (id == R.id.action_cure) {
if(player.getMaxPg() <= player.getPg()){ if(player.getMaxHp() <= player.getHp()){
SnackbarManager.show( SnackbarManager.show(
Snackbar Snackbar
.with(this) .with(this)
@ -167,23 +166,22 @@ public class ShowPlayer extends ActionBarActivity {
alert.setNegativeButton(R.string.level_up, new DialogInterface.OnClickListener() { alert.setNegativeButton(R.string.level_up, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
player.setPx(Player.LEVEL_PX[player.getLevel()]); player.setXp(Player.LEVEL_XP[player.getLevel()]);
levelUp(); levelUp();
p.edit().putInt(Player.PX, player.getPx()).apply(); p.edit().putInt(Player.XP, player.getXp()).apply();
pxUpdate(); xpUpdate();
} }
}); });
alert.show(); alert.show();
input.requestFocus(); input.requestFocus();
return true; return true;
//TODO: TEST fix restoring powers
} else if (id == R.id.action_time_long_rest) { } else if (id == R.id.action_time_long_rest) {
AttackAdapter attackAdapter = (AttackAdapter)attackList.getAdapter(); PowerAdapter powerAdapter = (PowerAdapter) powerList.getAdapter();
if (attackAdapter != null) { if (powerAdapter != null) {
for (int i = 0; i < attackAdapter.getCount(); i++) { for (int i = 0; i < powerAdapter.getCount(); i++) {
Power power = attackAdapter.getItem(i); Power power = powerAdapter.getItem(i);
if ( power.getFreq() != Power.A_VOLUNTAD ) { if ( power.getFreq() != Power.AT_WILL) {
power.recover(Power.DIARIO); power.recover(Power.DAILY);
getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE) getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE)
.edit().putBoolean("used", false); .edit().putBoolean("used", false);
} }
@ -199,18 +197,18 @@ public class ShowPlayer extends ActionBarActivity {
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
); );
p.edit() p.edit()
.putInt("pg", player.getPg()) .putInt("pg", player.getHp())
.putInt("curativeEfforts", player.getCurativeEfforts()) .putInt("curativeEfforts", player.getSurges())
.apply(); .apply();
pgUpdate(); hpUpdate();
ceUpdate(); surgeUpdate();
} else if (id == R.id.action_time_rest) { } else if (id == R.id.action_time_rest) {
AttackAdapter attackAdapter = (AttackAdapter) attackList.getAdapter(); PowerAdapter powerAdapter = (PowerAdapter) powerList.getAdapter();
if (attackAdapter != null) { if (powerAdapter != null) {
for (int i = 0; i < attackAdapter.getCount(); i++) { for (int i = 0; i < powerAdapter.getCount(); i++) {
Power power = attackAdapter.getItem(i); Power power = powerAdapter.getItem(i);
if ( power.getFreq() == Power.ENCUENTRO) { if ( power.getFreq() == Power.ENCOUNTER) {
power.recover(Power.ENCUENTRO); power.recover(Power.ENCOUNTER);
getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE) getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE)
.edit().putBoolean("used", false); .edit().putBoolean("used", false);
} }
@ -224,8 +222,8 @@ public class ShowPlayer extends ActionBarActivity {
.text(R.string.rest_done) .text(R.string.rest_done)
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
); );
pgUpdate(); hpUpdate();
ceUpdate(); surgeUpdate();
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
@ -233,17 +231,17 @@ public class ShowPlayer extends ActionBarActivity {
private void levelUp() { private void levelUp() {
//TODO: improve leveling up by using a sliding guide //TODO: improve leveling up by using a sliding guide
xpBar.setMax(Player.LEVEL_PX[player.getLevel()] - xpBar.setMax(Player.LEVEL_XP[player.getLevel()] -
Player.LEVEL_PX[player.getLevel() - 1]); Player.LEVEL_XP[player.getLevel() - 1]);
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
restoreData(); restoreData();
pgUpdate(); hpUpdate();
ceUpdate(); surgeUpdate();
pxUpdate(); xpUpdate();
} }
/** /**
@ -263,13 +261,13 @@ public class ShowPlayer extends ActionBarActivity {
return false; return false;
} else { } else {
SharedPreferences.Editor e = p.edit(); SharedPreferences.Editor e = p.edit();
e.putInt("pg", player.getPg()); e.putInt("pg", player.getHp());
if(usesEffort) { if(usesEffort) {
e.putInt("curativeEfforts", player.getCurativeEfforts()); e.putInt("curativeEfforts", player.getSurges());
ceUpdate(); surgeUpdate();
} }
e.apply(); e.apply();
pgUpdate(); hpUpdate();
return true; return true;
} }
} }
@ -285,24 +283,24 @@ public class ShowPlayer extends ActionBarActivity {
.setTitle(R.string.new_energies) .setTitle(R.string.new_energies)
.setPositiveButton(R.string.me, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.me, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
undoPreviousValue = player.getPg(); undoPreviousValue = player.getHp();
if (heal(true)) { if (heal(true)) { //a surge has been used
SnackbarManager.show( SnackbarManager.show(
Snackbar.with(getApplicationContext()) Snackbar.with(getApplicationContext())
.text(String.format(getString(R.string.healed), player.getMaxPg() / 4)) .text(String.format(getString(R.string.healed), player.getMaxHp() / 4))
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
.actionLabel(R.string.action_undo) .actionLabel(R.string.action_undo)
.actionColor(getResources().getColor(R.color.yellow)) .actionColor(getResources().getColor(R.color.yellow))
.actionListener(new ActionClickListener() { .actionListener(new ActionClickListener() {
@Override @Override
public void onActionClicked(Snackbar snackbar) { public void onActionClicked(Snackbar snackbar) {
player.setPg(undoPreviousValue); player.setHp(undoPreviousValue);
player.setCurativeEffort(player.getCurativeEfforts() + 1); player.setCurativeEffort(player.getSurges() + 1);
p.edit().putInt("pg", undoPreviousValue) p.edit().putInt("pg", undoPreviousValue)
.putInt("curativeEfforts", player.getCurativeEfforts()) .putInt("curativeEfforts", player.getSurges())
.apply(); .apply();
pgUpdate(); hpUpdate();
ceUpdate(); surgeUpdate();
SnackbarManager.show( SnackbarManager.show(
Snackbar Snackbar
.with(getApplicationContext()) .with(getApplicationContext())
@ -320,18 +318,18 @@ public class ShowPlayer extends ActionBarActivity {
.setNegativeButton(R.string.other, new DialogInterface.OnClickListener() { .setNegativeButton(R.string.other, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
undoPreviousValue = player.getPg(); undoPreviousValue = player.getHp();
heal(false); heal(false);
SnackbarManager.show( SnackbarManager.show(
Snackbar.with(getApplicationContext()) Snackbar.with(getApplicationContext())
.text(String.format(getString(R.string.healed), player.getMaxPg() / 4)) .text(String.format(getString(R.string.healed), player.getMaxHp() / 4))
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
.actionLabel(R.string.action_undo) .actionLabel(R.string.action_undo)
.actionColor(getResources().getColor(R.color.yellow)) .actionColor(getResources().getColor(R.color.yellow))
.actionListener(new ActionClickListener() { .actionListener(new ActionClickListener() {
@Override @Override
public void onActionClicked(Snackbar snackbar) { public void onActionClicked(Snackbar snackbar) {
player.setPg(undoPreviousValue); player.setHp(undoPreviousValue);
p.edit().putInt("pg", undoPreviousValue).apply(); p.edit().putInt("pg", undoPreviousValue).apply();
SnackbarManager.show( SnackbarManager.show(
Snackbar Snackbar
@ -340,7 +338,7 @@ public class ShowPlayer extends ActionBarActivity {
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE), .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE),
activity activity
); );
pgUpdate(); hpUpdate();
} }
}), }),
activity activity
@ -379,7 +377,7 @@ public class ShowPlayer extends ActionBarActivity {
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
try { try {
int preValue = player.getPg(); int preValue = player.getHp();
int damage = Integer.parseInt(input.getText().toString()); int damage = Integer.parseInt(input.getText().toString());
player.losePg(damage); player.losePg(damage);
undo = true; undo = true;
@ -397,8 +395,8 @@ public class ShowPlayer extends ActionBarActivity {
.actionColor(getResources().getColor(R.color.yellow)) .actionColor(getResources().getColor(R.color.yellow))
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
,activity); // action button's ,activity); // action button's
p.edit().putInt("pg", player.getPg()).apply(); p.edit().putInt("pg", player.getHp()).apply();
pgUpdate(); hpUpdate();
invalidateOptionsMenu(); invalidateOptionsMenu();
} catch (Exception e) { } catch (Exception e) {
Toast.makeText(getApplicationContext(), "There was an error", Toast.LENGTH_LONG).show(); Toast.makeText(getApplicationContext(), "There was an error", Toast.LENGTH_LONG).show();
@ -419,82 +417,46 @@ public class ShowPlayer extends ActionBarActivity {
* Sets the hit points progress bars to the adequate value and color. * Sets the hit points progress bars to the adequate value and color.
* Sets the text indicating the numerical value of the hit points * Sets the text indicating the numerical value of the hit points
*/ */
private void pgUpdate() { private void hpUpdate() {
int pg = player.getPg(); int hp = player.getHp();
negPgBar.setProgress(pg < 0 ? -pg : 0); negHpBar.setProgress(hp < 0 ? -hp : 0);
posPgBar.setProgress(pg > 0 ? pg : 0); posHpBar.setProgress(hp > 0 ? hp : 0);
currentPg.setText(player.getPg() + " / " + player.getMaxPg()); hpText.setText(player.getHp() + " / " + player.getMaxHp());
int color = player.getStatusColor(getApplicationContext()); int color = player.getStatusColor(getApplicationContext().getResources());
posPgBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); posHpBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
negPgBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); negHpBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
} }
/** /**
* Recovers the player's data from the sharedPreferences and then updates all the layouts * Recovers the player's data from the sharedPreferences and then updates all the layouts
* This includes an update for the attackList layout. * This includes an update for the powerList layout.
*/ */
private void restoreData(){ private void restoreData(){
//Loading player //Loading player
player = new Player( p ); player = new Player( p );
pxUpdate(); xpUpdate();
xpBar.setMax( xpBar.setMax(
Player.LEVEL_PX[player.getLevel()] - Player.LEVEL_XP[player.getLevel()] -
Player.LEVEL_PX[player.getLevel() - 1] Player.LEVEL_XP[player.getLevel() - 1]
); );
player.setCurativeEffort(p.getInt("curativeEfforts", player.getMaxCurativeEfforts())); player.setCurativeEffort(p.getInt("curativeEfforts", player.getMaxSurges()));
player.setPg(p.getInt("pg", player.getMaxPg())); player.setHp(p.getInt("pg", player.getMaxHp()));
posPgBar.setMax(player.getMaxPg()); posHpBar.setMax(player.getMaxHp());
negPgBar.setMax(player.getMaxPg() / 2); negHpBar.setMax(player.getMaxHp() / 2);
curativeEffortsBar.setMax(player.getMaxCurativeEfforts()); surgesBar.setMax(player.getMaxSurges());
pgUpdate(); hpUpdate();
ceUpdate(); surgeUpdate();
//set restored values to the respective fields //set restored values to the respective fields
toolbar.setTitle(player.getName()); toolbar.setTitle(player.getName());
toolbar.setSubtitle( toolbar.setSubtitle(
player.getClassName() + " " + player.getRaceName() player.getClassName() + " " + player.getRaceName()
); );
// //attacks
// ((TextView) findViewById(R.id.FUE)).setText(
// getString(R.string.FUE) + ":" + player.getFue()
// );
// ((TextView) findViewById(R.id.CON)).setText(
// getString(R.string.CON) + ":" + player.getCon()
// );
// ((TextView) findViewById(R.id.DES)).setText(
// getString(R.string.DES) + ":" + player.getDes()
// );
// ((TextView) findViewById(R.id.INT)).setText(
// getString(R.string.INT) + ":" + player.getInt()
// );
// ((TextView) findViewById(R.id.SAB)).setText(
// getString(R.string.SAB) + ":" + player.getSab()
// );
// ((TextView) findViewById(R.id.CAR)).setText(
// getString(R.string.CAR) + ":" + player.getCar()
// );
//
// //defenses
// ((TextView) findViewById(R.id.CA)).setText(
// getString(R.string.CA) + ":" + player.getCa()
// );
// ((TextView) findViewById(R.id.FORT)).setText(
// getString(R.string.FORT) + ":" + player.getFort()
// );
// ((TextView) findViewById(R.id.REF)).setText(
// getString(R.string.REF) + ":" + player.getRef()
// );
// ((TextView) findViewById(R.id.VOL)).setText(
// getString(R.string.VOL) + ":" + player.getVol()
// );
//
//
//Loading powers and abilities (not implemented yet) //Loading powers and abilities (not implemented yet)
refreshList(); refreshList();
} }
@ -502,34 +464,35 @@ public class ShowPlayer extends ActionBarActivity {
/** /**
* This updates the progress and indicator text of the available surges. * This updates the progress and indicator text of the available surges.
*/ */
private void ceUpdate() { private void surgeUpdate() {
curativeEffortsBar.setProgress(player.getCurativeEfforts()); surgesBar.setProgress(player.getSurges());
currentCurativeEfforts.setText( surgesText.setText(
player.getCurativeEfforts() + " / " + player.getSurges() + " / " +
player.getMaxCurativeEfforts() player.getMaxSurges()
); );
} }
/** /**
* Updates the progress and indicator text of the XP * Updates the progress and indicator text of the XP
*/ */
private void pxUpdate() { private void xpUpdate() {
xpBar.setProgress(player.getPx() - Player.LEVEL_PX[player.getLevel() - 1]); xpBar.setProgress(player.getXp() - Player.LEVEL_XP[player.getLevel() - 1]);
level.setText(getString(R.string.level) + " " + player.getLevel()); levelText.setText(getString(R.string.level) + " " + player.getLevel());
currentXp.setText( xpText.setText(
player.getPx() + " / " + player.getXp() + " / " +
Player.LEVEL_PX[player.getLevel()] Player.LEVEL_XP[player.getLevel()]
); );
} }
/** /**
* Undoes the last change done by the player. Only used in damage(). Healing is not yet included * Undoes the last change done by the player. Only used in damage().
* Healing is undone in the health dialog
*/ */
private void undo() { private void undo() {
String message = ""; String message = "";
if(undoObject == CURRENT_PG){ if(undoObject == CURRENT_PG){
player.setPg(undoPreviousValue); player.setHp(undoPreviousValue);
undoObject = NULL; undoObject = NULL;
message = getString(R.string.restored); message = getString(R.string.restored);
} }
@ -541,7 +504,7 @@ public class ShowPlayer extends ActionBarActivity {
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE) .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
); );
} }
pgUpdate(); hpUpdate();
undo = false; undo = false;
invalidateOptionsMenu(); invalidateOptionsMenu();
} }
@ -575,8 +538,8 @@ public class ShowPlayer extends ActionBarActivity {
int n = p.getInt("powers",0); int n = p.getInt("powers",0);
int elements = 0; int elements = 0;
attackList = (ListView) findViewById(R.id.attackList); powerList = (ListView) findViewById(R.id.powerList);
final AttackAdapter adapter = (AttackAdapter) attackList.getAdapter(); final PowerAdapter adapter = (PowerAdapter) powerList.getAdapter();
if ( adapter != null ) if ( adapter != null )
elements = adapter.getCount(); elements = adapter.getCount();
@ -593,24 +556,15 @@ public class ShowPlayer extends ActionBarActivity {
powers.add( new Power(sav) ); powers.add( new Power(sav) );
} }
attackList.setAdapter(new AttackAdapter(this, powers)); powerList.setAdapter(new PowerAdapter(this, powers));
final Activity activity = this; final Activity activity = this;
attackList.setOnItemClickListener(new AdapterView.OnItemClickListener() { powerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id) { public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {
final Dialog dialog = new Dialog(ShowPlayer.this); final Dialog dialog = new Dialog(ShowPlayer.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.attack_display); dialog.setContentView(R.layout.attack_display);
// set the custom dialog components - text, image and button
// Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
// // if button is clicked, close the custom dialog
// dialogButton.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View v) {
// dialog.dismiss();
// }
// });
//identify all the elements from the VIEW and then add LISTENERS //identify all the elements from the VIEW and then add LISTENERS
final Power power = (Power) parent.getItemAtPosition(position); final Power power = (Power) parent.getItemAtPosition(position);
@ -628,8 +582,8 @@ public class ShowPlayer extends ActionBarActivity {
((TextView) dialog.findViewById(R.id.impactText)).setText(power.getImpact()); ((TextView) dialog.findViewById(R.id.impactText)).setText(power.getImpact());
((TextView) dialog.findViewById(R.id.otherText)).setText(power.getOther()); ((TextView) dialog.findViewById(R.id.otherText)).setText(power.getOther());
String[] attack = getResources().getStringArray(R.array.attack_array); String[] attack = getResources().getStringArray(R.array.attack);
String[] defense = getResources().getStringArray(R.array.defense_array); String[] defense = getResources().getStringArray(R.array.defense);
((TextView) dialog.findViewById(R.id.attackText)).setText(attack[power.getAtk()] ((TextView) dialog.findViewById(R.id.attackText)).setText(attack[power.getAtk()]
+ " " + getResources().getString(R.string.vs) + " " + getResources().getString(R.string.vs)
+ " " + defense[power.getDef()]); + " " + defense[power.getDef()]);
@ -665,7 +619,7 @@ public class ShowPlayer extends ActionBarActivity {
.actionListener(new ActionClickListener() { .actionListener(new ActionClickListener() {
@Override @Override
public void onActionClicked(Snackbar snackbar) { public void onActionClicked(Snackbar snackbar) {
power.recover(Power.DIARIO); power.recover(Power.DAILY);
useButton.setBackgroundColor(color); useButton.setBackgroundColor(color);
useButton.setTextColor(getResources().getColor(R.color.white)); useButton.setTextColor(getResources().getColor(R.color.white));
useButton.getBackground().setAlpha(255); useButton.getBackground().setAlpha(255);
@ -700,14 +654,13 @@ public class ShowPlayer extends ActionBarActivity {
} }
final Activity thisActivity = this; final Activity thisActivity = this;
attackList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { powerList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override @Override
public boolean onItemLongClick(final AdapterView<?> parent, View view, final int position, long id) { public boolean onItemLongClick(final AdapterView<?> parent, View view, final int position, long id) {
AlertDialog.Builder alert = new AlertDialog.Builder(thisActivity); AlertDialog.Builder alert = new AlertDialog.Builder(thisActivity);
alert.setItems( alert.setItems(
new String[]{getString(R.string.delete), getString(R.string.edit)}, new String[]{getString(R.string.delete), getString(R.string.edit)},
new DialogInterface.OnClickListener() new DialogInterface.OnClickListener() {
{
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (which == 0) { if (which == 0) {

View file

@ -4,7 +4,6 @@ import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
@ -35,7 +34,10 @@ public class Welcome extends ActionBarActivity {
setContentView(R.layout.activity_welcome); setContentView(R.layout.activity_welcome);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
toolbar.setTitleTextColor(getResources().getColor(R.color.white));
Player.setStrings(getResources());
Power .setStrings(getResources());
p = getSharedPreferences(PREFERENCES, MODE_PRIVATE); p = getSharedPreferences(PREFERENCES, MODE_PRIVATE);
load(); load();
} }
@ -68,10 +70,9 @@ public class Welcome extends ActionBarActivity {
load(); load();
} }
//TODO: load all players with secondary constructor (except the ones created by introduction and haven't passed by ShowPlayer)
private void load() { private void load() {
int n = p.getInt("players",0); int n = p.getInt("players",0);
ListView playerList = (ListView) findViewById(R.id.listView); ListView playerList = (ListView) findViewById(R.id.playersList);
final PlayerAdapter adapter = (PlayerAdapter) playerList.getAdapter(); final PlayerAdapter adapter = (PlayerAdapter) playerList.getAdapter();
int elements = 0; int elements = 0;
if ( adapter != null ) if ( adapter != null )
@ -93,7 +94,7 @@ public class Welcome extends ActionBarActivity {
ArrayList<Player> players = new ArrayList<>(); ArrayList<Player> players = new ArrayList<>();
for ( int i = 0; i < n; i++ ) { for ( int i = 0; i < n; i++ ) {
SharedPreferences sav = getSharedPreferences(p.getString("player" + i, ""), MODE_PRIVATE); SharedPreferences sav = getSharedPreferences(p.getString("player" + i, ""), MODE_PRIVATE);
if (sav.contains(Player.NAME)) //TODO: adding a second player causes an error if (sav.contains(Player.NAME))
players.add( new Player( sav ) ); players.add( new Player( sav ) );
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

View file

@ -1,237 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<layer-list>
<!-- Shadow -->
<item android:top="1dp" android:right="1dp">
<layer-list>
<item>
<shape android:shape="oval">
<solid android:color="#08000000"/>
<padding
android:bottom="3px"
android:left="3px"
android:right="3px"
android:top="3px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#09000000"/>
<padding
android:bottom="2px"
android:left="2px"
android:right="2px"
android:top="2px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#10000000"/>
<padding
android:bottom="2px"
android:left="2px"
android:right="2px"
android:top="2px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#11000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#12000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#13000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#14000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#15000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#16000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
</layer-list>
</item>
<!-- Blue button pressed -->
<item>
<shape android:shape="oval">
<solid android:color="#90CAF9"/>
</shape>
</item>
</layer-list>
</item>
<item android:state_enabled="true">
<layer-list>
<!-- Shadow -->
<item android:top="2dp" android:right="1dp">
<layer-list>
<item>
<shape android:shape="oval">
<solid android:color="#08000000"/>
<padding
android:bottom="4px"
android:left="4px"
android:right="4px"
android:top="4px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#09000000"/>
<padding
android:bottom="2px"
android:left="2px"
android:right="2px"
android:top="2px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#10000000"/>
<padding
android:bottom="2px"
android:left="2px"
android:right="2px"
android:top="2px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#11000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#12000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#13000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#14000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#15000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#16000000"/>
<padding
android:bottom="1px"
android:left="1px"
android:right="1px"
android:top="1px"
/>
</shape>
</item>
</layer-list>
</item>
<!-- Blue button -->
<item>
<shape android:shape="oval">
<solid android:color="#03A9F4"/>
</shape>
</item>
</layer-list>
</item>
</selector>

View file

@ -35,23 +35,23 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPersonName|textCapWords" android:inputType="textPersonName|textCapWords"
android:layout_weight="0.5" android:layout_weight="0.5"
android:id="@+id/editNameIntro" android:id="@+id/namePlayerEdit"
android:hint="@string/adventurer_name" android:hint="@string/adventurer_name"
android:nextFocusDown="@+id/editPxIntro" android:nextFocusDown="@+id/xpEdit"
android:nextFocusForward="@+id/editPxIntro"/> android:nextFocusForward="@+id/xpEdit"/>
<EditText <EditText
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="number" android:inputType="number"
android:id="@+id/editPxIntro" android:id="@+id/xpEdit"
android:hint="@string/px" android:hint="@string/px"
android:layout_weight="1" android:layout_weight="1"
android:nextFocusDown="@+id/FUE" android:nextFocusDown="@+id/STR"
android:nextFocusForward="@+id/FUE" android:nextFocusForward="@+id/STR"
android:nextFocusLeft="@+id/FUE" android:nextFocusLeft="@+id/STR"
android:nextFocusRight="@+id/FUE" android:nextFocusRight="@+id/STR"
android:nextFocusUp="@+id/FUE"/> android:nextFocusUp="@+id/STR"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -93,9 +93,9 @@
android:layout_row="0" android:layout_row="0"
android:layout_column="0" android:layout_column="0"
android:id="@+id/FUE" android:id="@+id/STR"
android:hint="@string/FUE" android:hint="@string/FUE"
android:nextFocusDown="@+id/DES"/> android:nextFocusDown="@+id/DEX"/>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -119,9 +119,9 @@
android:layout_row="0" android:layout_row="0"
android:layout_column="1" android:layout_column="1"
android:id="@+id/DES" android:id="@+id/DEX"
android:hint="@string/DES" android:hint="@string/DES"
android:nextFocusDown="@+id/SAB"/> android:nextFocusDown="@+id/WIS"/>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -134,7 +134,7 @@
android:id="@+id/INT" android:id="@+id/INT"
android:hint="@string/INT" android:hint="@string/INT"
android:nextFocusDown="@+id/CAR"/> android:nextFocusDown="@+id/CHA"/>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -145,7 +145,7 @@
android:layout_row="0" android:layout_row="0"
android:layout_column="2" android:layout_column="2"
android:id="@+id/SAB" android:id="@+id/WIS"
android:hint="@string/SAB" android:hint="@string/SAB"
android:nextFocusDown="@+id/CON"/> android:nextFocusDown="@+id/CON"/>
@ -159,7 +159,7 @@
android:layout_row="1" android:layout_row="1"
android:layout_column="2" android:layout_column="2"
android:id="@+id/CAR" android:id="@+id/CHA"
android:hint="@string/CAR"/> android:hint="@string/CAR"/>
</GridLayout> </GridLayout>

View file

@ -22,12 +22,12 @@
android:layout_height="fill_parent"> android:layout_height="fill_parent">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin" 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" android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.kauron.dungeonmanager.PowerEditor"> tools:context=".PowerEditor">
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -102,11 +102,11 @@
android:id="@+id/rangeSpinner" android:id="@+id/rangeSpinner"
android:layout_weight="1" android:layout_weight="1"
android:spinnerMode="dropdown" /> android:spinnerMode="dropdown" />
<!--TODO: this field can accept more than numbers, rearrange-->
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="number" android:inputType="textCapSentences"
android:ems="10" android:ems="10"
android:id="@+id/distanceNumEdit" android:id="@+id/distanceNumEdit"
android:layout_weight="0.75" android:layout_weight="0.75"
@ -173,7 +173,7 @@
<Spinner <Spinner
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/actionTypeSpinner" android:id="@+id/actionSpinner"
android:layout_below="@+id/impactEdit" android:layout_below="@+id/impactEdit"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
@ -186,7 +186,7 @@
android:text="@string/objective" android:text="@string/objective"
android:id="@+id/objectiveText" android:id="@+id/objectiveText"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_below="@+id/actionTypeSpinner" android:layout_below="@+id/actionSpinner"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
@ -197,7 +197,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/objectiveEdit" android:id="@+id/objectiveEdit"
android:hint="@string/objectiveHint" android:hint="@string/objectiveHint"
android:layout_below="@+id/actionTypeSpinner" android:layout_below="@+id/actionSpinner"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:capitalize="sentences" android:capitalize="sentences"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"

View file

@ -40,8 +40,8 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/titlePgBar" android:id="@+id/hpTitle"
android:text="@string/pg" android:text="@string/hp"
android:textAllCaps="true" android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator" android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -56,7 +56,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="end" android:gravity="end"
android:id="@+id/currentPg" android:id="@+id/hpText"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
android:textAllCaps="true" android:textAllCaps="true"
@ -71,7 +71,7 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/negPgBar" android:id="@+id/negative_hp_bar"
android:layout_weight="2" android:layout_weight="2"
android:rotation="180"/> android:rotation="180"/>
<TextView <TextView
@ -86,7 +86,7 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/pgBar" android:id="@+id/positive_hp_bar"
android:layout_weight="1"/> android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -103,7 +103,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/titleCurativeEffortsBar" android:id="@+id/surgesTitle"
android:text="@string/curative_efforts" android:text="@string/curative_efforts"
android:textAllCaps="true" android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator" android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
@ -120,7 +120,7 @@
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
android:gravity="end" android:gravity="end"
android:id="@+id/currentCurativeEfforts" android:id="@+id/surgesText"
android:textAllCaps="true"/> android:textAllCaps="true"/>
</LinearLayout> </LinearLayout>
@ -128,7 +128,7 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/curativeEffortsBar"/> android:id="@+id/surgesBar"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -142,7 +142,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/titleXpBar" android:id="@+id/xpTitle"
android:text="@string/px" android:text="@string/px"
android:textAllCaps="true" android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator" android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
@ -155,7 +155,7 @@
android:paddingRight="8dip" android:paddingRight="8dip"
android:layout_weight="1"/> android:layout_weight="1"/>
<TextView <TextView
android:id="@+id/level" android:id="@+id/levelText"
tools:text="Level 1" tools:text="Level 1"
android:textAllCaps="true" android:textAllCaps="true"
android:gravity="center_horizontal" android:gravity="center_horizontal"
@ -169,7 +169,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="end" android:gravity="end"
android:id="@+id/currentXp" android:id="@+id/xpText"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
android:textAllCaps="true" android:textAllCaps="true"
@ -214,186 +214,186 @@
<ListView <ListView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/attackList" android:id="@+id/powerList"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:divider="@android:color/transparent" android:divider="@android:color/transparent"
android:dividerHeight="0dp" android:dividerHeight="0dp"
android:choiceMode="none" /> android:choiceMode="none" />
<LinearLayout <!--<LinearLayout-->
android:id="@+id/attackContainer" <!--android:id="@+id/attackContainer"-->
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:orientation="vertical" <!--android:orientation="vertical"-->
android:visibility="gone"> <!--android:visibility="gone">-->
<TextView <!--<TextView-->
android:id="@+id/titleAttack" <!--android:id="@+id/titleAttack"-->
android:text="@string/attack" <!--android:text="@string/attack"-->
android:textAllCaps="true" <!--android:textAllCaps="true"-->
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator" <!--android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"-->
android:layout_marginBottom="5dp" <!--android:layout_marginBottom="5dp"-->
android:layout_width="match_parent" <!--android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textStyle="bold" <!--android:textStyle="bold"-->
android:textColor="?android:textColorSecondary" <!--android:textColor="?android:textColorSecondary"-->
android:textSize="14sp" <!--android:textSize="14sp"-->
android:gravity="center_vertical" <!--android:gravity="center_vertical"-->
android:paddingLeft="8dip" <!--android:paddingLeft="8dip"-->
android:paddingRight="8dip"/> <!--android:paddingRight="8dip"/>-->
<HorizontalScrollView <!--<HorizontalScrollView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content"> <!--android:layout_height="wrap_content">-->
<GridLayout <!--<GridLayout-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:id="@+id/attackGrid" <!--android:id="@+id/attackGrid"-->
android:columnCount="3" <!--android:columnCount="3"-->
android:rowCount="2"> <!--android:rowCount="2">-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="0" <!--android:layout_row="0"-->
android:layout_column="0" <!--android:layout_column="0"-->
android:id="@+id/FUE" <!--android:id="@+id/STR"-->
tools:text="@string/FUE" /> <!--tools:text="@string/FUE" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="1" <!--android:layout_row="1"-->
android:layout_column="0" <!--android:layout_column="0"-->
android:id="@+id/CON" <!--android:id="@+id/CON"-->
tools:text="@string/CON" /> <!--tools:text="@string/CON" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="0" <!--android:layout_row="0"-->
android:layout_column="1" <!--android:layout_column="1"-->
android:id="@+id/DES" <!--android:id="@+id/DEX"-->
tools:text="@string/DES" /> <!--tools:text="@string/DES" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="1" <!--android:layout_row="1"-->
android:layout_column="1" <!--android:layout_column="1"-->
android:id="@+id/INT" <!--android:id="@+id/INT"-->
tools:text="@string/INT" /> <!--tools:text="@string/INT" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="0" <!--android:layout_row="0"-->
android:layout_column="2" <!--android:layout_column="2"-->
android:id="@+id/SAB" <!--android:id="@+id/WIS"-->
tools:text="@string/SAB" /> <!--tools:text="@string/SAB" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="4" <!--android:ems="4"-->
android:layout_row="1" <!--android:layout_row="1"-->
android:layout_column="2" <!--android:layout_column="2"-->
android:id="@+id/CAR" <!--android:id="@+id/CHA"-->
tools:text="@string/CAR" /> <!--tools:text="@string/CAR" />-->
</GridLayout> <!--</GridLayout>-->
</HorizontalScrollView> <!--</HorizontalScrollView>-->
</LinearLayout> <!--</LinearLayout>-->
<LinearLayout <!--<LinearLayout-->
android:id="@+id/defenseContainer" <!--android:id="@+id/defenseContainer"-->
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:visibility="gone" <!--android:visibility="gone"-->
android:orientation="vertical"> <!--android:orientation="vertical">-->
<TextView <!--<TextView-->
android:id="@+id/titleDefense" <!--android:id="@+id/titleDefense"-->
android:text="@string/defense" <!--android:text="@string/defense"-->
android:textAllCaps="true" <!--android:textAllCaps="true"-->
android:layout_marginBottom="5dp" <!--android:layout_marginBottom="5dp"-->
android:layout_width="match_parent" <!--android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textStyle="bold" <!--android:textStyle="bold"-->
android:textColor="?android:textColorSecondary" <!--android:textColor="?android:textColorSecondary"-->
android:textSize="14sp" <!--android:textSize="14sp"-->
android:gravity="center_vertical" <!--android:gravity="center_vertical"-->
android:paddingLeft="8dip" <!--android:paddingLeft="8dip"-->
android:paddingRight="8dip"/> <!--android:paddingRight="8dip"/>-->
<GridLayout <!--<GridLayout-->
android:layout_width="fill_parent" <!--android:layout_width="fill_parent"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:id="@+id/defenseGrid" <!--android:id="@+id/defenseGrid"-->
android:columnCount="2" <!--android:columnCount="2"-->
android:rowCount="2"> <!--android:rowCount="2">-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="5" <!--android:ems="5"-->
android:layout_row="0" <!--android:layout_row="0"-->
android:layout_column="0" <!--android:layout_column="0"-->
android:id="@+id/CA" <!--android:id="@+id/CA"-->
tools:text="@string/CA" /> <!--tools:text="@string/CA" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="5" <!--android:ems="5"-->
android:layout_row="0" <!--android:layout_row="0"-->
android:layout_column="1" <!--android:layout_column="1"-->
android:id="@+id/FORT" <!--android:id="@+id/FORT"-->
tools:text="@string/FORT" /> <!--tools:text="@string/FORT" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="5" <!--android:ems="5"-->
android:layout_row="1" <!--android:layout_row="1"-->
android:layout_column="0" <!--android:layout_column="0"-->
android:id="@+id/REF" <!--android:id="@+id/REF"-->
tools:text="@string/REF" /> <!--tools:text="@string/REF" />-->
<TextView <!--<TextView-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:textAppearance="?android:attr/textAppearanceLarge" <!--android:textAppearance="?android:attr/textAppearanceLarge"-->
android:typeface="monospace" <!--android:typeface="monospace"-->
android:ems="5" <!--android:ems="5"-->
android:layout_row="1" <!--android:layout_row="1"-->
android:layout_column="1" <!--android:layout_column="1"-->
android:id="@+id/VOL" <!--android:id="@+id/VOL"-->
tools:text="@string/VOL" /> <!--tools:text="@string/VOL" />-->
</GridLayout> <!--</GridLayout>-->
</LinearLayout> <!--</LinearLayout>-->
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -1,5 +1,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="com.kauron.dungeonmanager.Welcome" tools:context="com.kauron.dungeonmanager.Welcome"
@ -10,7 +11,9 @@
android:background="@color/primary" android:background="@color/primary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:title="@string/app_name"> android:title="@string/app_name"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
@ -33,7 +36,7 @@
<ListView <ListView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/listView" android:id="@+id/playersList"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -7,13 +7,13 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
tools:text="Explosion"
tools:background="@color/encounter"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/encounter"
android:paddingTop="5dp" android:paddingTop="5dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:paddingLeft="10dp" android:paddingLeft="10dp"
tools:text="Explosión"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/white" android:textColor="@color/white"
@ -30,7 +30,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Diario" tools:text="Daily"
android:id="@+id/freqText" android:id="@+id/freqText"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
@ -42,7 +42,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Fuego, arcano" tools:text="Fire, arcana"
android:id="@+id/keywordsText" android:id="@+id/keywordsText"
android:layout_toRightOf="@+id/freqText" android:layout_toRightOf="@+id/freqText"
android:textColor="@color/black" android:textColor="@color/black"
@ -53,7 +53,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Acción estándar" tools:text="Standard action"
android:textColor="@color/black" android:textColor="@color/black"
android:id="@+id/typeText" android:id="@+id/typeText"
android:layout_below="@+id/freqText" android:layout_below="@+id/freqText"
@ -160,44 +160,18 @@
android:layout_below="@+id/impact" android:layout_below="@+id/impact"
tools:text="If you are reading this the description has been displayed" tools:text="If you are reading this the description has been displayed"
android:layout_alignParentLeft="true"/> android:layout_alignParentLeft="true"/>
<Button <Button
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Use" android:text="@string/use"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:textStyle="bold" android:textStyle="bold"
android:id="@+id/useButton" android:id="@+id/useButton"
android:layout_below="@+id/linearLayout" android:layout_gravity="right"
android:layout_below="@+id/otherText"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" /> android:layout_alignParentEnd="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/otherText"
android:id="@+id/linearLayout">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/edit"
android:visibility="gone"
android:layout_weight="1"
android:textStyle="bold"
android:background="@android:color/transparent"
android:id="@+id/editButton" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
android:textColor="#ff0000"
android:visibility="gone"
android:textStyle="bold"
android:layout_weight="1"
android:background="@android:color/transparent"
android:id="@+id/deleteButton" />
</LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>

View file

@ -33,7 +33,7 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/negPgBar" android:id="@+id/negative_hp_bar"
android:layout_weight="2" android:layout_weight="2"
android:rotation="180"/> android:rotation="180"/>
<TextView <TextView
@ -48,10 +48,10 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/pgBar" android:id="@+id/positive_hp_bar"
android:layout_weight="1" android:layout_weight="1"
tools:progress="30" tools:progress="30"
tools:progressTint="#FF0"/> tools:progressTint="@color/yellow"/>
</LinearLayout> </LinearLayout>
<TextView <TextView
@ -59,7 +59,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Brujo Tiflin" tools:text="Brujo Tiflin"
android:id="@+id/other" android:id="@+id/class_and_race"
android:layout_above="@+id/progressBar" android:layout_above="@+id/progressBar"
android:layout_toRightOf="@+id/name" android:layout_toRightOf="@+id/name"
android:layout_toEndOf="@+id/name" android:layout_toEndOf="@+id/name"
@ -70,7 +70,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Level 1" tools:text="Level 1"
android:id="@+id/level" android:id="@+id/levelText"
android:layout_above="@+id/progressBar" android:layout_above="@+id/progressBar"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" /> android:layout_alignParentEnd="true" />

View file

@ -21,7 +21,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="Melee 1" tools:text="Melee 1"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/extra" android:id="@+id/range_and_distance"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:layout_below="@+id/name" android:layout_below="@+id/name"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
@ -35,9 +35,9 @@
tools:text="(fire, explosion)" tools:text="(fire, explosion)"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:layout_alignBottom="@id/extra" android:layout_alignBottom="@id/range_and_distance"
android:layout_toRightOf="@+id/extra" android:layout_toRightOf="@+id/range_and_distance"
android:layout_toEndOf="@+id/extra" /> android:layout_toEndOf="@+id/range_and_distance" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -2,13 +2,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="com.kauron.dungeonmanager.Welcome"> tools:context="com.kauron.dungeonmanager.Welcome">
<item
android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never"
android:icon="@drawable/ic_action_settings"
android:visible="false"/>
<item <item
android:id="@+id/action_add_player" android:id="@+id/action_add_player"

View file

@ -3,7 +3,7 @@
<string name="action_cure">Curar</string> <string name="action_cure">Curar</string>
<string name="action_edit_basics">Editar personaje</string> <string name="action_edit_basics">Editar personaje</string>
<string name="action_finish">Guardar</string> <string name="action_finish">Guardar</string>
<string name="adventurer_name">Nombre</string> <string name="adventurer_name">Nombre del personaje</string>
<string name="cancel">Cancelar</string> <string name="cancel">Cancelar</string>
<string name="class_name">Clase</string> <string name="class_name">Clase</string>
<string name="edit_PG_Title">Sufrir daño</string> <string name="edit_PG_Title">Sufrir daño</string>
@ -27,7 +27,7 @@
<string name="action_undo">Deshacer</string> <string name="action_undo">Deshacer</string>
<string name="action_undo_current_pg">Acción deshecha</string> <string name="action_undo_current_pg">Acción deshecha</string>
<string name="curative_efforts">Esfuerzos curativos</string> <string name="curative_efforts">Esfuerzos curativos</string>
<string name="pg">PG</string> <string name="hp">PG</string>
<string name="action_reset">Borrar datos</string> <string name="action_reset">Borrar datos</string>
<string name="die">Morir</string> <string name="die">Morir</string>
<string name="message_death">Has muerto</string> <string name="message_death">Has muerto</string>
@ -63,7 +63,7 @@
<string name="message_no_px">No has ganado ningún PX</string> <string name="message_no_px">No has ganado ningún PX</string>
<string name="dialog_resolve_max_pg_hint">Máx PG</string> <string name="dialog_resolve_max_pg_hint">Máx PG</string>
<string name="dialog_resolve_max_pg_message">No se han podido calcular tus PG a partir de tu nivel</string> <string name="dialog_resolve_max_pg_message">No se han podido calcular tus PG a partir de tu nivel</string>
<string name="dialog_resolve_max_pg_title">Atención</string> <string name="dialog_resolve_max_pg_title">Alerta</string>
<string name="empty_field">Por favor, escribe algo</string> <string name="empty_field">Por favor, escribe algo</string>
<string name="action_download">Actualizar app</string> <string name="action_download">Actualizar app</string>
<string name="message_no_back_button_intro">Tu personaje no se ha guardado</string> <string name="message_no_back_button_intro">Tu personaje no se ha guardado</string>
@ -95,7 +95,7 @@
<string name="save_player">Guardar personaje</string> <string name="save_player">Guardar personaje</string>
<string name="title_activity_power_editor">Editor de poderes</string> <string name="title_activity_power_editor">Editor de poderes</string>
<string-array name="freq_array"> <string-array name="frequencies">
<item>Frecuencia</item> <item>Frecuencia</item>
<item>Oportunidad</item> <item>Oportunidad</item>
<item>A voluntad</item> <item>A voluntad</item>
@ -103,7 +103,7 @@
<item>Diario</item> <item>Diario</item>
</string-array> </string-array>
<string-array name="actions_array"> <string-array name="actions">
<item>Tipo de acción</item> <item>Tipo de acción</item>
<item>Acción estándar</item> <item>Acción estándar</item>
<item>Acción de movimiento</item> <item>Acción de movimiento</item>
@ -111,7 +111,7 @@
<item>Acción gratuita</item> <item>Acción gratuita</item>
</string-array> </string-array>
<string-array name="ranges_array"> <string-array name="ranges">
<item>Rango de ataque</item> <item>Rango de ataque</item>
<item>Cuerpo a cuerpo</item> <item>Cuerpo a cuerpo</item>
<item>A distancia</item> <item>A distancia</item>
@ -120,7 +120,7 @@
<item>Aura</item> <item>Aura</item>
</string-array> </string-array>
<string-array name="atk_array"> <string-array name="atk">
<item>ATK</item> <item>ATK</item>
<item>FUE</item> <item>FUE</item>
<item>CON</item> <item>CON</item>
@ -130,7 +130,7 @@
<item>CAR</item> <item>CAR</item>
</string-array> </string-array>
<string-array name="def_array"> <string-array name="def">
<item>DEF</item> <item>DEF</item>
<item>CA</item> <item>CA</item>
<item>FORT</item> <item>FORT</item>
@ -138,7 +138,7 @@
<item>VOL</item> <item>VOL</item>
</string-array> </string-array>
<string-array name="attack_array"> <string-array name="attack">
<item>Ataque</item> <item>Ataque</item>
<item>Fuerza</item> <item>Fuerza</item>
<item>Constitución</item> <item>Constitución</item>
@ -148,7 +148,7 @@
<item>Carisma</item> <item>Carisma</item>
</string-array> </string-array>
<string-array name="defense_array"> <string-array name="defence">
<item>Defensa</item> <item>Defensa</item>
<item>CA</item> <item>CA</item>
<item>Fortaleza</item> <item>Fortaleza</item>
@ -166,4 +166,5 @@
<string name="title_activity_player_creator">Creador de personaje</string> <string name="title_activity_player_creator">Creador de personaje</string>
<string name="lost_hp">Has perdido %d PG</string> <string name="lost_hp">Has perdido %d PG</string>
<string name="level_up">Subir un nivel</string> <string name="level_up">Subir un nivel</string>
<string name="use">Usar</string>
</resources> </resources>

View file

@ -2,12 +2,6 @@
<resources> <resources>
<color name="primary">#5D4037</color> <color name="primary">#5D4037</color>
<color name="primary_dark">#3E2723</color> <color name="primary_dark">#3E2723</color>
<color name="primary_light">#D7CCC8</color>
<color name="accent">#FF5252</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="red" >#9F0D0A</color> <color name="red" >#9F0D0A</color>
<color name="yellow">#FFBB00</color> <color name="yellow">#FFBB00</color>
@ -22,6 +16,4 @@
<color name="surges_bar">#989F2B</color> <color name="surges_bar">#989F2B</color>
<color name="px_bar" >#005874</color> <color name="px_bar" >#005874</color>
<!--<color name="primary">#5D4037</color>-->
<!--<color name="primaryDark">#3E2723</color>-->
</resources> </resources>

View file

@ -4,10 +4,4 @@
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="bar_margin">15dp</dimen> <dimen name="bar_margin">15dp</dimen>
<dimen name="fab_button_diameter">56dp</dimen>
<dimen name="fab_button_margin_bottom">16dp</dimen>
<dimen name="fab_button_margin_right">16dp</dimen>
<dimen name="elevation_low">1dp</dimen>
<dimen name="elevation_high">8dp</dimen>
</resources> </resources>

View file

@ -5,17 +5,17 @@
<string name="attack">Attack</string> <string name="attack">Attack</string>
<string name="action_cure">Cure</string> <string name="action_cure">Cure</string>
<string name="action_undo">Undo</string> <string name="action_undo">Undo</string>
<string name="pg">PG</string> <string name="hp">HP</string>
<string name="die">Die</string> <string name="die">Die</string>
<string name="CA">AC</string> <string name="CA">AC</string>
<string name="FORT">FORT</string> <string name="FORT">FORT</string>
<string name="REF">REF</string> <string name="REF">REF</string>
<string name="VOL">WILL</string> <string name="VOL">WILL</string>
<string name="defense">Defense</string> <string name="defense">Defense</string>
<string name="curative_efforts">Curative efforts</string> <string name="curative_efforts">Surges</string>
<string name="load_text">Load %1$s</string> <string name="load_text">Load %1$s</string>
<string name="rest_done">Your encounter powers have been restored</string> <string name="rest_done">Your encounter powers have been restored</string>
<string name="long_rest_done">All your stats have been restored</string> <string name="long_rest_done">You have rested and restored all your powers</string>
<string name="action_reset">Reset</string> <string name="action_reset">Reset</string>
<string name="message_reset">All the data has been cleared</string> <string name="message_reset">All the data has been cleared</string>
<string name="reset_confirmation_title">Are you sure?</string> <string name="reset_confirmation_title">Are you sure?</string>
@ -49,12 +49,12 @@
<string name="level">Level</string> <string name="level">Level</string>
<string name="max_curative_efforts">Max surges</string> <string name="max_curative_efforts">Max surges</string>
<string name="max_pg">Max PG</string> <string name="max_pg">Max HP</string>
<string name="missing_info_error">You need to fill all the information</string> <string name="missing_info_error">You need to fill all the information</string>
<string name="no_curative_efforts_error">You don\'t have any surges left!</string> <string name="no_curative_efforts_error">You don\'t have any surges left!</string>
<string name="maxed_curative">You have reached your maximum level of PG</string> <string name="maxed_curative">You have reached your maximum level of HP</string>
<string name="suffer_damage">Input the damage suffered</string> <string name="suffer_damage">Input the damage suffered</string>
<string name="suffer_damage_hint">PG lost</string> <string name="suffer_damage_hint">HP lost</string>
<string name="me">Me</string> <string name="me">Me</string>
<string name="px_awarded_title">Input XP awarded</string> <string name="px_awarded_title">Input XP awarded</string>
<string name="px_awarded_hint">XP from the encounter</string> <string name="px_awarded_hint">XP from the encounter</string>
@ -69,10 +69,10 @@
<string name="CAR">CHA</string> <string name="CAR">CHA</string>
<string name="SAB">WIS</string> <string name="SAB">WIS</string>
<string name="action_save">Save</string> <string name="action_save">Save</string>
<string name="dialog_resolve_max_pg_hint">Max PG</string> <string name="dialog_resolve_max_pg_hint">Max HP</string>
<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 HP based on your level</string>
<string name="action_download">Update app</string> <string name="action_download">Update app</string>
<string name="message_no_back_button_intro">Your information hasn\'t been saved</string> <string name="message_no_back_button_intro">Your information hasn\'t been saved</string>
<string name="title_activity_welcome">Welcome</string> <string name="title_activity_welcome">Welcome</string>
@ -81,7 +81,7 @@
<string name="new_character">New character</string> <string name="new_character">New character</string>
<string name="load_character">Load character</string> <string name="load_character">Load character</string>
<string name="new_character_warning">This will erase any previously existing data saved</string> <string name="new_character_warning">This will erase any previously existing data saved</string>
<string name="new_attack">New attack</string> <string name="new_attack">New power</string>
<string name="edit">Edit</string> <string name="edit">Edit</string>
<string name="delete">Delete</string> <string name="delete">Delete</string>
<string name="title_activity_power_editor">Power Editor</string> <string name="title_activity_power_editor">Power Editor</string>
@ -109,9 +109,9 @@
<string name="sure">Are you sure?</string> <string name="sure">Are you sure?</string>
<string name="healed">You have restored %d HP</string> <string name="healed">You have restored %d HP</string>
<string name="restored">Values restored</string> <string name="restored">Values restored</string>
<string name="export">Exportar</string> <string name="export">Export</string>
<string-array name="freq_array"> <string-array name="frequencies">
<item>Frequency</item> <item>Frequency</item>
<item>Opportunity</item> <item>Opportunity</item>
<item>At will</item> <item>At will</item>
@ -119,7 +119,7 @@
<item>Daily</item> <item>Daily</item>
</string-array> </string-array>
<string-array name="actions_array"> <string-array name="actions">
<item>Action type</item> <item>Action type</item>
<item>Standard</item> <item>Standard</item>
<item>Movement</item> <item>Movement</item>
@ -127,7 +127,7 @@
<item>Free</item> <item>Free</item>
</string-array> </string-array>
<string-array name="ranges_array"> <string-array name="ranges">
<item>Range</item> <item>Range</item>
<item>Melee</item> <item>Melee</item>
<item>Ranged</item> <item>Ranged</item>
@ -136,7 +136,7 @@
<item>Aura</item> <item>Aura</item>
</string-array> </string-array>
<string-array name="atk_array"> <string-array name="atk">
<item>ATK</item> <item>ATK</item>
<item>STR</item> <item>STR</item>
<item>CON</item> <item>CON</item>
@ -146,7 +146,7 @@
<item>CHA</item> <item>CHA</item>
</string-array> </string-array>
<string-array name="def_array"> <string-array name="def">
<item>DEF</item> <item>DEF</item>
<item>AC</item> <item>AC</item>
<item>FORT</item> <item>FORT</item>
@ -154,7 +154,7 @@
<item>WILL</item> <item>WILL</item>
</string-array> </string-array>
<string-array name="attack_array"> <string-array name="attack">
<item>Attack</item> <item>Attack</item>
<item>Strength</item> <item>Strength</item>
<item>Constitution</item> <item>Constitution</item>
@ -164,16 +164,73 @@
<item>Charisma</item> <item>Charisma</item>
</string-array> </string-array>
<string-array name="defense_array"> <string-array name="defense">
<item>Defense</item> <item>Defense</item>
<item>AC</item> <item>AC</item>
<item>Fortitude</item> <item>Fortitude</item>
<item>Reflexes</item> <item>Reflexes</item>
<item>Will</item> <item>Will</item>
</string-array> </string-array>
<string-array name="abilities">
<item>Ability</item>
<item>Acrobatics</item>
<item>Arcana</item>
<item>Athletics</item>
<item>Bluff</item>
<item>Diplomacy</item>
<item>Dungeoneering</item>
<item>Endurance</item>
<item>Heal</item>
<item>History</item>
<item>Insight</item>
<item>Intimidate</item>
<item>Nature</item>
<item>Perception</item>
<item>Religion</item>
<item>Stealth</item>
<item>Streetwise</item>
<item>Thievery</item>
</string-array>
<string-array name="classes">
<item>Class</item>
<item>Ardiente</item>
<item>Brujo</item>
<item>Buscador</item>
<item>Clérigo</item>
<item>Explorador</item>
<item>Guerrero</item>
<item>Mago</item>
<item>Mente de Batalla</item>
<item>Monje</item>
<item>Paladín</item>
<item>Pícaro</item>
<item>Psiónico</item>
<item>Sacerdote Rúnico</item>
<item>Señor de la Guerra</item>
</string-array>
<string-array name="races">
<item>Race</item>
<item>Dracónidos</item>
<item>Eladrines</item>
<item>Elfos</item>
<item>Enanos</item>
<item>Gitzerai</item>
<item>Humanos</item>
<item>Medianos</item>
<item>Mente del Fragmento</item>
<item>Minotauro</item>
<item>Salvaje</item>
<item>Semielfo</item>
<item>Tiflin</item>
</string-array>
<string name="title_activity_player_creator">Player Creator</string> <string name="title_activity_player_creator">Player Creator</string>
<string name="hello_world">Hello world!</string> <string name="hello_world">Hello world!</string>
<string name="lost_hp">Lost %d HP</string> <string name="lost_hp">Lost %d HP</string>
<string name="level_up">Level up</string> <string name="level_up">Level up</string>
<string name="use">Use</string>
</resources> </resources>