Watch
1
0
Fork
You've already forked DungeonManager
0

Added powers and powersList

Still don't have powerDisplay or deletion process
This commit is contained in:
Carlos Galindo 2015-04-22 17:50:18 +02:00
commit 9a9af9d6e5
21 changed files with 831 additions and 797 deletions

2
.idea/misc.xml generated
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_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" 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

@ -8,17 +8,17 @@
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme" > android:theme="@style/AppTheme" >
<activity <activity
android:name=".MainActivity" android:name=".ShowPlayer"
android:label="@string/app_name" > android:label="@string/app_name" >
</activity> </activity>
<activity <activity
android:name=".Introduction" android:name=".PlayerEditor"
android:label="@string/title_activity_introduction" > android:label="@string/title_activity_introduction" >
<!-- android:parentActivityName=".MainActivity" --> <!-- android:parentActivityName=".ShowPlayer" -->
<!-- <meta-data --> <!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" --> <!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value=".MainActivity" /> --> <!-- android:value=".ShowPlayer" /> -->
</activity> </activity>
<activity <activity
android:name=".Welcome" android:name=".Welcome"

View file

@ -3,6 +3,8 @@ package com.kauron.dungeonmanager;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
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;
@ -10,11 +12,14 @@ import android.widget.ArrayAdapter;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; 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.Snackbar;
import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.listeners.ActionClickListener; import com.nispok.snackbar.listeners.ActionClickListener;
import java.io.File;
class AttackAdapter extends ArrayAdapter<Power> { class AttackAdapter extends ArrayAdapter<Power> {
AttackAdapter(Context context, Power[] powers) { AttackAdapter(Context context, Power[] powers) {
super(context, R.layout.attack_row, powers); super(context, R.layout.attack_row, powers);
@ -32,24 +37,45 @@ class AttackAdapter extends ArrayAdapter<Power> {
((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.extra)).setText(attack.getRangeString() + " " + attack.getDistance());
final AttackAdapter current = this; final AttackAdapter current = this;
((ImageView) mView.findViewById(R.id.delete)).setOnClickListener(new View.OnClickListener() { mView.findViewById(R.id.delete);
@Override // mView.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { // @Override
SnackbarManager.show( // public void onClick(View v) {
Snackbar.with(getContext()).text("¿Quieres borrarlo?").actionLabel("Sí").actionListener(new ActionClickListener() { // SnackbarManager.show(
@Override // Snackbar.with(getContext()).text("¿Quieres borrarlo?").actionLabel("Sí").actionListener(new ActionClickListener() {
public void onActionClicked(Snackbar snackbar) { // @Override
current.remove(attack); // public void onActionClicked(Snackbar snackbar) {
} // //delete the item
}) // String name = p.getString("power" + position, "");
); // if (name != null && !name.isEmpty()) {
//TODO: convert text to resource // getContext().getSharedPreferences(name, Context.MODE_PRIVATE).edit().clear().apply();
} // Log.d("Tag", activity.getApplicationContext().getFilesDir().getParent()
}); // + File.separator + "shared_prefs" + File.separator + name + ".xml");
} else { // try {
this.remove(attack); // if (!new File(activity.getApplicationContext().getFilesDir().getParent()
// + File.separator + "shared_prefs" + File.separator + name + ".xml").delete())
// throw new Exception();
// } catch (Exception e) {
// Toast.makeText(getContext(), "Error deleting player files", Toast.LENGTH_SHORT).show();
// }
// int max = p.getInt("powers", 0);
// SharedPreferences.Editor ed = p.edit();
// for (int i = position; i < max - 1; i++)
// ed.putString("power" + i, p.getString("power" + (i + 1), "max"));
// ed.putInt("powers", max - 1).apply();
// load();
// ed.remove("power" + (max - 1)).apply();
// }
// }
//
// ));
// //TODO: convert text to resource
// }
// }
//
// );
// };
} }
return mView; return mView;
} }
} }

View file

