Power: added extra field for other information
This commit is contained in:
parent
84c0d8abb3
commit
383341c72a
7 changed files with 55 additions and 25 deletions
|
@ -27,16 +27,17 @@ class Power implements Serializable{
|
|||
|
||||
private boolean used;
|
||||
private int freq, action, range;
|
||||
private String name, impact, objective, distance;
|
||||
private String name, impact, objective, distance, other;
|
||||
private String keywords; //fire, spell...
|
||||
private int atk, def; //constants from Player to denote atk and defense
|
||||
|
||||
Power ( SharedPreferences p ) {
|
||||
this.name = p.getString("s0", "Name");
|
||||
this.keywords = p.getString("s1", "Keywords");
|
||||
this.impact = p.getString("s2", "2d10");
|
||||
this.distance = p.getString("s3", "10");
|
||||
this.objective = p.getString("s4", "One creature");
|
||||
this.name = p.getString("s0", "Power");
|
||||
this.keywords = p.getString("s1", "");
|
||||
this.impact = p.getString("s2", "");
|
||||
this.distance = p.getString("s3", "");
|
||||
this.objective = p.getString("s4", "");
|
||||
this.other = p.getString("s5", "");
|
||||
|
||||
this.used = p.getBoolean("used", false);
|
||||
|
||||
|
@ -73,7 +74,7 @@ class Power implements Serializable{
|
|||
String getName(){return name;}
|
||||
String getImpact() {return impact;}
|
||||
String getObjective() {return objective;}
|
||||
String getOther() {return "";}
|
||||
String getOther() {return other;}
|
||||
|
||||
//TODO: add other element to include further description
|
||||
|
||||
|
@ -111,6 +112,7 @@ class Power implements Serializable{
|
|||
e.putString("s2", impact);
|
||||
e.putString("s3", distance);
|
||||
e.putString("s4", objective);
|
||||
e.putString("s5", other);
|
||||
e.putBoolean("used", used);
|
||||
e.putInt("i0", freq);
|
||||
e.putInt("i1", range);
|
||||
|
|
|
@ -18,8 +18,8 @@ import com.nispok.snackbar.SnackbarManager;
|
|||
|
||||
public class PowerEditor extends ActionBarActivity {
|
||||
|
||||
private EditText [] edits = new EditText[5];
|
||||
private Spinner [] spinners = new Spinner[5];
|
||||
private EditText [] edits = new EditText[6];
|
||||
private Spinner [] spinners = new Spinner[6];
|
||||
|
||||
private String[] strings = new String[5];
|
||||
private int[] ints = new int[5];
|
||||
|
@ -80,6 +80,7 @@ public class PowerEditor extends ActionBarActivity {
|
|||
edits[2] = (EditText) findViewById(R.id.impactEdit);
|
||||
edits[3] = (EditText) findViewById(R.id.distanceNumEdit);
|
||||
edits[4] = (EditText) findViewById(R.id.objectiveEdit);
|
||||
edits[5] = (EditText) findViewById(R.id.otherEdit);
|
||||
|
||||
//Spinners
|
||||
spinners[0] = (Spinner) findViewById(R.id.freqSpinner);
|
||||
|
|
|
@ -605,7 +605,7 @@ public class ShowPlayer extends ActionBarActivity {
|
|||
|
||||
String[] attack = getResources().getStringArray(R.array.attack);
|
||||
String[] defense = getResources().getStringArray(R.array.defense);
|
||||
((TextView) dialog.findViewById(R.id.attackText)).setText(attack[power.getAtk()]
|
||||
((TextView) dialog.findViewById(R.id.impactText)).setText(attack[power.getAtk()]
|
||||
+ " " + getResources().getString(R.string.vs) + " " + defense[power.getDef()]);
|
||||
|
||||
final Button useButton = (Button) dialog.findViewById(R.id.useButton);
|
||||
|
|
Reference in a new issue