@ -1,7 +1,6 @@
package com.kauron.dungeonmanager; package com.kauron.dungeonmanager;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import java.io.Serializable; import java.io.Serializable;
class Player implements Serializable { class Player implements Serializable {
@ -110,10 +109,8 @@ class Player implements Serializable {
private String name; private String name;
private int level; private int level;
//TODO: use dice dialogs //TODO: use dice dialogs
private int[] atk, def, abilities; private int[] atk, def;
private boolean[] abilitiesTrained;
//TODO: implement fully operational powers displayed as cards //TODO: implement fully operational powers displayed as cards
private Power[] powers;
Player (SharedPreferences p) { Player (SharedPreferences p) {
this.name = p.getString(NAME, "Player"); this.name = p.getString(NAME, "Player");
@ -133,40 +130,6 @@ class Player implements Serializable {
setState(); setState();
this.pg = p.getInt( "pg" , maxPg); this.pg = p.getInt( "pg" , maxPg);
this.curativeEfforts = p.getInt( "curativeEfforts" , maxCurativeEfforts ); this.curativeEfforts = p.getInt( "curativeEfforts" , maxCurativeEfforts );
//TODO: load powers from wherever they are saved
}
/** Constructor for creating a new character*/
Player( String name, int classInt, int raceInt,
int px, int[] atk, Power[] powers){
this.name = name;
this.px = px;
setLevel();
this.raceInt = raceInt;
this.classInt = classInt;
this.def = new int[4];
setAtk(atk);
setState();
pg = maxPg;
curativeEfforts = maxCurativeEfforts;
this.powers = powers;
}
/** Constructor for restoring the Player in the middle of the game*/
Player( int pg, int px, int curativeEfforts, int classInt, int raceInt, int[] atk, String name, Power[] powers) {
this.px = px;
setLevel();
setAtk(atk);
this.classInt = classInt;
this.raceInt = raceInt;
setClass();
this.name = name;
this.powers = powers;
this.pg = pg;
this.curativeEfforts = curativeEfforts;
setState();
} }
int getPx() {return px;} int getPx() {return px;}
@ -241,34 +204,11 @@ class Player implements Serializable {
} }
String getName() {return name;} String getName() {return name;}
void setName(String name) {this.name = name;}
int getClassInt() {return classInt;}
void setClassInt(int classInt) {
this.classInt = classInt;
if (atk != null) setClass();
}
String getClassName() {return CLASS_STRINGS[classInt];} String getClassName() {return CLASS_STRINGS[classInt];}
String getRaceName() {return RACE_STRINGS[raceInt];} String getRaceName() {return RACE_STRINGS[raceInt];}
void setRaceInt(int raceInt) {this.raceInt = raceInt;} void setRaceInt(int raceInt) {this.raceInt = raceInt;}
int getRaceInt() {return raceInt;} int getRaceInt() {return raceInt;}
//TODO: implement turns (for bonuses and continuous damage in the app
void rest(boolean isLong) {
if(isLong) {
pg = maxPg;
curativeEfforts = maxCurativeEfforts;
for (Power p : powers)
if (p != null)
p.recover(Power.DIARIO);
setState();
}
for (Power p : powers)
if (p != null)
p.recover(Power.ENCUENTRO);
}
void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();} void setAtk(int[] atk) {this.atk = atk; if(classInt != NULL) setClass();}
int getFue() {return atk[FUE];} int getFue() {return atk[FUE];}

View file

@ -0,0 +1,178 @@
package com.kauron.dungeonmanager;
import android.content.SharedPreferences;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
public class PlayerEditor extends ActionBarActivity {
private EditText name, level;
private EditText fue, con, des, sab, intel, car;
private Spinner classSpinner, raceSpinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_player_editor);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
name = (EditText) findViewById(R.id.editNameIntro);
name.requestFocus();
level = (EditText) findViewById(R.id.editPxIntro);
fue = (EditText) findViewById(R.id.FUE);
con = (EditText) findViewById(R.id.CON);
des = (EditText) findViewById(R.id.DES);
sab = (EditText) findViewById(R.id.SAB);
intel = (EditText) findViewById(R.id.INT);
car = (EditText) findViewById(R.id.CAR);
classSpinner = (Spinner) findViewById(R.id.classSpinner);
classSpinner.setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
Player.CLASS_STRINGS
)
);
raceSpinner = (Spinner) findViewById(R.id.raceSpinner);
raceSpinner.setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
Player.RACE_STRINGS
)
);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_player_editor, menu);
return true;
}
@Override
public void onBackPressed() {
super.onBackPressed();
Toast.makeText(
getApplicationContext(),
R.string.message_no_back_button_intro,
Toast.LENGTH_SHORT
).show();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_save) {
if(finished()) {
finish();
} else {
SnackbarManager.show(
Snackbar.with(getApplicationContext()).text(R.string.missing_info_error), this
);
}
return true;
}
return super.onOptionsItemSelected(item);
}
private boolean finished() {
String nameString = name.getText().toString().trim();
int classInt = classSpinner.getSelectedItemPosition();
int raceInt = raceSpinner.getSelectedItemPosition();
int pxInt = -1;
if (!level.getText().toString().isEmpty())
pxInt = Integer.parseInt(level.getText().toString());
int fue = 0, con = 0, des = 0, intel = 0, sab = 0, car = 0;
if (!this.car.getText().toString().isEmpty())
car = Integer.parseInt(this.car.getText().toString());
if (!this.fue.getText().toString().isEmpty())
fue = Integer.parseInt(this.fue.getText().toString());
if (!this.con.getText().toString().isEmpty())
con = Integer.parseInt(this.con.getText().toString());
if (!this.des.getText().toString().isEmpty())
des = Integer.parseInt(this.des.getText().toString());
if (!this.intel.getText().toString().isEmpty())
intel = Integer.parseInt(this.intel.getText().toString());
if (!this.sab.getText().toString().isEmpty())
sab = Integer.parseInt(this.sab.getText().toString());
// if(first) {
if (
!nameString.isEmpty() &&
classInt != Player.NULL &&
raceInt != Player.NULL &&
pxInt != -1 &&
car != 0 &&
fue != 0 &&
con != 0 &&
des != 0 &&
intel != 0 &&
sab != 0
) {
SharedPreferences p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE);
int i = p.getInt("players", 0);
String saveName = nameString;
for (int j = 0; j < i; j++) {
saveName += p.getString("player" + j, "").equals(saveName) ? "2" : "";
}
p.edit().putString("player" + i, saveName).putInt("players", i + 1).apply();
SharedPreferences.Editor ed = getSharedPreferences(saveName, MODE_PRIVATE).edit();
//first save it all
ed.putString("playerName", nameString);
ed.putInt("classInt", classInt);
ed.putInt("raceInt", raceInt);
ed.putInt("px", pxInt);
ed.putInt("fue", fue);
ed.putInt("car", car);
ed.putInt("int", intel);
ed.putInt("sab", sab);
ed.putInt("con", con);
ed.putInt("des", des);
//TEMP
ed.putBoolean("new", true);
ed.apply();
} else {
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

@ -1,5 +1,7 @@
package com.kauron.dungeonmanager; package com.kauron.dungeonmanager;
import android.content.SharedPreferences;
import java.io.Serializable; import java.io.Serializable;
class Power implements Serializable{ class Power implements Serializable{
@ -15,37 +17,33 @@ class Power implements Serializable{
/**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
* any other is represented by d2, d4, d6, d8, d10, d12, d20, d100 * any other is represented by [A], d2, d4, d6, d8, d10, d12, d20, d100, extra damage
*/ */
public static final int[] DIE = {0, 2, 4, 6, 8, 10, 12, 20, 100}; public static final int[] DIE = {0, 2, 4, 6, 8, 10, 12, 20, 100, 0};
private boolean used; private boolean used;
private int freq, action, distance, range, objectives; private int freq, action, distance, range, objectives;
private String name, description; private String name, impact, objective;
private String[] keywords; //fire, spell... private String keywords; //fire, spell...
private int atk, def; //constants from Player to denote atk and defense private int atk, def; //constants from Player to denote atk and defense
private int[] damage; //the max sizes of the different dies
Power ( SharedPreferences p ) {
this.name = p.getString("s0", "Name");
this.keywords = p.getString("s1", "Keywords");
this.impact = p.getString("s2", "2d10");
this.distance = Integer.parseInt(p.getString("s3", "10"));
this.objective = p.getString("s4", "One creature");
Power(String name, String desc, int freq, int action, int distance, String[] keywords, this.used = p.getBoolean("used", false);
int atk, int def, int[] damage){
used = false;
this.name = name; this.description = desc;
this.freq = freq; this.action = action;
this.distance = distance;
this.keywords = keywords;
this.freq = p.getInt("i0", 0);
this.range = p.getInt("i1", 0);
this.atk = p.getInt("i2", 0);
this.def = p.getInt("i3", 0);
this.action = p.getInt("i4", 0);
} }
String getKeywords() { String getKeywords() {return keywords;}
if ( keywords != null && keywords.length != 0 ) {
String r = keywords[0];
for (String k : keywords) r += ", " + k;
return r;
} else {
return "";
}
}
String getFrequencyString() {return FREQ[freq];} String getFrequencyString() {return FREQ[freq];}
int getFreq() {return freq;} int getFreq() {return freq;}
@ -56,7 +54,7 @@ class Power implements Serializable{
int getDistance() {return distance;} int getDistance() {return distance;}
String getName(){return name;} String getName(){return name;}
String getDescription() {return description;} String getImpact() {return impact;}
boolean isUsed(){return used;} boolean isUsed(){return used;}
@ -68,13 +66,6 @@ class Power implements Serializable{
} }
int rollAttack() {return atk + (int)(Math.random()*20) + 1;} int rollAttack() {return atk + (int)(Math.random()*20) + 1;}
int rollDamage() {
int roll = 0;
for(int i : damage) {
roll += (int)(Math.random()*i + 1);
}
return roll;
}
void recover(int type){ void recover(int type){
if(this.freq <= type) used = false; if(this.freq <= type) used = false;

View file

@ -1,23 +1,134 @@
package com.kauron.dungeonmanager; package com.kauron.dungeonmanager;
import android.content.SharedPreferences;
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;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
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"; public static final String NAME="name", FREQ="freq", KEYWORDS="keywords", RANGE="range", DISTANCE="distance";
private EditText [] edits = new EditText[5];
private Spinner [] spinners = new Spinner[5];
private String[] strings = new String[5];
private int[] ints = new int[5];
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_power_editor); setContentView(R.layout.activity_power_editor);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
//EditText
edits[0] = (EditText) findViewById(R.id.nameEdit);
edits[0].requestFocus();
edits[1] = (EditText) findViewById(R.id.keywordsEdit);
edits[2] = (EditText) findViewById(R.id.impactEdit);
edits[3] = (EditText) findViewById(R.id.distanceNumEdit);
edits[4] = (EditText) findViewById(R.id.objectiveEdit);
//Spinners
spinners[0] = (Spinner) findViewById(R.id.freqSpinner);
spinners[0].setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.freq_array)
)
);
spinners[1] = (Spinner) findViewById(R.id.rangeSpinner);
spinners[1].setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.ranges_array)
)
);
spinners[2] = (Spinner) findViewById(R.id.atkSpinner);
spinners[2].setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.atk_array)
)
);
spinners[3] = (Spinner) findViewById(R.id.defSpinner);
spinners[3].setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.def_array)
)
);
spinners[4] = (Spinner) findViewById(R.id.actionTypeSpinner);
spinners[4].setAdapter(
new ArrayAdapter<>(
this,
android.R.layout.simple_spinner_dropdown_item,
getResources().getStringArray(R.array.actions_array)
)
);
} }
public void saveClick(View view) { public void saveClick(View view) {
//TODO: save powers //TODO: change strings per resources
boolean readyToSave = true;
for ( int i = 0; i < edits.length; i++ )
if ( edits[i].getText().toString().trim().length() == 0 ) {
edits[i].setError("This field is required");
readyToSave = false;
} else {
strings[i] = edits[i].getText().toString().trim();
}
for ( int i = 0; i < spinners.length; i++)
if ( spinners[i].getSelectedItemPosition() == 0 ) {
spinners[i].setBackgroundColor(getResources().getColor(R.color.red));
readyToSave = false;
} else {
ints[i] = spinners[i].getSelectedItemPosition();
spinners[i].setBackgroundColor(getResources().getColor(R.color.green));
}
if ( readyToSave ) {
String player = getIntent().getStringExtra("player");
SharedPreferences p = getSharedPreferences(player, MODE_PRIVATE);
int powers = p.getInt("powers", 0);
for (int i = 0; i < powers; i++) {
if ( p.getString("power" + i, "") == strings[0] ) {
edits[0].setError("This power has already been defined. Use another name.");
return;
}
}
p.edit().putString("power" + powers, strings[0])
.putInt("powers", powers + 1)
.apply();
SharedPreferences.Editor ed = getSharedPreferences(strings[0], MODE_PRIVATE).edit();
for (int i = 0; i < strings.length; i++)
ed.putString("s" + i, strings[i]);
for (int i = 0; i < ints.length; i++)
ed.putInt("i" + i, ints[i]);
ed.apply();
finish();
}
} }
} }

View file

@ -0,0 +1,492 @@
package com.kauron.dungeonmanager;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.InputType;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.listeners.ActionClickListener;
public class ShowPlayer extends ActionBarActivity {
public static final int CURRENT_PG = 1, NULL = 0;
public Player player;
private boolean undo;
//TODO: fix undo (show snackbar with button in each case, without timing).
private int undoObject, undoPreviousValue;
private ProgressBar pgBar, negPgBar, xpBar, curativeEffortsBar;
private TextView currentPg, currentXp, currentCurativeEfforts;
private SharedPreferences p;
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Initializing activity (setting toolbar as actionbar)
setContentView(R.layout.activity_show_player);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
//Loading player
try{
String name = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE)
.getString("player" + getIntent().getIntExtra("player", 0), "null");
p = getSharedPreferences(name, MODE_PRIVATE);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Error loading character", Toast.LENGTH_LONG).show();
finish();
}
//Performing all the findViewById commands
xpBar = (ProgressBar) findViewById(R.id.xpBar);
curativeEffortsBar = (ProgressBar) findViewById(R.id.curativeEffortsBar);
pgBar = (ProgressBar) findViewById(R.id.pgBar);
negPgBar = (ProgressBar) findViewById(R.id.negPgBar);
currentPg = (TextView) findViewById(R.id.currentPg);
currentXp = (TextView) findViewById(R.id.currentXp);
currentCurativeEfforts = (TextView) findViewById(R.id.currentCurativeEfforts);
xpBar.getProgressDrawable()
.setColorFilter(getResources().getColor(R.color.px_bar), PorterDuff.Mode.SRC_IN);
curativeEffortsBar.getProgressDrawable()
.setColorFilter(getResources().getColor(R.color.surges_bar), PorterDuff.Mode.SRC_IN);
undo = false;
restoreData();
invalidateOptionsMenu();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_show_player, menu);
return true;
}
@Override
public boolean onPrepareOptionsMenu (Menu menu) {
MenuItem menuHeal = menu.findItem(R.id.action_cure);
boolean maxed = player.getPg() == player.getMaxPg();
menuHeal.setEnabled(!maxed);
if (maxed)
menuHeal.getIcon().setAlpha(128);
else
menuHeal.getIcon().setAlpha(255);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_cure) {
if(player.getMaxPg() <= player.getPg()){
SnackbarManager.show(
Snackbar
.with(this)
.text(R.string.maxed_curative)
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
);
} else {
healDialog();
}
return true;
} else if (id == R.id.action_time_encounter_end) {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(R.string.px_awarded_title);
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
input.setHint(R.string.px_awarded_hint);
alert.setCancelable(false);
alert.setView(input);
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
boolean levelUp = player.addPx(Integer.parseInt(input.getText().toString()));
if (levelUp) {
//levelUp
//TODO: improve leveling up by using a sliding guide
player.setMaxPgOnLevelUp();
}
p.edit().putInt("px", player.getPx()).apply();
if(levelUp)
xpBar.setMax(Player.LEVEL_PX[player.getLevel()] -
Player.LEVEL_PX[player.getLevel() - 1]);
pxUpdate();
ceUpdate();
pgUpdate();
} catch(Exception e) {
Toast.makeText(getApplicationContext(), "There was an error leveling up", Toast.LENGTH_LONG).show();
}
}
});
alert.show();
input.requestFocus();
return true;
//TODO: the player no longer contains the powers, therefore the
// } else if (id == R.id.action_time_long_rest) {
// player.rest(true);
// SnackbarManager.show(
// Snackbar
// .with(this)
// .text(R.string.long_rest_done)
// .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
// );
// p.edit()
// .putInt("pg", player.getPg())
// .putInt("curativeEfforts", player.getCurativeEfforts())
// .apply();
// pgUpdate();
// ceUpdate();
// } else if (id == R.id.action_time_rest) {
// player.rest(false);
// SnackbarManager.show(
// Snackbar
// .with(this)
// .text(R.string.rest_done)
// .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
// );
// pgUpdate();
// ceUpdate();
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onResume() {
super.onResume();
restoreData();
pgUpdate();
ceUpdate();
pxUpdate();
}
public void heal(boolean usesEffort) {
int hasCured = player.recoverPg(Player.USE_CURATIVE_EFFORT, usesEffort);
if (hasCured == Player.NOT_CURED) {
SnackbarManager.show(
Snackbar
.with(this)
.text(R.string.no_curative_efforts_error)
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
);
} else {
if(hasCured == Player.MAXED){
SnackbarManager.show(
Snackbar
.with(this)
.text(R.string.maxed_curative)
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
);
}
SharedPreferences.Editor e = p.edit();
e.putInt("pg", player.getPg());
if(usesEffort) {
e.putInt("curativeEfforts", player.getCurativeEfforts());
ceUpdate();
}
e.apply();
pgUpdate();
}
}
public void healDialog() {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setMessage(R.string.new_energies_message)
.setTitle(R.string.new_energies)
.setPositiveButton(R.string.me, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
heal(true);
}
})
.setNegativeButton(R.string.other, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
heal(false);
}
})
.setNeutralButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
alert.show();
}
public void damage(final View view){
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(R.string.suffer_damage);
// Set an EditText view to get user input
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
input.setHint(R.string.suffer_damage_hint);
alert.setView(input);
final Context context = getApplicationContext();
final ShowPlayer activity = this;
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
try {
int preValue = player.getPg();
int damage = Integer.parseInt(input.getText().toString());
player.losePg(damage);
undo = true;
undoPreviousValue = preValue;
undoObject = CURRENT_PG;
SnackbarManager.show(
Snackbar.with(context).text("Lost " + damage + " PG's")
.actionLabel("Undo") // action button label
.actionListener(new ActionClickListener() {
@Override
public void onActionClicked(Snackbar snackbar) {
undo();
}
})
.actionColor(getResources().getColor(R.color.yellow))
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
,activity); // action button's
p.edit().putInt("pg", player.getPg()).apply();
pgUpdate();
invalidateOptionsMenu();
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "There was an error", Toast.LENGTH_LONG).show();
}
}
});
alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
alert.show();
}
private void pgUpdate() {
int status = player.getState();
int pg = player.getPg();
if (pg < 0) {
if (status == Player.MUERTO)
negPgBar.setProgress(negPgBar.getMax());
else
negPgBar.setProgress(-pg);
pgBar.setProgress(0);
} else {
pgBar.setProgress(pg);
negPgBar.setProgress(0);
}
currentPg.setText(player.getPg() + " / " + player.getMaxPg());
if (status == Player.MUERTO) {
pgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
} else if (status == Player.DEBILITADO) {
pgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.red), PorterDuff.Mode.SRC_IN);
negPgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.red), PorterDuff.Mode.SRC_IN);
} else if (status == Player.MALHERIDO) {
pgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.yellow), PorterDuff.Mode.SRC_IN);
negPgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.yellow), PorterDuff.Mode.SRC_IN);
} else {
pgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.green), PorterDuff.Mode.SRC_IN);
negPgBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.green), PorterDuff.Mode.SRC_IN);
}
}
private void restoreData(){
//Loading player
player = new Player( p );
pxUpdate();
xpBar.setMax(
Player.LEVEL_PX[player.getLevel()] -
Player.LEVEL_PX[player.getLevel() - 1]
);
if (player.getMaxPg() == 0) {
pgDialog();
}
player.setCurativeEffort(p.getInt("curativeEfforts", player.getMaxCurativeEfforts()));
player.setPg(p.getInt("pg", player.getMaxPg()));
pgBar.setMax(player.getMaxPg());
negPgBar.setMax(player.getMaxPg() / 2);
curativeEffortsBar.setMax(player.getMaxCurativeEfforts());
pgUpdate();
ceUpdate();
//set restored values to the respective fields
toolbar.setTitle(player.getName());
toolbar.setSubtitle(
player.getClassName() + " " + player.getRaceName() + " " + player.getLevel()
);
toolbar.setTitleTextColor(getResources().getColor(R.color.white));
toolbar.setSubtitleTextColor(getResources().getColor(R.color.white));
//
// //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)
refreshList();
}
private void ceUpdate() {
curativeEffortsBar.setProgress(player.getCurativeEfforts());
currentCurativeEfforts.setText(
player.getCurativeEfforts() + " / " +
player.getMaxCurativeEfforts()
);
}
private void pxUpdate() {
xpBar.setProgress(player.getPx());
currentXp.setText(
player.getPx() + " / " +
Player.LEVEL_PX[player.getLevel()]
);
}
private void undo() {
String message = "";
if(undoObject == CURRENT_PG){
player.setPg(undoPreviousValue);
undoObject = NULL;
message = getString(R.string.action_undo_current_pg);
}
if (!message.isEmpty()) {
SnackbarManager.show(
Snackbar
.with(this)
.text(message)
.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
);
}
pgUpdate();
undo = false;
invalidateOptionsMenu();
}
private void pgDialog() {
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
final EditText input = new EditText(this);
input.setHint(R.string.dialog_resolve_max_pg_hint);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
input.setImeOptions(EditorInfo.IME_ACTION_DONE);
dialog
.setView(input)
.setCancelable(false)
.setTitle(R.string.dialog_resolve_max_pg_title)
.setMessage(R.string.dialog_resolve_max_pg_message)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!input.getText().toString().isEmpty()) {
player.setMaxPg(Integer.parseInt(input.getText().toString()));
}
}
});
dialog.show();
input.requestFocus();
}
public void addToList (View view) { startActivity(new Intent(this, PowerEditor.class).putExtra("player", player.getName())); }
private void refreshList() {
//TODO: check which is active (now there is only a power list), so there is only one possibility
int n = p.getInt("powers",0);
int elements = 0;
ListView attackList = (ListView) findViewById(R.id.attackList);
AttackAdapter adapter = (AttackAdapter) attackList.getAdapter();
if ( adapter != null )
elements = adapter.getCount();
if ( elements < n && adapter != null ) {
for ( int i = elements; i < n; i++ ) {
SharedPreferences sav = getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE);
adapter.add( new Power ( sav ) );
}
} else if ( n != 0 ) {
Power[] powers = new Power[n];
for (int i = 0; i < n; i++) {
SharedPreferences sav = getSharedPreferences(p.getString("power" + i, ""), MODE_PRIVATE);
powers[i] = new Power(sav);
}
attackList.setAdapter(new AttackAdapter(this, powers));
attackList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getApplicationContext(), ((Power)parent.getItemAtPosition(position)).getName(), Toast.LENGTH_LONG).show();
//TODO: show here dialog with power's complete information, and buttons to use, recharge or delete
}
});
}
}
}

View file

@ -49,7 +49,7 @@ public class Welcome extends ActionBarActivity {
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
if ( id == R.id.action_add_player ) { if ( id == R.id.action_add_player ) {
startActivity(new Intent(this, Introduction.class).putExtra("first_time", true)); startActivity(new Intent(this, PlayerEditor.class).putExtra("first_time", true));
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
@ -61,7 +61,7 @@ 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 MainActivity) //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.listView);
@ -86,7 +86,6 @@ public class Welcome extends ActionBarActivity {
findViewById(R.id.no_players_text).setVisibility(View.GONE); findViewById(R.id.no_players_text).setVisibility(View.GONE);
Player[] players = new Player[n]; Player[] players = new Player[n];
for ( int i = 0; i < n; i++ ) { for ( int i = 0; i < n; i++ ) {
//TODO: fill the information for the player creation
SharedPreferences sav = getSharedPreferences(p.getString("player" + i, ""), MODE_PRIVATE); SharedPreferences sav = getSharedPreferences(p.getString("player" + i, ""), MODE_PRIVATE);
if (sav.contains(Player.NAME)) if (sav.contains(Player.NAME))
players[i] = new Player( sav ); players[i] = new Player( sav );
@ -98,7 +97,7 @@ public class Welcome extends ActionBarActivity {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
startActivity(new Intent( startActivity(new Intent(
getApplicationContext(), MainActivity.class getApplicationContext(), ShowPlayer.class
).putExtra("player", position)); ).putExtra("player", position));
} }
}); });

View file

@ -1,423 +0,0 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:background="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
tools:text="Kauron"/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/pgCurrent"
android:textSize="40sp"
android:onClick="damage" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/scroll1">
<RelativeLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/basicInfoContainer">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/adventurer_name"
android:id="@+id/nameText"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/race_name"
android:id="@+id/raceText"
android:layout_alignTop="@+id/classText"
android:layout_toRightOf="@+id/classText"
android:layout_toEndOf="@+id/classText"
android:layout_marginLeft="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/class_name"
android:id="@+id/classText"
android:layout_below="@+id/nameText"
android:layout_alignParentStart="false"
android:layout_alignParentLeft="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/level"
android:id="@+id/lvlText"
android:layout_alignParentBottom="false"
android:layout_toRightOf="@+id/raceText"
android:layout_toEndOf="@+id/raceText"
android:layout_alignTop="@+id/raceText"
android:layout_marginLeft="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/lvl"
android:layout_alignParentBottom="false"
android:layout_toRightOf="@+id/lvlText"
android:layout_toEndOf="@+id/lvlText"
android:layout_alignTop="@+id/lvlText"
android:layout_marginLeft="10dp" />
</RelativeLayout>
</HorizontalScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titlePgBar"
android:text="@string/pg"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_marginBottom="5dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:id="@+id/currentPg"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/negPgBar"
android:layout_weight="2"
android:rotation="180"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:textStyle="bold"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:text="@string/zero"/>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/pgBar"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titleCurativeEffortsBar"
android:text="@string/curative_efforts"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_marginBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:gravity="end"
android:id="@+id/currentCurativeEfforts"
android:textAllCaps="true"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/curativeEffortsBar"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titleXpBar"
android:text="@string/px"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_marginBottom="5dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:id="@+id/currentXp"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_weight="1"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/xpBar"/>
<LinearLayout
android:id="@+id/attackContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/titleAttack"
android:text="@string/attack"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:gravity="center_vertical"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/attackGrid"
android:columnCount="3"
android:rowCount="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="0"
android:id="@+id/FUE"
tools:text="@string/FUE" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="0"
android:id="@+id/CON"
tools:text="@string/CON" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="1"
android:id="@+id/DES"
tools:text="@string/DES" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="1"
android:id="@+id/INT"
tools:text="@string/INT" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="2"
android:id="@+id/SAB"
tools:text="@string/SAB" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="2"
android:id="@+id/CAR"
tools:text="@string/CAR" />
</GridLayout>
</HorizontalScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/defenseContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/titleDefense"
android:text="@string/defense"
android:textAllCaps="true"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:gravity="center_vertical"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<GridLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/defenseGrid"
android:columnCount="2"
android:rowCount="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="0"
android:layout_column="0"
android:id="@+id/CA"
tools:text="@string/CA" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="0"
android:layout_column="1"
android:id="@+id/FORT"
tools:text="@string/FORT" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="1"
android:layout_column="0"
android:id="@+id/REF"
tools:text="@string/REF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="1"
android:layout_column="1"
android:id="@+id/VOL"
tools:text="@string/VOL" />
</GridLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View file

@ -0,0 +1,190 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".PlayerEditor">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:background="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/firstLayout"
android:orientation="horizontal">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName|textCapWords"
android:layout_weight="0.5"
android:id="@+id/editNameIntro"
android:hint="@string/adventurer_name"
android:nextFocusDown="@+id/editPxIntro"
android:nextFocusForward="@+id/editPxIntro"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:id="@+id/editPxIntro"
android:hint="@string/px"
android:layout_weight="1"
android:nextFocusDown="@+id/FUE"
android:nextFocusForward="@+id/FUE"
android:nextFocusLeft="@+id/FUE"
android:nextFocusRight="@+id/FUE"
android:nextFocusUp="@+id/FUE"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/secondLayout"
android:layout_below="@+id/firstLayout">
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/classSpinner"
tools:listitem="@android:layout/simple_spinner_dropdown_item"
android:spinnerMode="dropdown" />
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/raceSpinner"
tools:listitem="@android:layout/simple_spinner_dropdown_item"
android:spinnerMode="dropdown" />
</LinearLayout>
<GridLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/secondLayout"
android:id="@+id/thirdLayout"
android:columnCount="3">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:layout_row="0"
android:layout_column="0"
android:id="@+id/FUE"
android:hint="@string/FUE"
android:nextFocusDown="@+id/DES"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:layout_row="1"
android:layout_column="0"
android:id="@+id/CON"
android:hint="@string/CON"
android:nextFocusDown="@+id/INT" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:layout_row="0"
android:layout_column="1"
android:id="@+id/DES"
android:hint="@string/DES"
android:nextFocusDown="@+id/SAB"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:layout_row="1"
android:layout_column="1"
android:id="@+id/INT"
android:hint="@string/INT"
android:nextFocusDown="@+id/CAR"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:layout_row="0"
android:layout_column="2"
android:id="@+id/SAB"
android:hint="@string/SAB"
android:nextFocusDown="@+id/CON"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="3"
android:imeOptions="actionDone"
android:layout_row="1"
android:layout_column="2"
android:id="@+id/CAR"
android:hint="@string/CAR"/>
</GridLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/thirdLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:visibility="visible"
android:id="@+id/fourthLayout">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/new_attack"
android:id="@+id/new_attack_button" />
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/powerList"
android:choiceMode="none" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -11,15 +11,6 @@
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">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/power_editor"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
<ScrollView <ScrollView
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -43,7 +34,7 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/keywordsText" android:layout_toEndOf="@+id/keywordsText"
android:layout_toRightOf="@+id/keywordsText" android:layout_toRightOf="@+id/keywordsText"
android:hint="@string/powerNameHint" /> android:hint="@string/powerNameHint"/>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -91,7 +82,7 @@
android:layout_below="@+id/keywordsEdit" android:layout_below="@+id/keywordsEdit"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:id="@+id/linearLayout"> android:id="@+id/spinnersLayout">
<Spinner <Spinner
android:layout_width="match_parent" android:layout_width="match_parent"
@ -118,38 +109,33 @@
android:focusableInTouchMode="true" /> android:focusableInTouchMode="true" />
</LinearLayout> </LinearLayout>
<Spinner <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/atkSpinner" android:layout_below="@id/spinnersLayout"
android:spinnerMode="dropdown" android:orientation="horizontal"
android:layout_below="@+id/linearLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@+id/vsText"
android:layout_toStartOf="@+id/vsText" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/defSpinner"
android:spinnerMode="dropdown"
android:layout_below="@+id/linearLayout"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_toRightOf="@+id/vsText"
android:layout_toEndOf="@+id/vsText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/vs"
android:id="@+id/vsText"
android:gravity="center" android:gravity="center"
android:layout_below="@+id/linearLayout" android:id="@+id/vsLayout">
android:layout_centerHorizontal="true" <Spinner
android:layout_alignBottom="@+id/atkSpinner" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/atkSpinner"
android:spinnerMode="dropdown" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/vs"
android:id="@+id/vsText" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/defSpinner"
android:spinnerMode="dropdown" />
</LinearLayout>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -157,13 +143,14 @@
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:ems="10" android:ems="10"
android:id="@+id/impactEdit" android:id="@+id/impactEdit"
android:layout_below="@+id/defSpinner" android:layout_below="@+id/vsLayout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:hint="@string/impactEditHint" android:hint="@string/impactEditHint"
android:layout_toRightOf="@+id/impactText" android:layout_toRightOf="@+id/impactText"
android:layout_toEndOf="@+id/impactText" /> android:layout_toEndOf="@+id/impactText" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -171,7 +158,7 @@
android:text="@string/impact" android:text="@string/impact"
android:id="@+id/impactText" android:id="@+id/impactText"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_below="@+id/atkSpinner" android:layout_below="@+id/vsLayout"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignBottom="@+id/impactEdit" android:layout_alignBottom="@+id/impactEdit"
@ -220,10 +207,9 @@
android:layout_below="@+id/objectiveEdit" android:layout_below="@+id/objectiveEdit"
android:layout_alignRight="@+id/impactEdit" android:layout_alignRight="@+id/impactEdit"
android:layout_alignEnd="@+id/impactEdit" android:layout_alignEnd="@+id/impactEdit"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:onClick="saveClick"/> android:onClick="saveClick"
android:textColor="@color/primary_dark"/>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>

View file

@ -0,0 +1,382 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ShowPlayer">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:background="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:onClick="damage"
android:clickable="true"
android:layout_marginBottom="@dimen/bar_margin">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titlePgBar"
android:text="@string/pg"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:id="@+id/currentPg"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/negPgBar"
android:layout_weight="2"
android:rotation="180"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:textStyle="bold"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:text="@string/zero"/>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/pgBar"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="@dimen/bar_margin">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titleCurativeEffortsBar"
android:text="@string/curative_efforts"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:gravity="end"
android:id="@+id/currentCurativeEfforts"
android:textAllCaps="true"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/curativeEffortsBar"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="@dimen/bar_margin">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titleXpBar"
android:text="@string/px"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:layout_weight="1"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:id="@+id/currentXp"
android:textSize="14sp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_weight="1"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/xpBar"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/addElement"
android:text="@string/new_attack"
android:textColor="@color/primary"
android:background="@android:color/transparent"
android:onClick="addToList"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listSelectButton"
android:textColor="@color/primary"
android:background="@android:color/transparent"
tools:text="Go to abilities"/>
</LinearLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/attackList"
android:layout_gravity="center_horizontal"
android:choiceMode="none" />
<LinearLayout
android:id="@+id/attackContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/titleAttack"
android:text="@string/attack"
android:textAllCaps="true"
android:drawableBottom="?android:attr/listChoiceBackgroundIndicator"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:gravity="center_vertical"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/attackGrid"
android:columnCount="3"
android:rowCount="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="0"
android:id="@+id/FUE"
tools:text="@string/FUE" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="0"
android:id="@+id/CON"
tools:text="@string/CON" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="1"
android:id="@+id/DES"
tools:text="@string/DES" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="1"
android:id="@+id/INT"
tools:text="@string/INT" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="0"
android:layout_column="2"
android:id="@+id/SAB"
tools:text="@string/SAB" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="4"
android:layout_row="1"
android:layout_column="2"
android:id="@+id/CAR"
tools:text="@string/CAR" />
</GridLayout>
</HorizontalScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/defenseContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:visibility="gone"
android:orientation="vertical">
<TextView
android:id="@+id/titleDefense"
android:text="@string/defense"
android:textAllCaps="true"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
android:gravity="center_vertical"
android:paddingLeft="8dip"
android:paddingRight="8dip"/>
<GridLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/defenseGrid"
android:columnCount="2"
android:rowCount="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="0"
android:layout_column="0"
android:id="@+id/CA"
tools:text="@string/CA" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="0"
android:layout_column="1"
android:id="@+id/FORT"
tools:text="@string/FORT" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="1"
android:layout_column="0"
android:id="@+id/REF"
tools:text="@string/REF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:typeface="monospace"
android:ems="5"
android:layout_row="1"
android:layout_column="1"
android:id="@+id/VOL"
tools:text="@string/VOL" />
</GridLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -14,7 +14,8 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:contentDescription="@string/edit" /> android:contentDescription="@string/edit"
android:tint="@color/black" />
<TextView <TextView
tools:text="Happiness" tools:text="Happiness"

View file

@ -0,0 +1,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.kauron.dungeonmanager.PlayerEditor">
<item android:id="@+id/action_save"
android:title="@string/action_save"
android:orderInCategory="100"
android:icon="@drawable/ic_action_save"
app:showAsAction="ifRoom" />
</menu>

View file

@ -0,0 +1,37 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:context=".ShowPlayer">
<item
android:id="@+id/action_cure"
android:title="@string/action_cure"
android:orderInCategory="2"
android:icon="@drawable/ic_action_heal"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_time"
android:title="@string/action_time"
android:orderInCategory="3"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_time">
<menu>
<item
android:title="@string/action_time_rest"
android:id="@+id/action_time_rest"
android:orderInCategory="4"
app:showAsAction="never"/>
<item
android:title="@string/action_time_long_rest"
android:id="@+id/action_time_long_rest"
android:orderInCategory="5"
app:showAsAction="never"/>
<item
android:title="@string/action_time_encounter_end"
android:id="@+id/action_time_encounter_end"
android:orderInCategory="2"
app:showAsAction="never"/>
</menu>
</item>
</menu>

View file

@ -2,7 +2,7 @@
<resources> <resources>
<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">PG Máx.</string> <string name="action_finish">Guardar</string>
<string name="adventurer_name">Nombre</string> <string name="adventurer_name">Nombre</string>
<string name="cancel">Cancelar</string> <string name="cancel">Cancelar</string>
<string name="class_name">Clase</string> <string name="class_name">Clase</string>
@ -76,4 +76,23 @@
<string name="load_character">Cargar personaje</string> <string name="load_character">Cargar personaje</string>
<string name="new_character_warning">Esto borrará al personaje anterior</string> <string name="new_character_warning">Esto borrará al personaje anterior</string>
<string name="new_attack">Nuevo ataque</string> <string name="new_attack">Nuevo ataque</string>
<string name="add_player">Añadir personaje</string>
<string name="character_creation">Creación de personaje</string>
<string name="delete">Borrar</string>
<string name="edit">Editar</string>
<string name="hello_world"></string>
<string name="help_welcome_text">Toca un jugador para seleccionarlo, pulsación larga para opciones</string>
<string name="impact">Impacto</string>
<string name="impactEditHint">1d6 + 4 y eres invisible</string>
<string name="keywords">Palabras clave</string>
<string name="keywordsPowerHint">Arcano, hechizo, psíquico</string>
<string name="name">Nombre</string>
<string name="no_players">No hay personajes, añade uno</string>
<string name="objective">Objetivo</string>
<string name="objectiveHint">Una criatura</string>
<string name="powerNameHint">Mordedura visual</string>
<string name="power_editor">Editor de ataques</string>
<string name="save">Guardar</string>
<string name="save_player">Guardar personaje</string>
<string name="title_activity_power_editor">Editor de poderes</string>
</resources> </resources>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="primary">#795548</color> <color name="primary">#5D4037</color>
<color name="primary_dark">#5D4037</color> <color name="primary_dark">#3E2723</color>
<color name="primary_light">#D7CCC8</color> <color name="primary_light">#D7CCC8</color>
<color name="accent">#FF5252</color> <color name="accent">#FF5252</color>
<color name="primary_text">#212121</color> <color name="primary_text">#212121</color>
@ -12,9 +12,11 @@
<color name="red">#9F0D0A</color> <color name="red">#9F0D0A</color>
<color name="yellow">#FFBB00</color> <color name="yellow">#FFBB00</color>
<color name="green">#0f0</color> <color name="green">#0f0</color>
<color name="white">#EEEEEE</color>
<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="black">#000000</color>
<!--<color name="primary">#5D4037</color>--> <!--<color name="primary">#5D4037</color>-->
<!--<color name="primaryDark">#3E2723</color>--> <!--<color name="primaryDark">#3E2723</color>-->
</resources> </resources>

View file

@ -3,6 +3,8 @@
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="bar_margin">15dp</dimen>
<dimen name="fab_button_diameter">56dp</dimen> <dimen name="fab_button_diameter">56dp</dimen>
<dimen name="fab_button_margin_bottom">16dp</dimen> <dimen name="fab_button_margin_bottom">16dp</dimen>
<dimen name="fab_button_margin_right">16dp</dimen> <dimen name="fab_button_margin_right">16dp</dimen>

View file

@ -35,7 +35,7 @@
<string name="race_name">Race</string> <string name="race_name">Race</string>
<string name="state_changed_debilitado">You have fainted. You can\'t do anything!</string> <string name="state_changed_debilitado">You have fainted. You can\'t do anything!</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="ok">Ok</string> <string name="ok">OK</string>
<string name="yes">Yes</string> <string name="yes">Yes</string>
<string name="no">No</string> <string name="no">No</string>
@ -62,12 +62,12 @@
<string name="other">Otro</string> <string name="other">Otro</string>
<string name="px">XP</string> <string name="px">XP</string>
<string name="FUE">FUE</string> <string name="FUE">STR</string>
<string name="CON">CON</string> <string name="CON">CON</string>
<string name="DES">DES</string> <string name="DES">DEX</string>
<string name="INT">INT</string> <string name="INT">INT</string>
<string name="CAR">CAR</string> <string name="CAR">CHA</string>
<string name="SAB">SAB</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 PG</string>
<string name="empty_field">Please input something</string> <string name="empty_field">Please input something</string>
@ -94,15 +94,58 @@
<string name="character_creation">Character creation</string> <string name="character_creation">Character creation</string>
<string name="name">Name</string> <string name="name">Name</string>
<string name="keywords">Keywords</string> <string name="keywords">Keywords</string>
<string name="powerNameHint">Mordedura visual</string> <string name="powerNameHint">Blasting charm</string>
<string name="keywordsPowerHint">Arcano, hechizo, psíquico</string> <string name="keywordsPowerHint">Magic, fire, weapon</string>
<string name="number10">10</string> <string name="number10" translatable="false">10</string>
<string name="vs">VS</string> <string name="vs" translatable="false">VS</string>
<string name="save">Save</string> <string name="save">Save</string>
<string name="impactEditHint">1d6 + mod. CAR y eres invisible hasta el comienzo del siguiente turno</string> <string name="impactEditHint">1d6 + mod. CHAR and you become invisible</string>
<string name="impact">Impact</string> <string name="impact">Impact</string>
<string name="objective">Objective</string> <string name="objective">Objective</string>
<string name="objectiveHint">One creature</string> <string name="objectiveHint">One creature</string>
<string name="power_editor">Power Editor</string> <string name="power_editor">Power Editor</string>
<string name="save_player">Save player</string> <string name="save_player">Save player</string>
<string-array name="freq_array">
<item>Frequency</item>
<item>Opportunity</item>
<item>At will</item>
<item>Encounter</item>
<item>Daily</item>
</string-array>
<string-array name="actions_array">
<item>Action type</item>
<item>Standard</item>
<item>Movement</item>
<item>Minor</item>
<item>Free</item>
</string-array>
<string-array name="ranges_array">
<item>Range</item>
<item>Melee</item>
<item>Ranged</item>
<item>Area</item>
<item>Close</item>
<item>Aura</item>
</string-array>
<string-array name="atk_array">
<item>ATK</item>
<item>STR</item>
<item>CON</item>
<item>DEX</item>
<item>INT</item>
<item>WIS</item>
<item>CHA</item>
</string-array>
<string-array name="def_array">
<item>DEF</item>
<item>AC</item>
<item>FORT</item>
<item>REF</item>
<item>WILL</item>
</string-array>
</resources> </resources>

Some files were not shown because too many files have changed in this diff Show more